Published
Edited
Jan 15, 2020
1 fork
Insert cell
Insert cell
point_geojson = ({
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-97.321426, 38.128271]
},
"properties": {
"details": 'single point'
}
});
Insert cell
{
const svg = d3.select(DOM.svg(width, height));
svg.append("path")
.datum(statesOuter)
.attr("class", "outer")
.attr("d", path)
.style("stroke", "#000")
.style("stroke-width", .1)
.style("fill", "aliceblue")
svg.selectAll(".point")
.data([point_geojson])
.enter().append("path")
.attr("d", path)
.style("stroke", "#000")
.style("stroke-width", .1)

return svg.node();
}
Insert cell
statesGeo = topojson.feature(states, states.objects.states)
Insert cell
d3.geoContains(statesGeo, point_geojson.geometry.coordinates)
Insert cell
Insert cell
Insert cell
Insert cell
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