-
Notifications
You must be signed in to change notification settings - Fork 103
Closed
Description
Threshold scale domain values indicate the lower bound of every slice except the first. They are inclusive:
var color = d3.scaleThreshold()
.domain([ 0, 1])
.range(["red", "white", "green"]);
color(-1); // "red"
color(-0.5); // "red"
color(0); // "white"
color(0.5); // "white"
color(1); // "green"
Given the above scale and .labels(d3.legendHelpers.thresholdLabels), d3-scale will produce the following legend:
RED Less than 0.0
WHITE 0.0 to 1.0
GREEN More than 1.0
... where the last label being "more than" incorrectly suggests that 1.0 would not be green. In other words, the slice is inclusive but its label is exclusive.
It should say "1.0 or more".
"Less than" at the other end of the scale is correct, because 0 is the upper bound of that slice and is therefore exclusive.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels