@vitessce/all 2.0.3-beta.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/deflate-f57b3163.js +13 -0
  2. package/dist/hglib-1422f224.js +138925 -0
  3. package/dist/index-3f1c1764.js +258272 -0
  4. package/dist/index.js +12 -2
  5. package/dist/jpeg-e740c9a5.js +840 -0
  6. package/dist/lerc-01e6c4d8.js +2006 -0
  7. package/dist/lzw-865bd058.js +128 -0
  8. package/dist/packbits-d4191efd.js +30 -0
  9. package/dist/pako.esm-68f84e2a.js +4022 -0
  10. package/dist/raw-3c693341.js +12 -0
  11. package/dist/webimage-83da2258.js +32 -0
  12. package/dist-tsc/Vitessce.d.ts +2 -0
  13. package/dist-tsc/Vitessce.d.ts.map +1 -0
  14. package/dist-tsc/Vitessce.js +41 -0
  15. package/dist-tsc/base-plugins.d.ts +854 -0
  16. package/dist-tsc/base-plugins.d.ts.map +1 -0
  17. package/dist-tsc/base-plugins.js +191 -0
  18. package/dist-tsc/index.d.ts +4 -0
  19. package/dist-tsc/index.d.ts.map +1 -0
  20. package/dist-tsc/index.js +3 -0
  21. package/dist-tsc/joint-file-types-legacy.d.ts +226 -0
  22. package/dist-tsc/joint-file-types-legacy.d.ts.map +1 -0
  23. package/dist-tsc/joint-file-types-legacy.js +266 -0
  24. package/dist-tsc/joint-file-types-legacy.test.d.ts +2 -0
  25. package/dist-tsc/joint-file-types-legacy.test.d.ts.map +1 -0
  26. package/dist-tsc/joint-file-types-legacy.test.js +401 -0
  27. package/dist-tsc/joint-file-types.d.ts +4 -0
  28. package/dist-tsc/joint-file-types.d.ts.map +1 -0
  29. package/dist-tsc/joint-file-types.js +127 -0
  30. package/dist-tsc/joint-file-types.test.d.ts +2 -0
  31. package/dist-tsc/joint-file-types.test.d.ts.map +1 -0
  32. package/dist-tsc/joint-file-types.test.js +128 -0
  33. package/dist-tsc/latest-config-schema.test.d.ts +2 -0
  34. package/dist-tsc/latest-config-schema.test.d.ts.map +1 -0
  35. package/dist-tsc/latest-config-schema.test.js +19 -0
  36. package/package.json +39 -21
  37. package/src/Vitessce.tsx +74 -0
  38. package/src/base-plugins.ts +362 -0
  39. package/src/index.ts +8 -0
  40. package/src/joint-file-types-legacy.test.ts +413 -0
  41. package/src/joint-file-types-legacy.ts +284 -0
  42. package/src/joint-file-types.test.ts +132 -0
  43. package/src/joint-file-types.ts +142 -0
  44. package/src/latest-config-schema.test.ts +26 -0
  45. package/dist/setup.js +0 -96
@@ -0,0 +1,12 @@
1
+ import { B as BaseDecoder } from "./index-3f1c1764.js";
2
+ import "react";
3
+ import "@vitessce/vit-s";
4
+ import "react-dom";
5
+ class RawDecoder extends BaseDecoder {
6
+ decodeBlock(buffer) {
7
+ return buffer;
8
+ }
9
+ }
10
+ export {
11
+ RawDecoder as default
12
+ };
@@ -0,0 +1,32 @@
1
+ import { B as BaseDecoder } from "./index-3f1c1764.js";
2
+ import "react";
3
+ import "@vitessce/vit-s";
4
+ import "react-dom";
5
+ class WebImageDecoder extends BaseDecoder {
6
+ constructor() {
7
+ super();
8
+ if (typeof createImageBitmap === "undefined") {
9
+ throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");
10
+ } else if (typeof document === "undefined" && typeof OffscreenCanvas === "undefined") {
11
+ throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");
12
+ }
13
+ }
14
+ async decode(fileDirectory, buffer) {
15
+ const blob = new Blob([buffer]);
16
+ const imageBitmap = await createImageBitmap(blob);
17
+ let canvas;
18
+ if (typeof document !== "undefined") {
19
+ canvas = document.createElement("canvas");
20
+ canvas.width = imageBitmap.width;
21
+ canvas.height = imageBitmap.height;
22
+ } else {
23
+ canvas = new OffscreenCanvas(imageBitmap.width, imageBitmap.height);
24
+ }
25
+ const ctx = canvas.getContext("2d");
26
+ ctx.drawImage(imageBitmap, 0, 0);
27
+ return ctx.getImageData(0, 0, imageBitmap.width, imageBitmap.height).data.buffer;
28
+ }
29
+ }
30
+ export {
31
+ WebImageDecoder as default
32
+ };
@@ -0,0 +1,2 @@
1
+ export declare function Vitessce(props: any): import("react/jsx-runtime.js").JSX.Element;
2
+ //# sourceMappingURL=Vitessce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Vitessce.d.ts","sourceRoot":"","sources":["../src/Vitessce.tsx"],"names":[],"mappings":"AAeA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,8CA0DlC"}
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /* eslint-disable max-len */
3
+ import { useMemo } from 'react';
4
+ import { VitS, } from '@vitessce/vit-s';
5
+ import { upgradeAndParse, } from '@vitessce/schemas';
6
+ import { baseViewTypes, baseFileTypes, baseJointFileTypes, baseCoordinationTypes, } from './base-plugins.js';
7
+ export function Vitessce(props) {
8
+ const { config, onConfigUpgrade, pluginViewTypes: pluginViewTypesProp, pluginFileTypes: pluginFileTypesProp, pluginCoordinationTypes: pluginCoordinationTypesProp, pluginJointFileTypes: pluginJointFileTypesProp, } = props;
9
+ const configUid = config?.uid;
10
+ const configVersion = config?.version;
11
+ const [configOrWarning, success] = useMemo(() => {
12
+ try {
13
+ const validConfig = upgradeAndParse(config, onConfigUpgrade);
14
+ return [validConfig, true];
15
+ }
16
+ catch (e) {
17
+ console.error(e);
18
+ return [
19
+ {
20
+ title: 'Config validation or upgrade failed.',
21
+ unformatted: e.message,
22
+ },
23
+ false,
24
+ ];
25
+ }
26
+ // eslint-disable-next-line react-hooks/exhaustive-deps
27
+ }, [configUid, configVersion]);
28
+ const mergedPluginViewTypes = useMemo(() => ([
29
+ ...baseViewTypes, ...(pluginViewTypesProp || []),
30
+ ]), [pluginViewTypesProp]);
31
+ const mergedPluginFileTypes = useMemo(() => ([
32
+ ...baseFileTypes, ...(pluginFileTypesProp || []),
33
+ ]), [pluginFileTypesProp]);
34
+ const mergedPluginJointFileTypes = useMemo(() => ([
35
+ ...baseJointFileTypes, ...(pluginJointFileTypesProp || []),
36
+ ]), [pluginJointFileTypesProp]);
37
+ const mergedPluginCoordinationTypes = useMemo(() => ([
38
+ ...baseCoordinationTypes, ...(pluginCoordinationTypesProp || []),
39
+ ]), [pluginCoordinationTypesProp]);
40
+ return (_jsx(VitS, { ...props, config: configOrWarning, viewTypes: mergedPluginViewTypes, fileTypes: mergedPluginFileTypes, jointFileTypes: mergedPluginJointFileTypes, coordinationTypes: mergedPluginCoordinationTypes, warning: (success ? null : configOrWarning) }));
41
+ }