@vitessce/vega 3.6.6 → 3.6.8

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 +70 -15
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -48122,6 +48122,9 @@ const configSchema1_0_16 = configSchema1_0_13.extend({
48122
48122
  const configSchema1_0_17 = configSchema1_0_16.extend({
48123
48123
  version: z.literal("1.0.17")
48124
48124
  });
48125
+ const configSchema1_0_18 = configSchema1_0_17.extend({
48126
+ version: z.literal("1.0.18")
48127
+ });
48125
48128
  configSchema1_0_0.shape.coordinationSpace.unwrap();
48126
48129
  configSchema1_0_0.shape.layout.element.shape.coordinationScopes.unwrap();
48127
48130
  function upgradeReplaceViewProp(prefix2, view, coordinationSpace) {
@@ -48629,7 +48632,54 @@ function upgradeFrom1_0_16(config) {
48629
48632
  version: "1.0.17"
48630
48633
  };
48631
48634
  }
48632
- const latestConfigSchema = configSchema1_0_17;
48635
+ function upgradeFrom1_0_17(config) {
48636
+ const newConfig = cloneDeep(config);
48637
+ const { datasets } = newConfig;
48638
+ const newDatasets = datasets.map((datasetDef) => {
48639
+ const { files } = datasetDef;
48640
+ const newFiles = files.map((fileDef) => {
48641
+ const { fileType, options } = fileDef;
48642
+ if (fileType === "spatialdata.zarr" || fileType === "spatialdata.zarr.zip") {
48643
+ if (options.labels && options.shapes) {
48644
+ throw new Error("Cannot upgrade both labels and shapes at the same time. For now, a workaround is to include two separate spatialdata.zarr file definitions, one for labels and one for shapes.");
48645
+ }
48646
+ if (options.labels) {
48647
+ const newOptions = {
48648
+ ...options,
48649
+ obsSegmentations: options.labels
48650
+ };
48651
+ delete newOptions.labels;
48652
+ return {
48653
+ ...fileDef,
48654
+ options: newOptions
48655
+ };
48656
+ }
48657
+ if (options.shapes) {
48658
+ const newOptions = {
48659
+ ...options,
48660
+ obsSegmentations: options.shapes
48661
+ };
48662
+ delete newOptions.shapes;
48663
+ return {
48664
+ ...fileDef,
48665
+ options: newOptions
48666
+ };
48667
+ }
48668
+ }
48669
+ return fileDef;
48670
+ });
48671
+ return {
48672
+ ...datasetDef,
48673
+ files: newFiles
48674
+ };
48675
+ });
48676
+ return {
48677
+ ...newConfig,
48678
+ datasets: newDatasets,
48679
+ version: "1.0.18"
48680
+ };
48681
+ }
48682
+ const latestConfigSchema = configSchema1_0_18;
48633
48683
  const SCHEMA_HANDLERS = [
48634
48684
  [configSchema0_1_0, upgradeFrom0_1_0],
48635
48685
  [configSchema1_0_0, upgradeFrom1_0_0],
@@ -48648,7 +48698,8 @@ const SCHEMA_HANDLERS = [
48648
48698
  [configSchema1_0_13, upgradeFrom1_0_13],
48649
48699
  [configSchema1_0_14, upgradeFrom1_0_14],
48650
48700
  [configSchema1_0_15, upgradeFrom1_0_15],
48651
- [configSchema1_0_16, upgradeFrom1_0_16]
48701
+ [configSchema1_0_16, upgradeFrom1_0_16],
48702
+ [configSchema1_0_17, upgradeFrom1_0_17]
48652
48703
  ];
48653
48704
  var re$2 = { exports: {} };
48654
48705
  var constants$1;
@@ -50680,9 +50731,7 @@ const FileType$1 = {
50680
50731
  OBS_SETS_SPATIALDATA_ZARR: "obsSets.spatialdata.zarr",
50681
50732
  OBS_SPOTS_SPATIALDATA_ZARR: "obsSpots.spatialdata.zarr",
50682
50733
  FEATURE_LABELS_SPATIALDATA_ZARR: "featureLabels.spatialdata.zarr",
50683
- // TODO:
50684
- // OBS_POINTS_SPATIALDATA_ZARR: 'obsPoints.spatialdata.zarr',
50685
- // OBS_LOCATIONS_SPATIALDATA_ZARR: 'obsLocations.spatialdata.zarr',
50734
+ OBS_POINTS_SPATIALDATA_ZARR: "obsPoints.spatialdata.zarr",
50686
50735
  // SpatialData - zipped
50687
50736
  IMAGE_SPATIALDATA_ZARR_ZIP: "image.spatialdata.zarr.zip",
50688
50737
  LABELS_SPATIALDATA_ZARR_ZIP: "labels.spatialdata.zarr.zip",
@@ -50691,6 +50740,7 @@ const FileType$1 = {
50691
50740
  OBS_SETS_SPATIALDATA_ZARR_ZIP: "obsSets.spatialdata.zarr.zip",
50692
50741
  OBS_SPOTS_SPATIALDATA_ZARR_ZIP: "obsSpots.spatialdata.zarr.zip",
50693
50742
  FEATURE_LABELS_SPATIALDATA_ZARR_ZIP: "featureLabels.spatialdata.zarr.zip",
50743
+ OBS_POINTS_SPATIALDATA_ZARR_ZIP: "obsPoints.spatialdata.zarr.zip",
50694
50744
  // MuData
50695
50745
  OBS_FEATURE_MATRIX_MUDATA_ZARR: "obsFeatureMatrix.mudata.zarr",
50696
50746
  OBS_SETS_MUDATA_ZARR: "obsSets.mudata.zarr",
@@ -50937,6 +50987,7 @@ const CoordinationType$1 = {
50937
50987
  [FileType$1.OBS_FEATURE_MATRIX_SPATIALDATA_ZARR]: DataType$1.OBS_FEATURE_MATRIX,
50938
50988
  [FileType$1.OBS_SETS_SPATIALDATA_ZARR]: DataType$1.OBS_SETS,
50939
50989
  [FileType$1.FEATURE_LABELS_SPATIALDATA_ZARR]: DataType$1.FEATURE_LABELS,
50990
+ [FileType$1.OBS_POINTS_SPATIALDATA_ZARR]: DataType$1.OBS_POINTS,
50940
50991
  // For new file types to support old file types
50941
50992
  [FileType$1.OBS_EMBEDDING_CELLS_JSON]: DataType$1.OBS_EMBEDDING,
50942
50993
  [FileType$1.OBS_LOCATIONS_CELLS_JSON]: DataType$1.OBS_LOCATIONS,
@@ -51110,6 +51161,9 @@ const CoordinationType$1 = {
51110
51161
  },
51111
51162
  [FileType$1.FEATURE_LABELS_SPATIALDATA_ZARR]: {
51112
51163
  zip: FileType$1.FEATURE_LABELS_SPATIALDATA_ZARR_ZIP
51164
+ },
51165
+ [FileType$1.OBS_POINTS_SPATIALDATA_ZARR]: {
51166
+ zip: FileType$1.OBS_POINTS_SPATIALDATA_ZARR_ZIP
51113
51167
  }
51114
51168
  });
51115
51169
  [
@@ -52129,10 +52183,14 @@ const imageSpatialdataSchema = z.object({
52129
52183
  coordinateSystem: z.string().optional().describe('The name of a coordinate transformation output used to transform the image. If not provided, the "global" coordinate system is assumed.')
52130
52184
  });
52131
52185
  const obsSegmentationsSpatialdataSchema = z.object({
52132
- // TODO: should this be renamed labelsSpatialdataSchema?
52133
- // TODO: support obsTypesFromChannelNames?
52134
- path: z.string(),
52135
- tablePath: z.string().optional().describe("The path to a table which annotates the labels. If available but not specified, the spot identifiers may not be aligned with associated tabular data as expected."),
52186
+ // TODO: support obsTypesFromElementNames?
52187
+ path: z.string().describe("The path to the segmentation data, stored in either shapes/ or labels/."),
52188
+ tablePath: z.string().optional().describe("The path to a table which annotates the labels or shapes. If available but not specified, the spot identifiers may not be aligned with associated tabular data as expected."),
52189
+ coordinateSystem: z.string().optional().describe('The name of a coordinate transformation output used to transform the image. If not provided, the "global" coordinate system is assumed.')
52190
+ });
52191
+ const obsPointsSpatialdataSchema = z.object({
52192
+ path: z.string().describe("The path to the point data."),
52193
+ tablePath: z.string().optional().describe("The path to a table which annotates the points. If available but not specified, the spot identifiers may not be aligned with associated tabular data as expected."),
52136
52194
  coordinateSystem: z.string().optional().describe('The name of a coordinate transformation output used to transform the image. If not provided, the "global" coordinate system is assumed.')
52137
52195
  });
52138
52196
  z.object({
@@ -52252,13 +52310,10 @@ z.object({
52252
52310
  image: imageSpatialdataSchema,
52253
52311
  // TODO: should this be a special schema
52254
52312
  // to allow specifying fileUid (like for embeddingType)?
52255
- // TODO: allow multiple labels?
52256
- labels: obsSegmentationsSpatialdataSchema,
52313
+ // TODO: allow multiple labels/shapes?
52314
+ obsSegmentations: obsSegmentationsSpatialdataSchema,
52315
+ obsPoints: obsPointsSpatialdataSchema,
52257
52316
  // TODO: allow multiple shapes?
52258
- // TODO: unify labels and shapes to obsSegmentations,
52259
- // then distinguish in expand function based on
52260
- // "labels/*" vs. "shapes/*" in path?
52261
- shapes: obsSegmentationsSpatialdataSchema,
52262
52317
  obsFeatureMatrix: obsFeatureMatrixSpatialdataSchema,
52263
52318
  obsSpots: obsSpotsSpatialdataSchema,
52264
52319
  // TODO: obsPoints
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/vega",
3
- "version": "3.6.6",
3
+ "version": "3.6.8",
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": "3.6.6",
25
- "@vitessce/tooltip": "3.6.6",
26
- "@vitessce/legend": "3.6.6"
24
+ "@vitessce/styles": "3.6.8",
25
+ "@vitessce/tooltip": "3.6.8",
26
+ "@vitessce/legend": "3.6.8"
27
27
  },
28
28
  "devDependencies": {
29
29
  "react": "^18.0.0",