D3 and Javascript newbie here. I am making a chord diagram with one arc that is pulled apart from the center. I have managed to move the arc into my desire position but I wonder how do I make the group of chord touching the arc again and not messing up the position of other groups of chords?
Here is an image to explain my desired result.
I am currently using an if statement to select the angle where arc C is staying and translate its position.
.attr("transform", function(d) {
if (d.startAngle > Math.PI*1/2 && d.startAngle < Math.PI*5/6) {
return "transform", "translate(" + pullOutSize + "," + pullOutSize + ")"}
;})
I am able to translate the position of the chords by using the translate as well.
.attr("transform", "translate(" + 50 + "," + 50 + ")")
.attr("d", path);
However, when I applied the same if statement to it the translate stop working. It seems like the if statement does not met the condition. I wonder what will be the right statement to put into the if statement to help me select the section of chords that I am trying to move.
.attr("transform", function(d) {
if (d.startAngle > Math.PI*1/2 && d.startAngle < Math.PI*5/6) {
return "transform", "translate(" + pullOutSize + "," + pullOutSize + ")"}
;})
Thanks!
According to the documentation, you can pass the radius as a parameter when creating the chord/ribbon.
Documentation for ribbon