hilbert-chart-3d 0.6.1 → 0.8.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.
package/README.md CHANGED
@@ -43,6 +43,7 @@ new HilbertChart3D(<domElement>, { configOptions })
43
43
  | Config options | Description | Default |
44
44
  | --- | --- | :--: |
45
45
  | <b>controlType</b>: <i>str</i> or <i>class</i> | Which type of control to use to control the camera. Choice between [trackball](https://threejs.org/examples/misc_controls_trackball.html), [arcball](https://threejs.org/examples/misc_controls_arcball.html), [orbit](https://threejs.org/examples/#misc_controls_orbit), [fly](https://threejs.org/examples/misc_controls_fly.html), or a custom [Three.js controls](https://threejs.org/docs/#Controls) class. | `arcball` |
46
+ | <b>rendererConfig</b>: <i>object</i> | Configuration parameters to pass to the [ThreeJS WebGLRenderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer) constructor. | `{ antialias: true, alpha: true }` |
46
47
 
47
48
  ### Container
48
49
  | Method | Description | Default |
@@ -71,7 +72,7 @@ new HilbertChart3D(<domElement>, { configOptions })
71
72
  ### Render control
72
73
  | Method | Description | Default |
73
74
  | --- | --- | :--: |
74
- | <b>useInstancedMeshes</b>([<i>boolean</i>]) | Getter/setter for whether to render compatible segments with [THREE.InstancedMesh](https://threejs.org/docs/#InstancedMesh) to reduce draw calls. It's recommended to enable this for very large datasets. Segments that cannot be instanced use regular meshes. | `false` |
75
+ | <b>useInstancedMeshes</b>([<i>boolean</i> or <i>fn</i>]) | Getter/setter for whether to render compatible segments with [THREE.InstancedMesh](https://threejs.org/docs/#InstancedMesh) to reduce draw calls. Accepts a boolean or a function of the datum. Recommended for very large datasets. Segments that cannot be instanced use regular meshes. | `false` |
75
76
  | <b>zoomToFit</b>([<i>ms</i>], [<i>px</i>]) | Automatically moves the camera so that all of the hilbert segments become visible within its field of view. It accepts two optional arguments: the first defines the duration of the transition (in ms) to animate the camera motion (default: 0ms). The second argument is the amount of padding (in px) between the edge of the canvas and the outermost node location (default: 10px). | `(0, 10)` |
76
77
  | <b>focusOn</b>(<i>pos</i>, <i>length</i>, [<i>ms</i>]) | Zoom-in on a particular area of the chart, defined by [`pos`, `pos+length-1`]. `pos` and `length` may be Numbers or BigInts. An optional 3rd argument defines the duration of the transition (in ms) to animate the zooming motion. A value of 0 (default) jumps immediately to the final position. ||
77
78
  | <b>cameraPosition</b>([<i>{x,y,z}</i>], [<i>lookAt</i>], [<i>ms</i>]) | Getter/setter for the camera position, in terms of `x`, `y`, `z` coordinates. Each of the coordinates is optional, allowing for motion in just some dimensions. The optional second argument can be used to define the direction that the camera should aim at, in terms of an `{x,y,z}` point in the 3D space. The 3rd optional argument defines the duration of the transition (in ms) to animate the camera motion. A value of 0 (default) moves the camera immediately to the final position. | |
@@ -1,4 +1,4 @@
1
- import { Controls, Vector3, Scene, Camera, WebGLRenderer, Light } from 'three';
1
+ import { Controls, WebGLRendererParameters, Vector3, Scene, Camera, WebGLRenderer, Light } from 'three';
2
2
 
3
3
  type Accessor<In, Out> = Out | string | ((obj: In) => Out);
4
4
  type NumericValue = number | bigint;
@@ -12,6 +12,7 @@ type Range =
12
12
 
13
13
  interface HilbertChartOptions {
14
14
  controlType?: ControlType;
15
+ rendererConfig?: WebGLRendererParameters;
15
16
  }
16
17
 
17
18
  type RangeBounds = { start: number; length: number } | { start: bigint; length: bigint };
@@ -48,8 +49,8 @@ declare class HilbertChart<R extends RangeBounds = Range> {
48
49
  valFormatter(formatter: NumFormatter): HilbertChart<R>;
49
50
  simplifyCurves(): boolean;
50
51
  simplifyCurves(simplifyCurves: boolean): HilbertChart<R>;
51
- useInstancedMeshes(): boolean;
52
- useInstancedMeshes(useInstancedMeshes: boolean): HilbertChart<R>;
52
+ useInstancedMeshes(): RangeAccessor<R, boolean>;
53
+ useInstancedMeshes(useInstancedMeshesAccessor: RangeAccessor<R, boolean>): HilbertChart<R>;
53
54
 
54
55
  focusOn(pos: NumericValue, length: NumericValue, ms?: number): void;
55
56
  zoomToFit(ms?: number, padding?: number): HilbertChart<R>;
@@ -1,4 +1,4 @@
1
- // Version 0.6.1 hilbert-chart-3d - https://github.com/vasturiano/hilbert-chart-3d
1
+ // Version 0.8.0 hilbert-chart-3d - https://github.com/vasturiano/hilbert-chart-3d
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -152591,11 +152591,23 @@ var<${access}> ${ name } : ${ structName };`;
152591
152591
  glyphTexture.colorSpace = SRGBColorSpace;
152592
152592
  return glyphTexture;
152593
152593
  }
152594
+ const colorCache = new Map();
152595
+ function getMaterialColor(str) {
152596
+ let materialColor = colorCache.get(str);
152597
+ if (!materialColor) {
152598
+ materialColor = {
152599
+ color: new Color$1(colorStr2Hex(str)),
152600
+ opacity: colorAlpha(str)
152601
+ };
152602
+ colorCache.set(str, materialColor);
152603
+ }
152604
+ return materialColor;
152605
+ }
152594
152606
  class LabelAtlas {
152595
152607
  constructor(data, labelAccessor, labelColorAccessor) {
152596
152608
  const labelIds = new Map();
152597
152609
  this.labels = new WeakMap();
152598
- this.materialCache = new Map();
152610
+ this.materials = new Map();
152599
152611
  data.forEach(d => {
152600
152612
  const label = labelAccessor(d);
152601
152613
  const color = labelColorAccessor(d);
@@ -152639,71 +152651,82 @@ var<${access}> ${ name } : ${ structName };`;
152639
152651
  isEmpty() {
152640
152652
  return this.labelCount === 0;
152641
152653
  }
152642
- tagGeometry(geometry, records, instanced = false) {
152643
- if (this.isEmpty()) return;
152654
+ tagGeometry(geometry, records, {
152655
+ instanced = false,
152656
+ backgroundColorAccessor,
152657
+ recomputeLabels = true
152658
+ } = {}) {
152644
152659
  const vertexCount = geometry.getAttribute('position').count;
152645
152660
  const count = instanced ? records.length : vertexCount;
152646
152661
  const makeAttribute = (array, itemSize) => instanced ? new InstancedBufferAttribute(array, itemSize) : new Float32BufferAttribute(array, itemSize);
152647
- const ids = new Float32Array(count);
152648
- const lengths = new Float32Array(count);
152649
- const colors = new Float32Array(count * 4);
152650
- const dummyAspectRatio = new Float32Array(count);
152651
- records.forEach((d, index) => {
152652
- if (!this.labels.has(d)) {
152653
- console.warn(`Label not found for record ${JSON.stringify(d)}. Skipping...`);
152654
- return;
152655
- }
152656
- const label = this.labels.get(d);
152657
- const labelColor = label?.color;
152658
- const color = new Color$1(labelColor ? colorStr2Hex(labelColor) : 0xffffff);
152659
- const opacity = labelColor ? colorAlpha(labelColor) : 0;
152660
- const id = label ? label.id : -1;
152661
- const len = label ? label.length : 0;
152662
- const start = instanced ? index : 0;
152663
- const end = instanced ? index + 1 : count;
152664
- for (let i = start; i < end; i++) {
152665
- ids[i] = id;
152666
- lengths[i] = len;
152667
- colors[i * 4] = color.r;
152668
- colors[i * 4 + 1] = color.g;
152669
- colors[i * 4 + 2] = color.b;
152670
- colors[i * 4 + 3] = opacity;
152671
- dummyAspectRatio[i] = 2.0;
152662
+ if (backgroundColorAccessor) {
152663
+ const backgroundColors = new Float32Array(count * 3);
152664
+ const opacities = new Float32Array(count);
152665
+ records.forEach((record, index) => {
152666
+ const {
152667
+ color,
152668
+ opacity
152669
+ } = getMaterialColor(backgroundColorAccessor(record));
152670
+ const start = instanced ? index : 0;
152671
+ const end = instanced ? index + 1 : count;
152672
+ for (let i = start; i < end; i++) {
152673
+ color.toArray(backgroundColors, i * 3);
152674
+ opacities[i] = opacity;
152675
+ }
152676
+ });
152677
+ geometry.setAttribute('backgroundColor', makeAttribute(backgroundColors, 3));
152678
+ geometry.setAttribute('opacity', makeAttribute(opacities, 1));
152679
+ }
152680
+ if (recomputeLabels) {
152681
+ if (this.isEmpty()) return;
152682
+ const ids = new Float32Array(count);
152683
+ const lengths = new Float32Array(count);
152684
+ const colors = new Float32Array(count * 4);
152685
+ const dummyAspectRatio = new Float32Array(count);
152686
+ records.forEach((d, index) => {
152687
+ const label = this.labels.get(d);
152688
+ if (!label) return;
152689
+ const {
152690
+ color,
152691
+ opacity
152692
+ } = getMaterialColor(label.color);
152693
+ const id = label ? label.id : -1;
152694
+ const len = label ? label.length : 0;
152695
+ const start = instanced ? index : 0;
152696
+ const end = instanced ? index + 1 : count;
152697
+ for (let i = start; i < end; i++) {
152698
+ ids[i] = id;
152699
+ lengths[i] = len;
152700
+ colors[i * 4] = color.r;
152701
+ colors[i * 4 + 1] = color.g;
152702
+ colors[i * 4 + 2] = color.b;
152703
+ colors[i * 4 + 3] = opacity;
152704
+ dummyAspectRatio[i] = 2.0;
152705
+ }
152706
+ });
152707
+ geometry.setAttribute('labelId', makeAttribute(ids, 1));
152708
+ geometry.setAttribute('labelLength', makeAttribute(lengths, 1));
152709
+ geometry.setAttribute('labelColor', makeAttribute(colors, 4));
152710
+ if (!geometry.getAttribute('aspectRatio')) {
152711
+ console.warn(`Geometry requires aspectRatio attribute. Setting 2.0 throughout the faces.`);
152712
+ geometry.setAttribute('aspectRatio', makeAttribute(dummyAspectRatio, 1));
152672
152713
  }
152673
- });
152674
- geometry.setAttribute('labelId', makeAttribute(ids, 1));
152675
- geometry.setAttribute('labelLength', makeAttribute(lengths, 1));
152676
- geometry.setAttribute('labelColor', makeAttribute(colors, 4));
152677
- if (!geometry.getAttribute('aspectRatio')) {
152678
- console.warn(`Geometry requires aspectRatio attribute. Setting 2.0 throughout the faces.`);
152679
- geometry.setAttribute('aspectRatio', makeAttribute(dummyAspectRatio, 1));
152680
152714
  }
152681
152715
  }
152682
- getMaterial(color) {
152683
- let material = this.materialCache.get(color);
152716
+ getMaterial(transparent = false) {
152717
+ let material = this.materials.get(transparent);
152684
152718
  if (material) return material;
152685
- material = new MeshLambertMaterial();
152686
- this.materialCache.set(color, material);
152687
- const opacity = colorAlpha(color);
152688
- material.color.set(colorStr2Hex(color));
152689
- material.transparent = opacity < 1;
152690
- material.opacity = opacity;
152691
- if (!this.isEmpty()) {
152692
- material.onBeforeCompile = shader => {
152693
- shader.uniforms.labelGlyphTexture = {
152694
- value: this.glyphTexture
152695
- };
152696
- shader.uniforms.labelDataTexture = {
152697
- value: this.labelTexture
152698
- };
152699
- shader.uniforms.labelDataTextureSize = {
152700
- value: new Vector2(this.labelTexture.image.width, this.labelTexture.image.height)
152701
- };
152702
- shader.uniforms.labelLabelsPerRow = {
152703
- value: this.labelsPerRow
152704
- };
152705
- shader.vertexShader = shader.vertexShader.replace('#include <common>', `#include <common>
152706
- attribute float aspectRatio;
152719
+ material = new MeshLambertMaterial({
152720
+ transparent
152721
+ });
152722
+ this.materials.set(transparent, material);
152723
+ material.onBeforeCompile = shader => {
152724
+ shader.vertexShader = shader.vertexShader.replace('#include <common>', `#include <common>
152725
+ attribute vec3 backgroundColor;
152726
+ attribute float opacity;
152727
+ varying vec3 vBackgroundColor;
152728
+ varying float vOpacity;
152729
+ ${!this.isEmpty() ? `attribute float aspectRatio;
152707
152730
  attribute vec4 labelColor;
152708
152731
  attribute float labelId;
152709
152732
  attribute float labelLength;
@@ -152711,14 +152734,18 @@ var<${access}> ${ name } : ${ structName };`;
152711
152734
  varying vec4 vLabelColor;
152712
152735
  varying float vLabelId;
152713
152736
  varying float vLabelLength;
152714
- varying vec2 vLabelUv;`).replace('#include <begin_vertex>', `#include <begin_vertex>
152715
- vAspectRatio = aspectRatio;
152737
+ varying vec2 vLabelUv;` : ''}`).replace('#include <begin_vertex>', `#include <begin_vertex>
152738
+ vBackgroundColor = backgroundColor;
152739
+ vOpacity = opacity;
152740
+ ${!this.isEmpty() ? `vAspectRatio = aspectRatio;
152716
152741
  vLabelColor = labelColor;
152717
152742
  vLabelId = labelId;
152718
152743
  vLabelLength = labelLength;
152719
- vLabelUv = uv;`);
152720
- shader.fragmentShader = shader.fragmentShader.replace('#include <common>', `#include <common>
152721
- uniform sampler2D labelGlyphTexture;
152744
+ vLabelUv = uv;` : ''}`);
152745
+ shader.fragmentShader = shader.fragmentShader.replace('#include <common>', `#include <common>
152746
+ varying vec3 vBackgroundColor;
152747
+ varying float vOpacity;
152748
+ ${!this.isEmpty() ? `uniform sampler2D labelGlyphTexture;
152722
152749
  uniform sampler2D labelDataTexture;
152723
152750
  uniform vec2 labelDataTextureSize;
152724
152751
  uniform float labelLabelsPerRow;
@@ -152726,7 +152753,27 @@ var<${access}> ${ name } : ${ structName };`;
152726
152753
  varying vec4 vLabelColor;
152727
152754
  varying float vLabelId;
152728
152755
  varying float vLabelLength;
152729
- varying vec2 vLabelUv;`).replace('#include <map_fragment>', `#include <map_fragment>
152756
+ varying vec2 vLabelUv;` : ''}`).replace('#include <map_fragment>', `#include <map_fragment>
152757
+ diffuseColor.rgb *= vBackgroundColor;
152758
+ diffuseColor.a *= vOpacity;`);
152759
+ if (this.isEmpty()) return;
152760
+ shader.uniforms.labelGlyphTexture = {
152761
+ value: this.glyphTexture
152762
+ };
152763
+ shader.uniforms.labelDataTexture = {
152764
+ value: this.labelTexture
152765
+ };
152766
+ shader.uniforms.labelDataTextureSize = {
152767
+ value: new Vector2(this.labelTexture.image.width, this.labelTexture.image.height)
152768
+ };
152769
+ shader.uniforms.labelLabelsPerRow = {
152770
+ value: this.labelsPerRow
152771
+ };
152772
+ shader.fragmentShader = shader.fragmentShader.replace(`#include <map_fragment>
152773
+ diffuseColor.rgb *= vBackgroundColor;
152774
+ diffuseColor.a *= vOpacity;`, `#include <map_fragment>
152775
+ diffuseColor.rgb *= vBackgroundColor;
152776
+ diffuseColor.a *= vOpacity;
152730
152777
  if (vLabelId >= 0.0 && vLabelUv.x >= 0.0 && vLabelUv.x <= 1.0) {
152731
152778
  float aspect = max(vAspectRatio, 0.001);
152732
152779
  float visibleLength = vLabelLength;
@@ -152775,13 +152822,13 @@ var<${access}> ${ name } : ${ structName };`;
152775
152822
  }
152776
152823
  }
152777
152824
  }`);
152778
- };
152779
- material.customProgramCacheKey = () => 'three-label-glyph-atlas';
152780
- }
152825
+ };
152826
+ material.customProgramCacheKey = () => `three-label-glyph-atlas-${this.isEmpty() ? 'empty' : 'labels'}-geometry-color-${transparent}`;
152781
152827
  return material;
152782
152828
  }
152783
152829
  dispose() {
152784
152830
  this.labelTexture?.dispose();
152831
+ this.materials.forEach(material => material.dispose());
152785
152832
  }
152786
152833
  }
152787
152834
 
@@ -152825,9 +152872,11 @@ var<${access}> ${ name } : ${ structName };`;
152825
152872
  const geometryCache = new Map();
152826
152873
  const fallbackGeometries = new Map();
152827
152874
  const batches = new Map();
152875
+ const useInstancingAccessor = index$3(useInstancing);
152828
152876
  data.forEach(d => {
152829
152877
  const padding = paddingAccessor(d);
152830
152878
  const paddingAbsolute = paddingAbsoluteAccessor(d);
152879
+ const useInstancing = useInstancingAccessor(d);
152831
152880
  const description = useInstancing && getSimpleHilbertGeometry(order, d.start, d.length, padding, paddingAbsolute, simplifyCurves);
152832
152881
  if (!useInstancing || !description) {
152833
152882
  // skip instancing
@@ -152862,7 +152911,7 @@ var<${access}> ${ name } : ${ structName };`;
152862
152911
  scale
152863
152912
  });
152864
152913
  });
152865
- const instancedGeometries = Array.from(batches.values());
152914
+ const instancedGeometries = new Map(Array.from(batches.values()).map(batch => [batch.instances.map(i => i.data), batch]));
152866
152915
  instancedGeometries.forEach(batch => {
152867
152916
  const sourceGeometry = batch.geometry;
152868
152917
  batch.geometry = createTemplateGeometry(sourceGeometry, batch.origin, batch.scale);
@@ -153209,6 +153258,9 @@ var<${access}> ${ name } : ${ structName };`;
153209
153258
  bbox.min.multiplyScalar(SCALE);
153210
153259
  bbox.max.multiplyScalar(SCALE);
153211
153260
  return bbox;
153261
+ },
153262
+ _destructor: function () {
153263
+ this.prevLabelAtlas?.dispose();
153212
153264
  }
153213
153265
  },
153214
153266
  stateInit() {
@@ -153241,70 +153293,65 @@ var<${access}> ${ name } : ${ structName };`;
153241
153293
  const labelAccessor = index$3(state.label);
153242
153294
  const labelColorAccessor = index$3(state.labelColor);
153243
153295
  const getColor = d => colorAccessor?.(d) || state.defaultColorScale(labelAccessor(d) || '');
153244
- const labelAtlas = new LabelAtlas(state.data, labelAccessor, labelColorAccessor);
153296
+ const propsChanged = props => props.some(p => changedProps.hasOwnProperty(p));
153297
+ const atlasChanged = propsChanged(['data', 'label', 'labelColor']);
153298
+ const geometriesChanged = propsChanged(['useInstancedMeshes', 'data', 'order', 'padding', 'paddingAbsolute', 'simplifyCurves']);
153299
+ const labelAtlas = atlasChanged ? state.prevLabelAtlas = (state.prevLabelAtlas?.dispose(), new LabelAtlas(state.data, labelAccessor, labelColorAccessor)) : state.prevLabelAtlas;
153245
153300
  const {
153246
153301
  instancedGeometries,
153247
153302
  fallbackGeometries
153248
- } = createHilbertGeometries({
153303
+ } = geometriesChanged ? state.prevHilbertGeometries = createHilbertGeometries({
153249
153304
  useInstancing: state.useInstancedMeshes,
153250
153305
  data: state.data,
153251
153306
  order: state.order,
153252
153307
  paddingAccessor,
153253
153308
  paddingAbsoluteAccessor,
153254
153309
  simplifyCurves: state.simplifyCurves
153255
- });
153256
- const instancedMeshes = new Map();
153257
- instancedGeometries.forEach(geometryBatch => {
153258
- const colorBatches = new Map();
153259
- geometryBatch.instances.forEach(instance => {
153260
- // split by color
153261
- const color = getColor(instance.data);
153262
- let batch = colorBatches.get(color);
153263
- if (!batch) {
153264
- batch = {
153265
- material: labelAtlas.getMaterial(color),
153266
- instances: []
153267
- };
153268
- colorBatches.set(color, batch);
153269
- }
153270
- batch.instances.push(instance);
153271
- });
153272
- colorBatches.forEach(({
153273
- material,
153310
+ }) : state.prevHilbertGeometries;
153311
+ state.instancedDataMapper.onCreateObj(d => {
153312
+ const {
153313
+ geometry,
153274
153314
  instances
153275
- }) => {
153276
- const geometry = geometryBatch.geometry.clone();
153277
- labelAtlas.tagGeometry(geometry, instances.map(instance => instance.data), true);
153278
- const mesh = new InstancedMesh(geometry, material, instances.length);
153279
- const matrices = mesh.instanceMatrix.array;
153280
- instances.forEach(({
153281
- scale,
153282
- position
153283
- }, i) => {
153284
- const matrixOffset = i * 16;
153285
- matrices[matrixOffset] = scale;
153286
- matrices[matrixOffset + 5] = scale;
153287
- matrices[matrixOffset + 10] = scale;
153288
- matrices[matrixOffset + 12] = position.x;
153289
- matrices[matrixOffset + 13] = position.y;
153290
- matrices[matrixOffset + 14] = position.z;
153291
- matrices[matrixOffset + 15] = 1;
153292
- });
153293
- mesh.instanceMatrix.needsUpdate = true;
153294
- mesh.computeBoundingSphere();
153295
- const data = instances.map(instance => instance.data);
153296
- instancedMeshes.set(data, mesh);
153315
+ } = instancedGeometries.get(d);
153316
+ const mesh = new InstancedMesh(geometry, undefined, d.length);
153317
+ const matrices = mesh.instanceMatrix.array;
153318
+ instances.forEach(({
153319
+ scale,
153320
+ position
153321
+ }, i) => {
153322
+ const matrixOffset = i * 16;
153323
+ matrices[matrixOffset] = scale;
153324
+ matrices[matrixOffset + 5] = scale;
153325
+ matrices[matrixOffset + 10] = scale;
153326
+ matrices[matrixOffset + 12] = position.x;
153327
+ matrices[matrixOffset + 13] = position.y;
153328
+ matrices[matrixOffset + 14] = position.z;
153329
+ matrices[matrixOffset + 15] = 1;
153297
153330
  });
153298
- geometryBatch.geometry.dispose();
153299
- });
153300
- state.instancedDataMapper.onCreateObj(d => instancedMeshes.get(d)).digest([...instancedMeshes.keys()]);
153301
- [...fallbackGeometries.entries()].forEach(([d, geometry]) => labelAtlas.tagGeometry(geometry, [d]));
153331
+ mesh.instanceMatrix.needsUpdate = true;
153332
+ mesh.computeBoundingSphere();
153333
+ return mesh;
153334
+ }).onUpdateObj((mesh, d) => {
153335
+ labelAtlas.tagGeometry(mesh.geometry, d, {
153336
+ instanced: true,
153337
+ backgroundColorAccessor: getColor,
153338
+ recomputeLabels: geometriesChanged || atlasChanged
153339
+ });
153340
+ const transparent = mesh.geometry.getAttribute('opacity').array.some(o => o < 1);
153341
+ mesh.material = labelAtlas.getMaterial(transparent);
153342
+ }).digest([...instancedGeometries.keys()]);
153302
153343
  state.fallbackDataMapper.onUpdateObj((obj, d) => {
153303
- obj.geometry?.dispose();
153304
- obj.geometry = fallbackGeometries.get(d);
153305
- obj.material = labelAtlas.getMaterial(getColor(d));
153344
+ if (geometriesChanged) {
153345
+ obj.geometry?.dispose();
153346
+ obj.geometry = fallbackGeometries.get(d);
153347
+ }
153348
+ labelAtlas.tagGeometry(obj.geometry, [d], {
153349
+ backgroundColorAccessor: getColor,
153350
+ recomputeLabels: geometriesChanged || atlasChanged
153351
+ });
153352
+ const transparent = obj.geometry.getAttribute('opacity').array.some(o => o < 1);
153353
+ obj.material = labelAtlas.getMaterial(transparent);
153306
153354
  }).digest([...fallbackGeometries.keys()]);
153307
- labelAtlas.dispose();
153308
153355
  }
153309
153356
  });
153310
153357
 
@@ -153517,13 +153564,15 @@ var<${access}> ${ name } : ${ structName };`;
153517
153564
  }
153518
153565
  },
153519
153566
  stateInit({
153520
- controlType = 'arcball'
153567
+ controlType = 'arcball',
153568
+ rendererConfig
153521
153569
  }) {
153522
153570
  const hilbert = new index$1();
153523
153571
  return {
153524
153572
  hilbert,
153525
153573
  renderObjs: threeRenderObjects({
153526
- controlType
153574
+ controlType,
153575
+ rendererConfig
153527
153576
  }).objects([hilbert]).lights([new AmbientLight(0xcccccc, Math.PI), new DirectionalLight(0xffffff, 0.6 * Math.PI)]),
153528
153577
  controlType
153529
153578
  };