@vitessce/vega 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.
- package/dist/index.js +184 -10
- 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.
|
|
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({
|
|
@@ -51549,7 +51550,9 @@ const ViewType$1 = {
|
|
|
51549
51550
|
DUAL_SCATTERPLOT: "dualScatterplot",
|
|
51550
51551
|
TREEMAP: "treemap",
|
|
51551
51552
|
SAMPLE_SET_PAIR_MANAGER: "sampleSetPairManager",
|
|
51552
|
-
FEATURE_STATS_TABLE: "featureStatsTable"
|
|
51553
|
+
FEATURE_STATS_TABLE: "featureStatsTable",
|
|
51554
|
+
SINGLE_OBS_SET_SELECTOR: "singleObsSetSelector",
|
|
51555
|
+
ANNOTATION_CONTROLLER: "annotationController"
|
|
51553
51556
|
};
|
|
51554
51557
|
const DataType$1 = {
|
|
51555
51558
|
OBS_LABELS: "obsLabels",
|
|
@@ -51570,7 +51573,8 @@ const DataType$1 = {
|
|
|
51570
51573
|
COMPARISON_METADATA: "comparisonMetadata",
|
|
51571
51574
|
FEATURE_STATS: "featureStats",
|
|
51572
51575
|
FEATURE_SET_STATS: "featureSetStats",
|
|
51573
|
-
OBS_SET_STATS: "obsSetStats"
|
|
51576
|
+
OBS_SET_STATS: "obsSetStats",
|
|
51577
|
+
ANNOTATION_STORY: "annotationStory"
|
|
51574
51578
|
};
|
|
51575
51579
|
const FileType$1 = {
|
|
51576
51580
|
// Joint file types
|
|
@@ -51592,6 +51596,7 @@ const FileType$1 = {
|
|
|
51592
51596
|
OBS_SETS_CSV: "obsSets.csv",
|
|
51593
51597
|
OBS_SETS_JSON: "obsSets.json",
|
|
51594
51598
|
SAMPLE_SETS_CSV: "sampleSets.csv",
|
|
51599
|
+
ANNOTATION_STORY_JSON: "annotationStory.json",
|
|
51595
51600
|
// OME-Zarr
|
|
51596
51601
|
IMAGE_OME_ZARR: "image.ome-zarr",
|
|
51597
51602
|
OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
|
|
@@ -51876,7 +51881,15 @@ const CoordinationType$1 = {
|
|
|
51876
51881
|
FEATURE_POINT_FOLD_CHANGE_THRESHOLD: "featurePointFoldChangeThreshold",
|
|
51877
51882
|
FEATURE_LABEL_FOLD_CHANGE_THRESHOLD: "featureLabelFoldChangeThreshold",
|
|
51878
51883
|
// Treemap
|
|
51879
|
-
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"
|
|
51880
51893
|
};
|
|
51881
51894
|
({
|
|
51882
51895
|
// For new file types
|
|
@@ -51892,6 +51905,7 @@ const CoordinationType$1 = {
|
|
|
51892
51905
|
[FileType$1.OBS_SEGMENTATIONS_JSON]: DataType$1.OBS_SEGMENTATIONS,
|
|
51893
51906
|
[FileType$1.OBS_SETS_CSV]: DataType$1.OBS_SETS,
|
|
51894
51907
|
[FileType$1.OBS_SETS_JSON]: DataType$1.OBS_SETS,
|
|
51908
|
+
[FileType$1.ANNOTATION_STORY_JSON]: DataType$1.ANNOTATION_STORY,
|
|
51895
51909
|
[FileType$1.IMAGE_OME_ZARR]: DataType$1.IMAGE,
|
|
51896
51910
|
[FileType$1.OBS_SEGMENTATIONS_OME_ZARR]: DataType$1.OBS_SEGMENTATIONS,
|
|
51897
51911
|
[FileType$1.OBS_FEATURE_MATRIX_ANNDATA_ZARR]: DataType$1.OBS_FEATURE_MATRIX,
|
|
@@ -52014,7 +52028,8 @@ const CoordinationType$1 = {
|
|
|
52014
52028
|
[DataType$1.OBS_SET_STATS]: [
|
|
52015
52029
|
CoordinationType$1.OBS_TYPE
|
|
52016
52030
|
// TODO: should sampleType, obsSetSelection, and/or sampleSetSelection be used here?
|
|
52017
|
-
]
|
|
52031
|
+
],
|
|
52032
|
+
[DataType$1.ANNOTATION_STORY]: []
|
|
52018
52033
|
});
|
|
52019
52034
|
({
|
|
52020
52035
|
// For AnnData:
|
|
@@ -52147,7 +52162,9 @@ const CoordinationType$1 = {
|
|
|
52147
52162
|
CoordinationType$1.SPATIAL_TARGET_Z,
|
|
52148
52163
|
CoordinationType$1.SPATIAL_AXIS_FIXED,
|
|
52149
52164
|
CoordinationType$1.SPATIAL_ORBIT_AXIS,
|
|
52150
|
-
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
|
|
52151
52168
|
];
|
|
52152
52169
|
({
|
|
52153
52170
|
[ViewType$1.NEUROGLANCER]: [
|
|
@@ -52239,7 +52256,14 @@ const CoordinationType$1 = {
|
|
|
52239
52256
|
CoordinationType$1.EMBEDDING_CONTOURS_FILLED,
|
|
52240
52257
|
CoordinationType$1.EMBEDDING_CONTOUR_PERCENTILES,
|
|
52241
52258
|
CoordinationType$1.CONTOUR_COLOR_ENCODING,
|
|
52242
|
-
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
|
|
52243
52267
|
],
|
|
52244
52268
|
[ViewType$1.DUAL_SCATTERPLOT]: [
|
|
52245
52269
|
CoordinationType$1.DATASET,
|
|
@@ -52355,7 +52379,14 @@ const CoordinationType$1 = {
|
|
|
52355
52379
|
CoordinationType$1.ADDITIONAL_OBS_SETS,
|
|
52356
52380
|
CoordinationType$1.MOLECULE_HIGHLIGHT,
|
|
52357
52381
|
CoordinationType$1.TOOLTIPS_VISIBLE,
|
|
52358
|
-
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
|
|
52359
52390
|
],
|
|
52360
52391
|
[ViewType$1.SPATIAL_BETA]: [
|
|
52361
52392
|
CoordinationType$1.META_COORDINATION_SCOPES,
|
|
@@ -52433,7 +52464,27 @@ const CoordinationType$1 = {
|
|
|
52433
52464
|
CoordinationType$1.SPATIAL_CHANNEL_LABELS_ORIENTATION,
|
|
52434
52465
|
CoordinationType$1.SPATIAL_CHANNEL_LABEL_SIZE,
|
|
52435
52466
|
CoordinationType$1.SPATIAL_CHANNELS_SORT_ORDER,
|
|
52436
|
-
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.
|
|
52437
52488
|
],
|
|
52438
52489
|
[ViewType$1.HEATMAP]: [
|
|
52439
52490
|
CoordinationType$1.DATASET,
|
|
@@ -52743,6 +52794,11 @@ const CoordinationType$1 = {
|
|
|
52743
52794
|
CoordinationType$1.FEATURE_POINT_FOLD_CHANGE_THRESHOLD,
|
|
52744
52795
|
CoordinationType$1.FEATURE_LABEL_FOLD_CHANGE_THRESHOLD
|
|
52745
52796
|
],
|
|
52797
|
+
[ViewType$1.SINGLE_OBS_SET_SELECTOR]: [
|
|
52798
|
+
CoordinationType$1.OBS_TYPE,
|
|
52799
|
+
CoordinationType$1.OBS_SET_COLOR,
|
|
52800
|
+
CoordinationType$1.OBS_SET_SELECTION
|
|
52801
|
+
],
|
|
52746
52802
|
[ViewType$1.OBS_SET_COMPOSITION_BAR_PLOT]: [
|
|
52747
52803
|
CoordinationType$1.DATASET,
|
|
52748
52804
|
CoordinationType$1.OBS_TYPE,
|
|
@@ -53446,6 +53502,124 @@ z.object({
|
|
|
53446
53502
|
radius: z.number(),
|
|
53447
53503
|
opacity: z.number()
|
|
53448
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
|
+
});
|
|
53449
53623
|
var tinycolor = { exports: {} };
|
|
53450
53624
|
var hasRequiredTinycolor;
|
|
53451
53625
|
function requireTinycolor() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/vega",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.9",
|
|
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/
|
|
25
|
-
"@vitessce/
|
|
26
|
-
"@vitessce/
|
|
24
|
+
"@vitessce/styles": "4.0.9",
|
|
25
|
+
"@vitessce/legend": "4.0.9",
|
|
26
|
+
"@vitessce/tooltip": "4.0.9"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"react": "19.2.6",
|