hilbert-chart-3d 0.9.1 → 1.0.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
@@ -8,7 +8,11 @@ Hilbert Chart 3D
8
8
 
9
9
  A 3D hilbert space-filling curve chart for representing one-dimensional lengths on a three-dimensional space.
10
10
 
11
- Uses [ThreeJS](https://github.com/mrdoob/three.js/)/WebGL for 3D rendering.
11
+ <p align="center">
12
+ <a href="https://vasturiano.github.io/hilbert-chart-3d/examples/ipv4-address-space/"><img width="80%" src="https://vasturiano.github.io/hilbert-chart-3d/examples/ipv4-address-space/preview.png"></a>
13
+ </p>
14
+
15
+ Uses [ThreeJS](https://github.com/mrdoob/three.js/)/WebGL for 3D rendering and [three-hilbert](https://github.com/vasturiano/three-hilbert) for the layout computation.
12
16
 
13
17
  See also the [2D version](https://github.com/vasturiano/hilbert-chart).
14
18
 
@@ -16,6 +20,7 @@ See also the [2D version](https://github.com/vasturiano/hilbert-chart).
16
20
 
17
21
  * [IPv4 Address Space](https://vasturiano.github.io/hilbert-chart-3d/examples/ipv4-address-space/) ([source](https://github.com/vasturiano/hilbert-chart-3d/blob/master/examples/ipv4-address-space/index.html))
18
22
  * [Ordinal (cubic pie chart)](https://vasturiano.github.io/hilbert-chart-3d/examples/ordinal/) ([source](https://github.com/vasturiano/hilbert-chart-3d/blob/master/examples/ordinal/index.html))
23
+ * [IPv6 BGP Routing Table](https://vasturiano.github.io/hilbert-chart-3d/examples/bgp-announced-space-ipv6/) ([source](https://github.com/vasturiano/hilbert-chart-3d/blob/master/examples/bgp-announced-space-ipv6/index.html))
19
24
 
20
25
  ## Quick start
21
26
 
@@ -42,8 +47,8 @@ new HilbertChart3D(<domElement>, { configOptions })
42
47
 
43
48
  | Config options | Description | Default |
44
49
  | --- | --- | :--: |
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. | `trackball` |
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 }` |
50
+ | <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. | `orbit` |
51
+ | <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, reversedDepthBuffer: true }` |
47
52
 
48
53
  ### Container
49
54
  | Method | Description | Default |
@@ -1,4 +1,4 @@
1
- // Version 0.9.1 hilbert-chart-3d - https://github.com/vasturiano/hilbert-chart-3d
1
+ // Version 1.0.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) :
@@ -153359,6 +153359,12 @@ var<${access}> ${ name } : ${ structName };`;
153359
153359
  });
153360
153360
  mesh.instanceMatrix.needsUpdate = true;
153361
153361
  mesh.computeBoundingSphere();
153362
+
153363
+ // Link instanced mesh to each datum
153364
+ d.forEach((d, idx) => {
153365
+ d.__threeObjHilbert = mesh;
153366
+ d.__threeObjInstanceId = idx;
153367
+ });
153362
153368
  return mesh;
153363
153369
  }).onUpdateObj((mesh, d) => {
153364
153370
  labelAtlas.tagGeometry(mesh.geometry, d, {
@@ -153584,8 +153590,12 @@ var<${access}> ${ name } : ${ structName };`;
153584
153590
  }
153585
153591
  },
153586
153592
  stateInit({
153587
- controlType = 'trackball',
153588
- rendererConfig
153593
+ controlType = 'orbit',
153594
+ rendererConfig = {
153595
+ reversedDepthBuffer: true,
153596
+ antialias: true,
153597
+ alpha: true
153598
+ }
153589
153599
  }) {
153590
153600
  const hilbert = new index$1();
153591
153601
  return {
@@ -153627,7 +153637,11 @@ var<${access}> ${ name } : ${ structName };`;
153627
153637
  const d = getHilbertObjData(obj, intersection);
153628
153638
  d ? state.onClick?.(d, ev) : state.onBackgroundClick?.(ev);
153629
153639
  });
153630
- state.renderObjs.camera().position.z = 500;
153640
+ const camera = state.renderObjs.camera();
153641
+ camera.near = 0.001;
153642
+ camera.position.x = -350;
153643
+ camera.position.y = 160;
153644
+ camera.position.z = -175;
153631
153645
  state.controlType === 'fly' && (state.renderObjs.controls().movementSpeed = 80);
153632
153646
 
153633
153647
  //