Public
Edited
Nov 29
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
world = FileAttachment("world.json").json()
Insert cell
Insert cell
Insert cell
Insert cell
data = world.features.map((d) => d.properties)
Insert cell
Inputs.table(data)
Insert cell
Insert cell
On accède aux données géométriques de la façon suivante :
Insert cell
geom = world.features.map((d) => d.geometry)
Insert cell
Inputs.table(geom)
Insert cell
Insert cell
data1 = world
Insert cell
Insert cell
Insert cell
Plot.plot({ projection: "equal-earth", marks: [Plot.geo(world)] })
Insert cell
Insert cell
{
const container = yield htl.html`<div style="height: 500px;">`;
const map = L.map(container);
const layer = L.geoJSON(world).addTo(map);
map.fitBounds(layer.getBounds(), { maxZoom: 9 });
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution:
"© <a href=https://www.openstreetmap.org/copyright>OpenStreetMap</a> contributors"
}).addTo(map);
}
Insert cell
Insert cell
Insert cell
view = require("geoverview").then((d) => d.view)
Insert cell
view(world)
Insert cell
Insert cell
topohelper = require("topohelper@0.4.1")
Insert cell
topoworld = topohelper.fromGeojson(world).topojson
Insert cell
x = topohelper.from(topoworld).centroids({ layer: 0 })
Insert cell
x.view({ tooltip: true, zoom: true })
Insert cell
Insert cell
bertin = require("bertin")
Insert cell
bertin.draw({ layers: [{ geojson: world, tooltip: ["$NAMEfr", "$region"] }] })
Insert cell
Insert cell
viz = require("geoviz@0.7.2")
Insert cell
{
let svg = viz.create({ zoomable: true, domain: world });
svg.path({ data: world, tip: true });
return svg.render();
}
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