@aics/vole-app 3.4.4 → 3.6.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.
- package/es/aics-image-viewer/components/App/index.js +15 -5
- package/es/aics-image-viewer/components/ChannelsWidget.js +3 -1
- package/es/aics-image-viewer/components/ChannelsWidgetRow.js +29 -16
- package/es/aics-image-viewer/components/ColorPicker/index.js +9 -1
- package/es/aics-image-viewer/components/ControlPanel/CopySettingsButton.js +445 -0
- package/es/aics-image-viewer/components/ControlPanel/index.js +16 -5
- package/es/aics-image-viewer/components/ControlPanel/styles.css +29 -2
- package/es/aics-image-viewer/components/StyleProvider/index.js +17 -2
- package/es/aics-image-viewer/components/Toolbar/ViewModeRadioButtons.js +1 -1
- package/es/aics-image-viewer/components/Toolbar/index.js +1 -1
- package/es/aics-image-viewer/components/Toolbar/styles.css +0 -10
- package/es/aics-image-viewer/components/{CellViewerCanvasWrapper → ViewerCanvasWrapper}/index.js +3 -2
- package/es/aics-image-viewer/components/dimension_sliders/AxisClipSliders.js +21 -8
- package/es/aics-image-viewer/components/dimension_sliders/RotationSliders.js +6 -8
- package/es/aics-image-viewer/components/dimension_sliders/SliderRows.js +8 -6
- package/es/aics-image-viewer/components/shared/ContextualAlert.js +101 -0
- package/es/aics-image-viewer/components/shared/ControlPanelRow/index.js +4 -2
- package/es/aics-image-viewer/components/shared/ControlPanelRow/styles.css +4 -3
- package/es/aics-image-viewer/components/useVolume.js +59 -25
- package/es/aics-image-viewer/shared/constants.js +25 -1
- package/es/aics-image-viewer/shared/types.js +1 -1
- package/es/aics-image-viewer/shared/utils/controlPointsToLut.js +4 -0
- package/es/aics-image-viewer/shared/utils/parseSnapshot.js +205 -0
- package/es/aics-image-viewer/shared/utils/{urlParsing.js → parseUrl.js} +55 -191
- package/es/aics-image-viewer/shared/utils/permissions.js +46 -0
- package/es/aics-image-viewer/shared/utils/test/camera.test.js +1 -2
- package/es/aics-image-viewer/shared/utils/test/{urlParsing.test.js → parseUrl.test.js} +28 -25
- package/es/aics-image-viewer/shared/utils/test/storage.test.js +2 -2
- package/es/aics-image-viewer/shared/utils/test/viewerChannelSettings.test.js +1 -1
- package/es/aics-image-viewer/state/deserialize.js +443 -331
- package/es/aics-image-viewer/state/reset.js +1 -1
- package/es/aics-image-viewer/state/serialize.js +168 -78
- package/es/aics-image-viewer/state/subscribers.js +1 -1
- package/es/aics-image-viewer/state/test/deserialize.test.js +63 -77
- package/es/aics-image-viewer/state/test/reset.test.js +2 -2
- package/es/aics-image-viewer/state/test/serialize.test.js +42 -43
- package/es/aics-image-viewer/state/test/test_data.js +119 -1
- package/es/aics-image-viewer/state/types.js +157 -245
- package/es/aics-image-viewer/state/util.js +39 -1
- package/es/index.js +4 -2
- package/package.json +26 -44
- package/type-declarations/aics-image-viewer/components/App/types.d.ts +3 -3
- package/type-declarations/aics-image-viewer/components/ChannelsWidget.d.ts +3 -0
- package/type-declarations/aics-image-viewer/components/ChannelsWidgetRow.d.ts +3 -0
- package/type-declarations/aics-image-viewer/components/ControlPanel/CopySettingsButton.d.ts +11 -0
- package/type-declarations/aics-image-viewer/components/Toolbar/ViewModeRadioButtons.d.ts +1 -1
- package/type-declarations/aics-image-viewer/components/{CellViewerCanvasWrapper → ViewerCanvasWrapper}/index.d.ts +4 -3
- package/type-declarations/aics-image-viewer/components/dimension_sliders/AxisClipSliders.d.ts +7 -6
- package/type-declarations/aics-image-viewer/components/dimension_sliders/SliderRows.d.ts +1 -2
- package/type-declarations/aics-image-viewer/components/shared/ContextualAlert.d.ts +29 -0
- package/type-declarations/aics-image-viewer/components/shared/ControlPanelRow/index.d.ts +1 -0
- package/type-declarations/aics-image-viewer/components/useVolume.d.ts +3 -0
- package/type-declarations/aics-image-viewer/shared/constants.d.ts +2 -2
- package/type-declarations/aics-image-viewer/shared/types.d.ts +2 -2
- package/type-declarations/aics-image-viewer/shared/utils/controlPointsToLut.d.ts +1 -1
- package/type-declarations/aics-image-viewer/shared/utils/parseSnapshot.d.ts +49 -0
- package/type-declarations/aics-image-viewer/shared/utils/{urlParsing.d.ts → parseUrl.d.ts} +3 -24
- package/type-declarations/aics-image-viewer/shared/utils/permissions.d.ts +7 -0
- package/type-declarations/aics-image-viewer/shared/utils/viewerChannelSettings.d.ts +1 -1
- package/type-declarations/aics-image-viewer/state/deserialize.d.ts +70 -35
- package/type-declarations/aics-image-viewer/state/reset.d.ts +1 -1
- package/type-declarations/aics-image-viewer/state/serialize.d.ts +44 -10
- package/type-declarations/aics-image-viewer/state/types.d.ts +265 -159
- package/type-declarations/aics-image-viewer/state/util.d.ts +3 -1
- package/type-declarations/index.d.ts +5 -3
- package/es/Globals.d.js +0 -0
- package/es/aics-image-viewer/shared/enums.js +0 -18
- package/es/aics-image-viewer/shared/utils/firebase/index.js +0 -109
- package/type-declarations/aics-image-viewer/shared/enums.d.ts +0 -15
- package/type-declarations/aics-image-viewer/shared/utils/firebase/index.d.ts +0 -69
- package/type-declarations/aics-image-viewer/shared/utils/math.d.ts +0 -1
- /package/es/aics-image-viewer/components/{CellViewerCanvasWrapper → ViewerCanvasWrapper}/styles.css +0 -0
|
@@ -1,41 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export var ViewMode = /*#__PURE__*/function (ViewMode) {
|
|
2
|
+
ViewMode["threeD"] = "3D";
|
|
3
|
+
ViewMode["xy"] = "XY";
|
|
4
|
+
ViewMode["xz"] = "XZ";
|
|
5
|
+
ViewMode["yz"] = "YZ";
|
|
6
|
+
return ViewMode;
|
|
7
|
+
}({});
|
|
8
|
+
export var RenderMode = /*#__PURE__*/function (RenderMode) {
|
|
9
|
+
RenderMode["volumetric"] = "volumetric";
|
|
10
|
+
RenderMode["maxProject"] = "maxproject";
|
|
11
|
+
RenderMode["pathTrace"] = "pathtrace";
|
|
12
|
+
return RenderMode;
|
|
13
|
+
}({});
|
|
14
|
+
export var ImageType = /*#__PURE__*/function (ImageType) {
|
|
15
|
+
ImageType["segmentedCell"] = "cell";
|
|
16
|
+
ImageType["fullField"] = "fov";
|
|
17
|
+
return ImageType;
|
|
18
|
+
}({});
|
|
19
|
+
|
|
9
20
|
/** Global (not per-channel) viewer state which may be changed in the UI */
|
|
10
21
|
|
|
22
|
+
/** Settings for a single channel which may be changed in the UI */
|
|
23
|
+
|
|
11
24
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
25
|
+
* The variants of `ViewMode` that appear in serialized representations of state
|
|
26
|
+
* (`ViewerStateSnapshot`, `ViewerStateStringified`).
|
|
27
|
+
*
|
|
28
|
+
* **IMPORTANT:** Changing the values of this enum will BREAK existing image sharing links and exported app state.
|
|
29
|
+
* It should not be done without introducing code to handle the previous values. This enum must not have values that
|
|
30
|
+
* collide when `toLowerCase` is applied to them.
|
|
14
31
|
*/
|
|
15
|
-
export var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
export var ViewModeSnapshot = /*#__PURE__*/function (ViewModeSnapshot) {
|
|
33
|
+
ViewModeSnapshot["threeD"] = "3D";
|
|
34
|
+
ViewModeSnapshot["xy"] = "Z";
|
|
35
|
+
ViewModeSnapshot["xz"] = "Y";
|
|
36
|
+
ViewModeSnapshot["yz"] = "X";
|
|
37
|
+
return ViewModeSnapshot;
|
|
38
|
+
}({});
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The variants of `RenderMode` that appear in serialized representations of state
|
|
42
|
+
* (`ViewerStateSnapshot`, `ViewerStateStringified`).
|
|
43
|
+
*
|
|
44
|
+
* **IMPORTANT:** Changing the values of this enum will BREAK existing image sharing links and exported app state.
|
|
45
|
+
* It should not be done without introducing code to handle the previous values. This enum must not have values that
|
|
46
|
+
* collide when `toLowerCase` is applied to them.
|
|
47
|
+
*/
|
|
48
|
+
export var RenderModeSnapshot = /*#__PURE__*/function (RenderModeSnapshot) {
|
|
49
|
+
RenderModeSnapshot["volumetric"] = "volumetric";
|
|
50
|
+
RenderModeSnapshot["maxProject"] = "maxproject";
|
|
51
|
+
RenderModeSnapshot["pathTrace"] = "pathtrace";
|
|
52
|
+
return RenderModeSnapshot;
|
|
53
|
+
}({});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The variants of `ImageType` that appear in serialized representations of state
|
|
57
|
+
* (`ViewerStateSnapshot`, `ViewerStateStringified`).
|
|
58
|
+
*
|
|
59
|
+
* **IMPORTANT:** Changing the values of this enum will BREAK existing image sharing links and exported app state.
|
|
60
|
+
* It should not be done without introducing code to handle the previous values. This enum must not have values that
|
|
61
|
+
* collide when `toLowerCase` is applied to them.
|
|
62
|
+
*/
|
|
63
|
+
export var ImageTypeSnapshot = /*#__PURE__*/function (ImageTypeSnapshot) {
|
|
64
|
+
ImageTypeSnapshot["segmentedCell"] = "cell";
|
|
65
|
+
ImageTypeSnapshot["fullField"] = "fov";
|
|
66
|
+
return ImageTypeSnapshot;
|
|
39
67
|
}({});
|
|
40
68
|
export var CameraTransformKeys = /*#__PURE__*/function (CameraTransformKeys) {
|
|
41
69
|
CameraTransformKeys["Position"] = "pos";
|
|
@@ -45,221 +73,105 @@ export var CameraTransformKeys = /*#__PURE__*/function (CameraTransformKeys) {
|
|
|
45
73
|
CameraTransformKeys["Fov"] = "fov";
|
|
46
74
|
return CameraTransformKeys;
|
|
47
75
|
}({});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
_defineProperty(this, _ViewerStateKeys$Mode, undefined);
|
|
81
|
-
/** The opacity of the mask channel, an integer in the range [0, 100]. Defaults to 50. */
|
|
82
|
-
_defineProperty(this, _ViewerStateKeys$Mask, undefined);
|
|
83
|
-
/** The type of image to display. Valid values are "cell" and "fov". Defaults to "cell". */
|
|
84
|
-
_defineProperty(this, _ViewerStateKeys$Imag, undefined);
|
|
85
|
-
/** Whether to show the axes helper. "1" is enabled. Disabled by default. */
|
|
86
|
-
_defineProperty(this, _ViewerStateKeys$Axes, undefined);
|
|
87
|
-
/** Whether to show the bounding box. "1" is enabled. Disabled by default. */
|
|
88
|
-
_defineProperty(this, _ViewerStateKeys$Boun, undefined);
|
|
89
|
-
/** Whether single-channel mode is active. "1" is active. Inactive by default. */
|
|
90
|
-
_defineProperty(this, _ViewerStateKeys$Sing, undefined);
|
|
91
|
-
/** If single-channel mode is active, which channel index is shown. Defaults to 0. */
|
|
92
|
-
_defineProperty(this, _ViewerStateKeys$Sing2, undefined);
|
|
93
|
-
/** The color of the bounding box, as a 6-digit hex color. */
|
|
94
|
-
_defineProperty(this, _ViewerStateKeys$Boun2, undefined);
|
|
95
|
-
/** The background color, as a 6-digit hex color. */
|
|
96
|
-
_defineProperty(this, _ViewerStateKeys$Back, undefined);
|
|
97
|
-
/** Whether to autorotate the view. "1" is enabled. Disabled by default. */
|
|
98
|
-
_defineProperty(this, _ViewerStateKeys$Auto, undefined);
|
|
99
|
-
/** The brightness of the image, an float in the range [0, 100]. Defaults to 70. */
|
|
100
|
-
_defineProperty(this, _ViewerStateKeys$Brig, undefined);
|
|
101
|
-
/** Density, a float in the range [0, 100]. Defaults to 50. */
|
|
102
|
-
_defineProperty(this, _ViewerStateKeys$Dens, undefined);
|
|
103
|
-
/**
|
|
104
|
-
* Levels for image intensity adjustment. Should be three numeric values separated
|
|
105
|
-
* by commas, representing the low, middle, and high values in a [0, 255] range.
|
|
106
|
-
* Values will be sorted in ascending order; empty values will be parsed as 0.
|
|
107
|
-
*/
|
|
108
|
-
_defineProperty(this, _ViewerStateKeys$Leve, undefined);
|
|
109
|
-
/** Whether to enable interpolation. "1" is enabled. Enabled by default. */
|
|
110
|
-
_defineProperty(this, _ViewerStateKeys$Inte, undefined);
|
|
111
|
-
/** Subregions per axis, as min:max pairs separated by commas.
|
|
112
|
-
* Defaults to full range (`0:1`) for each axis.
|
|
113
|
-
*/
|
|
114
|
-
_defineProperty(this, _ViewerStateKeys$Regi, undefined);
|
|
115
|
-
/** Slice position per X, Y, and Z axes, as a list of comma-separated floats.
|
|
116
|
-
* 0.5 for all axes by default (e.g. `0.5,0.5,0.5`)
|
|
117
|
-
*/
|
|
118
|
-
_defineProperty(this, _ViewerStateKeys$Slic, undefined);
|
|
119
|
-
/** Frame number, for time-series volumes. 0 by default. */
|
|
120
|
-
_defineProperty(this, _ViewerStateKeys$Time, undefined);
|
|
121
|
-
/** Scene number, for multiscene images. 0 by default. */
|
|
122
|
-
_defineProperty(this, _ViewerStateKeys$Scen, undefined);
|
|
123
|
-
/** Whether to use an exact scale level index. 0 by default. */
|
|
124
|
-
_defineProperty(this, _ViewerStateKeys$UseE, undefined);
|
|
125
|
-
/** The exact scale level index to use, if `UseExactScaleLevel` is 1. 0 by default. */
|
|
126
|
-
_defineProperty(this, _ViewerStateKeys$Scal, undefined);
|
|
127
|
-
/**
|
|
128
|
-
* Camera transform settings, as a list of `key:value` pairs separated by commas.
|
|
129
|
-
* Valid keys are defined in `CameraTransformKeys`:
|
|
130
|
-
* - `pos`: position
|
|
131
|
-
* - `tar`: target
|
|
132
|
-
* - `up`: up
|
|
133
|
-
* - `ort`: orthographic scale
|
|
134
|
-
* - `fov`: field of view
|
|
135
|
-
*
|
|
136
|
-
* Vector values are encoded as three floats separated by colons (e.g. `1:2:3`) and
|
|
137
|
-
* encoded using `encodeURIComponent`.
|
|
138
|
-
*/
|
|
139
|
-
_defineProperty(this, _ViewerStateKeys$Came, undefined);
|
|
140
|
-
});
|
|
76
|
+
/**
|
|
77
|
+
* Property keys for the "snapshot" variants of `ViewerState`. These keys are shorter, for contexts that need brevity
|
|
78
|
+
* (like URLs), and have a stronger guarantee of stability than the keys of `ViewerState`.
|
|
79
|
+
*
|
|
80
|
+
* **IMPORTANT:** Changing the values of this enum will BREAK existing image sharing links and exported app state.
|
|
81
|
+
* Ideally, you should never do it. If you must, you must also add code to version-check and handle previous values.
|
|
82
|
+
*/
|
|
83
|
+
export var ViewerStateSnapshotKeys = /*#__PURE__*/function (ViewerStateSnapshotKeys) {
|
|
84
|
+
ViewerStateSnapshotKeys["View"] = "view";
|
|
85
|
+
ViewerStateSnapshotKeys["Mode"] = "mode";
|
|
86
|
+
ViewerStateSnapshotKeys["MaskOpacity"] = "mask";
|
|
87
|
+
ViewerStateSnapshotKeys["ImageType"] = "image";
|
|
88
|
+
ViewerStateSnapshotKeys["ShowAxes"] = "axes";
|
|
89
|
+
ViewerStateSnapshotKeys["ShowBoundingBox"] = "bb";
|
|
90
|
+
ViewerStateSnapshotKeys["BoundingBoxColor"] = "bbcol";
|
|
91
|
+
ViewerStateSnapshotKeys["BackgroundColor"] = "bgcol";
|
|
92
|
+
ViewerStateSnapshotKeys["Autorotate"] = "rot";
|
|
93
|
+
ViewerStateSnapshotKeys["Brightness"] = "bright";
|
|
94
|
+
ViewerStateSnapshotKeys["Density"] = "dens";
|
|
95
|
+
ViewerStateSnapshotKeys["Levels"] = "lvl";
|
|
96
|
+
ViewerStateSnapshotKeys["Interpolation"] = "interp";
|
|
97
|
+
ViewerStateSnapshotKeys["Region"] = "reg";
|
|
98
|
+
ViewerStateSnapshotKeys["Slice"] = "slice";
|
|
99
|
+
ViewerStateSnapshotKeys["Time"] = "t";
|
|
100
|
+
ViewerStateSnapshotKeys["Scene"] = "scene";
|
|
101
|
+
ViewerStateSnapshotKeys["CameraState"] = "cam";
|
|
102
|
+
ViewerStateSnapshotKeys["SingleChannelMode"] = "scm";
|
|
103
|
+
ViewerStateSnapshotKeys["SingleChannelIndex"] = "sci";
|
|
104
|
+
ViewerStateSnapshotKeys["UseExactScaleLevel"] = "esl";
|
|
105
|
+
ViewerStateSnapshotKeys["ScaleLevelIndex"] = "scl";
|
|
106
|
+
return ViewerStateSnapshotKeys;
|
|
107
|
+
}({});
|
|
141
108
|
|
|
142
109
|
/**
|
|
143
|
-
*
|
|
110
|
+
* Property keys for the "snapshot" variants of `ChannelState`/`ViewerChannelSettings`. These keys are shorter, for
|
|
111
|
+
* contexts that need brevity (like URLs), and have a stronger guarantee of stability than the keys of `ChannelState`.
|
|
112
|
+
*
|
|
113
|
+
* **IMPORTANT:** Changing the values of this enum will BREAK existing image sharing links and exported app state.
|
|
114
|
+
* Ideally, you should never do it. If you must, you must also add code to version-check and handle previous values.
|
|
144
115
|
*/
|
|
145
|
-
export var
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return
|
|
116
|
+
export var ChannelStateSnapshotKeys = /*#__PURE__*/function (ChannelStateSnapshotKeys) {
|
|
117
|
+
ChannelStateSnapshotKeys["Color"] = "col";
|
|
118
|
+
ChannelStateSnapshotKeys["Colorize"] = "clz";
|
|
119
|
+
ChannelStateSnapshotKeys["ColorizeAlpha"] = "cza";
|
|
120
|
+
ChannelStateSnapshotKeys["IsosurfaceAlpha"] = "isa";
|
|
121
|
+
ChannelStateSnapshotKeys["Lut"] = "lut";
|
|
122
|
+
ChannelStateSnapshotKeys["ControlPoints"] = "cpt";
|
|
123
|
+
ChannelStateSnapshotKeys["ControlPointsLegacy"] = "cps";
|
|
124
|
+
ChannelStateSnapshotKeys["Ramp"] = "ram";
|
|
125
|
+
ChannelStateSnapshotKeys["RampLegacy"] = "rmp";
|
|
126
|
+
ChannelStateSnapshotKeys["ControlPointsEnabled"] = "cpe";
|
|
127
|
+
ChannelStateSnapshotKeys["VolumeEnabled"] = "ven";
|
|
128
|
+
ChannelStateSnapshotKeys["SurfaceEnabled"] = "sen";
|
|
129
|
+
ChannelStateSnapshotKeys["IsosurfaceValue"] = "isv";
|
|
130
|
+
ChannelStateSnapshotKeys["KeepRange"] = "pin";
|
|
131
|
+
return ChannelStateSnapshotKeys;
|
|
161
132
|
}({});
|
|
162
133
|
|
|
134
|
+
// Maps `ViewerStateKeys` to the type of each key in `ViewerStateSnapshot`.
|
|
135
|
+
// This is not the exported "snapshot" type: that's `ViewerStateSnapshot`, below. Defining `ViewerStateSnapshot` as
|
|
136
|
+
// a mapped type ensures that if a variant is added to `ViewerStateKeys`, `ViewerStateSnapshot` will type error until
|
|
137
|
+
// that key's value is added to this type.
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* A "snapshot" of a `ViewerState`.
|
|
141
|
+
*
|
|
142
|
+
* This type is a variant representation of `ViewerState`, specialized for saving/restoring state to/from some
|
|
143
|
+
* serialized representation. It has the following desirable properties for this purpose:
|
|
144
|
+
* - Its keys are *shorter*, for formats where that's desirable (mostly URL parameters)
|
|
145
|
+
* - Its keys are reasonably *stable*, so that settings exported from older app versions can be imported by newer ones
|
|
146
|
+
* - Some values, notably colors, are converted to alternate representations for compactness and/or clarity
|
|
147
|
+
*/
|
|
148
|
+
|
|
163
149
|
/**
|
|
164
|
-
*
|
|
150
|
+
* A `ViewerStateSnapshot` with all its keys converted to compact string representations. Useful for (de)serializing
|
|
151
|
+
* viewer state to/from URL parameters.
|
|
165
152
|
*/
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
* Lookup table (LUT) to map from volume intensity to opacity. Should be two
|
|
192
|
-
* alphanumeric values separated by a colon, where the first value is the
|
|
193
|
-
* minimum and the second is the maximum. Defaults to [0, 255].
|
|
194
|
-
*
|
|
195
|
-
* Min and max values are determined as following:
|
|
196
|
-
* - Plain numbers are indices of histogram bins, typically in the range [0,
|
|
197
|
-
* 255].
|
|
198
|
-
* - `v{n}` represents a raw intensity value, where `n` is a number.
|
|
199
|
-
* - `p{n}` represents a percentile, where `n` is a percentile in the [0, 100]
|
|
200
|
-
* range.
|
|
201
|
-
* - `m{n}` represents the median multiplied by `n / 100`.
|
|
202
|
-
* - `autoij` in either the min or max fields will use the "auto" algorithm
|
|
203
|
-
* from ImageJ to select the min AND max.
|
|
204
|
-
*
|
|
205
|
-
* Values will be used to determine the initial control points and ramp if
|
|
206
|
-
* those fields are not provided.
|
|
207
|
-
*
|
|
208
|
-
* @example
|
|
209
|
-
* ```
|
|
210
|
-
* "0:255" // min: intensity 0, max: intensity 255.
|
|
211
|
-
* "p50:p90" // min: 50th percentile, max: 90th percentile.
|
|
212
|
-
* "m1:p75" // min: median, max: 75th percentile.
|
|
213
|
-
* "autoij:0" // use Auto-IJ to calculate min and max.
|
|
214
|
-
* ```
|
|
215
|
-
*/
|
|
216
|
-
_defineProperty(this, _ViewerChannelSetting5, undefined);
|
|
217
|
-
/**
|
|
218
|
-
* Legacy specifier for control points for the transfer function as a list of
|
|
219
|
-
* `x:opacity:color` triplets, separated by colon. Uses histogram bin indices
|
|
220
|
-
* instead of intensity values.
|
|
221
|
-
* - `x` is a histogram bin index in the [0, 255] range.
|
|
222
|
-
* - `opacity` is a float in the [0, 1] range.
|
|
223
|
-
* - `color` is a 6-digit hex color, e.g. `ff0000`.
|
|
224
|
-
*
|
|
225
|
-
* Will be overridden by the ControlPoints field (`cpt`) if provided.
|
|
226
|
-
*/
|
|
227
|
-
_defineProperty(this, _ViewerChannelSetting6, undefined);
|
|
228
|
-
/**
|
|
229
|
-
* Control points for the transfer function, formatted as a list of
|
|
230
|
-
* `x:opacity:color` triplets, separated by colons.
|
|
231
|
-
* - `x` is a numeric intensity value.
|
|
232
|
-
* - `opacity` is a float in the [0, 1] range.
|
|
233
|
-
* - `color` is a 6-digit hex color, e.g. `ff0000`.
|
|
234
|
-
*
|
|
235
|
-
* If provided, overrides the `lut` field when calculating the control points.
|
|
236
|
-
*/
|
|
237
|
-
_defineProperty(this, _ViewerChannelSetting7, undefined);
|
|
238
|
-
/**
|
|
239
|
-
* Whether to show advanced mode, which will show control points instead of
|
|
240
|
-
* ramp values defined by the LUT. "1" is enabled, disabled by default.
|
|
241
|
-
*/
|
|
242
|
-
_defineProperty(this, _ViewerChannelSetting8, undefined);
|
|
243
|
-
/**
|
|
244
|
-
* Legacy specifier for the transfer function ramp which uses histogram bin
|
|
245
|
-
* indices instead of intensity values, formatted as `min:max`. Will be
|
|
246
|
-
* overridden by the Ramp field (`ram`) if provided.
|
|
247
|
-
*/
|
|
248
|
-
_defineProperty(this, _ViewerChannelSetting9, undefined);
|
|
249
|
-
/**
|
|
250
|
-
* Ramp min and max intensity values (`min:max`). If provided, overrides the
|
|
251
|
-
* `lut` field when calculating the ramp.
|
|
252
|
-
*/
|
|
253
|
-
_defineProperty(this, _ViewerChannelSetting10, undefined);
|
|
254
|
-
/** Volume enabled. "1" is enabled. Disabled by default. */
|
|
255
|
-
_defineProperty(this, _ViewerChannelSetting11, undefined);
|
|
256
|
-
/** Isosurface enabled. "1" is enabled. Disabled by default. */
|
|
257
|
-
_defineProperty(this, _ViewerChannelSetting12, undefined);
|
|
258
|
-
/** Isosurface value, in the [0, 255] range. Set to `128` by default. */
|
|
259
|
-
_defineProperty(this, _ViewerChannelSetting13, undefined);
|
|
260
|
-
/**
|
|
261
|
-
* Whether to keep the current contrast settings when loading a new volume.
|
|
262
|
-
* "1" is enabled. Disabled by default.
|
|
263
|
-
*/
|
|
264
|
-
_defineProperty(this, _ViewerChannelSetting14, undefined);
|
|
265
|
-
});
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* A `ControlPoint` where `color` is a six-digit hex string, or gets shortened to `"1"` in the overwhelming majority of
|
|
156
|
+
* cases where the control point is white to save space in sharing URLs. Used by `ChannelStateSnapshot`.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
// Maps `ChannelStateKeys` to the type of each key in `ChannelStateSnapshot`.
|
|
160
|
+
// This is not the exported "snapshot" type: that's `ChannelStateSnapshot`, below. Defining `ChannelStateSnapshot` as
|
|
161
|
+
// a mapped type ensures that if a variant is added to `ChannelStateKeys`, `ChannelStateSnapshot` will type error until
|
|
162
|
+
// that key's value is added to this type.
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* A "snapshot" of a `ChannelState` or `ViewerChannelSetting`.
|
|
166
|
+
*
|
|
167
|
+
* This type is a variant representation of `ChannelState`/`ViewerChannelSetting`, specialized for saving/restoring
|
|
168
|
+
* channel state to/from some serialized representation. It has the following desirable properties for this purpose:
|
|
169
|
+
* - Its keys are *shorter*, for formats where that's desirable (mostly URL parameters)
|
|
170
|
+
* - Its keys are reasonably *stable*, so that settings exported from older app versions can be imported by newer ones
|
|
171
|
+
* - Some values, notably colors, are converted to alternate representations for compactness and/or clarity
|
|
172
|
+
*/
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* A `ChannelStateSnapshot` with all its keys converted to compact string representations. Useful for (de)serializing
|
|
176
|
+
* channel state to/from URL parameters.
|
|
177
|
+
*/
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
9
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
10
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
5
11
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
12
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
7
|
-
import { RenderMode, ViewMode } from "
|
|
13
|
+
import { RenderMode, ViewMode } from "./types";
|
|
8
14
|
|
|
9
15
|
// TODO move back to a new `types` module (?)
|
|
10
16
|
|
|
@@ -68,4 +74,36 @@ export var validateState = function validateState(currentState, newState) {
|
|
|
68
74
|
Object.assign(validated, validateStateValue(currentState, key, newState[key]));
|
|
69
75
|
}
|
|
70
76
|
return validated;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** Creates a deep copy of a `ChannelState` */
|
|
80
|
+
// Fills in every property individually so that new properties force a modification to this function
|
|
81
|
+
export var cloneChannelState = function cloneChannelState(setting) {
|
|
82
|
+
return {
|
|
83
|
+
ramp: _toConsumableArray(setting.ramp),
|
|
84
|
+
controlPoints: setting.controlPoints.map(function (_ref5) {
|
|
85
|
+
var x = _ref5.x,
|
|
86
|
+
opacity = _ref5.opacity,
|
|
87
|
+
color = _ref5.color;
|
|
88
|
+
return {
|
|
89
|
+
x: x,
|
|
90
|
+
opacity: opacity,
|
|
91
|
+
color: _toConsumableArray(color)
|
|
92
|
+
};
|
|
93
|
+
}),
|
|
94
|
+
// Safe shallow copies
|
|
95
|
+
name: setting.name,
|
|
96
|
+
displayName: setting.displayName,
|
|
97
|
+
volumeEnabled: setting.volumeEnabled,
|
|
98
|
+
isosurfaceEnabled: setting.isosurfaceEnabled,
|
|
99
|
+
isovalue: setting.isovalue,
|
|
100
|
+
colorizeEnabled: setting.colorizeEnabled,
|
|
101
|
+
colorizeAlpha: setting.colorizeAlpha,
|
|
102
|
+
opacity: setting.opacity,
|
|
103
|
+
color: setting.color,
|
|
104
|
+
useControlPoints: setting.useControlPoints,
|
|
105
|
+
plotMin: setting.plotMin,
|
|
106
|
+
plotMax: setting.plotMax,
|
|
107
|
+
keepIntensityRange: setting.keepIntensityRange
|
|
108
|
+
};
|
|
71
109
|
};
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import ImageViewerApp from "./aics-image-viewer/components/App";
|
|
2
|
-
export {
|
|
2
|
+
export { parseViewerUrlParams } from "./aics-image-viewer/shared/utils/parseUrl";
|
|
3
3
|
export { writeMetadata, writeScenes } from "./aics-image-viewer/shared/utils/storage";
|
|
4
|
-
export {
|
|
4
|
+
export { viewerMessageToParams, isStoreSnapshot, snapshotToViewerChannelSettings } from "./aics-image-viewer/shared/utils/parseSnapshot";
|
|
5
|
+
export { snapshotToViewerState } from "./aics-image-viewer/state/deserialize";
|
|
6
|
+
export { ViewMode, RenderMode, ImageType } from "./aics-image-viewer/state/types";
|
|
5
7
|
export { ImageViewerApp };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aics/vole-app",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "web view of cell volume images",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,32 +21,30 @@
|
|
|
21
21
|
"url": "git+https://github.com/allen-cell-animated/vole-app.git"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"start": "
|
|
25
|
-
"gh-build-nightly": "
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"dev": "webpack --config webpack.dev.js --env env=dev",
|
|
24
|
+
"start": "vite dev",
|
|
25
|
+
"gh-build-nightly": "vite build --base=/vole-app/",
|
|
26
|
+
"s3-build": "vite build",
|
|
27
|
+
"release-build": "vite build",
|
|
28
|
+
"docker-build": "vite build",
|
|
29
|
+
"dev": "vite dev",
|
|
31
30
|
"lint": "eslint --config ./.eslintrc --ignore-path ./.eslintignore --ext .jsx --ext .js --ext .ts --ext .tsx ./",
|
|
32
|
-
"test": "
|
|
33
|
-
"test:github-action": "jest --silent --passWithNoTests --ci --coverage --coverageReporters=\"text\" --coverageReporters=\"text-summary\" --outputFile=\"report.json\"",
|
|
31
|
+
"test": "vitest run --passWithNoTests",
|
|
34
32
|
"typeCheck": "tsc -p tsconfig.json --noEmit",
|
|
35
33
|
"generateTypes": "tsc -p tsconfig.base.json --emitDeclarationOnly",
|
|
36
|
-
"transpileES": "cross-env TS_NODE_PROJECT=tsconfig.es.json BABEL_ENV=es babel src --out-dir es --extensions \".js,.jsx,.ts,.tsx,.svg\" --ignore src/**/*.test.*",
|
|
34
|
+
"transpileES": "cross-env TS_NODE_PROJECT=tsconfig.es.json BABEL_ENV=es VOLEAPP_VERSION=$npm_package_version babel src --out-dir es --extensions \".js,.jsx,.ts,.tsx,.svg\" --ignore src/**/*.test.*",
|
|
37
35
|
"build": "npm-run-all generateTypes postcss transpileES",
|
|
38
36
|
"postcss": "postcss src/**/*.css --base src --dir es",
|
|
39
37
|
"publish-patch": "npm version patch | xargs -I {} sh -c 'git push origin {}'",
|
|
40
38
|
"postpublish-patch": "git push origin main",
|
|
41
39
|
"prepare": "cross-env DEPLOYMENT_ENV=production npm run build",
|
|
42
|
-
"predeploy": "cross-env DEPLOYMENT_ENV=production npm run
|
|
40
|
+
"predeploy": "cross-env DEPLOYMENT_ENV=production npm run release-build",
|
|
43
41
|
"deploy": "gh-pages -d imageviewer -t true",
|
|
44
42
|
"checks": "npm run lint && npm run typeCheck && npm run test"
|
|
45
43
|
},
|
|
46
44
|
"author": "Allen Institute, Cell Science",
|
|
47
45
|
"license": "BSD-3-Clause",
|
|
48
46
|
"dependencies": {
|
|
49
|
-
"@aics/vole-core": "^4.
|
|
47
|
+
"@aics/vole-core": "^4.10.1",
|
|
50
48
|
"@ant-design/icons": "^5.2.5",
|
|
51
49
|
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
|
52
50
|
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
|
@@ -81,60 +79,44 @@
|
|
|
81
79
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
82
80
|
"@types/color-string": "^1.5.2",
|
|
83
81
|
"@types/d3": "^7.4.3",
|
|
84
|
-
"@types/jest": "^29.5.14",
|
|
85
82
|
"@types/lodash": "^4.14.185",
|
|
83
|
+
"@types/node": "^26.5.0",
|
|
86
84
|
"@types/react": "^18.x",
|
|
87
85
|
"@types/react-color": "^3.0.12",
|
|
88
86
|
"@types/react-dom": "^18.x",
|
|
89
87
|
"@types/three": "0.184.0",
|
|
90
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
91
|
-
"@typescript-eslint/parser": "^8.
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "^8.70.0",
|
|
89
|
+
"@typescript-eslint/parser": "^8.70.0",
|
|
90
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
92
91
|
"antd": "^5.16.2",
|
|
93
|
-
"axios": "^0.21.1",
|
|
94
|
-
"babel-loader": "^8.2.2",
|
|
95
92
|
"babel-plugin-replace-import-extension": "^1.1.3",
|
|
96
|
-
"
|
|
97
|
-
"command-line-args": "^5.1.1",
|
|
98
|
-
"copy-webpack-plugin": "^11.0.0",
|
|
93
|
+
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
|
|
99
94
|
"cross-env": "^7.0.3",
|
|
100
|
-
"
|
|
101
|
-
"esbuild": "^0.14.50",
|
|
102
|
-
"esbuild-jest": "^0.5.0",
|
|
95
|
+
"esbuild": "^0.28.2",
|
|
103
96
|
"eslint": "^8.20.0",
|
|
97
|
+
"eslint-import-resolver-typescript": "^4.4.5",
|
|
98
|
+
"eslint-plugin-import": "^2.32.0",
|
|
104
99
|
"eslint-plugin-react": "^7.37.5",
|
|
105
100
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
106
|
-
"file-loader": "^6.2.0",
|
|
107
|
-
"firebase": "^7.x",
|
|
108
101
|
"gh-pages": "^4.0.0",
|
|
109
|
-
"
|
|
110
|
-
"jest": "^29.7.0",
|
|
111
|
-
"jest-environment-jsdom": "^30.2.0",
|
|
112
|
-
"mini-css-extract-plugin": "^2.9.1",
|
|
113
|
-
"morgan": "^1.9.1",
|
|
102
|
+
"jsdom": "^30.0.1",
|
|
114
103
|
"npm-run-all": "^4.1.5",
|
|
115
|
-
"postcss": "^8.
|
|
104
|
+
"postcss": "^8.5.26",
|
|
116
105
|
"postcss-cli": "^11.0.0",
|
|
117
106
|
"postcss-discard-comments": "^7.0.3",
|
|
118
107
|
"postcss-extend-rule": "^4.0.0",
|
|
119
108
|
"postcss-import": "^16.1.0",
|
|
120
|
-
"postcss-
|
|
121
|
-
"postcss-mixins": "^11.0.3",
|
|
109
|
+
"postcss-mixins": "^12.1.2",
|
|
122
110
|
"postcss-nested": "^6.2.0",
|
|
123
111
|
"postcss-simple-vars": "^7.0.1",
|
|
124
112
|
"postcss-url": "^10.1.3",
|
|
125
113
|
"prettier": "^3.3.3",
|
|
126
|
-
"prop-types": "^15.5.10",
|
|
127
114
|
"react": "^18.3.1",
|
|
128
115
|
"react-dom": "^18.3.1",
|
|
129
|
-
"resolve-url-loader": "^5.0.0",
|
|
130
|
-
"style-loader": "^4.0.0",
|
|
131
|
-
"ts-jest": "^29.4.6",
|
|
132
116
|
"typescript": "^5.9.3",
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"webpack-merge": "^5.8.0",
|
|
138
|
-
"webpack-shell-plugin": "^0.5.0"
|
|
117
|
+
"vite": "^8.2.2",
|
|
118
|
+
"vite-plugin-glsl": "^1.6.1",
|
|
119
|
+
"vite-plugin-svgr": "^5.2.0",
|
|
120
|
+
"vitest": "^4.1.11"
|
|
139
121
|
}
|
|
140
122
|
}
|