-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
162 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { defineConfig } from "vitepress"; | ||
import { tabsMarkdownPlugin } from "vitepress-plugin-tabs"; | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
title: "zarrita.js", | ||
base: "/zarrita.js/", | ||
description: "Zarr building blocks for JavaScript", | ||
head: [ | ||
["link", { rel: "icon", type: "image/svg+xml", href: "/logo.svg" }], | ||
], | ||
themeConfig: { | ||
logo: "/logo.svg", | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: [ | ||
{ text: "Home", link: "/" }, | ||
{ text: "Guide", link: "/what-is-zarrita" }, | ||
], | ||
sidebar: [ | ||
{ | ||
text: "Introduction", | ||
items: [ | ||
{ text: "What is zarrita.js?", link: "/what-is-zarrita" }, | ||
{ text: "Get Started", link: "/get-started" }, | ||
{ text: "Recipes", link: "/recipes" }, | ||
], | ||
}, | ||
{ | ||
text: "API Reference", | ||
collapsed: false, | ||
items: [ | ||
{ text: "@zarrita/core", link: "/core" }, | ||
{ text: "@zarrita/storage", link: "/storage" }, | ||
{ text: "@zarrita/indexing", link: "/indexing" }, | ||
{ text: "@zarrita/ndarray", link: "/ndarray" }, | ||
], | ||
}, | ||
], | ||
socialLinks: [ | ||
{ icon: "github", link: "https://github.com/manzt/zarrita.js" }, | ||
], | ||
search: { | ||
provider: "local", | ||
}, | ||
footer: { | ||
message: | ||
"Released under the <a style='text-decoration:underline;' href='https://github.com/manzt/zarrita.js/blob/main/LICENSE'>MIT License</a>.", | ||
copyright: `Copyright 2020–${new Date().getUTCFullYear()} Trevor Manz`, | ||
}, | ||
}, | ||
markdown: { | ||
config(md) { | ||
md.use(tabsMarkdownPlugin); | ||
}, | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Getting Started | ||
|
||
## Open an Array | ||
|
||
```js | ||
import * as zarr from "@zarrita/core"; | ||
import { FetchStore } from "@zarrita/storage"; | ||
|
||
const store = new FetchStore("http://localhost:8080/data.zarr"); | ||
const arr = await zarr.open.v2(store, { kind: "array" }); | ||
``` | ||
|
||
## Read a chunk | ||
|
||
```js | ||
const chunk = await arr.get_chunk([0, 0]); | ||
// { | ||
// data: Int32Array(10) [ | ||
// 0, 1, 2, 3, 4, | ||
// 10, 11, 12, 13, 14, | ||
// ], | ||
// shape: [ 2, 5 ], | ||
// } | ||
``` | ||
|
||
## Read entire dataset | ||
|
||
```js | ||
import { get } from "@zarrita/indexing"; | ||
|
||
const full = await get(arr); // ndarray.Ndarray<Int32Array> | ||
// { | ||
// data: Int32Array(50) [ | ||
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, | ||
// 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, | ||
// 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, | ||
// 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, | ||
// 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, | ||
// ], | ||
// shape: [ 5, 10 ], | ||
// stride: [ 10, 1 ] | ||
// } | ||
``` | ||
|
||
## Read a selection | ||
|
||
```js | ||
const region = await get(arr, [null, zarr.slice(6)]); | ||
// { | ||
// data: Int32Array(30) [ | ||
// 0, 1, 2, 3, 4, 5, | ||
// 10, 11, 12, 13, 14, 15, | ||
// 20, 21, 22, 23, 24, 25, | ||
// 30, 31, 32, 33, 34, 35, | ||
// 40, 41, 42, 43, 44, 45, | ||
// ], | ||
// shape: [ 5, 6 ], | ||
// stride: [ 6, 1 ] | ||
// } | ||
``` | ||
|
||
## Read as a `scijs/ndarray` | ||
|
||
```js | ||
import { get } from "@zarrita/ndarray"; | ||
|
||
const full = await get(arr); // ndarray.Ndarray<Int32Array> | ||
const region = await get(arr, [null, zarr.slice(6)]); // ndarray.Ndarray<Int32Array> | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.