diff --git a/.gitignore b/.gitignore
index 002078ff..a5f1c820 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,4 +37,6 @@ coverage/
# Temporary files
*.tmp
-*.swp
\ No newline at end of file
+*.swp
+
+docs/build
diff --git a/biome.json b/biome.json
index ea70492e..039ef74d 100644
--- a/biome.json
+++ b/biome.json
@@ -24,7 +24,7 @@
}
},
"files": {
- "ignore": ["python"]
+ "ignore": ["python", "package.json", "viewer/package.json"]
},
"vcs": {
"enabled": true,
diff --git a/docs/viewer/introduction.md b/docs/viewer/introduction.md
new file mode 100644
index 00000000..7e709501
--- /dev/null
+++ b/docs/viewer/introduction.md
@@ -0,0 +1,33 @@
+---
+title: Quick start
+---
+
+
+### Getting started
+
+## Installation
+
+
+```
+npm install @hms-dbmi/vizarr
+```
+
+## Basic Usage
+
+```
+import VizarrViewer from '@hms-dbmi/vizarr'
+
+function App() {
+
+const sources = ["https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.5/idr0062A/6001240_labels.zarr"]
+
+return(
+
+)
+}
+
+
+```
diff --git a/package.json b/package.json
index ad8821c4..1a10d68e 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
"check": "pnpm build:viewer && pnpm -r run check",
"build:viewer": "pnpm --filter vizarr build",
"build:app": "pnpm --filter app build",
+ "build:docs": "pnpm typedoc --plugin typedoc-github-theme",
"build": "pnpm build:viewer && pnpm build:app",
"test": "vitest"
},
@@ -28,6 +29,8 @@
"@vitejs/plugin-react": "^4.3.4",
"@vitest/coverage-v8": "4.0.15",
"semantic-release": "^25.0.2",
+ "typedoc": "^0.28.18",
+ "typedoc-github-theme": "^0.4.0",
"typescript": "^5.8.2",
"vite": "^6.2.7",
"vitest": "^4.0.15"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f1119d24..7b3ca521 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -55,6 +55,12 @@ importers:
semantic-release:
specifier: ^25.0.2
version: 25.0.2(typescript@5.8.2)
+ typedoc:
+ specifier: ^0.28.18
+ version: 0.28.18(typescript@5.8.2)
+ typedoc-github-theme:
+ specifier: ^0.4.0
+ version: 0.4.0(typedoc@0.28.18(typescript@5.8.2))
typescript:
specifier: ^5.8.2
version: 5.8.2
@@ -721,6 +727,9 @@ packages:
'@floating-ui/utils@0.2.10':
resolution: {integrity: sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==}
+ '@gerrit0/mini-shiki@3.23.0':
+ resolution: {integrity: sha512-bEMORlG0cqdjVyCEuU0cDQbORWX+kYCeo0kV1lbxF5bt4r7SID2l9bqsxJEM0zndaxpOUT7riCyIVEuqq/Ynxg==}
+
'@hms-dbmi/viv@0.17.2':
resolution: {integrity: sha512-TLXDLLRg3bJLJGIeKk0XuB5zLZyD0H9atUxlma57mLn/L4GTKCbed7pLR4qymt5aSKFcpyLcMLeFm2Y7d0WxTA==}
@@ -1299,6 +1308,21 @@ packages:
peerDependencies:
semantic-release: '>=20.1.0'
+ '@shikijs/engine-oniguruma@3.23.0':
+ resolution: {integrity: sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g==}
+
+ '@shikijs/langs@3.23.0':
+ resolution: {integrity: sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg==}
+
+ '@shikijs/themes@3.23.0':
+ resolution: {integrity: sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA==}
+
+ '@shikijs/types@3.23.0':
+ resolution: {integrity: sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==}
+
+ '@shikijs/vscode-textmate@10.0.2':
+ resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==}
+
'@sindresorhus/is@4.6.0':
resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==}
engines: {node: '>=10'}
@@ -1379,6 +1403,9 @@ packages:
'@types/hammerjs@2.0.46':
resolution: {integrity: sha512-ynRvcq6wvqexJ9brDMS4BnBLzmr0e14d6ZJTEShTBWKymQiHwlAyGu0ZPEFI2Fh1U53F7tN9ufClWM5KvqkKOw==}
+ '@types/hast@3.0.4':
+ resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==}
+
'@types/node@24.3.0':
resolution: {integrity: sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==}
@@ -1419,6 +1446,9 @@ packages:
'@types/trusted-types@2.0.7':
resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==}
+ '@types/unist@3.0.3':
+ resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}
+
'@vaadin/a11y-base@24.6.11':
resolution: {integrity: sha512-yBZ0QGPngbItIJQx3FRIa9IXDW2Ftf6SFFPGhbdAZafJPBlFi6FElP9cVtL3qjJlI5KKBp/UXEcC8ehPK207gw==}
@@ -1678,6 +1708,10 @@ packages:
balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
+ balanced-match@4.0.4:
+ resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==}
+ engines: {node: 18 || 20 || >=22}
+
base64-js@1.5.1:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
@@ -1690,6 +1724,10 @@ packages:
brace-expansion@2.0.2:
resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==}
+ brace-expansion@5.0.5:
+ resolution: {integrity: sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==}
+ engines: {node: 18 || 20 || >=22}
+
braces@3.0.3:
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
engines: {node: '>=8'}
@@ -2497,6 +2535,9 @@ packages:
lines-and-columns@1.2.4:
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
+ linkify-it@5.0.0:
+ resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==}
+
lit-element@4.2.2:
resolution: {integrity: sha512-aFKhNToWxoyhkNDmWZwEva2SlQia+jfG0fjIWV//YeTaWrVnOxD89dPKfigCUspXFmjzOEUQpOkejH5Ly6sG0w==}
@@ -2564,6 +2605,9 @@ packages:
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
engines: {node: '>=10'}
+ lunr@2.3.9:
+ resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==}
+
luxon@3.5.0:
resolution: {integrity: sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==}
engines: {node: '>=12'}
@@ -2591,6 +2635,10 @@ packages:
resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==}
engines: {node: '>=10'}
+ markdown-it@14.1.1:
+ resolution: {integrity: sha512-BuU2qnTti9YKgK5N+IeMubp14ZUKUUw7yeJbkjtosvHiP0AZ5c8IAgEMk79D0eC8F23r4Ac/q8cAIFdm2FtyoA==}
+ hasBin: true
+
marked-terminal@7.3.0:
resolution: {integrity: sha512-t4rBvPsHc57uE/2nJOLmMbZCQ4tgAccAED3ngXQqW6g+TxA488JzJ+FK3lQkzBQOI1mRV/r/Kq+1ZlJ4D0owQw==}
engines: {node: '>=16.0.0'}
@@ -2608,6 +2656,9 @@ packages:
md5@2.3.0:
resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==}
+ mdurl@2.0.0:
+ resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==}
+
meow@13.2.0:
resolution: {integrity: sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==}
engines: {node: '>=18'}
@@ -2636,6 +2687,10 @@ packages:
resolution: {integrity: sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==}
engines: {node: 20 || >=22}
+ minimatch@10.2.4:
+ resolution: {integrity: sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==}
+ engines: {node: 18 || 20 || >=22}
+
minimatch@9.0.5:
resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==}
engines: {node: '>=16 || 14 >=14.17'}
@@ -2974,6 +3029,10 @@ packages:
protocol-buffers-schema@3.6.0:
resolution: {integrity: sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==}
+ punycode.js@2.3.1:
+ resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==}
+ engines: {node: '>=6'}
+
punycode@2.3.1:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
@@ -3358,11 +3417,27 @@ packages:
resolution: {integrity: sha512-xxCJm+Bckc6kQBknN7i9fnP/xobQRsRQxR01CztFkp/h++yfVxUUcmMgfR2HttJx/dpWjS9ubVuyspJv24Q9DA==}
engines: {node: '>=20'}
+ typedoc-github-theme@0.4.0:
+ resolution: {integrity: sha512-lo/hr4EFZxq0SsMGeAscKUzljIKFgrJf5fb4nOAJcqaiSShQv7kzwF6M1s2fVRvUyx6UsmD4zEb+MtKkbucYpg==}
+ engines: {node: '>=18.0.0'}
+ peerDependencies:
+ typedoc: ~0.28.0
+
+ typedoc@0.28.18:
+ resolution: {integrity: sha512-NTWTUOFRQ9+SGKKTuWKUioUkjxNwtS3JDRPVKZAXGHZy2wCA8bdv2iJiyeePn0xkmK+TCCqZFT0X7+2+FLjngA==}
+ engines: {node: '>= 18', pnpm: '>= 10'}
+ hasBin: true
+ peerDependencies:
+ typescript: 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x || 6.0.x
+
typescript@5.8.2:
resolution: {integrity: sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==}
engines: {node: '>=14.17'}
hasBin: true
+ uc.micro@2.1.0:
+ resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==}
+
ufo@1.6.1:
resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==}
@@ -4192,6 +4267,14 @@ snapshots:
'@floating-ui/utils@0.2.10': {}
+ '@gerrit0/mini-shiki@3.23.0':
+ dependencies:
+ '@shikijs/engine-oniguruma': 3.23.0
+ '@shikijs/langs': 3.23.0
+ '@shikijs/themes': 3.23.0
+ '@shikijs/types': 3.23.0
+ '@shikijs/vscode-textmate': 10.0.2
+
'@hms-dbmi/viv@0.17.2(@deck.gl/core@9.0.41)(@deck.gl/geo-layers@9.0.41(@deck.gl/core@9.0.41)(@deck.gl/extensions@9.0.41(@deck.gl/core@9.0.41)(@luma.gl/core@9.0.28)(@luma.gl/engine@9.0.28(@luma.gl/core@9.0.28)))(@deck.gl/layers@9.0.41(@deck.gl/core@9.0.41)(@loaders.gl/core@4.3.3)(@luma.gl/core@9.0.28)(@luma.gl/engine@9.0.28(@luma.gl/core@9.0.28)))(@deck.gl/mesh-layers@9.0.41(@deck.gl/core@9.0.41)(@loaders.gl/core@4.3.3)(@luma.gl/core@9.0.28)(@luma.gl/engine@9.0.28(@luma.gl/core@9.0.28)))(@loaders.gl/core@4.3.3)(@luma.gl/core@9.0.28)(@luma.gl/engine@9.0.28(@luma.gl/core@9.0.28)))(@deck.gl/layers@9.0.41(@deck.gl/core@9.0.41)(@loaders.gl/core@4.3.3)(@luma.gl/core@9.0.28)(@luma.gl/engine@9.0.28(@luma.gl/core@9.0.28)))(@deck.gl/react@9.0.41(@deck.gl/core@9.0.41)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@luma.gl/constants@9.0.28)(@luma.gl/core@9.0.28)(@luma.gl/engine@9.0.28(@luma.gl/core@9.0.28))(@luma.gl/shadertools@9.0.28(@luma.gl/core@9.0.28))(@luma.gl/webgl@9.0.28(@luma.gl/core@9.0.28))(react@18.3.1)':
dependencies:
'@vivjs/constants': 0.17.2
@@ -4936,6 +5019,26 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@shikijs/engine-oniguruma@3.23.0':
+ dependencies:
+ '@shikijs/types': 3.23.0
+ '@shikijs/vscode-textmate': 10.0.2
+
+ '@shikijs/langs@3.23.0':
+ dependencies:
+ '@shikijs/types': 3.23.0
+
+ '@shikijs/themes@3.23.0':
+ dependencies:
+ '@shikijs/types': 3.23.0
+
+ '@shikijs/types@3.23.0':
+ dependencies:
+ '@shikijs/vscode-textmate': 10.0.2
+ '@types/hast': 3.0.4
+
+ '@shikijs/vscode-textmate@10.0.2': {}
+
'@sindresorhus/is@4.6.0': {}
'@sindresorhus/merge-streams@4.0.0': {}
@@ -5023,6 +5126,10 @@ snapshots:
'@types/hammerjs@2.0.46': {}
+ '@types/hast@3.0.4':
+ dependencies:
+ '@types/unist': 3.0.3
+
'@types/node@24.3.0':
dependencies:
undici-types: 7.10.0
@@ -5056,6 +5163,8 @@ snapshots:
'@types/trusted-types@2.0.7': {}
+ '@types/unist@3.0.3': {}
+
'@vaadin/a11y-base@24.6.11':
dependencies:
'@open-wc/dedupe-mixin': 1.4.0
@@ -5443,6 +5552,8 @@ snapshots:
balanced-match@1.0.2: {}
+ balanced-match@4.0.4: {}
+
base64-js@1.5.1:
optional: true
@@ -5454,6 +5565,10 @@ snapshots:
dependencies:
balanced-match: 1.0.2
+ brace-expansion@5.0.5:
+ dependencies:
+ balanced-match: 4.0.4
+
braces@3.0.3:
dependencies:
fill-range: 7.1.1
@@ -6187,6 +6302,10 @@ snapshots:
lines-and-columns@1.2.4: {}
+ linkify-it@5.0.0:
+ dependencies:
+ uc.micro: 2.1.0
+
lit-element@4.2.2:
dependencies:
'@lit-labs/ssr-dom-shim': 1.5.1
@@ -6255,6 +6374,8 @@ snapshots:
dependencies:
yallist: 4.0.0
+ lunr@2.3.9: {}
+
luxon@3.5.0: {}
lz4js@0.2.0:
@@ -6284,6 +6405,15 @@ snapshots:
dependencies:
semver: 7.7.3
+ markdown-it@14.1.1:
+ dependencies:
+ argparse: 2.0.1
+ entities: 4.5.0
+ linkify-it: 5.0.0
+ mdurl: 2.0.0
+ punycode.js: 2.3.1
+ uc.micro: 2.1.0
+
marked-terminal@7.3.0(marked@15.0.12):
dependencies:
ansi-escapes: 7.2.0
@@ -6307,6 +6437,8 @@ snapshots:
crypt: 0.0.2
is-buffer: 1.1.6
+ mdurl@2.0.0: {}
+
meow@13.2.0: {}
merge-stream@2.0.0: {}
@@ -6326,6 +6458,10 @@ snapshots:
dependencies:
'@isaacs/brace-expansion': 5.0.0
+ minimatch@10.2.4:
+ dependencies:
+ brace-expansion: 5.0.5
+
minimatch@9.0.5:
dependencies:
brace-expansion: 2.0.2
@@ -6574,6 +6710,8 @@ snapshots:
protocol-buffers-schema@3.6.0: {}
+ punycode.js@2.3.1: {}
+
punycode@2.3.1: {}
quadbin@0.2.0:
@@ -6967,8 +7105,23 @@ snapshots:
dependencies:
tagged-tag: 1.0.0
+ typedoc-github-theme@0.4.0(typedoc@0.28.18(typescript@5.8.2)):
+ dependencies:
+ typedoc: 0.28.18(typescript@5.8.2)
+
+ typedoc@0.28.18(typescript@5.8.2):
+ dependencies:
+ '@gerrit0/mini-shiki': 3.23.0
+ lunr: 2.3.9
+ markdown-it: 14.1.1
+ minimatch: 10.2.4
+ typescript: 5.8.2
+ yaml: 2.8.2
+
typescript@5.8.2: {}
+ uc.micro@2.1.0: {}
+
ufo@1.6.1: {}
uglify-js@3.19.3:
diff --git a/typedoc.json b/typedoc.json
new file mode 100644
index 00000000..0a564893
--- /dev/null
+++ b/typedoc.json
@@ -0,0 +1,8 @@
+{
+ "entryPointStrategy": "packages",
+ "entryPoints": ["./viewer"],
+ "packageOptions": {
+ "entryPoints": ["src/index.tsx"]
+ },
+ "out": "./docs/build"
+}
diff --git a/viewer/package.json b/viewer/package.json
index 986b2175..5f0e0638 100644
--- a/viewer/package.json
+++ b/viewer/package.json
@@ -5,7 +5,9 @@
"main": "dist/biongff-vizarr.cjs.js",
"module": "dist/biongff-vizarr.es.js",
"types": "dist/index.d.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"exports": {
".": {
"types": "./dist/index.d.ts",
diff --git a/viewer/src/components/VizarrViewer.tsx b/viewer/src/components/VizarrViewer.tsx
index 19743551..fbdeaf03 100644
--- a/viewer/src/components/VizarrViewer.tsx
+++ b/viewer/src/components/VizarrViewer.tsx
@@ -8,7 +8,6 @@ import { ViewStateContext } from "../hooks";
import { createSourceData } from "../io";
import {
type ImageLayerConfig,
- type ViewState,
redirectObjAtom,
sourceErrorAtom,
sourceInfoAtom,
@@ -20,9 +19,21 @@ import Menu from "./Menu";
import { InfoSnackbar } from "./Snackbar";
import Viewer from "./Viewer";
+export interface ViewState {
+ /**Level of zoom */
+ zoom: number;
+ /** Coordinates to center the view state on */
+ target: [number, number];
+ width?: number;
+ height?: number;
+}
+
export interface VizarrViewerProps {
+ /** Source image urls*/
sources?: string[];
+ /** View state of the viewer*/
viewState?: ViewState;
+ /** Callback to execute side effects when view state changes */
onViewStateChange?: (viewState: ViewState) => void;
}
@@ -155,6 +166,9 @@ function VizarrViewerComponent({ sources = [], viewState: initialViewState, onVi
);
}
+/**
+ *Component to render source images
+ */
export default function VizarrViewer(props: VizarrViewerProps) {
return (
diff --git a/viewer/src/state.ts b/viewer/src/state.ts
index dab72dd2..8e7c61d1 100644
--- a/viewer/src/state.ts
+++ b/viewer/src/state.ts
@@ -20,7 +20,9 @@ import {
} from "./layers/viv-layers";
export interface ViewState {
+ /**Level of zoom */
zoom: number;
+ /** Coordinates to center the view state on */
target: [number, number];
width?: number;
height?: number;
diff --git a/viewer/typedoc.json b/viewer/typedoc.json
new file mode 100644
index 00000000..6b64cac2
--- /dev/null
+++ b/viewer/typedoc.json
@@ -0,0 +1,3 @@
+{
+ "projectDocuments": ["../docs/viewer/introduction.md"]
+}