@vitessce/zarr 4.0.7 → 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 +184 -10
  2. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -5565,7 +5565,9 @@ const ViewType$1 = {
5565
5565
  DUAL_SCATTERPLOT: "dualScatterplot",
5566
5566
  TREEMAP: "treemap",
5567
5567
  SAMPLE_SET_PAIR_MANAGER: "sampleSetPairManager",
5568
- FEATURE_STATS_TABLE: "featureStatsTable"
5568
+ FEATURE_STATS_TABLE: "featureStatsTable",
5569
+ SINGLE_OBS_SET_SELECTOR: "singleObsSetSelector",
5570
+ ANNOTATION_CONTROLLER: "annotationController"
5569
5571
  };
5570
5572
  const DataType$1 = {
5571
5573
  OBS_LABELS: "obsLabels",
@@ -5586,7 +5588,8 @@ const DataType$1 = {
5586
5588
  COMPARISON_METADATA: "comparisonMetadata",
5587
5589
  FEATURE_STATS: "featureStats",
5588
5590
  FEATURE_SET_STATS: "featureSetStats",
5589
- OBS_SET_STATS: "obsSetStats"
5591
+ OBS_SET_STATS: "obsSetStats",
5592
+ ANNOTATION_STORY: "annotationStory"
5590
5593
  };
5591
5594
  const FileType$1 = {
5592
5595
  // Joint file types
@@ -5608,6 +5611,7 @@ const FileType$1 = {
5608
5611
  OBS_SETS_CSV: "obsSets.csv",
5609
5612
  OBS_SETS_JSON: "obsSets.json",
5610
5613
  SAMPLE_SETS_CSV: "sampleSets.csv",
5614
+ ANNOTATION_STORY_JSON: "annotationStory.json",
5611
5615
  // OME-Zarr
5612
5616
  IMAGE_OME_ZARR: "image.ome-zarr",
5613
5617
  OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
@@ -5892,7 +5896,15 @@ const CoordinationType$1 = {
5892
5896
  FEATURE_POINT_FOLD_CHANGE_THRESHOLD: "featurePointFoldChangeThreshold",
5893
5897
  FEATURE_LABEL_FOLD_CHANGE_THRESHOLD: "featureLabelFoldChangeThreshold",
5894
5898
  // Treemap
5895
- 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"
5896
5908
  };
5897
5909
  ({
5898
5910
  // For new file types
@@ -5908,6 +5920,7 @@ const CoordinationType$1 = {
5908
5920
  [FileType$1.OBS_SEGMENTATIONS_JSON]: DataType$1.OBS_SEGMENTATIONS,
5909
5921
  [FileType$1.OBS_SETS_CSV]: DataType$1.OBS_SETS,
5910
5922
  [FileType$1.OBS_SETS_JSON]: DataType$1.OBS_SETS,
5923
+ [FileType$1.ANNOTATION_STORY_JSON]: DataType$1.ANNOTATION_STORY,
5911
5924
  [FileType$1.IMAGE_OME_ZARR]: DataType$1.IMAGE,
5912
5925
  [FileType$1.OBS_SEGMENTATIONS_OME_ZARR]: DataType$1.OBS_SEGMENTATIONS,
5913
5926
  [FileType$1.OBS_FEATURE_MATRIX_ANNDATA_ZARR]: DataType$1.OBS_FEATURE_MATRIX,
@@ -6030,7 +6043,8 @@ const CoordinationType$1 = {
6030
6043
  [DataType$1.OBS_SET_STATS]: [
6031
6044
  CoordinationType$1.OBS_TYPE
6032
6045
  // TODO: should sampleType, obsSetSelection, and/or sampleSetSelection be used here?
6033
- ]
6046
+ ],
6047
+ [DataType$1.ANNOTATION_STORY]: []
6034
6048
  });
6035
6049
  ({
6036
6050
  // For AnnData:
@@ -6163,7 +6177,9 @@ const CoordinationType$1 = {
6163
6177
  CoordinationType$1.SPATIAL_TARGET_Z,
6164
6178
  CoordinationType$1.SPATIAL_AXIS_FIXED,
6165
6179
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
6166
- 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
6167
6183
  ];
6168
6184
  ({
6169
6185
  [ViewType$1.NEUROGLANCER]: [
@@ -6255,7 +6271,14 @@ const CoordinationType$1 = {
6255
6271
  CoordinationType$1.EMBEDDING_CONTOURS_FILLED,
6256
6272
  CoordinationType$1.EMBEDDING_CONTOUR_PERCENTILES,
6257
6273
  CoordinationType$1.CONTOUR_COLOR_ENCODING,
6258
- 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
6259
6282
  ],
6260
6283
  [ViewType$1.DUAL_SCATTERPLOT]: [
6261
6284
  CoordinationType$1.DATASET,
@@ -6371,7 +6394,14 @@ const CoordinationType$1 = {
6371
6394
  CoordinationType$1.ADDITIONAL_OBS_SETS,
6372
6395
  CoordinationType$1.MOLECULE_HIGHLIGHT,
6373
6396
  CoordinationType$1.TOOLTIPS_VISIBLE,
6374
- 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
6375
6405
  ],
6376
6406
  [ViewType$1.SPATIAL_BETA]: [
6377
6407
  CoordinationType$1.META_COORDINATION_SCOPES,
@@ -6449,7 +6479,27 @@ const CoordinationType$1 = {
6449
6479
  CoordinationType$1.SPATIAL_CHANNEL_LABELS_ORIENTATION,
6450
6480
  CoordinationType$1.SPATIAL_CHANNEL_LABEL_SIZE,
6451
6481
  CoordinationType$1.SPATIAL_CHANNELS_SORT_ORDER,
6452
- 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.
6453
6503
  ],
6454
6504
  [ViewType$1.HEATMAP]: [
6455
6505
  CoordinationType$1.DATASET,
@@ -6759,6 +6809,11 @@ const CoordinationType$1 = {
6759
6809
  CoordinationType$1.FEATURE_POINT_FOLD_CHANGE_THRESHOLD,
6760
6810
  CoordinationType$1.FEATURE_LABEL_FOLD_CHANGE_THRESHOLD
6761
6811
  ],
6812
+ [ViewType$1.SINGLE_OBS_SET_SELECTOR]: [
6813
+ CoordinationType$1.OBS_TYPE,
6814
+ CoordinationType$1.OBS_SET_COLOR,
6815
+ CoordinationType$1.OBS_SET_SELECTION
6816
+ ],
6762
6817
  [ViewType$1.OBS_SET_COMPOSITION_BAR_PLOT]: [
6763
6818
  CoordinationType$1.DATASET,
6764
6819
  CoordinationType$1.OBS_TYPE,
@@ -12978,7 +13033,7 @@ const latestFileDefSchema = z.object({
12978
13033
  options: fileOptionsSchema.optional(),
12979
13034
  requestInit: requestInit.optional(),
12980
13035
  // New: file def can have coordinationValues.
12981
- coordinationValues: z.record(z.string()).optional()
13036
+ coordinationValues: z.record(z.any()).optional()
12982
13037
  });
12983
13038
  const datasetsSchema1_0_13 = z.array(z.object({
12984
13039
  uid: z.string(),
@@ -13009,7 +13064,8 @@ const configSchema1_0_16 = configSchema1_0_13.extend({
13009
13064
  h: z.number().int().optional(),
13010
13065
  // Updates coordinationScopes and coordinationScopesBy
13011
13066
  coordinationScopes: componentCoordinationScopes.optional(),
13012
- coordinationScopesBy: componentCoordinationScopesBy.optional()
13067
+ coordinationScopesBy: componentCoordinationScopesBy.optional(),
13068
+ coordinationValues: z.record(z.any()).optional()
13013
13069
  }))
13014
13070
  });
13015
13071
  const configSchema1_0_17 = configSchema1_0_16.extend({
@@ -16094,6 +16150,124 @@ z.object({
16094
16150
  radius: z.number(),
16095
16151
  opacity: z.number()
16096
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
+ });
16097
16271
  const SETS_DATATYPE_OBS = "obs";
16098
16272
  const HIERARCHICAL_SCHEMAS = {
16099
16273
  latestVersion: "0.1.3"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/zarr",
3
- "version": "4.0.7",
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/abstract": "4.0.7",
26
- "@vitessce/error": "4.0.7",
27
- "@vitessce/constants-internal": "4.0.7",
28
- "@vitessce/sets-utils": "4.0.7",
29
- "@vitessce/image-utils": "4.0.7",
30
- "@vitessce/utils": "4.0.7",
31
- "@vitessce/zarr-utils": "4.0.7",
32
- "@vitessce/globals": "4.0.7",
33
- "@vitessce/config": "4.0.7"
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.7"
36
+ "@vitessce/types": "4.0.9"
37
37
  },
38
38
  "scripts": {
39
39
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.mjs",