Published
Edited
Jul 26, 2022
2 forks
43 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
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
cacheSize = {
while (true) {
let mapChanged = map.drawTiles(); // drawTiles does nothing if map is complete
let numCachedTiles = tileCache.prune(map.tileDistance, 1.0);
if (mapChanged) drawGlobe(camPosition);
yield numCachedTiles;
}
}
Insert cell
Insert cell
drawGlobe(camPosition)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
yawgl = import("yawgl@0.1.2")
Insert cell
Insert cell
map = tileFrame.init({
getTile: tileCache.retrieve,
context: mapContext,
width: mapSize,
height: mapSize,
tileSize: tileSize,
maxZoom: 22
})
Insert cell
tileCache = tileRack.initRasterCache(tileSize, tileURL)
Insert cell
mapSize = {
let screenSize = Math.max(screen.width, screen.height);
let power = Math.ceil(Math.log2(screenSize));
return 2 ** power;
}
Insert cell
Insert cell
Insert cell
tileFrame = import("tile-frame@1.0.0")
Insert cell
tileRack = import("tile-rack@0.2.1")
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