Closed seahurt closed 1 year ago
you probably missed all of the x's and y's. Fortunately, this is now built in in the form of a tweak.
When constructing the layout function, there's a line in the example:
.tweaks([shape]);
All you need to do is add another tweak to flip it:
.tweaks([shape, d3dag.tweakFlip()]);
The edges will still look a bit weird due to the spline interpolation of d3. To fix that, change
const line = d3.line().curve(d3.curveMonotoneY);
to
const line = d3.line().curve(d3.curveMonotoneX);
You should then see:
I am tring to plot a horizontally placed graph, but got a little problem.
Below is the original graph from https://codepen.io/brinkbot/pen/oNQwNRv
After swipe the x and y by following code(change from line 144):
The result graph become this:
It seems like the path between nodes differed. But I don't known how to make it work. Could you please help me?
Or is there an option to plot horizontally placed graph directly?