Published
Edited
Sep 21, 2018
5 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mapProps = ({
/** This is the meat of the choropleth, where we compute the color from our data
* us-county-basemap takes this as a property, and assigns it to the fill function for each county */
countyFillFunction: (loc) => {
return countyColorScale(data.get(loc.properties.FIPS));
},
countyMouseOverFunction: (loc) => {
mutable selectedDataValue = data.get(loc.properties.FIPS);
mutable selectedCountyName = loc.properties.location_name;
},
countyOnClickFunction: (loc) => {
console.log(loc);
},
colorScale: countyColorScale,
data: dataArray,
legendTitle: 'Population',
legendWidthScale: d3.scaleLog(),
legendTickFormat: d3.format('.1s'),
stateFIPSToInclude: region_state_FIPS,
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more