Published
Edited
Nov 14, 2021
2 forks
Importers
2 stars
Insert cell
Insert cell
office= "Clover town council unexpired term"
Insert cell
pollingplaces
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
precincts = topojson.feature(pollingplaces, pollingplaces.objects[Object.keys(pollingplaces.objects)[0]])
Insert cell
path = d3.geoPath(projection)
Insert cell
### Map, Charts, and Coloring
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
candidates = data.columns.slice(2,data.columns.indexOf("Total"))
Insert cell
results =
{
if(precinct==null)
return aq.from(data).select(candidates).fold(aq.all()

).pivot('key', { value: d => op.sum(d.value) }).objects()
else
return aq.from(data).filter(aq.escape(d=>d.precinct_id==precinct.properties.PRECINCTID)).select(candidates).objects()
}
Insert cell
precinctMap=new Map(data.map(d=>[d["precinct_id"],d]))
Insert cell
import {Legend, Swatches} from "@d3/color-legend"
Insert cell
import {vl} from "@vega/vega-lite-api"
Insert cell
import { aq, op } from '@uwdata/arquero'
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