I have a dataset as mentioned here in this notebook. All I want is to create a path that utilizes the path’s A command to go through the points to create the desired path.
Regarding the dataset, circleX,circleY are the points on a circle that has circleRadius, centreX, centreY.
But I am simply trying to understand, how can I use path.arc(x, y, radius, startAngle, endAngle[, anticlockwise]) to generate the same path. What do I need to feed these parameters and what do they expect?
I’m not quite sure what effect you’re going for because the notebook is just rendering a single large circle. Do you have an example image?
d3.path.arc is for drawing a fraction of a circle. If you want to draw a line connecting points that are defined in relation to different circles, it isn’t the right tool.
Note that d3.line is part of d3-shape and, like all the functions defined there, it transforms appropriately formatted data into an SVG path string.
d3.path is a bit different; it’s designed to serialize a sequence of instructions to draw a figure on an HTML canvas into an SVG path string. Most methods have abbreviations for those instructions, as well. Thus, the following should generate a quarter circle: