question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

curved edges/paths

See original GitHub issue

Tried to go over the docs and google but could not find nothing 😕

the only thing similar is this:

graph.setEdge("D", "Z", {
    label: "A to zppppp",
    labelStyle: "font-style: italic; text-decoration: underline;",
    lineInterpolate: 'basis'
  });

but it didnt curved my edge, any ideas?

thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
lutzroedercommented, Jan 18, 2018

In dagre-d3 v0.6.1 this will change to curve: d3.curveBasis and samples will be updated to use the new approach.

4reactions
herzasocommented, Dec 25, 2019

It’s a bit old but for future reference, here’s how I handled it:

Create a curve function:

const BezierCurve = (context) => ({
  lineStart() {
    this.data = [];
  },

  point(x, y) {
    this.data.push([x, y]);
  },

  lineEnd() {
    const [x0, y0] = this.data[0];
    const [cp1x, cp1y] = this.data[1];
    const [cp2x, cp2y] = this.data[this.data.length - 2];
    const [x1, y1] = this.data[this.data.length - 1];
    context.moveTo(x0, y0);
    context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x1, y1);
  },
});

Assign the curve function to the edges:

g.setEdge(from, to, { curve: BezierCurve });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Edge Paths to Curves Node — Blender Manual
Edge Paths to Curves Node. The Edge Paths to Curves node output curves that follow paths across mesh edges. ... This node is...
Read more >
SVG rounded corner - Stack Overflow
From what I can tell, there is no easy way to give a path element in an SVG rounded corners except if you...
Read more >
Path Edge Guide! Including Curved edges! - Pinterest
Path Edge Guide! Including Curved edges! Post your designs, patterns, etc. all within this subreddit.
Read more >
Curved Paths - Red Blob Games
The default choice for curved paths is Bezier curves/splines. It's a reasonable choice. They're well understood and easy to work with. However, you...
Read more >
Paths - SVG: Scalable Vector Graphics - MDN Web Docs
The <path> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found