@vitessce/scatterplot 3.6.17 → 3.7.0

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.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { B as BaseDecoder } from "./index-DtMt-QI0.js";
2
+ import { B as BaseDecoder } from "./index-3MaQoF6s.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -104846,6 +104846,8 @@ const PIXELATED_TEXTURE_PARAMETERS = {
104846
104846
  [GL$1.TEXTURE_WRAP_T]: GL$1.CLAMP_TO_EDGE
104847
104847
  };
104848
104848
  const GLSL_COLORMAPS = [
104849
+ // NOTE: the ordering of these is important,
104850
+ // as the shader code in bitmask-layer-beta-shaders hardcodes their indices.
104849
104851
  "plasma",
104850
104852
  "viridis",
104851
104853
  "jet",
@@ -105939,22 +105941,22 @@ function addDecoder(cases, importFn) {
105939
105941
  }
105940
105942
  cases.forEach((c2) => registry$1.set(c2, importFn));
105941
105943
  }
105942
- addDecoder([void 0, 1], () => import("./raw-CsQY--F8.js").then((m2) => m2.default));
105943
- addDecoder(5, () => import("./lzw-CalgI7pl.js").then((m2) => m2.default));
105944
+ addDecoder([void 0, 1], () => import("./raw-B5fgnX06.js").then((m2) => m2.default));
105945
+ addDecoder(5, () => import("./lzw-bq1KhCJW.js").then((m2) => m2.default));
105944
105946
  addDecoder(6, () => {
105945
105947
  throw new Error("old style JPEG compression is not supported.");
105946
105948
  });
105947
- addDecoder(7, () => import("./jpeg-C7IlM-Ln.js").then((m2) => m2.default));
105948
- addDecoder([8, 32946], () => import("./deflate-D7v9y_Ec.js").then((m2) => m2.default));
105949
- addDecoder(32773, () => import("./packbits-CZKKaUwh.js").then((m2) => m2.default));
105949
+ addDecoder(7, () => import("./jpeg-Dd3Whsa_.js").then((m2) => m2.default));
105950
+ addDecoder([8, 32946], () => import("./deflate-B_q2mNjQ.js").then((m2) => m2.default));
105951
+ addDecoder(32773, () => import("./packbits-Dhncj7No.js").then((m2) => m2.default));
105950
105952
  addDecoder(
105951
105953
  34887,
105952
- () => import("./lerc-D8906_Qm.js").then(async (m2) => {
105954
+ () => import("./lerc-DG3xbTk6.js").then(async (m2) => {
105953
105955
  await m2.zstd.init();
105954
105956
  return m2;
105955
105957
  }).then((m2) => m2.default)
105956
105958
  );
105957
- addDecoder(50001, () => import("./webimage-AcNWv3Gx.js").then((m2) => m2.default));
105959
+ addDecoder(50001, () => import("./webimage-CWwSjMxu.js").then((m2) => m2.default));
105958
105960
  function decodeRowAcc(row, stride) {
105959
105961
  let length2 = row.length - stride;
105960
105962
  let offset2 = 0;
@@ -119323,7 +119325,7 @@ uniform float channelOpacities[7];
119323
119325
  uniform bool channelIsStaticColorMode[7]; // TODO: should this be a single float?
119324
119326
  uniform bool channelIsSetColorMode[7]; // TODO: should this be a single float?
119325
119327
 
119326
- // TODO: can array of tuples/vec2 be used?
119328
+ uniform int channelColormapFuncIndices[7];
119327
119329
  uniform float channelColormapRangeStarts[7];
119328
119330
  uniform float channelColormapRangeEnds[7];
119329
119331
 
@@ -119389,7 +119391,30 @@ vec3 sampleAndGetData(sampler2D dataTex, vec2 coord, bool isFilled, float stroke
119389
119391
  return vec3(clampedSampledData * float(isOn), sampledData, float(isEdge));
119390
119392
  }
119391
119393
 
119392
- vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
119394
+ vec3 colormapFunc(float clampedScaledExpressionValue, int colormapIndex) {
119395
+ // Map indices of GLSL_COLORMAPS array to their function calls.
119396
+ // GLSL_COLORMAPS is defined in ./constants.js and needs to stay manually synced.
119397
+ // 0: 'plasma',
119398
+ // 1: 'viridis',
119399
+ // 2: 'jet',
119400
+ // 3: 'greys',
119401
+
119402
+ if (colormapIndex <= 0) {
119403
+ // This should also match -1, to account for a failed Array.indexOf lookup.
119404
+ return plasma(clampedScaledExpressionValue).rgb;
119405
+ }
119406
+ if (colormapIndex == 1) {
119407
+ return viridis(clampedScaledExpressionValue).rgb;
119408
+ }
119409
+ if (colormapIndex == 2) {
119410
+ return jet(clampedScaledExpressionValue).rgb;
119411
+ }
119412
+ if (colormapIndex == 3) {
119413
+ return greys(clampedScaledExpressionValue).rgb;
119414
+ }
119415
+ }
119416
+
119417
+ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, int colormapFuncIndex, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
119393
119418
  float clampedSampledDataAndIsOn = sampledDataAndIsEdge.x;
119394
119419
  float sampledData = sampledDataAndIsEdge.y;
119395
119420
  float isEdge = sampledDataAndIsEdge.z;
@@ -119433,7 +119458,7 @@ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channel
119433
119458
  }
119434
119459
 
119435
119460
 
119436
- vec4 sampledColor = (1. - (float(isStaticColorMode) + float(isSetColorMode))) * vec4(COLORMAP_FUNC(clamp(scaledExpressionValue, 0.0, 1.0)).rgb, channelOpacity) + float(isStaticColorMode) * vec4(channelColor.rgb, channelOpacity) + float(isSetColorMode) * vec4(setColor, channelOpacity);
119461
+ vec4 sampledColor = (1. - (float(isStaticColorMode) + float(isSetColorMode))) * vec4(colormapFunc(clamp(scaledExpressionValue, 0.0, 1.0), colormapFuncIndex).rgb, channelOpacity) + float(isStaticColorMode) * vec4(channelColor.rgb, channelOpacity) + float(isSetColorMode) * vec4(setColor, channelOpacity);
119437
119462
  // Only return a color if the data is non-zero.
119438
119463
 
119439
119464
  return clampedSampledDataAndIsOn * isEdge * sampledColor;
@@ -119449,15 +119474,15 @@ void main() {
119449
119474
  vec3 dat4 = sampleAndGetData(channel4, vTexCoord, channelsFilled[4], channelStrokeWidths[4], channelsVisible[4]);
119450
119475
  vec3 dat5 = sampleAndGetData(channel5, vTexCoord, channelsFilled[5], channelStrokeWidths[5], channelsVisible[5]);
119451
119476
  vec3 dat6 = sampleAndGetData(channel6, vTexCoord, channelsFilled[6], channelStrokeWidths[6], channelsVisible[6]);
119452
-
119453
- vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
119454
- vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
119455
- vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
119456
- vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
119457
- vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
119458
- vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
119459
- vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
119460
-
119477
+
119478
+ vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapFuncIndices[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
119479
+ vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapFuncIndices[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
119480
+ vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapFuncIndices[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
119481
+ vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapFuncIndices[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
119482
+ vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapFuncIndices[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
119483
+ vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapFuncIndices[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
119484
+ vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapFuncIndices[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
119485
+
119461
119486
  // If all of the channels are "empty", then discard this pixel so that it is not considered during picking.
119462
119487
  float emptyDat = 0.;
119463
119488
  if(dat0.x == emptyDat && dat1.x == emptyDat && dat2.x == emptyDat && dat3.x == emptyDat && dat4.x == emptyDat && dat5.x == emptyDat && dat6.x == emptyDat) {
@@ -119896,14 +119921,10 @@ const defaultProps$2 = {
119896
119921
  class BitmaskLayer2 extends XRLayer {
119897
119922
  // eslint-disable-next-line class-methods-use-this
119898
119923
  getShaders() {
119899
- const { colormap } = this.props;
119900
119924
  return {
119901
119925
  fs,
119902
119926
  vs,
119903
- modules: [project32, picking],
119904
- defines: {
119905
- [COLORMAP_SHADER_PLACEHOLDER]: GLSL_COLORMAPS.includes(colormap) ? colormap : GLSL_COLORMAP_DEFAULT
119906
- }
119927
+ modules: [project32, picking]
119907
119928
  };
119908
119929
  }
119909
119930
  /**
@@ -119962,8 +119983,6 @@ class BitmaskLayer2 extends XRLayer {
119962
119983
  channelOpacities,
119963
119984
  channelColors,
119964
119985
  channelsVisible,
119965
- // TODO: use `channelFeatureValueColormaps` in shader,
119966
- // figure out how to call multiple GLSL colormap functions
119967
119986
  channelFeatureValueColormaps,
119968
119987
  channelFeatureValueColormapRanges,
119969
119988
  channelIsStaticColorMode,
@@ -120024,6 +120043,12 @@ class BitmaskLayer2 extends XRLayer {
120024
120043
  // There are six texture entries on the shaders
120025
120044
  MAX_CHANNELS - channelStrokeWidths.length
120026
120045
  ),
120046
+ channelColormapFuncIndices: padWithDefault(
120047
+ channelFeatureValueColormaps.map((d) => GLSL_COLORMAPS.indexOf(d)),
120048
+ 0,
120049
+ // There are six texture entries on the shaders
120050
+ MAX_CHANNELS - channelFeatureValueColormaps.length
120051
+ ),
120027
120052
  channelColormapRangeStarts: padWithDefault(
120028
120053
  channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[0]) || 0),
120029
120054
  0,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A, E, S, a, b, f, e, d, c } from "./index-DtMt-QI0.js";
1
+ import { A, E, S, a, b, f, e, d, c } from "./index-3MaQoF6s.js";
2
2
  export {
3
3
  A as AbstractSpatialOrScatterplot,
4
4
  E as EmptyMessage,
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-DtMt-QI0.js";
1
+ import { B as BaseDecoder } from "./index-3MaQoF6s.js";
2
2
  const dctZigZag = new Int32Array([
3
3
  0,
4
4
  1,
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-DtMt-QI0.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-3MaQoF6s.js";
3
3
  const LercParameters = {
4
4
  AddCompression: 1
5
5
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-DtMt-QI0.js";
1
+ import { B as BaseDecoder } from "./index-3MaQoF6s.js";
2
2
  const MIN_BITS = 9;
3
3
  const CLEAR_CODE = 256;
4
4
  const EOI_CODE = 257;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-DtMt-QI0.js";
1
+ import { B as BaseDecoder } from "./index-3MaQoF6s.js";
2
2
  class PackbitsDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  const dataView = new DataView(buffer);
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-DtMt-QI0.js";
1
+ import { B as BaseDecoder } from "./index-3MaQoF6s.js";
2
2
  class RawDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  return buffer;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-DtMt-QI0.js";
1
+ import { B as BaseDecoder } from "./index-3MaQoF6s.js";
2
2
  class WebImageDecoder extends BaseDecoder {
3
3
  constructor() {
4
4
  super();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/scatterplot",
3
- "version": "3.6.17",
3
+ "version": "3.7.0",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -21,27 +21,27 @@
21
21
  "d3-quadtree": "^1.0.7",
22
22
  "lodash-es": "^4.17.21",
23
23
  "react-aria": "^3.28.0",
24
- "@vitessce/styles": "3.6.17",
25
- "@vitessce/constants-internal": "3.6.17",
26
- "@vitessce/gl": "3.6.17",
27
- "@vitessce/icons": "3.6.17",
28
- "@vitessce/tooltip": "3.6.17",
29
- "@vitessce/utils": "3.6.17",
30
- "@vitessce/vit-s": "3.6.17"
24
+ "@vitessce/styles": "3.7.0",
25
+ "@vitessce/constants-internal": "3.7.0",
26
+ "@vitessce/gl": "3.7.0",
27
+ "@vitessce/icons": "3.7.0",
28
+ "@vitessce/tooltip": "3.7.0",
29
+ "@vitessce/utils": "3.7.0",
30
+ "@vitessce/vit-s": "3.7.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@testing-library/jest-dom": "^6.6.3",
34
34
  "@testing-library/react": "^16.3.0",
35
35
  "react": "^18.0.0",
36
36
  "react-dom": "^18.0.0",
37
- "vite": "^6.3.5",
37
+ "vite": "^7.0.0",
38
38
  "vitest": "^3.1.4"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
42
42
  },
43
43
  "scripts": {
44
- "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
44
+ "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.mjs",
45
45
  "test": "pnpm exec vitest --run"
46
46
  },
47
47
  "module": "dist/index.js",