d3.layout.orbit icon indicating copy to clipboard operation
d3.layout.orbit copied to clipboard

Allow setting radius of root orbit

Open jazzido opened this issue 10 years ago • 1 comments

AFAICT, it isn't currently possible to set the size of the first orbit —line 192 sets its radius to half the total size of the container.

How would an API for that look like?

Thanks for the great work!

jazzido avatar Dec 29 '14 21:12 jazzido

The idea of setting a size of the layout follows the pattern in other hierarchical layouts. The diameter of the root orbit is equal to the size (currently only the first setting of size--height--is honored, but maybe I'll support ellipse later). The actual size of the root orbit should take into account the total size of child orbits, so it's probably going to grow to be more involved eventually.

The diameter of the orbit is the height of the layout, so the radius is half that. The root node is then centered on the middle of the layout size and all other nodes and orbits are computed based on that.

Does that make sense? Is there something more intuitive that you're thinking?

emeeks avatar Dec 29 '14 21:12 emeeks