Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit b18f6af

Browse files
author
Hendrik van Antwerpen
committed
Fix edges not being reversed
1 parent a3a02fb commit b18f6af

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

stack-graphs/src/visualization/visualization.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,6 @@ class StackGraph {
174174
.targetId((edge) => this.ID[this.node_id_to_str(edge.sink)])
175175
.decycle(true);
176176
const dag = connect(this.graph.edges);
177-
// restore reversed edges
178-
for (let link of dag.links()) {
179-
if (link.reversed) {
180-
delete link.reversed;
181-
link.points.reverse();
182-
}
183-
}
184177

185178
// plot nodes
186179
const nodes = node_group
@@ -220,7 +213,7 @@ class StackGraph {
220213
.attr("id", (d) => this.edge_to_id_str(d.data));
221214
edges.append("path")
222215
.attr("id", (d) => this.edge_to_id_str(d.data) + ":path")
223-
.attr("d", ({ points }) => line(points))
216+
.attr("d", (d) => line(d.reversed ? d3.reverse(d.points) : d.points))
224217
let edge_labels = edges.append("text")
225218
.append("textPath")
226219
.attr("xlink:href", (d) => `#${this.edge_to_id_str(d.data)}:path`)

0 commit comments

Comments
 (0)