Public
Edited
Aug 3, 2023
Insert cell
# Slates
Insert cell
Plot.carto({
color: { scheme: "orrd", type: "pow", exponent: 1 / 2 },
marks: [
Plot.features(precincts_features, {
fill: (d) =>
(gig.get(d.properties.full_text) || 0) / d.properties.Shape_Area,
stroke: "grey",
strokeWidth: 0.2
})
]
})
Insert cell
Plot.carto({
color: { scheme: "orrd", type: "pow", exponent: 1 / 2 },

marks: [
Plot.features(precincts_features, {
fill: (d) =>
(ccdc.get(d.properties.full_text) || 0) / d.properties.Shape_Area,
stroke: "grey",
strokeWidth: 0.2
})
]
})
Insert cell
ccdc = new Map(ccdc_raw.map((d) => [d.id, Number(d.cnt)]))
Insert cell
ccdc_raw = FileAttachment("ccdc.csv").csv(d3.autoType)
Insert cell
gig = new Map(gig_raw.map((d) => [d.id, Number(d.cnt)]))
Insert cell
gig_raw = FileAttachment("gig@2.csv").csv()
Insert cell
precincts_features = topojson.feature(
precincts,
precincts.objects["2022_precincts"]
)
Insert cell
topojson = require("topojson-client@3")
Insert cell
precincts = FileAttachment("2022_precincts@4.topo.json").json()
Insert cell
import { Plot } from "@fil/plot-carto-0-5"
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more