Public
Edited
Jul 8, 2023
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
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
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
const junctions = new NumMap(CoordNum.fromXy);
junctions.set([10, 10], "potato");
return junctions.get([10,10,10]);
}
Insert cell
async function buildTopology(traceResult, options) {
options = Object.assign({ smooth: true }, options);
options.round ??= options.smooth;
const geojson = await buildGeoJsonRaw(traceResult);
let topology = topojson.topology({traced: geojson});
topology.properties = { options };
topology.bbox = traceResult.bbox;
if (options.smooth) {
smoothTopology(topology, traceResult.coordClasses);
// Remove unneeded points
const simplified = topojson.presimplify(topology);
simplified.arcs.flat()
.filter(c => c[2] == 0 && traceResult.coordClasses.get(c) == "junction")
.forEach(c => c[2] = Infinity);
topology = topojson.simplify(simplified, 0.5 / smoothTopology.roundFactor);

// Round to int
if (options.round) scaleTopology(topology, smoothTopology.roundFactor);
}
return topology;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
li = new LoadIndicator(sampleImage);
Insert cell
li.canvas
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
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
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