@vitessce/csv 3.3.3 → 3.3.4

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 +128 -128
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -907,6 +907,134 @@ const PALETTE = [
907
907
  [136, 34, 85],
908
908
  [170, 68, 153]
909
909
  ];
910
+ class CoordinationLevel {
911
+ constructor(value) {
912
+ this.value = value;
913
+ this.cachedValue = null;
914
+ }
915
+ setCached(processedLevel) {
916
+ this.cachedValue = processedLevel;
917
+ }
918
+ getCached() {
919
+ return this.cachedValue;
920
+ }
921
+ isCached() {
922
+ return this.cachedValue !== null;
923
+ }
924
+ }
925
+ function CL(value) {
926
+ return new CoordinationLevel(value);
927
+ }
928
+ class ObsSpotsCsvLoader extends CsvLoader {
929
+ loadFromCache(data) {
930
+ if (this.cachedResult) {
931
+ return this.cachedResult;
932
+ }
933
+ const { obsIndex: indexCol, obsSpots: [xCol, yCol] } = this.options;
934
+ const obsIndex = data.map((d) => String(d[indexCol]));
935
+ const obsLocationsX = Float32Array.from(data.map((d) => d[xCol]));
936
+ const obsLocationsY = Float32Array.from(data.map((d) => d[yCol]));
937
+ const obsSpots = {
938
+ data: [obsLocationsX, obsLocationsY],
939
+ shape: [2, obsLocationsX.length]
940
+ };
941
+ this.cachedResult = { obsIndex, obsSpots };
942
+ return this.cachedResult;
943
+ }
944
+ async load() {
945
+ const payload = await this.getSourceData().catch((reason) => Promise.resolve(reason));
946
+ if (payload instanceof AbstractLoaderError) {
947
+ return Promise.reject(payload);
948
+ }
949
+ const coordinationValues = {
950
+ spotLayer: CL({
951
+ obsType: "spot",
952
+ // obsColorEncoding: 'spatialLayerColor',
953
+ // spatialLayerColor: [255, 255, 255],
954
+ spatialLayerVisible: true,
955
+ spatialLayerOpacity: 1,
956
+ spatialSpotRadius: 10
957
+ // TODO: spatialSpotRadiusUnit: 'µm' or 'um'
958
+ // after resolving https://github.com/vitessce/vitessce/issues/1760
959
+ // featureValueColormapRange: [0, 1],
960
+ // obsHighlight: null,
961
+ // obsSetColor: null,
962
+ // obsSetSelection: null,
963
+ // additionalObsSets: null,
964
+ })
965
+ };
966
+ const { data, url } = payload;
967
+ const result = this.loadFromCache(data);
968
+ return Promise.resolve(new LoaderResult(
969
+ result,
970
+ url,
971
+ coordinationValues
972
+ ));
973
+ }
974
+ }
975
+ class ObsPointsCsvLoader extends CsvLoader {
976
+ loadFromCache(data) {
977
+ if (this.cachedResult) {
978
+ return this.cachedResult;
979
+ }
980
+ const { obsIndex: indexCol, obsPoints: [xCol, yCol] } = this.options;
981
+ const obsIndex = data.map((d) => String(d[indexCol]));
982
+ const obsLocationsX = Float32Array.from(data.map((d) => d[xCol]));
983
+ const obsLocationsY = Float32Array.from(data.map((d) => d[yCol]));
984
+ const obsPoints = {
985
+ data: [obsLocationsX, obsLocationsY],
986
+ shape: [2, obsLocationsX.length]
987
+ };
988
+ this.cachedResult = { obsIndex, obsPoints };
989
+ return this.cachedResult;
990
+ }
991
+ async load() {
992
+ const payload = await this.getSourceData().catch((reason) => Promise.resolve(reason));
993
+ if (payload instanceof AbstractLoaderError) {
994
+ return Promise.reject(payload);
995
+ }
996
+ const coordinationValues = {
997
+ pointLayer: CL({
998
+ obsType: "point",
999
+ // obsColorEncoding: 'spatialLayerColor',
1000
+ // spatialLayerColor: [255, 255, 255],
1001
+ spatialLayerVisible: true,
1002
+ spatialLayerOpacity: 1
1003
+ // TODO: support a point radius?
1004
+ // featureValueColormapRange: [0, 1],
1005
+ // obsHighlight: null,
1006
+ // obsSetColor: null,
1007
+ // obsSetSelection: null,
1008
+ // additionalObsSets: null,
1009
+ // obsLabelsType: null,
1010
+ })
1011
+ };
1012
+ const { data, url } = payload;
1013
+ const result = this.loadFromCache(data);
1014
+ return Promise.resolve(new LoaderResult(
1015
+ result,
1016
+ url,
1017
+ coordinationValues
1018
+ ));
1019
+ }
1020
+ }
1021
+ class ObsLocationsCsvLoader extends CsvLoader {
1022
+ loadFromCache(data) {
1023
+ if (this.cachedResult) {
1024
+ return this.cachedResult;
1025
+ }
1026
+ const { obsIndex: indexCol, obsLocations: [xCol, yCol] } = this.options;
1027
+ const obsIndex = data.map((d) => String(d[indexCol]));
1028
+ const obsLocationsX = Float32Array.from(data.map((d) => d[xCol]));
1029
+ const obsLocationsY = Float32Array.from(data.map((d) => d[yCol]));
1030
+ const obsLocations = {
1031
+ data: [obsLocationsX, obsLocationsY],
1032
+ shape: [2, obsLocationsX.length]
1033
+ };
1034
+ this.cachedResult = { obsIndex, obsLocations };
1035
+ return this.cachedResult;
1036
+ }
1037
+ }
910
1038
  let getRandomValues;
911
1039
  const rnds8 = new Uint8Array(16);
912
1040
  function rng() {
@@ -16440,134 +16568,6 @@ function interpolateSequentialMulti(range2) {
16440
16568
  }
16441
16569
  interpolateRgbBasis(schemeRdBu);
16442
16570
  interpolateSequentialMulti(schemePlasma);
16443
- class CoordinationLevel {
16444
- constructor(value) {
16445
- this.value = value;
16446
- this.cachedValue = null;
16447
- }
16448
- setCached(processedLevel) {
16449
- this.cachedValue = processedLevel;
16450
- }
16451
- getCached() {
16452
- return this.cachedValue;
16453
- }
16454
- isCached() {
16455
- return this.cachedValue !== null;
16456
- }
16457
- }
16458
- function CL(value) {
16459
- return new CoordinationLevel(value);
16460
- }
16461
- class ObsSpotsCsvLoader extends CsvLoader {
16462
- loadFromCache(data) {
16463
- if (this.cachedResult) {
16464
- return this.cachedResult;
16465
- }
16466
- const { obsIndex: indexCol, obsSpots: [xCol, yCol] } = this.options;
16467
- const obsIndex = data.map((d) => String(d[indexCol]));
16468
- const obsLocationsX = Float32Array.from(data.map((d) => d[xCol]));
16469
- const obsLocationsY = Float32Array.from(data.map((d) => d[yCol]));
16470
- const obsSpots = {
16471
- data: [obsLocationsX, obsLocationsY],
16472
- shape: [2, obsLocationsX.length]
16473
- };
16474
- this.cachedResult = { obsIndex, obsSpots };
16475
- return this.cachedResult;
16476
- }
16477
- async load() {
16478
- const payload = await this.getSourceData().catch((reason) => Promise.resolve(reason));
16479
- if (payload instanceof AbstractLoaderError) {
16480
- return Promise.reject(payload);
16481
- }
16482
- const coordinationValues = {
16483
- spotLayer: CL({
16484
- obsType: "spot",
16485
- // obsColorEncoding: 'spatialLayerColor',
16486
- // spatialLayerColor: [255, 255, 255],
16487
- spatialLayerVisible: true,
16488
- spatialLayerOpacity: 1,
16489
- spatialSpotRadius: 10
16490
- // TODO: spatialSpotRadiusUnit: 'µm' or 'um'
16491
- // after resolving https://github.com/vitessce/vitessce/issues/1760
16492
- // featureValueColormapRange: [0, 1],
16493
- // obsHighlight: null,
16494
- // obsSetColor: null,
16495
- // obsSetSelection: null,
16496
- // additionalObsSets: null,
16497
- })
16498
- };
16499
- const { data, url } = payload;
16500
- const result = this.loadFromCache(data);
16501
- return Promise.resolve(new LoaderResult(
16502
- result,
16503
- url,
16504
- coordinationValues
16505
- ));
16506
- }
16507
- }
16508
- class ObsPointsCsvLoader extends CsvLoader {
16509
- loadFromCache(data) {
16510
- if (this.cachedResult) {
16511
- return this.cachedResult;
16512
- }
16513
- const { obsIndex: indexCol, obsPoints: [xCol, yCol] } = this.options;
16514
- const obsIndex = data.map((d) => String(d[indexCol]));
16515
- const obsLocationsX = Float32Array.from(data.map((d) => d[xCol]));
16516
- const obsLocationsY = Float32Array.from(data.map((d) => d[yCol]));
16517
- const obsPoints = {
16518
- data: [obsLocationsX, obsLocationsY],
16519
- shape: [2, obsLocationsX.length]
16520
- };
16521
- this.cachedResult = { obsIndex, obsPoints };
16522
- return this.cachedResult;
16523
- }
16524
- async load() {
16525
- const payload = await this.getSourceData().catch((reason) => Promise.resolve(reason));
16526
- if (payload instanceof AbstractLoaderError) {
16527
- return Promise.reject(payload);
16528
- }
16529
- const coordinationValues = {
16530
- pointLayer: CL({
16531
- obsType: "point",
16532
- // obsColorEncoding: 'spatialLayerColor',
16533
- // spatialLayerColor: [255, 255, 255],
16534
- spatialLayerVisible: true,
16535
- spatialLayerOpacity: 1
16536
- // TODO: support a point radius?
16537
- // featureValueColormapRange: [0, 1],
16538
- // obsHighlight: null,
16539
- // obsSetColor: null,
16540
- // obsSetSelection: null,
16541
- // additionalObsSets: null,
16542
- // obsLabelsType: null,
16543
- })
16544
- };
16545
- const { data, url } = payload;
16546
- const result = this.loadFromCache(data);
16547
- return Promise.resolve(new LoaderResult(
16548
- result,
16549
- url,
16550
- coordinationValues
16551
- ));
16552
- }
16553
- }
16554
- class ObsLocationsCsvLoader extends CsvLoader {
16555
- loadFromCache(data) {
16556
- if (this.cachedResult) {
16557
- return this.cachedResult;
16558
- }
16559
- const { obsIndex: indexCol, obsLocations: [xCol, yCol] } = this.options;
16560
- const obsIndex = data.map((d) => String(d[indexCol]));
16561
- const obsLocationsX = Float32Array.from(data.map((d) => d[xCol]));
16562
- const obsLocationsY = Float32Array.from(data.map((d) => d[yCol]));
16563
- const obsLocations = {
16564
- data: [obsLocationsX, obsLocationsY],
16565
- shape: [2, obsLocationsX.length]
16566
- };
16567
- this.cachedResult = { obsIndex, obsLocations };
16568
- return this.cachedResult;
16569
- }
16570
- }
16571
16571
  class ObsSetsCsvLoader extends CsvLoader {
16572
16572
  loadFromCache(data) {
16573
16573
  if (this.cachedResult) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/csv",
3
- "version": "3.3.3",
3
+ "version": "3.3.4",
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.3.3",
22
- "@vitessce/sets-utils": "3.3.3",
23
- "@vitessce/vit-s": "3.3.3",
24
- "@vitessce/config": "3.3.3"
21
+ "@vitessce/constants-internal": "3.3.4",
22
+ "@vitessce/vit-s": "3.3.4",
23
+ "@vitessce/config": "3.3.4",
24
+ "@vitessce/sets-utils": "3.3.4"
25
25
  },
26
26
  "scripts": {
27
27
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",