@vitessce/zarr 4.0.8 → 4.0.9

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 (2) hide show
  1. package/dist/index.js +178 -10
  2. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -5566,7 +5566,8 @@ const ViewType$1 = {
5566
5566
  TREEMAP: "treemap",
5567
5567
  SAMPLE_SET_PAIR_MANAGER: "sampleSetPairManager",
5568
5568
  FEATURE_STATS_TABLE: "featureStatsTable",
5569
- SINGLE_OBS_SET_SELECTOR: "singleObsSetSelector"
5569
+ SINGLE_OBS_SET_SELECTOR: "singleObsSetSelector",
5570
+ ANNOTATION_CONTROLLER: "annotationController"
5570
5571
  };
5571
5572
  const DataType$1 = {
5572
5573
  OBS_LABELS: "obsLabels",
@@ -5587,7 +5588,8 @@ const DataType$1 = {
5587
5588
  COMPARISON_METADATA: "comparisonMetadata",
5588
5589
  FEATURE_STATS: "featureStats",
5589
5590
  FEATURE_SET_STATS: "featureSetStats",
5590
- OBS_SET_STATS: "obsSetStats"
5591
+ OBS_SET_STATS: "obsSetStats",
5592
+ ANNOTATION_STORY: "annotationStory"
5591
5593
  };
5592
5594
  const FileType$1 = {
5593
5595
  // Joint file types
@@ -5609,6 +5611,7 @@ const FileType$1 = {
5609
5611
  OBS_SETS_CSV: "obsSets.csv",
5610
5612
  OBS_SETS_JSON: "obsSets.json",
5611
5613
  SAMPLE_SETS_CSV: "sampleSets.csv",
5614
+ ANNOTATION_STORY_JSON: "annotationStory.json",
5612
5615
  // OME-Zarr
5613
5616
  IMAGE_OME_ZARR: "image.ome-zarr",
5614
5617
  OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
@@ -5893,7 +5896,15 @@ const CoordinationType$1 = {
5893
5896
  FEATURE_POINT_FOLD_CHANGE_THRESHOLD: "featurePointFoldChangeThreshold",
5894
5897
  FEATURE_LABEL_FOLD_CHANGE_THRESHOLD: "featureLabelFoldChangeThreshold",
5895
5898
  // Treemap
5896
- HIERARCHY_LEVELS: "hierarchyLevels"
5899
+ HIERARCHY_LEVELS: "hierarchyLevels",
5900
+ // Annotation frames
5901
+ ANNOTATION_STORY: "annotationStory",
5902
+ ANNOTATION_FRAME_INDEX: "annotationFrameIndex",
5903
+ ANNOTATION_SHAPES: "annotationShapes",
5904
+ ANNOTATION_OVERLAY_VISIBLE: "annotationOverlayVisible",
5905
+ ANNOTATION_TRANSITION_DURATION: "annotationTransitionDuration",
5906
+ ANNOTATION_SEMANTIC_ZOOM: "annotationSemanticZoom",
5907
+ ANNOTATION_EDITABLE: "annotationEditable"
5897
5908
  };
5898
5909
  ({
5899
5910
  // For new file types
@@ -5909,6 +5920,7 @@ const CoordinationType$1 = {
5909
5920
  [FileType$1.OBS_SEGMENTATIONS_JSON]: DataType$1.OBS_SEGMENTATIONS,
5910
5921
  [FileType$1.OBS_SETS_CSV]: DataType$1.OBS_SETS,
5911
5922
  [FileType$1.OBS_SETS_JSON]: DataType$1.OBS_SETS,
5923
+ [FileType$1.ANNOTATION_STORY_JSON]: DataType$1.ANNOTATION_STORY,
5912
5924
  [FileType$1.IMAGE_OME_ZARR]: DataType$1.IMAGE,
5913
5925
  [FileType$1.OBS_SEGMENTATIONS_OME_ZARR]: DataType$1.OBS_SEGMENTATIONS,
5914
5926
  [FileType$1.OBS_FEATURE_MATRIX_ANNDATA_ZARR]: DataType$1.OBS_FEATURE_MATRIX,
@@ -6031,7 +6043,8 @@ const CoordinationType$1 = {
6031
6043
  [DataType$1.OBS_SET_STATS]: [
6032
6044
  CoordinationType$1.OBS_TYPE
6033
6045
  // TODO: should sampleType, obsSetSelection, and/or sampleSetSelection be used here?
6034
- ]
6046
+ ],
6047
+ [DataType$1.ANNOTATION_STORY]: []
6035
6048
  });
6036
6049
  ({
6037
6050
  // For AnnData:
@@ -6164,7 +6177,9 @@ const CoordinationType$1 = {
6164
6177
  CoordinationType$1.SPATIAL_TARGET_Z,
6165
6178
  CoordinationType$1.SPATIAL_AXIS_FIXED,
6166
6179
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
6167
- CoordinationType$1.FEATURE_AGGREGATION_STRATEGY
6180
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
6181
+ // Annotation shapes are specific to a view's coordinate system.
6182
+ CoordinationType$1.ANNOTATION_SHAPES
6168
6183
  ];
6169
6184
  ({
6170
6185
  [ViewType$1.NEUROGLANCER]: [
@@ -6256,7 +6271,14 @@ const CoordinationType$1 = {
6256
6271
  CoordinationType$1.EMBEDDING_CONTOURS_FILLED,
6257
6272
  CoordinationType$1.EMBEDDING_CONTOUR_PERCENTILES,
6258
6273
  CoordinationType$1.CONTOUR_COLOR_ENCODING,
6259
- CoordinationType$1.CONTOUR_COLOR
6274
+ CoordinationType$1.CONTOUR_COLOR,
6275
+ CoordinationType$1.ANNOTATION_STORY,
6276
+ CoordinationType$1.ANNOTATION_SHAPES,
6277
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
6278
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
6279
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
6280
+ CoordinationType$1.ANNOTATION_EDITABLE,
6281
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
6260
6282
  ],
6261
6283
  [ViewType$1.DUAL_SCATTERPLOT]: [
6262
6284
  CoordinationType$1.DATASET,
@@ -6372,7 +6394,14 @@ const CoordinationType$1 = {
6372
6394
  CoordinationType$1.ADDITIONAL_OBS_SETS,
6373
6395
  CoordinationType$1.MOLECULE_HIGHLIGHT,
6374
6396
  CoordinationType$1.TOOLTIPS_VISIBLE,
6375
- CoordinationType$1.PHOTOMETRIC_INTERPRETATION
6397
+ CoordinationType$1.PHOTOMETRIC_INTERPRETATION,
6398
+ CoordinationType$1.ANNOTATION_STORY,
6399
+ CoordinationType$1.ANNOTATION_SHAPES,
6400
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
6401
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
6402
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
6403
+ CoordinationType$1.ANNOTATION_EDITABLE,
6404
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
6376
6405
  ],
6377
6406
  [ViewType$1.SPATIAL_BETA]: [
6378
6407
  CoordinationType$1.META_COORDINATION_SCOPES,
@@ -6450,7 +6479,27 @@ const CoordinationType$1 = {
6450
6479
  CoordinationType$1.SPATIAL_CHANNEL_LABELS_ORIENTATION,
6451
6480
  CoordinationType$1.SPATIAL_CHANNEL_LABEL_SIZE,
6452
6481
  CoordinationType$1.SPATIAL_CHANNELS_SORT_ORDER,
6453
- CoordinationType$1.PHOTOMETRIC_INTERPRETATION
6482
+ CoordinationType$1.PHOTOMETRIC_INTERPRETATION,
6483
+ CoordinationType$1.ANNOTATION_STORY,
6484
+ CoordinationType$1.ANNOTATION_SHAPES,
6485
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
6486
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
6487
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
6488
+ CoordinationType$1.ANNOTATION_EDITABLE,
6489
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
6490
+ ],
6491
+ [ViewType$1.ANNOTATION_CONTROLLER]: [
6492
+ CoordinationType$1.DATASET,
6493
+ CoordinationType$1.ANNOTATION_STORY,
6494
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
6495
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
6496
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
6497
+ CoordinationType$1.ANNOTATION_EDITABLE,
6498
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
6499
+ // Note: the annotation controller also needs to read the coordination state
6500
+ // of all other views/coordination types via the full config.
6501
+ // Note: we get/set the CoordinationType.ANNOTATION_SHAPES from the full config,
6502
+ // as this info is view-specific rather than global to the story.
6454
6503
  ],
6455
6504
  [ViewType$1.HEATMAP]: [
6456
6505
  CoordinationType$1.DATASET,
@@ -12984,7 +13033,7 @@ const latestFileDefSchema = z.object({
12984
13033
  options: fileOptionsSchema.optional(),
12985
13034
  requestInit: requestInit.optional(),
12986
13035
  // New: file def can have coordinationValues.
12987
- coordinationValues: z.record(z.string()).optional()
13036
+ coordinationValues: z.record(z.any()).optional()
12988
13037
  });
12989
13038
  const datasetsSchema1_0_13 = z.array(z.object({
12990
13039
  uid: z.string(),
@@ -13015,7 +13064,8 @@ const configSchema1_0_16 = configSchema1_0_13.extend({
13015
13064
  h: z.number().int().optional(),
13016
13065
  // Updates coordinationScopes and coordinationScopesBy
13017
13066
  coordinationScopes: componentCoordinationScopes.optional(),
13018
- coordinationScopesBy: componentCoordinationScopesBy.optional()
13067
+ coordinationScopesBy: componentCoordinationScopesBy.optional(),
13068
+ coordinationValues: z.record(z.any()).optional()
13019
13069
  }))
13020
13070
  });
13021
13071
  const configSchema1_0_17 = configSchema1_0_16.extend({
@@ -16100,6 +16150,124 @@ z.object({
16100
16150
  radius: z.number(),
16101
16151
  opacity: z.number()
16102
16152
  });
16153
+ const shapeBaseObj = z.object({
16154
+ uid: z.string(),
16155
+ text: z.string().optional(),
16156
+ strokeColor: z.array(z.number()).length(3).optional(),
16157
+ strokeWidth: z.number().optional(),
16158
+ // SVG-style dash pattern, e.g. "10 5" or "10 20 30 10". "none" or omitted = solid.
16159
+ strokeDashArray: z.string().optional(),
16160
+ visible: z.boolean().optional()
16161
+ // TODO: define unit modes for x and y axes
16162
+ // ("pixels" vs "normalized" vs "physical" etc.)
16163
+ // TODO: a coordinate system identifier (e.g., "DeckGL" for now,
16164
+ // but a coordinate system from OME-NGFF/SpatialData eventually?)
16165
+ });
16166
+ const rectangleShapeObj = shapeBaseObj.extend({
16167
+ type: z.literal("rectangle"),
16168
+ // OME-XML field names verbatim (upper-left origin)
16169
+ x: z.number(),
16170
+ y: z.number(),
16171
+ width: z.number(),
16172
+ height: z.number(),
16173
+ fillColor: z.array(z.number()).length(3).optional(),
16174
+ fillOpacity: z.number().optional()
16175
+ });
16176
+ const lineShapeObj = shapeBaseObj.extend({
16177
+ type: z.literal("line"),
16178
+ // OME-XML field names verbatim
16179
+ x1: z.number(),
16180
+ y1: z.number(),
16181
+ x2: z.number(),
16182
+ y2: z.number(),
16183
+ markerStart: z.enum(["Arrow", "Tick"]).nullable().optional(),
16184
+ markerEnd: z.enum(["Arrow", "Tick"]).nullable().optional(),
16185
+ textPosition: z.enum(["start", "middle", "end"]).optional(),
16186
+ textBufferPx: z.number().optional()
16187
+ });
16188
+ const ellipseShapeObj = shapeBaseObj.extend({
16189
+ type: z.literal("ellipse"),
16190
+ // OME-XML field names verbatim (centre point + radii)
16191
+ x1: z.number(),
16192
+ y1: z.number(),
16193
+ radiusX: z.number(),
16194
+ radiusY: z.number(),
16195
+ fillColor: z.array(z.number()).length(3).optional(),
16196
+ fillOpacity: z.number().optional()
16197
+ });
16198
+ const polygonShapeObj = shapeBaseObj.extend({
16199
+ type: z.literal("polygon"),
16200
+ // OME-XML: array of [x, y] coordinate pairs, closed automatically
16201
+ points: z.array(z.tuple([z.number(), z.number()])),
16202
+ fillColor: z.array(z.number()).length(3).optional(),
16203
+ fillOpacity: z.number().optional()
16204
+ });
16205
+ const polylineShapeObj = shapeBaseObj.extend({
16206
+ type: z.literal("polyline"),
16207
+ // OME-XML: array of [x, y] coordinate pairs, open (not closed)
16208
+ points: z.array(z.tuple([z.number(), z.number()])),
16209
+ markerStart: z.enum(["Arrow", "Tick"]).nullable().optional(),
16210
+ markerEnd: z.enum(["Arrow", "Tick"]).nullable().optional()
16211
+ });
16212
+ const annotationShapeObj = z.discriminatedUnion("type", [
16213
+ rectangleShapeObj,
16214
+ lineShapeObj,
16215
+ ellipseShapeObj,
16216
+ polygonShapeObj,
16217
+ polylineShapeObj
16218
+ ]);
16219
+ z.array(annotationShapeObj);
16220
+ const annotationFrameObj = z.object({
16221
+ uid: z.string(),
16222
+ title: z.string().optional(),
16223
+ description: z.string().optional(),
16224
+ descriptionType: z.enum(["text", "markdown"]).optional(),
16225
+ // A frame can define per-view: coordinationValues
16226
+ // (if the view's state should not be coordinated with other views)
16227
+ // or per-view coordinationScopes/coordinationScopesBy
16228
+ // (if at this frame, the view should be coordinated with other views).
16229
+ // We can also define a frame-level coordination space,
16230
+ // which will be merged with the global coordination space.
16231
+ // TODO: datasets
16232
+ // TODO: coordinationSpace
16233
+ layout: z.array(
16234
+ // Note: for now, we will infer view objects which have a uid
16235
+ // that is present in the global layout, and do NOT have x/y/w/h defined,
16236
+ // to mean that in this frame, the layout and set of views is unchanged
16237
+ // from the global layout.
16238
+ // This will allow each frame to omit the full list of views from the layout,
16239
+ // and only specify the views whose coordination state is changing in this frame.
16240
+ // If a frame includes a view with a uid that is not present
16241
+ // in the global layout, then that view will be added to the layout at this frame.
16242
+ // This frame should also define x/y/w/h for all views,
16243
+ // since it will otherwise be ambiguous how to layout the updated set of views
16244
+ // for this frame.
16245
+ z.object({
16246
+ // The view UID. If this view uid is not present in the global layout,
16247
+ // it will be added to the layout at this frame,
16248
+ // and will need to have its coordination values initialized to their defaults
16249
+ // for any that were not fully specified.
16250
+ uid: z.string(),
16251
+ coordinationValues: z.record(
16252
+ z.string(),
16253
+ // The coordination type name, e.g. "embeddingType"
16254
+ z.any()
16255
+ ).optional()
16256
+ // TODO: support coordinationScopes/coordinationScopesBy for per-view coordination
16257
+ // at this frame.
16258
+ // TODO: view x/y/w/h once we support view layout changes per-frame.
16259
+ })
16260
+ ).optional()
16261
+ });
16262
+ z.object({
16263
+ // TODO: schema version for the story schema?
16264
+ // Same as current Vitessce schema version?
16265
+ uid: z.string(),
16266
+ title: z.string().optional(),
16267
+ description: z.string().optional(),
16268
+ descriptionType: z.enum(["text", "markdown"]).optional(),
16269
+ frames: z.array(annotationFrameObj)
16270
+ });
16103
16271
  const SETS_DATATYPE_OBS = "obs";
16104
16272
  const HIERARCHICAL_SCHEMAS = {
16105
16273
  latestVersion: "0.1.3"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/zarr",
3
- "version": "4.0.8",
3
+ "version": "4.0.9",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -22,18 +22,18 @@
22
22
  "apache-arrow": "^17.0.0",
23
23
  "parquet-wasm": "^0.6.1",
24
24
  "ol": "^10.2.1",
25
- "@vitessce/error": "4.0.8",
26
- "@vitessce/sets-utils": "4.0.8",
27
- "@vitessce/abstract": "4.0.8",
28
- "@vitessce/image-utils": "4.0.8",
29
- "@vitessce/constants-internal": "4.0.8",
30
- "@vitessce/zarr-utils": "4.0.8",
31
- "@vitessce/globals": "4.0.8",
32
- "@vitessce/config": "4.0.8",
33
- "@vitessce/utils": "4.0.8"
25
+ "@vitessce/abstract": "4.0.9",
26
+ "@vitessce/error": "4.0.9",
27
+ "@vitessce/constants-internal": "4.0.9",
28
+ "@vitessce/sets-utils": "4.0.9",
29
+ "@vitessce/utils": "4.0.9",
30
+ "@vitessce/zarr-utils": "4.0.9",
31
+ "@vitessce/config": "4.0.9",
32
+ "@vitessce/image-utils": "4.0.9",
33
+ "@vitessce/globals": "4.0.9"
34
34
  },
35
35
  "devDependencies": {
36
- "@vitessce/types": "4.0.8"
36
+ "@vitessce/types": "4.0.9"
37
37
  },
38
38
  "scripts": {
39
39
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.mjs",