Published
Edited
Jun 14, 2021
6 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
iterations = 1e4
Insert cell
Insert cell
Insert cell
Insert cell
colorScale = d3.scaleThreshold().domain(breaks).range(colorBins)
Insert cell
breaks = {
if (binType === "eg. Quantile") {
return []
} else if (binType === 'naturalBreaks' || binType === 'quantileBreaks') {
return geoda[binType](k, data)
} else {
return geoda[binType](data)
}
}
Insert cell
colorBins = {
let colorBins = []

for (let i=0; i<breaks.length+1; i++){
colorBins.push(d3.interpolateCividis(i/(breaks.length+1)))
}

return colorBins
}
Insert cell
Insert cell
geoda = await jsgeoda.New()
Insert cell
Insert cell
import {fileInput} from "@mbostock/file-input"
Insert cell
Insert cell
jsgeoda = import('https://cdn.skypack.dev/jsgeoda')
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