@vitessce/statistical-plots 3.6.18 → 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-C8VlTSXb.js";
2
+ import { B as BaseDecoder } from "./index-CA8GNk6M.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -177645,6 +177645,8 @@ const PIXELATED_TEXTURE_PARAMETERS = {
177645
177645
  [GL$1.TEXTURE_WRAP_T]: GL$1.CLAMP_TO_EDGE
177646
177646
  };
177647
177647
  const GLSL_COLORMAPS = [
177648
+ // NOTE: the ordering of these is important,
177649
+ // as the shader code in bitmask-layer-beta-shaders hardcodes their indices.
177648
177650
  "plasma",
177649
177651
  "viridis",
177650
177652
  "jet",
@@ -178737,22 +178739,22 @@ function addDecoder(cases2, importFn) {
178737
178739
  }
178738
178740
  cases2.forEach((c2) => registry$1.set(c2, importFn));
178739
178741
  }
178740
- addDecoder([void 0, 1], () => import("./raw-BjsOfrZJ.js").then((m2) => m2.default));
178741
- addDecoder(5, () => import("./lzw-H16ZlUv0.js").then((m2) => m2.default));
178742
+ addDecoder([void 0, 1], () => import("./raw-CmQNUdnh.js").then((m2) => m2.default));
178743
+ addDecoder(5, () => import("./lzw-CCOmLsId.js").then((m2) => m2.default));
178742
178744
  addDecoder(6, () => {
178743
178745
  throw new Error("old style JPEG compression is not supported.");
178744
178746
  });
178745
- addDecoder(7, () => import("./jpeg-DI6r1Qu1.js").then((m2) => m2.default));
178746
- addDecoder([8, 32946], () => import("./deflate-DaFHdnIz.js").then((m2) => m2.default));
178747
- addDecoder(32773, () => import("./packbits-3-1YYdxN.js").then((m2) => m2.default));
178747
+ addDecoder(7, () => import("./jpeg-BzxWgvmY.js").then((m2) => m2.default));
178748
+ addDecoder([8, 32946], () => import("./deflate-B5Mg3kwY.js").then((m2) => m2.default));
178749
+ addDecoder(32773, () => import("./packbits-1HUBp5DU.js").then((m2) => m2.default));
178748
178750
  addDecoder(
178749
178751
  34887,
178750
- () => import("./lerc-CSlbF9fX.js").then(async (m2) => {
178752
+ () => import("./lerc-DD_Qgv9w.js").then(async (m2) => {
178751
178753
  await m2.zstd.init();
178752
178754
  return m2;
178753
178755
  }).then((m2) => m2.default)
178754
178756
  );
178755
- addDecoder(50001, () => import("./webimage-U9BOPX4n.js").then((m2) => m2.default));
178757
+ addDecoder(50001, () => import("./webimage-Bl4VBRx9.js").then((m2) => m2.default));
178756
178758
  function decodeRowAcc(row, stride) {
178757
178759
  let length2 = row.length - stride;
178758
178760
  let offset2 = 0;
@@ -188535,7 +188537,7 @@ uniform float channelOpacities[7];
188535
188537
  uniform bool channelIsStaticColorMode[7]; // TODO: should this be a single float?
188536
188538
  uniform bool channelIsSetColorMode[7]; // TODO: should this be a single float?
188537
188539
 
188538
- // TODO: can array of tuples/vec2 be used?
188540
+ uniform int channelColormapFuncIndices[7];
188539
188541
  uniform float channelColormapRangeStarts[7];
188540
188542
  uniform float channelColormapRangeEnds[7];
188541
188543
 
@@ -188601,7 +188603,30 @@ vec3 sampleAndGetData(sampler2D dataTex, vec2 coord, bool isFilled, float stroke
188601
188603
  return vec3(clampedSampledData * float(isOn), sampledData, float(isEdge));
188602
188604
  }
188603
188605
 
188604
- vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
188606
+ vec3 colormapFunc(float clampedScaledExpressionValue, int colormapIndex) {
188607
+ // Map indices of GLSL_COLORMAPS array to their function calls.
188608
+ // GLSL_COLORMAPS is defined in ./constants.js and needs to stay manually synced.
188609
+ // 0: 'plasma',
188610
+ // 1: 'viridis',
188611
+ // 2: 'jet',
188612
+ // 3: 'greys',
188613
+
188614
+ if (colormapIndex <= 0) {
188615
+ // This should also match -1, to account for a failed Array.indexOf lookup.
188616
+ return plasma(clampedScaledExpressionValue).rgb;
188617
+ }
188618
+ if (colormapIndex == 1) {
188619
+ return viridis(clampedScaledExpressionValue).rgb;
188620
+ }
188621
+ if (colormapIndex == 2) {
188622
+ return jet(clampedScaledExpressionValue).rgb;
188623
+ }
188624
+ if (colormapIndex == 3) {
188625
+ return greys(clampedScaledExpressionValue).rgb;
188626
+ }
188627
+ }
188628
+
188629
+ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, int colormapFuncIndex, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
188605
188630
  float clampedSampledDataAndIsOn = sampledDataAndIsEdge.x;
188606
188631
  float sampledData = sampledDataAndIsEdge.y;
188607
188632
  float isEdge = sampledDataAndIsEdge.z;
@@ -188645,7 +188670,7 @@ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channel
188645
188670
  }
188646
188671
 
188647
188672
 
188648
- 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);
188673
+ 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);
188649
188674
  // Only return a color if the data is non-zero.
188650
188675
 
188651
188676
  return clampedSampledDataAndIsOn * isEdge * sampledColor;
@@ -188661,15 +188686,15 @@ void main() {
188661
188686
  vec3 dat4 = sampleAndGetData(channel4, vTexCoord, channelsFilled[4], channelStrokeWidths[4], channelsVisible[4]);
188662
188687
  vec3 dat5 = sampleAndGetData(channel5, vTexCoord, channelsFilled[5], channelStrokeWidths[5], channelsVisible[5]);
188663
188688
  vec3 dat6 = sampleAndGetData(channel6, vTexCoord, channelsFilled[6], channelStrokeWidths[6], channelsVisible[6]);
188664
-
188665
- vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
188666
- vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
188667
- vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
188668
- vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
188669
- vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
188670
- vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
188671
- vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
188672
-
188689
+
188690
+ vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapFuncIndices[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
188691
+ vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapFuncIndices[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
188692
+ vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapFuncIndices[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
188693
+ vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapFuncIndices[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
188694
+ vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapFuncIndices[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
188695
+ vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapFuncIndices[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
188696
+ vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapFuncIndices[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
188697
+
188673
188698
  // If all of the channels are "empty", then discard this pixel so that it is not considered during picking.
188674
188699
  float emptyDat = 0.;
188675
188700
  if(dat0.x == emptyDat && dat1.x == emptyDat && dat2.x == emptyDat && dat3.x == emptyDat && dat4.x == emptyDat && dat5.x == emptyDat && dat6.x == emptyDat) {
@@ -189158,14 +189183,10 @@ const defaultProps$1 = {
189158
189183
  class BitmaskLayer2 extends XRLayer {
189159
189184
  // eslint-disable-next-line class-methods-use-this
189160
189185
  getShaders() {
189161
- const { colormap } = this.props;
189162
189186
  return {
189163
189187
  fs,
189164
189188
  vs,
189165
- modules: [project32, picking],
189166
- defines: {
189167
- [COLORMAP_SHADER_PLACEHOLDER]: GLSL_COLORMAPS.includes(colormap) ? colormap : GLSL_COLORMAP_DEFAULT
189168
- }
189189
+ modules: [project32, picking]
189169
189190
  };
189170
189191
  }
189171
189192
  /**
@@ -189224,8 +189245,6 @@ class BitmaskLayer2 extends XRLayer {
189224
189245
  channelOpacities,
189225
189246
  channelColors,
189226
189247
  channelsVisible,
189227
- // TODO: use `channelFeatureValueColormaps` in shader,
189228
- // figure out how to call multiple GLSL colormap functions
189229
189248
  channelFeatureValueColormaps,
189230
189249
  channelFeatureValueColormapRanges,
189231
189250
  channelIsStaticColorMode,
@@ -189286,6 +189305,12 @@ class BitmaskLayer2 extends XRLayer {
189286
189305
  // There are six texture entries on the shaders
189287
189306
  MAX_CHANNELS - channelStrokeWidths.length
189288
189307
  ),
189308
+ channelColormapFuncIndices: padWithDefault(
189309
+ channelFeatureValueColormaps.map((d) => GLSL_COLORMAPS.indexOf(d)),
189310
+ 0,
189311
+ // There are six texture entries on the shaders
189312
+ MAX_CHANNELS - channelFeatureValueColormaps.length
189313
+ ),
189289
189314
  channelColormapRangeStarts: padWithDefault(
189290
189315
  channelFeatureValueColormapRanges.map((r3) => (r3 == null ? void 0 : r3[0]) || 0),
189291
189316
  0,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b, f, C, e, a, i, D, h, E, F, c, d, T, V } from "./index-C8VlTSXb.js";
1
+ import { b, f, C, e, a, i, D, h, E, F, c, d, T, V } from "./index-CA8GNk6M.js";
2
2
  export {
3
3
  b as CellSetCompositionBarPlotSubscriber,
4
4
  f as CellSetExpressionPlot,
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-C8VlTSXb.js";
1
+ import { B as BaseDecoder } from "./index-CA8GNk6M.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-C8VlTSXb.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-CA8GNk6M.js";
3
3
  const LercParameters = {
4
4
  AddCompression: 1
5
5
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-C8VlTSXb.js";
1
+ import { B as BaseDecoder } from "./index-CA8GNk6M.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-C8VlTSXb.js";
1
+ import { B as BaseDecoder } from "./index-CA8GNk6M.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-C8VlTSXb.js";
1
+ import { B as BaseDecoder } from "./index-CA8GNk6M.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-C8VlTSXb.js";
1
+ import { B as BaseDecoder } from "./index-CA8GNk6M.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/statistical-plots",
3
- "version": "3.6.18",
3
+ "version": "3.7.0",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -28,25 +28,25 @@
28
28
  "react-aria": "^3.28.0",
29
29
  "internmap": "^2.0.3",
30
30
  "uuid": "^9.0.0",
31
- "@vitessce/styles": "3.6.18",
32
- "@vitessce/constants-internal": "3.6.18",
33
- "@vitessce/sets-utils": "3.6.18",
34
- "@vitessce/utils": "3.6.18",
35
- "@vitessce/vega": "3.6.18",
36
- "@vitessce/vit-s": "3.6.18",
37
- "@vitessce/gl": "3.6.18"
31
+ "@vitessce/styles": "3.7.0",
32
+ "@vitessce/constants-internal": "3.7.0",
33
+ "@vitessce/sets-utils": "3.7.0",
34
+ "@vitessce/utils": "3.7.0",
35
+ "@vitessce/vega": "3.7.0",
36
+ "@vitessce/vit-s": "3.7.0",
37
+ "@vitessce/gl": "3.7.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "react": "^18.0.0",
41
41
  "react-dom": "^18.0.0",
42
- "vite": "^6.3.5",
42
+ "vite": "^7.0.0",
43
43
  "vitest": "^3.1.4"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
47
47
  },
48
48
  "scripts": {
49
- "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
49
+ "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.mjs",
50
50
  "test": "pnpm exec vitest --run"
51
51
  },
52
52
  "module": "dist/index.js",