Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fixed chord widths #969

Closed
EdwardPrest opened this Issue Dec 17, 2012 · 1 comment

Comments

2 participants

Digging into D3 and liking it. Its all new to me however.

I have extended the basic chord example a bit to display satellite network links. This works for a fixed size network by fiddling with chord.padding(). Networks can vary in size and the amount of UP terminals at any one time. I need to control not the spacing between chords but the chord width itself. This is so I can control the appearance and make thinner chords - more like connections. Note that there can be many dead links (chord ticks with no chords at all).

Chord.padding does insert x radians space between chords but it is very difficult to get it looking nice automatically.

I have tried to set the endAngle using the startAngle but I am stuck. I realize there are two ends as in d.source.index and d.target.index. How do I change the width for chords, and ticks at the same time?

Something like?

chord = d3.layout.chord()
.padding(0)
.endAngle(function (d) { return d.startAngle(); } +0.1 )
.sortSubgroups(d3.descending)
.matrix(mat);

Maybe a new function to set a fixed chord width instead of letting it fill the space completely?

Owner

mbostock commented Jan 23, 2013

I think this would be more appropriately asked on the d3-js Google group or the d3.js tag on Stack Overflow. You can draw fixed-width links between arcs in a donut layout, for example. The chord layout is intended for asymmetric links. When you pose your question in the other forums it may help to include an image showing the effect you are trying to achieve.

@mbostock mbostock closed this Jan 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment