-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
and this
with:
You might want to move some of the code around; I'm just having them all together
// Quantize evenly breakups domain into range buckets
const color = d3
.scaleQuantize() //color buckets depending on data, scaleQuantize breaks up domain into ranges for different colors
.domain([0, d3.max(data, (d) => d.extremely_poor)])
.nice() //color distribution, from 0 to 23 extremely poor
.range(d3.schemeGreens[9]); // replace 9 with number of bins desired
// builds legend and places it on the HTML
d3.select("#legend")
.node() // creates node and then appends child to it (ie. legend)
.appendChild(
Legend(color, {
title: "Extreme Poverty Level",
tickFormat: (d) => Math.floor(d),
})
);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels