@vitessce/vega 4.0.8 → 4.0.10

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 +4 -4
package/dist/index.js CHANGED
@@ -49012,7 +49012,7 @@ const latestFileDefSchema = z.object({
49012
49012
  options: fileOptionsSchema.optional(),
49013
49013
  requestInit: requestInit.optional(),
49014
49014
  // New: file def can have coordinationValues.
49015
- coordinationValues: z.record(z.string()).optional()
49015
+ coordinationValues: z.record(z.any()).optional()
49016
49016
  });
49017
49017
  const datasetsSchema1_0_13 = z.array(z.object({
49018
49018
  uid: z.string(),
@@ -49043,7 +49043,8 @@ const configSchema1_0_16 = configSchema1_0_13.extend({
49043
49043
  h: z.number().int().optional(),
49044
49044
  // Updates coordinationScopes and coordinationScopesBy
49045
49045
  coordinationScopes: componentCoordinationScopes.optional(),
49046
- coordinationScopesBy: componentCoordinationScopesBy.optional()
49046
+ coordinationScopesBy: componentCoordinationScopesBy.optional(),
49047
+ coordinationValues: z.record(z.any()).optional()
49047
49048
  }))
49048
49049
  });
49049
49050
  const configSchema1_0_17 = configSchema1_0_16.extend({
@@ -51550,7 +51551,8 @@ const ViewType$1 = {
51550
51551
  TREEMAP: "treemap",
51551
51552
  SAMPLE_SET_PAIR_MANAGER: "sampleSetPairManager",
51552
51553
  FEATURE_STATS_TABLE: "featureStatsTable",
51553
- SINGLE_OBS_SET_SELECTOR: "singleObsSetSelector"
51554
+ SINGLE_OBS_SET_SELECTOR: "singleObsSetSelector",
51555
+ ANNOTATION_CONTROLLER: "annotationController"
51554
51556
  };
51555
51557
  const DataType$1 = {
51556
51558
  OBS_LABELS: "obsLabels",
@@ -51571,7 +51573,8 @@ const DataType$1 = {
51571
51573
  COMPARISON_METADATA: "comparisonMetadata",
51572
51574
  FEATURE_STATS: "featureStats",
51573
51575
  FEATURE_SET_STATS: "featureSetStats",
51574
- OBS_SET_STATS: "obsSetStats"
51576
+ OBS_SET_STATS: "obsSetStats",
51577
+ ANNOTATION_STORY: "annotationStory"
51575
51578
  };
51576
51579
  const FileType$1 = {
51577
51580
  // Joint file types
@@ -51593,6 +51596,7 @@ const FileType$1 = {
51593
51596
  OBS_SETS_CSV: "obsSets.csv",
51594
51597
  OBS_SETS_JSON: "obsSets.json",
51595
51598
  SAMPLE_SETS_CSV: "sampleSets.csv",
51599
+ ANNOTATION_STORY_JSON: "annotationStory.json",
51596
51600
  // OME-Zarr
51597
51601
  IMAGE_OME_ZARR: "image.ome-zarr",
51598
51602
  OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
@@ -51877,7 +51881,15 @@ const CoordinationType$1 = {
51877
51881
  FEATURE_POINT_FOLD_CHANGE_THRESHOLD: "featurePointFoldChangeThreshold",
51878
51882
  FEATURE_LABEL_FOLD_CHANGE_THRESHOLD: "featureLabelFoldChangeThreshold",
51879
51883
  // Treemap
51880
- HIERARCHY_LEVELS: "hierarchyLevels"
51884
+ HIERARCHY_LEVELS: "hierarchyLevels",
51885
+ // Annotation frames
51886
+ ANNOTATION_STORY: "annotationStory",
51887
+ ANNOTATION_FRAME_INDEX: "annotationFrameIndex",
51888
+ ANNOTATION_SHAPES: "annotationShapes",
51889
+ ANNOTATION_OVERLAY_VISIBLE: "annotationOverlayVisible",
51890
+ ANNOTATION_TRANSITION_DURATION: "annotationTransitionDuration",
51891
+ ANNOTATION_SEMANTIC_ZOOM: "annotationSemanticZoom",
51892
+ ANNOTATION_EDITABLE: "annotationEditable"
51881
51893
  };
51882
51894
  ({
51883
51895
  // For new file types
@@ -51893,6 +51905,7 @@ const CoordinationType$1 = {
51893
51905
  [FileType$1.OBS_SEGMENTATIONS_JSON]: DataType$1.OBS_SEGMENTATIONS,
51894
51906
  [FileType$1.OBS_SETS_CSV]: DataType$1.OBS_SETS,
51895
51907
  [FileType$1.OBS_SETS_JSON]: DataType$1.OBS_SETS,
51908
+ [FileType$1.ANNOTATION_STORY_JSON]: DataType$1.ANNOTATION_STORY,
51896
51909
  [FileType$1.IMAGE_OME_ZARR]: DataType$1.IMAGE,
51897
51910
  [FileType$1.OBS_SEGMENTATIONS_OME_ZARR]: DataType$1.OBS_SEGMENTATIONS,
51898
51911
  [FileType$1.OBS_FEATURE_MATRIX_ANNDATA_ZARR]: DataType$1.OBS_FEATURE_MATRIX,
@@ -52015,7 +52028,8 @@ const CoordinationType$1 = {
52015
52028
  [DataType$1.OBS_SET_STATS]: [
52016
52029
  CoordinationType$1.OBS_TYPE
52017
52030
  // TODO: should sampleType, obsSetSelection, and/or sampleSetSelection be used here?
52018
- ]
52031
+ ],
52032
+ [DataType$1.ANNOTATION_STORY]: []
52019
52033
  });
52020
52034
  ({
52021
52035
  // For AnnData:
@@ -52148,7 +52162,9 @@ const CoordinationType$1 = {
52148
52162
  CoordinationType$1.SPATIAL_TARGET_Z,
52149
52163
  CoordinationType$1.SPATIAL_AXIS_FIXED,
52150
52164
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
52151
- CoordinationType$1.FEATURE_AGGREGATION_STRATEGY
52165
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
52166
+ // Annotation shapes are specific to a view's coordinate system.
52167
+ CoordinationType$1.ANNOTATION_SHAPES
52152
52168
  ];
52153
52169
  ({
52154
52170
  [ViewType$1.NEUROGLANCER]: [
@@ -52240,7 +52256,14 @@ const CoordinationType$1 = {
52240
52256
  CoordinationType$1.EMBEDDING_CONTOURS_FILLED,
52241
52257
  CoordinationType$1.EMBEDDING_CONTOUR_PERCENTILES,
52242
52258
  CoordinationType$1.CONTOUR_COLOR_ENCODING,
52243
- CoordinationType$1.CONTOUR_COLOR
52259
+ CoordinationType$1.CONTOUR_COLOR,
52260
+ CoordinationType$1.ANNOTATION_STORY,
52261
+ CoordinationType$1.ANNOTATION_SHAPES,
52262
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
52263
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
52264
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
52265
+ CoordinationType$1.ANNOTATION_EDITABLE,
52266
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
52244
52267
  ],
52245
52268
  [ViewType$1.DUAL_SCATTERPLOT]: [
52246
52269
  CoordinationType$1.DATASET,
@@ -52356,7 +52379,14 @@ const CoordinationType$1 = {
52356
52379
  CoordinationType$1.ADDITIONAL_OBS_SETS,
52357
52380
  CoordinationType$1.MOLECULE_HIGHLIGHT,
52358
52381
  CoordinationType$1.TOOLTIPS_VISIBLE,
52359
- CoordinationType$1.PHOTOMETRIC_INTERPRETATION
52382
+ CoordinationType$1.PHOTOMETRIC_INTERPRETATION,
52383
+ CoordinationType$1.ANNOTATION_STORY,
52384
+ CoordinationType$1.ANNOTATION_SHAPES,
52385
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
52386
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
52387
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
52388
+ CoordinationType$1.ANNOTATION_EDITABLE,
52389
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
52360
52390
  ],
52361
52391
  [ViewType$1.SPATIAL_BETA]: [
52362
52392
  CoordinationType$1.META_COORDINATION_SCOPES,
@@ -52434,7 +52464,27 @@ const CoordinationType$1 = {
52434
52464
  CoordinationType$1.SPATIAL_CHANNEL_LABELS_ORIENTATION,
52435
52465
  CoordinationType$1.SPATIAL_CHANNEL_LABEL_SIZE,
52436
52466
  CoordinationType$1.SPATIAL_CHANNELS_SORT_ORDER,
52437
- CoordinationType$1.PHOTOMETRIC_INTERPRETATION
52467
+ CoordinationType$1.PHOTOMETRIC_INTERPRETATION,
52468
+ CoordinationType$1.ANNOTATION_STORY,
52469
+ CoordinationType$1.ANNOTATION_SHAPES,
52470
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
52471
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
52472
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
52473
+ CoordinationType$1.ANNOTATION_EDITABLE,
52474
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
52475
+ ],
52476
+ [ViewType$1.ANNOTATION_CONTROLLER]: [
52477
+ CoordinationType$1.DATASET,
52478
+ CoordinationType$1.ANNOTATION_STORY,
52479
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
52480
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
52481
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
52482
+ CoordinationType$1.ANNOTATION_EDITABLE,
52483
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
52484
+ // Note: the annotation controller also needs to read the coordination state
52485
+ // of all other views/coordination types via the full config.
52486
+ // Note: we get/set the CoordinationType.ANNOTATION_SHAPES from the full config,
52487
+ // as this info is view-specific rather than global to the story.
52438
52488
  ],
52439
52489
  [ViewType$1.HEATMAP]: [
52440
52490
  CoordinationType$1.DATASET,
@@ -53452,6 +53502,124 @@ z.object({
53452
53502
  radius: z.number(),
53453
53503
  opacity: z.number()
53454
53504
  });
53505
+ const shapeBaseObj = z.object({
53506
+ uid: z.string(),
53507
+ text: z.string().optional(),
53508
+ strokeColor: z.array(z.number()).length(3).optional(),
53509
+ strokeWidth: z.number().optional(),
53510
+ // SVG-style dash pattern, e.g. "10 5" or "10 20 30 10". "none" or omitted = solid.
53511
+ strokeDashArray: z.string().optional(),
53512
+ visible: z.boolean().optional()
53513
+ // TODO: define unit modes for x and y axes
53514
+ // ("pixels" vs "normalized" vs "physical" etc.)
53515
+ // TODO: a coordinate system identifier (e.g., "DeckGL" for now,
53516
+ // but a coordinate system from OME-NGFF/SpatialData eventually?)
53517
+ });
53518
+ const rectangleShapeObj = shapeBaseObj.extend({
53519
+ type: z.literal("rectangle"),
53520
+ // OME-XML field names verbatim (upper-left origin)
53521
+ x: z.number(),
53522
+ y: z.number(),
53523
+ width: z.number(),
53524
+ height: z.number(),
53525
+ fillColor: z.array(z.number()).length(3).optional(),
53526
+ fillOpacity: z.number().optional()
53527
+ });
53528
+ const lineShapeObj = shapeBaseObj.extend({
53529
+ type: z.literal("line"),
53530
+ // OME-XML field names verbatim
53531
+ x1: z.number(),
53532
+ y1: z.number(),
53533
+ x2: z.number(),
53534
+ y2: z.number(),
53535
+ markerStart: z.enum(["Arrow", "Tick"]).nullable().optional(),
53536
+ markerEnd: z.enum(["Arrow", "Tick"]).nullable().optional(),
53537
+ textPosition: z.enum(["start", "middle", "end"]).optional(),
53538
+ textBufferPx: z.number().optional()
53539
+ });
53540
+ const ellipseShapeObj = shapeBaseObj.extend({
53541
+ type: z.literal("ellipse"),
53542
+ // OME-XML field names verbatim (centre point + radii)
53543
+ x1: z.number(),
53544
+ y1: z.number(),
53545
+ radiusX: z.number(),
53546
+ radiusY: z.number(),
53547
+ fillColor: z.array(z.number()).length(3).optional(),
53548
+ fillOpacity: z.number().optional()
53549
+ });
53550
+ const polygonShapeObj = shapeBaseObj.extend({
53551
+ type: z.literal("polygon"),
53552
+ // OME-XML: array of [x, y] coordinate pairs, closed automatically
53553
+ points: z.array(z.tuple([z.number(), z.number()])),
53554
+ fillColor: z.array(z.number()).length(3).optional(),
53555
+ fillOpacity: z.number().optional()
53556
+ });
53557
+ const polylineShapeObj = shapeBaseObj.extend({
53558
+ type: z.literal("polyline"),
53559
+ // OME-XML: array of [x, y] coordinate pairs, open (not closed)
53560
+ points: z.array(z.tuple([z.number(), z.number()])),
53561
+ markerStart: z.enum(["Arrow", "Tick"]).nullable().optional(),
53562
+ markerEnd: z.enum(["Arrow", "Tick"]).nullable().optional()
53563
+ });
53564
+ const annotationShapeObj = z.discriminatedUnion("type", [
53565
+ rectangleShapeObj,
53566
+ lineShapeObj,
53567
+ ellipseShapeObj,
53568
+ polygonShapeObj,
53569
+ polylineShapeObj
53570
+ ]);
53571
+ z.array(annotationShapeObj);
53572
+ const annotationFrameObj = z.object({
53573
+ uid: z.string(),
53574
+ title: z.string().optional(),
53575
+ description: z.string().optional(),
53576
+ descriptionType: z.enum(["text", "markdown"]).optional(),
53577
+ // A frame can define per-view: coordinationValues
53578
+ // (if the view's state should not be coordinated with other views)
53579
+ // or per-view coordinationScopes/coordinationScopesBy
53580
+ // (if at this frame, the view should be coordinated with other views).
53581
+ // We can also define a frame-level coordination space,
53582
+ // which will be merged with the global coordination space.
53583
+ // TODO: datasets
53584
+ // TODO: coordinationSpace
53585
+ layout: z.array(
53586
+ // Note: for now, we will infer view objects which have a uid
53587
+ // that is present in the global layout, and do NOT have x/y/w/h defined,
53588
+ // to mean that in this frame, the layout and set of views is unchanged
53589
+ // from the global layout.
53590
+ // This will allow each frame to omit the full list of views from the layout,
53591
+ // and only specify the views whose coordination state is changing in this frame.
53592
+ // If a frame includes a view with a uid that is not present
53593
+ // in the global layout, then that view will be added to the layout at this frame.
53594
+ // This frame should also define x/y/w/h for all views,
53595
+ // since it will otherwise be ambiguous how to layout the updated set of views
53596
+ // for this frame.
53597
+ z.object({
53598
+ // The view UID. If this view uid is not present in the global layout,
53599
+ // it will be added to the layout at this frame,
53600
+ // and will need to have its coordination values initialized to their defaults
53601
+ // for any that were not fully specified.
53602
+ uid: z.string(),
53603
+ coordinationValues: z.record(
53604
+ z.string(),
53605
+ // The coordination type name, e.g. "embeddingType"
53606
+ z.any()
53607
+ ).optional()
53608
+ // TODO: support coordinationScopes/coordinationScopesBy for per-view coordination
53609
+ // at this frame.
53610
+ // TODO: view x/y/w/h once we support view layout changes per-frame.
53611
+ })
53612
+ ).optional()
53613
+ });
53614
+ z.object({
53615
+ // TODO: schema version for the story schema?
53616
+ // Same as current Vitessce schema version?
53617
+ uid: z.string(),
53618
+ title: z.string().optional(),
53619
+ description: z.string().optional(),
53620
+ descriptionType: z.enum(["text", "markdown"]).optional(),
53621
+ frames: z.array(annotationFrameObj)
53622
+ });
53455
53623
  var tinycolor = { exports: {} };
53456
53624
  var hasRequiredTinycolor;
53457
53625
  function requireTinycolor() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/vega",
3
- "version": "4.0.8",
3
+ "version": "4.0.10",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -21,9 +21,9 @@
21
21
  "vega": "^5.21.0",
22
22
  "vega-lite": "^5.1.1",
23
23
  "vega-tooltip": "^0.27.0",
24
- "@vitessce/styles": "4.0.8",
25
- "@vitessce/tooltip": "4.0.8",
26
- "@vitessce/legend": "4.0.8"
24
+ "@vitessce/tooltip": "4.0.10",
25
+ "@vitessce/styles": "4.0.10",
26
+ "@vitessce/legend": "4.0.10"
27
27
  },
28
28
  "devDependencies": {
29
29
  "react": "19.2.6",