I'm starting with d3js and trying to make a graph on my own. I'm 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');
//diagonal function that can draw a curve goes in here
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 diagonal function to draw curves. like this
Is there a way to use diagonal to draw a simple curve between two known points ? Or is there some alternative methods ?