@vitessce/csv 3.4.6 → 3.4.7

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 CHANGED
@@ -263,6 +263,7 @@ const ViewType$1 = {
263
263
  OBS_SET_SIZES: "obsSetSizes",
264
264
  OBS_SET_FEATURE_VALUE_DISTRIBUTION: "obsSetFeatureValueDistribution",
265
265
  FEATURE_VALUE_HISTOGRAM: "featureValueHistogram",
266
+ DOT_PLOT: "dotPlot",
266
267
  FEATURE_BAR_PLOT: "featureBarPlot"
267
268
  };
268
269
  const DataType$1 = {
@@ -452,6 +453,7 @@ const CoordinationType$1 = {
452
453
  GATING_FEATURE_SELECTION_X: "gatingFeatureSelectionX",
453
454
  GATING_FEATURE_SELECTION_Y: "gatingFeatureSelectionY",
454
455
  FEATURE_VALUE_TRANSFORM_COEFFICIENT: "featureValueTransformCoefficient",
456
+ FEATURE_VALUE_POSITIVITY_THRESHOLD: "featureValuePositivityThreshold",
455
457
  TOOLTIPS_VISIBLE: "tooltipsVisible",
456
458
  FILE_UID: "fileUid",
457
459
  IMAGE_LAYER: "imageLayer",
@@ -499,7 +501,14 @@ const CoordinationType$1 = {
499
501
  SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize",
500
502
  // Multi-sample / comparative
501
503
  SAMPLE_TYPE: "sampleType",
502
- SAMPLE_SET_SELECTION: "sampleSetSelection"
504
+ SAMPLE_SET_SELECTION: "sampleSetSelection",
505
+ SAMPLE_SET_COLOR: "sampleSetColor",
506
+ EMBEDDING_POINTS_VISIBLE: "embeddingPointsVisible",
507
+ EMBEDDING_CONTOURS_VISIBLE: "embeddingContoursVisible",
508
+ EMBEDDING_CONTOURS_FILLED: "embeddingContoursFilled",
509
+ EMBEDDING_CONTOUR_PERCENTILES: "embeddingContourPercentiles",
510
+ CONTOUR_COLOR_ENCODING: "contourColorEncoding",
511
+ CONTOUR_COLOR: "contourColor"
503
512
  };
504
513
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
505
514
  function getDefaultExportFromCjs(x) {
@@ -1078,7 +1087,7 @@ for (let i = 0; i < 256; ++i) {
1078
1087
  byteToHex.push((i + 256).toString(16).slice(1));
1079
1088
  }
1080
1089
  function unsafeStringify(arr, offset = 0) {
1081
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
1090
+ return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
1082
1091
  }
1083
1092
  const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1084
1093
  const native = {
@@ -3349,7 +3358,7 @@ class ParseStatus {
3349
3358
  status.dirty();
3350
3359
  if (value.status === "dirty")
3351
3360
  status.dirty();
3352
- if (typeof value.value !== "undefined" || pair.alwaysSet) {
3361
+ if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
3353
3362
  finalObject[key.value] = value.value;
3354
3363
  }
3355
3364
  }
@@ -3452,6 +3461,7 @@ class ZodType {
3452
3461
  this.catch = this.catch.bind(this);
3453
3462
  this.describe = this.describe.bind(this);
3454
3463
  this.pipe = this.pipe.bind(this);
3464
+ this.readonly = this.readonly.bind(this);
3455
3465
  this.isNullable = this.isNullable.bind(this);
3456
3466
  this.isOptional = this.isOptional.bind(this);
3457
3467
  }
@@ -3659,6 +3669,9 @@ class ZodType {
3659
3669
  pipe(target) {
3660
3670
  return ZodPipeline.create(this, target);
3661
3671
  }
3672
+ readonly() {
3673
+ return ZodReadonly.create(this);
3674
+ }
3662
3675
  isOptional() {
3663
3676
  return this.safeParse(void 0).success;
3664
3677
  }
@@ -3668,10 +3681,11 @@ class ZodType {
3668
3681
  }
3669
3682
  const cuidRegex = /^c[^\s-]{8,}$/i;
3670
3683
  const cuid2Regex = /^[a-z][a-z0-9]*$/;
3671
- const ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/;
3672
- const uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
3673
- const emailRegex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/;
3674
- const emojiRegex = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u;
3684
+ const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
3685
+ const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
3686
+ const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
3687
+ const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
3688
+ let emojiRegex;
3675
3689
  const ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
3676
3690
  const ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
3677
3691
  const datetimeRegex = (args) => {
@@ -3705,27 +3719,6 @@ function isValidIP(ip, version) {
3705
3719
  return false;
3706
3720
  }
3707
3721
  class ZodString extends ZodType {
3708
- constructor() {
3709
- super(...arguments);
3710
- this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
3711
- validation,
3712
- code: ZodIssueCode.invalid_string,
3713
- ...errorUtil.errToObj(message)
3714
- });
3715
- this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
3716
- this.trim = () => new ZodString({
3717
- ...this._def,
3718
- checks: [...this._def.checks, { kind: "trim" }]
3719
- });
3720
- this.toLowerCase = () => new ZodString({
3721
- ...this._def,
3722
- checks: [...this._def.checks, { kind: "toLowerCase" }]
3723
- });
3724
- this.toUpperCase = () => new ZodString({
3725
- ...this._def,
3726
- checks: [...this._def.checks, { kind: "toUpperCase" }]
3727
- });
3728
- }
3729
3722
  _parse(input) {
3730
3723
  if (this._def.coerce) {
3731
3724
  input.data = String(input.data);
@@ -3810,6 +3803,9 @@ class ZodString extends ZodType {
3810
3803
  status.dirty();
3811
3804
  }
3812
3805
  } else if (check.kind === "emoji") {
3806
+ if (!emojiRegex) {
3807
+ emojiRegex = new RegExp(_emojiRegex, "u");
3808
+ }
3813
3809
  if (!emojiRegex.test(input.data)) {
3814
3810
  ctx = this._getOrReturnCtx(input, ctx);
3815
3811
  addIssueToContext(ctx, {
@@ -3946,6 +3942,13 @@ class ZodString extends ZodType {
3946
3942
  }
3947
3943
  return { status: status.value, value: input.data };
3948
3944
  }
3945
+ _regex(regex, validation, message) {
3946
+ return this.refinement((data) => regex.test(data), {
3947
+ validation,
3948
+ code: ZodIssueCode.invalid_string,
3949
+ ...errorUtil.errToObj(message)
3950
+ });
3951
+ }
3949
3952
  _addCheck(check) {
3950
3953
  return new ZodString({
3951
3954
  ...this._def,
@@ -4043,6 +4046,31 @@ class ZodString extends ZodType {
4043
4046
  ...errorUtil.errToObj(message)
4044
4047
  });
4045
4048
  }
4049
+ /**
4050
+ * @deprecated Use z.string().min(1) instead.
4051
+ * @see {@link ZodString.min}
4052
+ */
4053
+ nonempty(message) {
4054
+ return this.min(1, errorUtil.errToObj(message));
4055
+ }
4056
+ trim() {
4057
+ return new ZodString({
4058
+ ...this._def,
4059
+ checks: [...this._def.checks, { kind: "trim" }]
4060
+ });
4061
+ }
4062
+ toLowerCase() {
4063
+ return new ZodString({
4064
+ ...this._def,
4065
+ checks: [...this._def.checks, { kind: "toLowerCase" }]
4066
+ });
4067
+ }
4068
+ toUpperCase() {
4069
+ return new ZodString({
4070
+ ...this._def,
4071
+ checks: [...this._def.checks, { kind: "toUpperCase" }]
4072
+ });
4073
+ }
4046
4074
  get isDatetime() {
4047
4075
  return !!this._def.checks.find((ch) => ch.kind === "datetime");
4048
4076
  }
@@ -5634,6 +5662,12 @@ class ZodRecord extends ZodType {
5634
5662
  }
5635
5663
  }
5636
5664
  class ZodMap extends ZodType {
5665
+ get keySchema() {
5666
+ return this._def.keyType;
5667
+ }
5668
+ get valueSchema() {
5669
+ return this._def.valueType;
5670
+ }
5637
5671
  _parse(input) {
5638
5672
  const { status, ctx } = this._processInputParams(input);
5639
5673
  if (ctx.parsedType !== ZodParsedType.map) {
@@ -5828,27 +5862,29 @@ class ZodFunction extends ZodType {
5828
5862
  const params = { errorMap: ctx.common.contextualErrorMap };
5829
5863
  const fn = ctx.data;
5830
5864
  if (this._def.returns instanceof ZodPromise) {
5831
- return OK(async (...args) => {
5865
+ const me = this;
5866
+ return OK(async function(...args) {
5832
5867
  const error = new ZodError([]);
5833
- const parsedArgs = await this._def.args.parseAsync(args, params).catch((e) => {
5868
+ const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
5834
5869
  error.addIssue(makeArgsIssue(args, e));
5835
5870
  throw error;
5836
5871
  });
5837
- const result = await fn(...parsedArgs);
5838
- const parsedReturns = await this._def.returns._def.type.parseAsync(result, params).catch((e) => {
5872
+ const result = await Reflect.apply(fn, this, parsedArgs);
5873
+ const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
5839
5874
  error.addIssue(makeReturnsIssue(result, e));
5840
5875
  throw error;
5841
5876
  });
5842
5877
  return parsedReturns;
5843
5878
  });
5844
5879
  } else {
5845
- return OK((...args) => {
5846
- const parsedArgs = this._def.args.safeParse(args, params);
5880
+ const me = this;
5881
+ return OK(function(...args) {
5882
+ const parsedArgs = me._def.args.safeParse(args, params);
5847
5883
  if (!parsedArgs.success) {
5848
5884
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
5849
5885
  }
5850
- const result = fn(...parsedArgs.data);
5851
- const parsedReturns = this._def.returns.safeParse(result, params);
5886
+ const result = Reflect.apply(fn, this, parsedArgs.data);
5887
+ const parsedReturns = me._def.returns.safeParse(result, params);
5852
5888
  if (!parsedReturns.success) {
5853
5889
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
5854
5890
  }
@@ -6070,8 +6106,28 @@ class ZodEffects extends ZodType {
6070
6106
  _parse(input) {
6071
6107
  const { status, ctx } = this._processInputParams(input);
6072
6108
  const effect = this._def.effect || null;
6109
+ const checkCtx = {
6110
+ addIssue: (arg) => {
6111
+ addIssueToContext(ctx, arg);
6112
+ if (arg.fatal) {
6113
+ status.abort();
6114
+ } else {
6115
+ status.dirty();
6116
+ }
6117
+ },
6118
+ get path() {
6119
+ return ctx.path;
6120
+ }
6121
+ };
6122
+ checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
6073
6123
  if (effect.type === "preprocess") {
6074
- const processed = effect.transform(ctx.data);
6124
+ const processed = effect.transform(ctx.data, checkCtx);
6125
+ if (ctx.common.issues.length) {
6126
+ return {
6127
+ status: "dirty",
6128
+ value: ctx.data
6129
+ };
6130
+ }
6075
6131
  if (ctx.common.async) {
6076
6132
  return Promise.resolve(processed).then((processed2) => {
6077
6133
  return this._def.schema._parseAsync({
@@ -6088,20 +6144,6 @@ class ZodEffects extends ZodType {
6088
6144
  });
6089
6145
  }
6090
6146
  }
6091
- const checkCtx = {
6092
- addIssue: (arg) => {
6093
- addIssueToContext(ctx, arg);
6094
- if (arg.fatal) {
6095
- status.abort();
6096
- } else {
6097
- status.dirty();
6098
- }
6099
- },
6100
- get path() {
6101
- return ctx.path;
6102
- }
6103
- };
6104
- checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
6105
6147
  if (effect.type === "refinement") {
6106
6148
  const executeRefinement = (acc) => {
6107
6149
  const result = effect.refinement(acc, checkCtx);
@@ -6385,6 +6427,22 @@ class ZodPipeline extends ZodType {
6385
6427
  });
6386
6428
  }
6387
6429
  }
6430
+ class ZodReadonly extends ZodType {
6431
+ _parse(input) {
6432
+ const result = this._def.innerType._parse(input);
6433
+ if (isValid(result)) {
6434
+ result.value = Object.freeze(result.value);
6435
+ }
6436
+ return result;
6437
+ }
6438
+ }
6439
+ ZodReadonly.create = (type, params) => {
6440
+ return new ZodReadonly({
6441
+ innerType: type,
6442
+ typeName: ZodFirstPartyTypeKind.ZodReadonly,
6443
+ ...processCreateParams(params)
6444
+ });
6445
+ };
6388
6446
  const custom = (check, params = {}, fatal) => {
6389
6447
  if (check)
6390
6448
  return ZodAny.create().superRefine((data, ctx) => {
@@ -6438,6 +6496,7 @@ var ZodFirstPartyTypeKind;
6438
6496
  ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
6439
6497
  ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
6440
6498
  ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
6499
+ ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
6441
6500
  })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
6442
6501
  const instanceOfType = (cls, params = {
6443
6502
  message: `Input not instance of ${cls.name}`
@@ -6552,6 +6611,7 @@ var z = /* @__PURE__ */ Object.freeze({
6552
6611
  BRAND,
6553
6612
  ZodBranded,
6554
6613
  ZodPipeline,
6614
+ ZodReadonly,
6555
6615
  custom,
6556
6616
  Schema: ZodType,
6557
6617
  ZodSchema: ZodType,
@@ -9692,6 +9752,7 @@ const annDataConvenienceObsEmbeddingItem = z.object({
9692
9752
  });
9693
9753
  const annDataObsLabels = annDataObs;
9694
9754
  const annDataFeatureLabels = annDataObs;
9755
+ const annDataSampleEdges = annDataObs;
9695
9756
  const annDataObsFeatureMatrix = z.object({
9696
9757
  path: z.string(),
9697
9758
  featureFilterPath: z.string().optional().describe("If the feature index should be filtered, put a boolean column here (analogous to the previous geneFilter option). e.g., var/in_obsm_X_small_matrix"),
@@ -9848,7 +9909,8 @@ z.object({
9848
9909
  obsEmbedding: z.union([
9849
9910
  annDataObsEmbedding,
9850
9911
  z.array(annDataConvenienceObsEmbeddingItem)
9851
- ])
9912
+ ]),
9913
+ sampleEdges: annDataSampleEdges
9852
9914
  }).partial();
9853
9915
  z.object({
9854
9916
  // TODO: should `image` be a special schema
@@ -16696,7 +16758,10 @@ class SampleSetsCsvLoader extends CsvLoader {
16696
16758
  cellSetScores
16697
16759
  ], setsArr);
16698
16760
  const obsSetsMembership = treeToMembershipMap(cellSetsTree);
16699
- return [obsIndex, cellSetsTree, obsSetsMembership];
16761
+ const coordinationValues = {};
16762
+ const newAutoSetColors = initializeCellSetColor(cellSetsTree, []);
16763
+ coordinationValues.sampleSetColor = newAutoSetColors;
16764
+ return [obsIndex, cellSetsTree, obsSetsMembership, coordinationValues];
16700
16765
  }
16701
16766
  async load() {
16702
16767
  const payload = await this.getSourceData().catch((reason) => Promise.resolve(reason));
@@ -16707,14 +16772,15 @@ class SampleSetsCsvLoader extends CsvLoader {
16707
16772
  const [
16708
16773
  obsIndex,
16709
16774
  cellSetsTree,
16710
- obsSetsMembership
16775
+ obsSetsMembership,
16776
+ coordinationValues
16711
16777
  ] = this.loadFromCache(data);
16712
16778
  return Promise.resolve(
16713
16779
  new LoaderResult({
16714
16780
  sampleIndex: obsIndex,
16715
16781
  sampleSets: cellSetsTree,
16716
16782
  sampleSetsMembership: obsSetsMembership
16717
- }, url)
16783
+ }, url, coordinationValues)
16718
16784
  );
16719
16785
  }
16720
16786
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SampleSetsCsv.d.ts","sourceRoot":"","sources":["../../src/csv-loaders/SampleSetsCsv.js"],"names":[],"mappings":"AAIA;IACE,8BAwBC;CAqBF;sBAhDqB,gBAAgB"}
1
+ {"version":3,"file":"SampleSetsCsv.d.ts","sourceRoot":"","sources":["../../src/csv-loaders/SampleSetsCsv.js"],"names":[],"mappings":"AAIA;IACE,8BA6BC;CAsBF;sBAtDqB,gBAAgB"}
@@ -1,5 +1,5 @@
1
1
  import { LoaderResult, AbstractLoaderError } from '@vitessce/vit-s';
2
- import { treeToMembershipMap, dataToCellSetsTree } from '@vitessce/sets-utils';
2
+ import { initializeCellSetColor, treeToMembershipMap, dataToCellSetsTree } from '@vitessce/sets-utils';
3
3
  import CsvLoader from './CsvLoader.js';
4
4
  export default class SampleSetsCsvLoader extends CsvLoader {
5
5
  loadFromCache(data) {
@@ -21,7 +21,11 @@ export default class SampleSetsCsvLoader extends CsvLoader {
21
21
  cellSetScores,
22
22
  ], setsArr);
23
23
  const obsSetsMembership = treeToMembershipMap(cellSetsTree);
24
- return [obsIndex, cellSetsTree, obsSetsMembership];
24
+ const coordinationValues = {};
25
+ // Create a list of sample set objects with color mappings.
26
+ const newAutoSetColors = initializeCellSetColor(cellSetsTree, []);
27
+ coordinationValues.sampleSetColor = newAutoSetColors;
28
+ return [obsIndex, cellSetsTree, obsSetsMembership, coordinationValues];
25
29
  }
26
30
  async load() {
27
31
  const payload = await this.getSourceData().catch(reason => Promise.resolve(reason));
@@ -29,11 +33,11 @@ export default class SampleSetsCsvLoader extends CsvLoader {
29
33
  return Promise.reject(payload);
30
34
  }
31
35
  const { data, url } = payload;
32
- const [obsIndex, cellSetsTree, obsSetsMembership,] = this.loadFromCache(data);
36
+ const [obsIndex, cellSetsTree, obsSetsMembership, coordinationValues,] = this.loadFromCache(data);
33
37
  return Promise.resolve(new LoaderResult({
34
38
  sampleIndex: obsIndex,
35
39
  sampleSets: cellSetsTree,
36
40
  sampleSetsMembership: obsSetsMembership,
37
- }, url));
41
+ }, url, coordinationValues));
38
42
  }
39
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/csv",
3
- "version": "3.4.6",
3
+ "version": "3.4.7",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -18,10 +18,10 @@
18
18
  "dependencies": {
19
19
  "d3-array": "^2.4.0",
20
20
  "d3-dsv": "^1.1.1",
21
- "@vitessce/constants-internal": "3.4.6",
22
- "@vitessce/vit-s": "3.4.6",
23
- "@vitessce/sets-utils": "3.4.6",
24
- "@vitessce/config": "3.4.6"
21
+ "@vitessce/constants-internal": "3.4.7",
22
+ "@vitessce/sets-utils": "3.4.7",
23
+ "@vitessce/vit-s": "3.4.7",
24
+ "@vitessce/config": "3.4.7"
25
25
  },
26
26
  "scripts": {
27
27
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
@@ -1,5 +1,5 @@
1
1
  import { LoaderResult, AbstractLoaderError } from '@vitessce/vit-s';
2
- import { treeToMembershipMap, dataToCellSetsTree } from '@vitessce/sets-utils';
2
+ import { initializeCellSetColor, treeToMembershipMap, dataToCellSetsTree } from '@vitessce/sets-utils';
3
3
  import CsvLoader from './CsvLoader.js';
4
4
 
5
5
  export default class SampleSetsCsvLoader extends CsvLoader {
@@ -26,7 +26,12 @@ export default class SampleSetsCsvLoader extends CsvLoader {
26
26
  cellSetScores,
27
27
  ], setsArr);
28
28
  const obsSetsMembership = treeToMembershipMap(cellSetsTree);
29
- return [obsIndex, cellSetsTree, obsSetsMembership];
29
+
30
+ const coordinationValues = {};
31
+ // Create a list of sample set objects with color mappings.
32
+ const newAutoSetColors = initializeCellSetColor(cellSetsTree, []);
33
+ coordinationValues.sampleSetColor = newAutoSetColors;
34
+ return [obsIndex, cellSetsTree, obsSetsMembership, coordinationValues];
30
35
  }
31
36
 
32
37
  async load() {
@@ -39,13 +44,14 @@ export default class SampleSetsCsvLoader extends CsvLoader {
39
44
  obsIndex,
40
45
  cellSetsTree,
41
46
  obsSetsMembership,
47
+ coordinationValues,
42
48
  ] = this.loadFromCache(data);
43
49
  return Promise.resolve(
44
50
  new LoaderResult({
45
51
  sampleIndex: obsIndex,
46
52
  sampleSets: cellSetsTree,
47
53
  sampleSetsMembership: obsSetsMembership,
48
- }, url),
54
+ }, url, coordinationValues),
49
55
  );
50
56
  }
51
57
  }