Public
Edited
Jun 13, 2023
1 fork
8 stars
Insert cell
Insert cell
// data from https://observablehq.com/@mbostock/geojson-viewer
geoJsonTable(data)
Insert cell
// data from https://observablehq.com/@fleeth/base-map
geoJsonTable(subSts)
Insert cell
// data from https://observablehq.com/@fleeth/base-map
geoJsonTable(bldgs)
Insert cell
// data from https://observablehq.com/@fleeth/base-map
geoJsonTable(subLns)
Insert cell
Insert cell
Insert cell
geoJsonTable = (data) =>
Inputs.table(
flatten(data).map((d) => ({
type: d.type,
preview: d,
...d.properties
})),
{ format: { preview: map } }
)
Insert cell
map = (d) =>
Plot.geo(d).plot({
x: { axis: null },
y: { axis: null },
width: 120,
height: 60
})
Insert cell
flatten = (geoJson) =>
geoJson.type === "FeatureCollection"
? [geoJson, ...geoJson.features]
: geoJson
Insert cell
Insert cell
import {subSts, bldgs, subLns} from "@fleeth/base-map"
Insert cell
data = fetch("https://static.observableusercontent.com/files/04fb9ff8d0c52895260d29a82d55b25ac325f3b25fdfd366d65c2f90880280036aa47a9114e8eb8dfd17d49497c201e13dd851ecf206c64430a87d46f8b1730f").then(resp => resp.json())
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