Published
Edited
Jun 8, 2021
7 stars
Insert cell
Insert cell
// see https://observablehq.com/@nofurtherinformation/jsgeoda-binning-playground
jsgeoda = import('https://cdn.skypack.dev/jsgeoda')
Insert cell
geoda = jsgeoda.New()
Insert cell
nat = fetch("https://webgeoda.github.io/data/natregimes.geojson")
.then((d) => d.arrayBuffer())
.then((data) => geoda.read_geojson(data))
Insert cell
geoda.get_numobs(nat)
Insert cell
hr60 = geoda.get_col(nat, "HR60")
Insert cell
geoda.get_colnames(nat) // this example is fixed! 🪄 thank you @lixun910
Insert cell
Insert cell
geoda.stddev_breaks(d3.range(1000))
Insert cell
nbreaks = geoda.natural_breaks(4, data)
Insert cell
data = Array.from({ length: 200 }, (_, i) => Math.random() + 2 * (i % 6))
Insert cell
Plot.plot({
marks: [
Plot.dotX(data, { fill: (d) => d }),
Plot.ruleX(geoda.natural_breaks(8, data))
]
})
Insert cell
Plot.plot({
marks: [
Plot.dotX(data, { fill: (d) => d }),
Plot.ruleX(geoda.stddev_breaks(data))
]
})
Insert cell
Plot.plot({
marks: [
Plot.dotX(data, { fill: (d) => d }),
Plot.ruleX(geoda.hinge15_breaks(data))
]
})
Insert cell
Plot.plot({
marks: [
Plot.dotX(data, { fill: (d) => d }),
Plot.ruleX(geoda.hinge30_breaks(data))
]
})
Insert cell
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