Skip to content
  • Mike Bostock's avatar
    Add padding to d3.layout.pack. · 47adcf5d
    Mike Bostock authored
    The previous method of subtracting slightly from the radius introduces
    distortion where smaller circles are disproportionately reduced. For example,
    subtracting 1px from the radius scales a circle of radius 5px by 0.64x, while a
    circle of radius 50px is only reduced by 0.96x.
    
    By incorporating padding into the layout algorithm, the leaf circles’ area is
    still proportional to the associated value. Due to the scale-independent nature
    of the layout, the specified padding value is only approximate.
    47adcf5d