Published
Edited
Dec 4, 2019
1 star
Insert cell
Insert cell
// nonprofitAssetMap = {
// return drawMap({
// dataLayer: mtCounties,
// plotData: nonprofits.filter(d => d.assets > 0),
// plotDataDim: 'assets',
// fillColorScale: d => regionColor(d.properties.region),
// baseLayerStyle: {stroke: '#fff', fillOpacity: 0.5},
// makeTitleText: d => `${d.data['NAME']}\n${format(d.data['assets'])}`
// })
// }
Insert cell
Insert cell
Insert cell
Insert cell
nonprofitIncomeMap = {
return drawMap({
dataLayer: mtCounties,
plotData: nonprofits.filter(d => d.type === sel),
plotDataDim: 'income',
fillColorScale: d => regionColor(d.properties.region),
baseLayerStyle: {stroke: '#fff', fillOpacity: 0.5},
// markerColor: d => color(d.data.type),
markerStyle: {
// fill: d => color(d.data.CLASSIFICATION),
fill: d => color(d.data.type),
size: d3.scaleSqrt().domain([0,d3.max(nonprofits, d => d.income)]).range([0.1,100])
},
makeTitleText: d =>
`${d.data['NAME']}
Type: ${d.data.type}
Class: ${d.data.CLASSIFICATION}
Assets: ${format(d.data.assets)}
Income: ${format(d.data.income)}`
})
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
color = d3.scaleOrdinal(d3.schemeCategory10)
// .range(["#a6761d","#e6ab02","#d95f02", "#1b9e77", "#66a61e" , "#e7298a" ,"#7570b3" , "#666666"])
// .range(["#7570b3","#a6761d","#e6ab02", "#1b9e77", "#1b9e77" , "#e7298a" , , "#666666"]
// .range(['#377eb8','#666', "#a6761d","#e6ab02", "#1b9e77"])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
embed = require("vega-embed@4")
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