I start with d3js and try to make a chart myself. I am trying to draw a curve between two points.
function CreateEdge(nodeId1,nodeId2,edgeLabel)
{
var curveData = [ { "x": 190, "y": 100}, { "x": 260, "y": 50} ];
var edge = d3.select("svg").append('g');
var curve = edge.append("path")
.attr("d", diagonal)
.attr("stroke", "#444")
.attr("stroke-width", 2)
.attr("fill", "none");
}
When I did my research, I found some examples using the diagonal function to draw curves. for example this
Is there a way to use the diagonal to draw a simple curve between two known points? Or are there alternative methods?
source
share