@biongff/vizarr 0.3.0-dev.2025-11-12.283baee9

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 (81) hide show
  1. package/.gitattributes +1 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
  3. package/.github/ISSUE_TEMPLATE/documentation_update.md +16 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
  5. package/.github/ISSUE_TEMPLATE/maintenance.md +19 -0
  6. package/.github/ISSUE_TEMPLATE/optimisation_request.md +23 -0
  7. package/.github/ISSUE_TEMPLATE/support_request.md +25 -0
  8. package/.github/PULL_REQUEST_TEMPLATE.md +21 -0
  9. package/.github/dependabot.yml +13 -0
  10. package/.github/workflows/build_and_deploy.yml +29 -0
  11. package/.github/workflows/npm-publish-dev.yml +49 -0
  12. package/.github/workflows/npm-publish.yml +20 -0
  13. package/.github/workflows/release.yml +37 -0
  14. package/.github/workflows/test.yml +21 -0
  15. package/.releaserc.json +29 -0
  16. package/CITATION.cff +56 -0
  17. package/CONTRIBUTING.md +82 -0
  18. package/LICENSE +21 -0
  19. package/README.md +85 -0
  20. package/assets/favicon.ico +0 -0
  21. package/assets/favicon.png +0 -0
  22. package/assets/logo-wide.png +0 -0
  23. package/assets/logo-wide.svg +60 -0
  24. package/assets/logo.png +0 -0
  25. package/assets/logo.svg +36 -0
  26. package/assets/robots.txt +3 -0
  27. package/assets/screenshot.png +0 -0
  28. package/biome.json +34 -0
  29. package/index.html +24 -0
  30. package/main.ts +52 -0
  31. package/package.json +55 -0
  32. package/patches/@vivjs__loaders@0.17.2.patch +13 -0
  33. package/python/.python-version +1 -0
  34. package/python/README.md +14 -0
  35. package/python/Untitled.ipynb +40 -0
  36. package/python/deno.json +22 -0
  37. package/python/notebooks/IDR_example.ipynb +86 -0
  38. package/python/notebooks/README.md +35 -0
  39. package/python/notebooks/create_fixture.py +72 -0
  40. package/python/notebooks/getting_started.ipynb +217 -0
  41. package/python/notebooks/mandelbrot.ipynb +211 -0
  42. package/python/notebooks/spatial_transformations.ipynb +139 -0
  43. package/python/pyproject.toml +18 -0
  44. package/python/src/vizarr/__init__.py +10 -0
  45. package/python/src/vizarr/_widget.js +113 -0
  46. package/python/src/vizarr/_widget.py +67 -0
  47. package/python/uv.lock +2495 -0
  48. package/src/ZarrPixelSource.ts +182 -0
  49. package/src/codecs/jpeg2k.ts +22 -0
  50. package/src/codecs/register.ts +2 -0
  51. package/src/components/LayerController/AcquisitionController.tsx +46 -0
  52. package/src/components/LayerController/AddChannelButton.tsx +122 -0
  53. package/src/components/LayerController/AxisOptions.tsx +93 -0
  54. package/src/components/LayerController/AxisSlider.tsx +86 -0
  55. package/src/components/LayerController/AxisSliders.tsx +29 -0
  56. package/src/components/LayerController/ChannelController.tsx +84 -0
  57. package/src/components/LayerController/ChannelOptions.tsx +183 -0
  58. package/src/components/LayerController/ColorPalette.tsx +40 -0
  59. package/src/components/LayerController/Content.tsx +71 -0
  60. package/src/components/LayerController/Header.tsx +48 -0
  61. package/src/components/LayerController/Labels.tsx +73 -0
  62. package/src/components/LayerController/LayerFitToViewportButton.tsx +43 -0
  63. package/src/components/LayerController/LayerVisibilityButton.tsx +32 -0
  64. package/src/components/LayerController/OpacitySlider.tsx +25 -0
  65. package/src/components/LayerController/index.tsx +42 -0
  66. package/src/components/Menu.tsx +54 -0
  67. package/src/components/Viewer.tsx +136 -0
  68. package/src/hooks.ts +29 -0
  69. package/src/index.tsx +138 -0
  70. package/src/io.ts +276 -0
  71. package/src/layers/grid-layer.ts +214 -0
  72. package/src/layers/label-layer.ts +446 -0
  73. package/src/layers/viv-layers.ts +55 -0
  74. package/src/lru-store.ts +57 -0
  75. package/src/ome.ts +388 -0
  76. package/src/state.ts +202 -0
  77. package/src/theme.ts +80 -0
  78. package/src/types.ts +112 -0
  79. package/src/utils.ts +655 -0
  80. package/tsconfig.json +14 -0
  81. package/vite.config.js +47 -0
package/src/theme.ts ADDED
@@ -0,0 +1,80 @@
1
+ import { grey } from "@mui/material/colors";
2
+ import { createTheme } from "@mui/material/styles";
3
+
4
+ export default createTheme({
5
+ palette: {
6
+ mode: "dark",
7
+ primary: { main: grey[500] },
8
+ secondary: { main: grey[500] },
9
+ },
10
+ components: {
11
+ MuiButton: {
12
+ defaultProps: { size: "small" },
13
+ },
14
+ MuiButtonBase: {
15
+ defaultProps: { disableRipple: true },
16
+ },
17
+ MuiFilledInput: {
18
+ defaultProps: { margin: "dense" },
19
+ },
20
+ MuiFormControl: {
21
+ defaultProps: { margin: "dense" },
22
+ },
23
+ MuiFormHelperText: {
24
+ defaultProps: { margin: "dense" },
25
+ },
26
+ MuiIconButton: {
27
+ defaultProps: { size: "small" },
28
+ },
29
+ MuiInputBase: {
30
+ defaultProps: { margin: "dense" },
31
+ },
32
+ MuiInputLabel: {
33
+ defaultProps: { margin: "dense" },
34
+ },
35
+ MuiOutlinedInput: {
36
+ defaultProps: { margin: "dense" },
37
+ },
38
+
39
+ MuiSlider: {
40
+ defaultProps: {
41
+ size: "small",
42
+ },
43
+ styleOverrides: {
44
+ thumb: {
45
+ "&:focus, &:hover": {
46
+ boxShadow: "none",
47
+ },
48
+ height: 11,
49
+ width: 5,
50
+ borderRadius: "15%",
51
+ marginLeft: -1,
52
+ },
53
+ },
54
+ },
55
+ MuiInput: {
56
+ styleOverrides: {
57
+ underline: {
58
+ "&&&&:hover:before": {
59
+ borderBottom: "1px solid #fff",
60
+ },
61
+ },
62
+ },
63
+ },
64
+ MuiPaper: {
65
+ styleOverrides: {
66
+ root: {
67
+ backgroundColor: "rgba(0, 0, 0, 0.8)",
68
+ },
69
+ },
70
+ },
71
+ MuiSvgIcon: {
72
+ styleOverrides: {
73
+ root: {
74
+ width: "0.7em",
75
+ height: "0.7em",
76
+ },
77
+ },
78
+ },
79
+ },
80
+ });
package/src/types.ts ADDED
@@ -0,0 +1,112 @@
1
+ declare namespace Ome {
2
+ type Version = "0.1";
3
+
4
+ interface Channel {
5
+ active: boolean;
6
+ coefficient: number;
7
+ color: string;
8
+ family: string;
9
+ inverted: boolean;
10
+ label?: string;
11
+ window: {
12
+ end: number;
13
+ max?: number;
14
+ min?: number;
15
+ start: number;
16
+ };
17
+ }
18
+
19
+ interface Omero {
20
+ id: number;
21
+ name?: string;
22
+ version: Version;
23
+ channels: Channel[];
24
+ rdefs: {
25
+ defaultT?: number;
26
+ defaultZ?: number;
27
+ model: "color" | "greyscale";
28
+ };
29
+ }
30
+
31
+ interface Axis {
32
+ name: string;
33
+ type?: string;
34
+ unit?: string;
35
+ }
36
+
37
+ type CoordinateTransformation =
38
+ | {
39
+ type: "scale";
40
+ scale: Array<number>;
41
+ }
42
+ | {
43
+ type: "translation";
44
+ translation: Array<number>;
45
+ };
46
+
47
+ interface Dataset {
48
+ path: string;
49
+ coordinateTransformations?: Array<CoordinateTransformation>;
50
+ }
51
+
52
+ interface Multiscale {
53
+ datasets: Array<Dataset>;
54
+ version?: string;
55
+ axes?: string[] | Axis[];
56
+ }
57
+
58
+ interface Bioformats2rawlayout {
59
+ "bioformats2raw.layout": 3;
60
+ }
61
+
62
+ interface Acquisition {
63
+ id: number;
64
+ name?: string;
65
+ maximumfieldcount?: number;
66
+ description?: string;
67
+ starttime?: number;
68
+ /**
69
+ * @deprecated
70
+ */
71
+ path?: string;
72
+ }
73
+
74
+ interface Plate {
75
+ acquisitions?: Acquisition[];
76
+ columns: { name: string }[];
77
+ field_count: 4;
78
+ name: string;
79
+ rows: { name: string }[];
80
+ version: Version;
81
+ wells: { path: string }[];
82
+ }
83
+
84
+ interface Well {
85
+ images: { path: string; acquisition?: number }[];
86
+ version: Version;
87
+ }
88
+
89
+ interface ImageLabel {
90
+ version: Version;
91
+ colors?: Array<{
92
+ "label-value": number;
93
+ rgba: [r: number, g: number, b: number, a: number];
94
+ }>;
95
+ properties?: Array<{
96
+ "label-value": number;
97
+ "omero:roiId": number;
98
+ "omero:shapeId": number;
99
+ }>;
100
+ /** Location of source image */
101
+ source: {
102
+ image: string;
103
+ };
104
+ }
105
+
106
+ type Attrs =
107
+ | { multiscales: Multiscale[] }
108
+ | { omero: Omero; multiscales: Multiscale[] }
109
+ | { plate: Plate }
110
+ | { well: Well }
111
+ | { "image-label": ImageLabel; multiscales: Multiscale[] };
112
+ }