@vitessce/heatmap 3.6.18 → 3.7.1

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-gbnJAInw.js";
2
+ import { B as BaseDecoder } from "./index-BDT04sKA.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -10097,6 +10097,7 @@ const COMPONENT_COORDINATION_TYPES = {
10097
10097
  CoordinationType$1.SPATIAL_ROTATION_Y,
10098
10098
  CoordinationType$1.SPATIAL_ROTATION_Z,
10099
10099
  CoordinationType$1.SPATIAL_AXIS_FIXED,
10100
+ CoordinationType$1.SPATIAL_ROTATION_ORBIT,
10100
10101
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
10101
10102
  CoordinationType$1.SPATIAL_ZOOM,
10102
10103
  CoordinationType$1.OBS_FILTER,
@@ -10104,14 +10105,11 @@ const COMPONENT_COORDINATION_TYPES = {
10104
10105
  CoordinationType$1.OBS_SET_SELECTION,
10105
10106
  CoordinationType$1.OBS_SET_FILTER,
10106
10107
  CoordinationType$1.OBS_SET_HIGHLIGHT,
10107
- CoordinationType$1.OBS_SET_COLOR,
10108
10108
  CoordinationType$1.OBS_TYPE,
10109
- CoordinationType$1.ADDITIONAL_OBS_SETS,
10110
10109
  CoordinationType$1.OBS_SET_COLOR,
10111
10110
  CoordinationType$1.OBS_COLOR_ENCODING,
10112
- CoordinationType$1.OBS_SET_SELECTION,
10113
10111
  CoordinationType$1.EMBEDDING_TYPE,
10114
- CoordinationType$1.OBS_COLOR_ENCODING,
10112
+ CoordinationType$1.ADDITIONAL_OBS_SETS,
10115
10113
  CoordinationType$1.TOOLTIPS_VISIBLE
10116
10114
  ],
10117
10115
  [ViewType$1.SCATTERPLOT]: [
@@ -33632,7 +33630,7 @@ function combineMissings(missings, featureAggregationStrategy) {
33632
33630
  return null;
33633
33631
  }
33634
33632
  function Legend(props) {
33635
- const { visible: visibleProp, positionRelative = false, highContrast = false, obsType, featureValueType, considerSelections = true, obsColorEncoding, featureSelection, featureLabelsMap, featureValueColormap, featureValueColormapRange, spatialChannelColor, spatialLayerColor, obsSetSelection, obsSetColor, featureAggregationStrategy, extent: extent2, missing, width: width2 = 100, height: height2 = 36, theme, showObsLabel = false, pointsVisible = true, contoursVisible = false, contoursFilled, contourPercentiles, contourThresholds } = props;
33633
+ const { visible: visibleProp, positionRelative = false, highContrast = false, obsType, featureValueType, considerSelections = true, obsColorEncoding, featureSelection, featureLabelsMap, featureValueColormap, featureValueColormapRange, spatialChannelColor, spatialLayerColor, obsSetSelection, obsSetColor, featureAggregationStrategy, extent: extent2, missing, width: width2 = 100, height: height2 = 36, maxHeight: maxHeight2 = null, theme, showObsLabel = false, pointsVisible = true, contoursVisible = false, contoursFilled, contourPercentiles, contourThresholds } = props;
33636
33634
  const svgRef = useRef();
33637
33635
  const { classes } = useStyles$2();
33638
33636
  const isDarkTheme = theme === "dark";
@@ -33644,6 +33642,8 @@ function Legend(props) {
33644
33642
  const visible = visibleProp && (!considerSelections || obsColorEncoding === "geneSelection" && featureSelection && Array.isArray(featureSelection) && featureSelection.length >= 1 || isSetColor && (obsSetSelection == null ? void 0 : obsSetSelection.length) > 0 && (obsSetColor == null ? void 0 : obsSetColor.length) > 0 || isStaticColor);
33645
33643
  const levelZeroNames = useMemo(() => Array.from(new Set((obsSetSelection == null ? void 0 : obsSetSelection.map((setPath) => setPath[0])) || [])), [obsSetSelection]);
33646
33644
  const dynamicHeight = isSetColor && obsSetSelection ? levelZeroNames.length * titleHeight + (obsSetSelection == null ? void 0 : obsSetSelection.length) * (rectHeight + rectMarginY) : height2 + (!pointsVisible && contoursVisible ? 25 : 0);
33645
+ const availHeight = maxHeight2 !== null ? Math.max(0, maxHeight2 - 4) : Infinity;
33646
+ const needsScroll = Number.isFinite(availHeight) && dynamicHeight > availHeight + 1;
33647
33647
  useEffect(() => {
33648
33648
  const domElement = svgRef.current;
33649
33649
  const foregroundColor = highContrast ? "black" : isDarkTheme ? "white" : "black";
@@ -33776,7 +33776,9 @@ function Legend(props) {
33776
33776
  [classes.legendHighContrast]: highContrast,
33777
33777
  [classes.legendLowContrast]: !highContrast,
33778
33778
  [classes.legendInvisible]: !visible
33779
- }), children: jsxRuntimeExports.jsx("svg", { ref: svgRef, style: {
33779
+ }), style: {
33780
+ ...needsScroll ? { maxHeight: `${Math.floor(availHeight)}px`, overflowY: "auto" } : { maxHeight: void 0, overflowY: "visible" }
33781
+ }, children: jsxRuntimeExports.jsx("svg", { ref: svgRef, style: {
33780
33782
  width: `${width2}px`,
33781
33783
  height: `${dynamicHeight}px`
33782
33784
  } }) });
@@ -136708,6 +136710,8 @@ const PIXELATED_TEXTURE_PARAMETERS = {
136708
136710
  [GL$1.TEXTURE_WRAP_T]: GL$1.CLAMP_TO_EDGE
136709
136711
  };
136710
136712
  const GLSL_COLORMAPS = [
136713
+ // NOTE: the ordering of these is important,
136714
+ // as the shader code in bitmask-layer-beta-shaders hardcodes their indices.
136711
136715
  "plasma",
136712
136716
  "viridis",
136713
136717
  "jet",
@@ -137800,22 +137804,22 @@ function addDecoder(cases, importFn) {
137800
137804
  }
137801
137805
  cases.forEach((c) => registry$1.set(c, importFn));
137802
137806
  }
137803
- addDecoder([void 0, 1], () => import("./raw-BqSl12fx.js").then((m) => m.default));
137804
- addDecoder(5, () => import("./lzw-DmLr47v3.js").then((m) => m.default));
137807
+ addDecoder([void 0, 1], () => import("./raw-DK1tS_1S.js").then((m) => m.default));
137808
+ addDecoder(5, () => import("./lzw-CbPHwemm.js").then((m) => m.default));
137805
137809
  addDecoder(6, () => {
137806
137810
  throw new Error("old style JPEG compression is not supported.");
137807
137811
  });
137808
- addDecoder(7, () => import("./jpeg-D4w6F2QL.js").then((m) => m.default));
137809
- addDecoder([8, 32946], () => import("./deflate-9nZ87Z1F.js").then((m) => m.default));
137810
- addDecoder(32773, () => import("./packbits-BXfNep8e.js").then((m) => m.default));
137812
+ addDecoder(7, () => import("./jpeg-C2Vem90J.js").then((m) => m.default));
137813
+ addDecoder([8, 32946], () => import("./deflate-9hig_prR.js").then((m) => m.default));
137814
+ addDecoder(32773, () => import("./packbits-Biz7Ork3.js").then((m) => m.default));
137811
137815
  addDecoder(
137812
137816
  34887,
137813
- () => import("./lerc-DDvnNSMa.js").then(async (m) => {
137817
+ () => import("./lerc-DK0VVejt.js").then(async (m) => {
137814
137818
  await m.zstd.init();
137815
137819
  return m;
137816
137820
  }).then((m) => m.default)
137817
137821
  );
137818
- addDecoder(50001, () => import("./webimage-DRT49Aaq.js").then((m) => m.default));
137822
+ addDecoder(50001, () => import("./webimage-C31NcGoz.js").then((m) => m.default));
137819
137823
  function decodeRowAcc(row, stride) {
137820
137824
  let length2 = row.length - stride;
137821
137825
  let offset2 = 0;
@@ -147598,7 +147602,7 @@ uniform float channelOpacities[7];
147598
147602
  uniform bool channelIsStaticColorMode[7]; // TODO: should this be a single float?
147599
147603
  uniform bool channelIsSetColorMode[7]; // TODO: should this be a single float?
147600
147604
 
147601
- // TODO: can array of tuples/vec2 be used?
147605
+ uniform int channelColormapFuncIndices[7];
147602
147606
  uniform float channelColormapRangeStarts[7];
147603
147607
  uniform float channelColormapRangeEnds[7];
147604
147608
 
@@ -147664,7 +147668,30 @@ vec3 sampleAndGetData(sampler2D dataTex, vec2 coord, bool isFilled, float stroke
147664
147668
  return vec3(clampedSampledData * float(isOn), sampledData, float(isEdge));
147665
147669
  }
147666
147670
 
147667
- vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
147671
+ vec3 colormapFunc(float clampedScaledExpressionValue, int colormapIndex) {
147672
+ // Map indices of GLSL_COLORMAPS array to their function calls.
147673
+ // GLSL_COLORMAPS is defined in ./constants.js and needs to stay manually synced.
147674
+ // 0: 'plasma',
147675
+ // 1: 'viridis',
147676
+ // 2: 'jet',
147677
+ // 3: 'greys',
147678
+
147679
+ if (colormapIndex <= 0) {
147680
+ // This should also match -1, to account for a failed Array.indexOf lookup.
147681
+ return plasma(clampedScaledExpressionValue).rgb;
147682
+ }
147683
+ if (colormapIndex == 1) {
147684
+ return viridis(clampedScaledExpressionValue).rgb;
147685
+ }
147686
+ if (colormapIndex == 2) {
147687
+ return jet(clampedScaledExpressionValue).rgb;
147688
+ }
147689
+ if (colormapIndex == 3) {
147690
+ return greys(clampedScaledExpressionValue).rgb;
147691
+ }
147692
+ }
147693
+
147694
+ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, int colormapFuncIndex, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
147668
147695
  float clampedSampledDataAndIsOn = sampledDataAndIsEdge.x;
147669
147696
  float sampledData = sampledDataAndIsEdge.y;
147670
147697
  float isEdge = sampledDataAndIsEdge.z;
@@ -147708,7 +147735,7 @@ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channel
147708
147735
  }
147709
147736
 
147710
147737
 
147711
- 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);
147738
+ 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);
147712
147739
  // Only return a color if the data is non-zero.
147713
147740
 
147714
147741
  return clampedSampledDataAndIsOn * isEdge * sampledColor;
@@ -147724,15 +147751,15 @@ void main() {
147724
147751
  vec3 dat4 = sampleAndGetData(channel4, vTexCoord, channelsFilled[4], channelStrokeWidths[4], channelsVisible[4]);
147725
147752
  vec3 dat5 = sampleAndGetData(channel5, vTexCoord, channelsFilled[5], channelStrokeWidths[5], channelsVisible[5]);
147726
147753
  vec3 dat6 = sampleAndGetData(channel6, vTexCoord, channelsFilled[6], channelStrokeWidths[6], channelsVisible[6]);
147727
-
147728
- vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
147729
- vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
147730
- vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
147731
- vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
147732
- vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
147733
- vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
147734
- vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
147735
-
147754
+
147755
+ vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapFuncIndices[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
147756
+ vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapFuncIndices[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
147757
+ vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapFuncIndices[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
147758
+ vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapFuncIndices[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
147759
+ vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapFuncIndices[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
147760
+ vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapFuncIndices[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
147761
+ vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapFuncIndices[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
147762
+
147736
147763
  // If all of the channels are "empty", then discard this pixel so that it is not considered during picking.
147737
147764
  float emptyDat = 0.;
147738
147765
  if(dat0.x == emptyDat && dat1.x == emptyDat && dat2.x == emptyDat && dat3.x == emptyDat && dat4.x == emptyDat && dat5.x == emptyDat && dat6.x == emptyDat) {
@@ -147916,14 +147943,10 @@ const defaultProps$1 = {
147916
147943
  class BitmaskLayer2 extends XRLayer {
147917
147944
  // eslint-disable-next-line class-methods-use-this
147918
147945
  getShaders() {
147919
- const { colormap } = this.props;
147920
147946
  return {
147921
147947
  fs,
147922
147948
  vs,
147923
- modules: [project32, picking],
147924
- defines: {
147925
- [COLORMAP_SHADER_PLACEHOLDER]: GLSL_COLORMAPS.includes(colormap) ? colormap : GLSL_COLORMAP_DEFAULT
147926
- }
147949
+ modules: [project32, picking]
147927
147950
  };
147928
147951
  }
147929
147952
  /**
@@ -147982,8 +148005,6 @@ class BitmaskLayer2 extends XRLayer {
147982
148005
  channelOpacities,
147983
148006
  channelColors,
147984
148007
  channelsVisible,
147985
- // TODO: use `channelFeatureValueColormaps` in shader,
147986
- // figure out how to call multiple GLSL colormap functions
147987
148008
  channelFeatureValueColormaps,
147988
148009
  channelFeatureValueColormapRanges,
147989
148010
  channelIsStaticColorMode,
@@ -148044,6 +148065,12 @@ class BitmaskLayer2 extends XRLayer {
148044
148065
  // There are six texture entries on the shaders
148045
148066
  MAX_CHANNELS - channelStrokeWidths.length
148046
148067
  ),
148068
+ channelColormapFuncIndices: padWithDefault(
148069
+ channelFeatureValueColormaps.map((d) => GLSL_COLORMAPS.indexOf(d)),
148070
+ 0,
148071
+ // There are six texture entries on the shaders
148072
+ MAX_CHANNELS - channelFeatureValueColormaps.length
148073
+ ),
148047
148074
  channelColormapRangeStarts: padWithDefault(
148048
148075
  channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[0]) || 0),
148049
148076
  0,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a, H } from "./index-gbnJAInw.js";
1
+ import { a, H } from "./index-BDT04sKA.js";
2
2
  export {
3
3
  a as Heatmap,
4
4
  H as HeatmapSubscriber
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-gbnJAInw.js";
1
+ import { B as BaseDecoder } from "./index-BDT04sKA.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-gbnJAInw.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-BDT04sKA.js";
3
3
  const LercParameters = {
4
4
  AddCompression: 1
5
5
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-gbnJAInw.js";
1
+ import { B as BaseDecoder } from "./index-BDT04sKA.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-gbnJAInw.js";
1
+ import { B as BaseDecoder } from "./index-BDT04sKA.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-gbnJAInw.js";
1
+ import { B as BaseDecoder } from "./index-BDT04sKA.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-gbnJAInw.js";
1
+ import { B as BaseDecoder } from "./index-BDT04sKA.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/heatmap",
3
- "version": "3.6.18",
3
+ "version": "3.7.1",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -19,29 +19,29 @@
19
19
  "lodash-es": "^4.17.21",
20
20
  "uuid": "^9.0.0",
21
21
  "react-aria": "^3.28.0",
22
- "@vitessce/styles": "3.6.18",
23
- "@vitessce/constants-internal": "3.6.18",
24
- "@vitessce/gl": "3.6.18",
25
- "@vitessce/legend": "3.6.18",
26
- "@vitessce/sets-utils": "3.6.18",
27
- "@vitessce/tooltip": "3.6.18",
28
- "@vitessce/utils": "3.6.18",
29
- "@vitessce/vit-s": "3.6.18",
30
- "@vitessce/workers": "3.6.18"
22
+ "@vitessce/styles": "3.7.1",
23
+ "@vitessce/constants-internal": "3.7.1",
24
+ "@vitessce/gl": "3.7.1",
25
+ "@vitessce/legend": "3.7.1",
26
+ "@vitessce/sets-utils": "3.7.1",
27
+ "@vitessce/tooltip": "3.7.1",
28
+ "@vitessce/utils": "3.7.1",
29
+ "@vitessce/vit-s": "3.7.1",
30
+ "@vitessce/workers": "3.7.1"
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",