File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,16 +77,12 @@ export function legendRamp(color, options) {
7777 // divides the horizontal extent of the legend. (In the common case, the
7878 // domain.length is two, and so the range is simply the extent.) For a
7979 // diverging scale, we need an extra point in the range for the pivot such
80- // that the pivot is always drawn in the middle. For a threshold scale, we
81- // add some space below and above.
80+ // that the pivot is always drawn in the middle.
8281 x = applyRange (
8382 scale . copy ( ) ,
8483 quantize (
8584 interpolateNumber ( marginLeft , width - marginRight ) ,
86- Math . min (
87- domain . length + ( pivot !== undefined ) + 2 * ( type === "threshold" ) ,
88- range === undefined ? Infinity : range . length + + ( type === "threshold" )
89- )
85+ Math . min ( domain . length + ( pivot !== undefined ) , range === undefined ? Infinity : range . length )
9086 )
9187 ) ;
9288
You can’t perform that action at this time.
0 commit comments