hilbert-chart-3d 0.9.0 → 0.10.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 +2 -1
- package/dist/hilbert-chart-3d.js +22 -24
- package/dist/hilbert-chart-3d.js.map +1 -1
- package/dist/hilbert-chart-3d.min.js +2 -2
- package/dist/hilbert-chart-3d.mjs +14 -23
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ See also the [2D version](https://github.com/vasturiano/hilbert-chart).
|
|
|
16
16
|
|
|
17
17
|
* [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
18
|
* [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))
|
|
19
|
+
* [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
20
|
|
|
20
21
|
## Quick start
|
|
21
22
|
|
|
@@ -42,7 +43,7 @@ new HilbertChart3D(<domElement>, { configOptions })
|
|
|
42
43
|
|
|
43
44
|
| Config options | Description | Default |
|
|
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. | `
|
|
46
|
+
| <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` |
|
|
46
47
|
| <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 }` |
|
|
47
48
|
|
|
48
49
|
### Container
|
package/dist/hilbert-chart-3d.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 0.
|
|
1
|
+
// Version 0.10.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, {
|
|
@@ -153373,6 +153379,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
153373
153379
|
if (geometriesChanged) {
|
|
153374
153380
|
obj.geometry?.dispose();
|
|
153375
153381
|
obj.geometry = fallbackGeometries.get(d);
|
|
153382
|
+
obj.renderOrder = Number(d.length); // Draw larger objects later to reduce transparency issues
|
|
153376
153383
|
}
|
|
153377
153384
|
labelAtlas.tagGeometry(obj.geometry, [d], {
|
|
153378
153385
|
backgroundColorAccessor: getColor,
|
|
@@ -153441,78 +153448,68 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
153441
153448
|
default: window.innerWidth,
|
|
153442
153449
|
onChange(v, state) {
|
|
153443
153450
|
state.renderObjs.width(v);
|
|
153444
|
-
}
|
|
153445
|
-
triggerUpdate: false
|
|
153451
|
+
}
|
|
153446
153452
|
},
|
|
153447
153453
|
height: {
|
|
153448
153454
|
default: window.innerHeight,
|
|
153449
153455
|
onChange(v, state) {
|
|
153450
153456
|
state.renderObjs.height(v);
|
|
153451
|
-
}
|
|
153452
|
-
triggerUpdate: false
|
|
153457
|
+
}
|
|
153453
153458
|
},
|
|
153454
153459
|
hilbertOrder: {
|
|
153455
153460
|
default: 3,
|
|
153456
153461
|
onChange(v, state) {
|
|
153457
153462
|
state.hilbert.order(v);
|
|
153458
|
-
}
|
|
153459
|
-
triggerUpdate: false
|
|
153463
|
+
}
|
|
153460
153464
|
},
|
|
153461
153465
|
// 0-4096 default
|
|
153462
153466
|
data: {
|
|
153463
153467
|
default: [],
|
|
153464
153468
|
onChange(v, state) {
|
|
153465
153469
|
state.hilbert.data(v);
|
|
153466
|
-
|
|
153467
|
-
|
|
153470
|
+
state.renderObjs.pointerRaycasterThrottleMs(v.length > 1e4 ? 200 : 50); // throttle raycaster when there's a lot of objects
|
|
153471
|
+
}
|
|
153468
153472
|
},
|
|
153469
153473
|
padding: {
|
|
153470
153474
|
default: 0,
|
|
153471
153475
|
onChange(v, state) {
|
|
153472
153476
|
state.hilbert.padding(v);
|
|
153473
|
-
}
|
|
153474
|
-
triggerUpdate: false
|
|
153477
|
+
}
|
|
153475
153478
|
},
|
|
153476
153479
|
paddingAbsolute: {
|
|
153477
153480
|
default: 0,
|
|
153478
153481
|
onChange(v, state) {
|
|
153479
153482
|
state.hilbert.paddingAbsolute(v);
|
|
153480
|
-
}
|
|
153481
|
-
triggerUpdate: false
|
|
153483
|
+
}
|
|
153482
153484
|
},
|
|
153483
153485
|
color: {
|
|
153484
153486
|
onChange(v, state) {
|
|
153485
153487
|
state.hilbert.color(v);
|
|
153486
|
-
}
|
|
153487
|
-
triggerUpdate: false
|
|
153488
|
+
}
|
|
153488
153489
|
},
|
|
153489
153490
|
label: {
|
|
153490
153491
|
default: 'name',
|
|
153491
153492
|
onChange(v, state) {
|
|
153492
153493
|
state.hilbert.label(v);
|
|
153493
|
-
}
|
|
153494
|
-
triggerUpdate: false
|
|
153494
|
+
}
|
|
153495
153495
|
},
|
|
153496
153496
|
labelColor: {
|
|
153497
153497
|
default: () => 'lavender',
|
|
153498
153498
|
onChange(v, state) {
|
|
153499
153499
|
state.hilbert.labelColor(v);
|
|
153500
|
-
}
|
|
153501
|
-
triggerUpdate: false
|
|
153500
|
+
}
|
|
153502
153501
|
},
|
|
153503
153502
|
simplifyCurves: {
|
|
153504
153503
|
default: true,
|
|
153505
153504
|
onChange(v, state) {
|
|
153506
153505
|
state.hilbert.simplifyCurves(v);
|
|
153507
|
-
}
|
|
153508
|
-
triggerUpdate: false
|
|
153506
|
+
}
|
|
153509
153507
|
},
|
|
153510
153508
|
useInstancedMeshes: {
|
|
153511
153509
|
default: false,
|
|
153512
153510
|
onChange(v, state) {
|
|
153513
153511
|
state.hilbert.useInstancedMeshes(v);
|
|
153514
|
-
}
|
|
153515
|
-
triggerUpdate: false
|
|
153512
|
+
}
|
|
153516
153513
|
},
|
|
153517
153514
|
valFormatter: {
|
|
153518
153515
|
default: d => d
|
|
@@ -153593,7 +153590,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
153593
153590
|
}
|
|
153594
153591
|
},
|
|
153595
153592
|
stateInit({
|
|
153596
|
-
controlType = '
|
|
153593
|
+
controlType = 'orbit',
|
|
153597
153594
|
rendererConfig
|
|
153598
153595
|
}) {
|
|
153599
153596
|
const hilbert = new index$1();
|
|
@@ -153636,6 +153633,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
153636
153633
|
const d = getHilbertObjData(obj, intersection);
|
|
153637
153634
|
d ? state.onClick?.(d, ev) : state.onBackgroundClick?.(ev);
|
|
153638
153635
|
});
|
|
153636
|
+
state.renderObjs.camera().near = 0.001;
|
|
153639
153637
|
state.renderObjs.camera().position.z = 500;
|
|
153640
153638
|
state.controlType === 'fly' && (state.renderObjs.controls().movementSpeed = 80);
|
|
153641
153639
|
|