1

I am following the link mentioned below to create d3 pack layout. what I want to change is to get fixed sized circles in every pack layout. https://bl.ocks.org/mbostock/7607535

I found the solution in the following link, but this code is for d3.v3.js S per my knowledge Possible to use a circle pack layout in d3.js with fixed circle sizes?

can someone help me how can I achieve same size instead of its actual "d.value". Thanks in advance.

Community
  • 1
  • 1

1 Answers1

1

Just set the size you want using pack.radius:

If radius is specified, sets the pack layout’s radius accessor to the specified function and returns this pack layout.

So, it can be simply:

pack.radius(() => someNumber)
//your value here-----^

Here is that Bostock's code you linked with every circle having a radius of 10px: https://bl.ocks.org/anonymous/42d0e66ee507ee769907f0519d25bc8a

Gerardo Furtado
  • 100,839
  • 9
  • 121
  • 171