3d-force-graph 1.72.0 → 1.72.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/3d-force-graph.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import 'three';
|
|
1
|
+
import { AmbientLight, DirectionalLight, Vector3 } from 'three';
|
|
2
2
|
import { DragControls } from 'three/examples/jsm/controls/DragControls.js';
|
|
3
3
|
import ThreeForceGraph from 'three-forcegraph';
|
|
4
4
|
import ThreeRenderObjects from 'three-render-objects';
|
|
@@ -137,6 +137,13 @@ function linkKapsule (kapsulePropName, kapsuleType) {
|
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
var three = window.THREE ? window.THREE // Prefer consumption from global THREE, if exists
|
|
141
|
+
: {
|
|
142
|
+
AmbientLight: AmbientLight,
|
|
143
|
+
DirectionalLight: DirectionalLight,
|
|
144
|
+
Vector3: Vector3
|
|
145
|
+
};
|
|
146
|
+
|
|
140
147
|
//
|
|
141
148
|
|
|
142
149
|
var CAMERA_DISTANCE2NODES_FACTOR = 170;
|
|
@@ -473,7 +480,7 @@ var _3dForceGraph = Kapsule({
|
|
|
473
480
|
state.renderObjs.renderer().useLegacyLights = false; // force behavior for three < 155
|
|
474
481
|
state.renderObjs.objects([
|
|
475
482
|
// Populate scene
|
|
476
|
-
new
|
|
483
|
+
new three.AmbientLight(0xcccccc, Math.PI), new three.DirectionalLight(0xffffff, 0.6 * Math.PI), state.forceGraph]).hoverOrderComparator(function (a, b) {
|
|
477
484
|
// Prioritize graph objects
|
|
478
485
|
var aObj = getGraphObj(a);
|
|
479
486
|
if (!aObj) return 1;
|
package/package.json
CHANGED