hilbert-chart-3d 0.6.0 → 0.6.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.
package/dist/hilbert-chart-3d.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 0.6.
|
|
1
|
+
// Version 0.6.1 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) :
|
|
@@ -153503,27 +153503,11 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
153503
153503
|
controls: state => state.renderObjs.controls(),
|
|
153504
153504
|
// Expose controls
|
|
153505
153505
|
hoverOrderComparator: function (state, dataComp) {
|
|
153506
|
-
state.renderObjs.hoverOrderComparator((_a, _b, a, b) => {
|
|
153506
|
+
state.renderObjs.hoverOrderComparator(dataComp && ((_a, _b, a, b) => {
|
|
153507
153507
|
const [da, db] = [a, b].map(i => getHilbertObjData(i?.object, i));
|
|
153508
|
-
|
|
153509
|
-
|
|
153510
|
-
return dataComp(da, db);
|
|
153511
|
-
});
|
|
153508
|
+
return !da - !db || dataComp(da, db) || a.distance - b.distance;
|
|
153509
|
+
}));
|
|
153512
153510
|
return this;
|
|
153513
|
-
function getHilbertObjData(obj, intersection) {
|
|
153514
|
-
if (!obj) return null;
|
|
153515
|
-
const hilbertObj = getHilbertObj(obj);
|
|
153516
|
-
const d = hilbertObj?.__data || null;
|
|
153517
|
-
return intersection && hilbertObj.isInstancedMesh ? d?.[intersection.instanceId] : d;
|
|
153518
|
-
function getHilbertObj(object) {
|
|
153519
|
-
let obj = object;
|
|
153520
|
-
// recurse up object chain until finding the hilbert object
|
|
153521
|
-
while (obj && !obj.hasOwnProperty('__data')) {
|
|
153522
|
-
obj = obj.parent;
|
|
153523
|
-
}
|
|
153524
|
-
return obj;
|
|
153525
|
-
}
|
|
153526
|
-
}
|
|
153527
153511
|
},
|
|
153528
153512
|
_destructor: function (state) {
|
|
153529
153513
|
cancelAnimationFrame(state.animationFrameRequestId);
|
|
@@ -153553,20 +153537,6 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
153553
153537
|
const roDomNode = document.createElement('div');
|
|
153554
153538
|
roDomNode.className = 'hilbert-scene-container';
|
|
153555
153539
|
el.appendChild(roDomNode);
|
|
153556
|
-
const getHilbertObjData = (obj, intersection) => {
|
|
153557
|
-
if (!obj) return null;
|
|
153558
|
-
const hilbertObj = getHilbertObj(obj);
|
|
153559
|
-
const d = hilbertObj?.__data || null;
|
|
153560
|
-
return intersection && hilbertObj.isInstancedMesh ? d?.[intersection.instanceId] : d;
|
|
153561
|
-
function getHilbertObj(object) {
|
|
153562
|
-
let obj = object;
|
|
153563
|
-
// recurse up object chain until finding the hilbert object
|
|
153564
|
-
while (obj && !obj.hasOwnProperty('__data')) {
|
|
153565
|
-
obj = obj.parent;
|
|
153566
|
-
}
|
|
153567
|
-
return obj;
|
|
153568
|
-
}
|
|
153569
|
-
};
|
|
153570
153540
|
state.renderObjs(roDomNode).tooltipContent((obj, intersection) => {
|
|
153571
153541
|
const d = getHilbertObjData(obj, intersection);
|
|
153572
153542
|
return !d ? '' : state.tooltipContent ? index$3(state.tooltipContent)(d) || '' : (() => {
|
|
@@ -153597,6 +153567,20 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
153597
153567
|
this._animationCycle();
|
|
153598
153568
|
}
|
|
153599
153569
|
});
|
|
153570
|
+
function getHilbertObjData(obj, intersection) {
|
|
153571
|
+
if (!obj) return null;
|
|
153572
|
+
const hilbertObj = getHilbertObj(obj);
|
|
153573
|
+
const d = hilbertObj?.__data || null;
|
|
153574
|
+
return intersection && hilbertObj.isInstancedMesh ? d?.[intersection.instanceId] : d;
|
|
153575
|
+
function getHilbertObj(object) {
|
|
153576
|
+
let obj = object;
|
|
153577
|
+
// recurse up object chain until finding the hilbert object
|
|
153578
|
+
while (obj && !obj.hasOwnProperty('__data')) {
|
|
153579
|
+
obj = obj.parent;
|
|
153580
|
+
}
|
|
153581
|
+
return obj;
|
|
153582
|
+
}
|
|
153583
|
+
}
|
|
153600
153584
|
|
|
153601
153585
|
return index;
|
|
153602
153586
|
|