Public
Edited
Mar 20, 2023
Insert cell
Insert cell
Insert cell
Insert cell
chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height])
.attr("fill", "none")
.attr("stroke", "currentColor");

applyPencilFilterTextures(svg);
const outline = svg.append("path")
.attr("fill","mintcream");

const feature = svg.append("path")
.attr("stroke-width", "3px")
.attr("fill","white")
.attr("stroke","#808080")
.attr("filter", "url(#pencilTexture)");

function render() {
outline.attr("d", path(sphere));
feature.attr("d", path(land));
}

return svg
.call(zoom(projection).on("zoom.render end.render", render))
.call(render)
.node();
}
Insert cell
Insert cell
Insert cell
sphere = ({type: "Sphere"})
Insert cell
Insert cell
world = FileAttachment("land-110m.json").json()
Insert cell
topojson = require("topojson@3")
Insert cell
d3 = require("d3@6")
Insert cell
import {zoom} from "@d3/versor-zooming"
Insert cell
import {geoCurvePath} from "@d3/context-to-curve"
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