Public
Edited
Sep 6, 2023
1 star
Also listed in…
Maps
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
total_vote_counts = {
let dvotes = d3.sum(precinct_data.features.map((o) => o.properties.dvotes));
let rvotes = d3.sum(precinct_data.features.map((o) => o.properties.rvotes));
return { dvotes, rvotes };
}
Insert cell
map_data = FileAttachment("buncombe_precincts_with_data@2.json").json()
Insert cell
precinct_data = topojson.feature(
map_data,
map_data.objects.buncombe_precincts_with_data
)
Insert cell
road_data = topojson.feature(map_data, map_data.objects.centerline)
Insert cell
Insert cell
path = d3.geoPath().projection(projection)
Insert cell
projection = d3.geoIdentity().reflectY(true).fitSize([w, h], precinct_data)
Insert cell
h = 0.7 * w
Insert cell
w = width < 1200 ? width : 1200
Insert cell
Insert cell
import { Legend } from "@d3/color-legend"
Insert cell
tippy_style = html`<div style="display: none"><link rel="stylesheet" href="${await require.resolve(
`tippy.js/themes/light-border.css`
)}"></div>`
Insert cell
tippy = require("tippy.js@6")
Insert cell
d3.geoConicEqualArea
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