Public
Edited
Jun 8, 2023
Insert cell
Insert cell
Insert cell
nj = import("https://cdn.skypack.dev/numjs@latest")
Insert cell
Insert cell
Insert cell
masks = new Float32Array(
decoded.split("").map(function (c) {
return c.charCodeAt(0);
})
)
Insert cell
arr = nj.array(masks)
Insert cell
reshaped_mask = arr.reshape([1, 4, 512, 512])
Insert cell
{
let container = html`<div style='height:600px;' />`;

// Give the container dimensions.
yield container;

// Create the \`map\` object with the mapboxgl.Map constructor, referencing
// the container div
let map = new mapboxgl.Map({
container,
center: [2.32424, 48.86501],
zoom: 10,
style: "mapbox://styles/mapbox/streets-v11",
scrollZoom: false
});

map.addControl(new mapboxgl.NavigationControl(), "top-right");

// Be careful to clean up the map's resources using \`map.remove()\` whenever
// this cell is re-evaluated.
invalidation.then(() => map.remove());
}
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more