Public
Edited
Sep 19, 2023
Insert cell
Insert cell
Insert cell
Insert cell
spiedCalls = view[1]
Insert cell
spiedReturns = view[2]
Insert cell
view = {
// Create a store
const store = new zarr.FetchStore(url);

// Spy on the store's get method
const spied = tinyspy.spyOn(store, 'get');


// Open a zarr.Array
const arr = await zarr.open(store, { kind: "array" });
// {
// store: FetchStore,
// path: "/",
// dtype: "uint8",
// shape: [512, 512, 3],
// chunks: [100, 100, 1],
// }

// load a region of the array
const channelIndex = ["red", "green", "blue"].indexOf(radios);
const view = await zarr.get(arr, [null, null, channelIndex]);
// {
// data: Uint8Array,
// shape: [512, 512],
// stride: [512, 1],
// }

return [view, spied.calls, spied.returns];
}
Insert cell
zarr = import("https://cdn.jsdelivr.net/npm/zarrita@next/+esm")
Insert cell
tinyspy = import("tinyspy")
Insert cell
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