mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-07 03:00:26 -04:00
ensure edge labels are always on top (#9908)
This commit is contained in:
@@ -191,6 +191,7 @@
|
||||
<svg id="graph-svg" preserveAspectRatio="xMidYMid meet">
|
||||
<g id="render">
|
||||
<g id="edges"></g>
|
||||
<g id="edge-labels"></g> <!-- NOTE: this ensures edge labels are always on top -->
|
||||
<g id="nodes"></g>
|
||||
<g id="bars"></g>
|
||||
</g>
|
||||
|
||||
@@ -54,7 +54,7 @@ async function renderDag(graph, additions, recenter=false) {
|
||||
points.push(intersectRect(g.node(e.w), points[points.length-1]));
|
||||
return line(points);
|
||||
}).attr("marker-end", "url(#arrowhead)");
|
||||
const edgeLabels = d3.select("#edges").selectAll("g").data(g.edges().filter(e => g.edge(e).label != null)).join("g").attr("transform", (e) => {
|
||||
const edgeLabels = d3.select("#edge-labels").selectAll("g").data(g.edges().filter(e => g.edge(e).label != null)).join("g").attr("transform", (e) => {
|
||||
// get a point near the end
|
||||
const [p1, p2] = g.edge(e).points.slice(-2);
|
||||
const dx = p2.x-p1.x;
|
||||
|
||||
Reference in New Issue
Block a user