This circle pack layout example (http://bl.ocks.org/4063269) is perfect for a project I'm working on, however it sizes all the circles relative to one another:
Is there a simple way to specify fixed radii for each circle?
I've scoured the source code, examples, google, and stackoverflow and can't seem to find anything helpful.
The exact sizing of circles is important to me.
It is possible, and simple thing to do. The first answer is accurate, but I believe mine is simpler, more explicit, so I am attaching it too.
Please take a look at this example: jsfiddle
When you press "Constant" button, you will see something like this:
The key code line is this:
pack.value(function(d) { return 100; })
This will make circle radiuses constant regardles of data. 100 can be any constant of course. You can apply this line in circle pack initialization (most likely this will be your case), or reinitialization (like in my example).
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With