3d-force-graph 1.70.4 → 1.70.8
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 +16 -16
- package/dist/3d-force-graph.common.js +16 -28
- package/dist/3d-force-graph.d.ts +1 -2
- package/dist/3d-force-graph.js +19468 -17241
- package/dist/3d-force-graph.js.map +1 -1
- package/dist/3d-force-graph.min.js +3 -3
- package/dist/3d-force-graph.module.js +11 -23
- package/example/bloom-effect/index.html +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
[![NPM package][npm-img]][npm-url]
|
|
5
5
|
[![Build Size][build-size-img]][build-size-url]
|
|
6
|
-
[![
|
|
6
|
+
[![NPM Downloads][npm-downloads-img]][npm-downloads-url]
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
<a href="https://vasturiano.github.io/3d-force-graph/example/large-graph/"><img width="80%" src="http://gist.github.com/vasturiano/02affe306ce445e423f992faeea13521/raw/preview.png"></a>
|
|
@@ -51,28 +51,28 @@ And check out the [React bindings](https://github.com/vasturiano/react-force-gra
|
|
|
51
51
|
|
|
52
52
|
## Quick start
|
|
53
53
|
|
|
54
|
-
```
|
|
54
|
+
```js
|
|
55
55
|
import ForceGraph3D from '3d-force-graph';
|
|
56
56
|
```
|
|
57
57
|
or
|
|
58
|
-
```
|
|
59
|
-
|
|
58
|
+
```js
|
|
59
|
+
const ForceGraph3D = require('3d-force-graph');
|
|
60
60
|
```
|
|
61
61
|
or even
|
|
62
|
-
```
|
|
62
|
+
```html
|
|
63
63
|
<script src="//unpkg.com/3d-force-graph"></script>
|
|
64
64
|
```
|
|
65
65
|
then
|
|
66
|
-
```
|
|
67
|
-
|
|
66
|
+
```js
|
|
67
|
+
const myGraph = ForceGraph3D();
|
|
68
68
|
myGraph(<myDOMElement>)
|
|
69
|
-
|
|
69
|
+
.graphData(<myData>);
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
## API reference
|
|
73
73
|
|
|
74
74
|
### Initialisation
|
|
75
|
-
```
|
|
75
|
+
```js
|
|
76
76
|
ForceGraph3d({ configOptions })(<domElement>)
|
|
77
77
|
```
|
|
78
78
|
|
|
@@ -209,7 +209,7 @@ ForceGraph3d({ configOptions })(<domElement>)
|
|
|
209
209
|
| <b>screen2GraphCoords</b>(<i>x</i>, <i>y</i>, <i>distance</i>) | Utility method to translate viewport distance coordinates to the graph domain. Given a pair of `x`,`y` screen coordinates and distance from the camera, returns the current equivalent `{x, y, z}` in the domain of graph node coordinates. |
|
|
210
210
|
|
|
211
211
|
### Input JSON syntax
|
|
212
|
-
```
|
|
212
|
+
```json
|
|
213
213
|
{
|
|
214
214
|
"nodes": [
|
|
215
215
|
{
|
|
@@ -222,14 +222,14 @@ ForceGraph3d({ configOptions })(<domElement>)
|
|
|
222
222
|
"name": "name2",
|
|
223
223
|
"val": 10
|
|
224
224
|
},
|
|
225
|
-
|
|
225
|
+
...
|
|
226
226
|
],
|
|
227
227
|
"links": [
|
|
228
228
|
{
|
|
229
229
|
"source": "id1",
|
|
230
230
|
"target": "id2"
|
|
231
231
|
},
|
|
232
|
-
|
|
232
|
+
...
|
|
233
233
|
]
|
|
234
234
|
}
|
|
235
235
|
```
|
|
@@ -238,9 +238,9 @@ ForceGraph3d({ configOptions })(<domElement>)
|
|
|
238
238
|
|
|
239
239
|
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=L398E7PKP47E8¤cy_code=USD&source=url) If this project has helped you and you'd like to contribute back, you can always [buy me a ☕](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=L398E7PKP47E8¤cy_code=USD&source=url)!
|
|
240
240
|
|
|
241
|
-
[npm-img]: https://img.shields.io/npm/v/3d-force-graph
|
|
241
|
+
[npm-img]: https://img.shields.io/npm/v/3d-force-graph
|
|
242
242
|
[npm-url]: https://npmjs.org/package/3d-force-graph
|
|
243
|
-
[build-size-img]: https://img.shields.io/bundlephobia/minzip/3d-force-graph
|
|
243
|
+
[build-size-img]: https://img.shields.io/bundlephobia/minzip/3d-force-graph
|
|
244
244
|
[build-size-url]: https://bundlephobia.com/result?p=3d-force-graph
|
|
245
|
-
[
|
|
246
|
-
[
|
|
245
|
+
[npm-downloads-img]: https://img.shields.io/npm/dt/3d-force-graph
|
|
246
|
+
[npm-downloads-url]: https://www.npmtrends.com/3d-force-graph
|
|
@@ -51,14 +51,9 @@ function ownKeys(object, enumerableOnly) {
|
|
|
51
51
|
|
|
52
52
|
if (Object.getOwnPropertySymbols) {
|
|
53
53
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
keys.push.apply(keys, symbols);
|
|
54
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
55
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
56
|
+
})), keys.push.apply(keys, symbols);
|
|
62
57
|
}
|
|
63
58
|
|
|
64
59
|
return keys;
|
|
@@ -66,19 +61,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
66
61
|
|
|
67
62
|
function _objectSpread2(target) {
|
|
68
63
|
for (var i = 1; i < arguments.length; i++) {
|
|
69
|
-
var source = arguments[i]
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
76
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
77
|
-
} else {
|
|
78
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
79
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
80
|
-
});
|
|
81
|
-
}
|
|
64
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
65
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
66
|
+
_defineProperty(target, key, source[key]);
|
|
67
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
68
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
69
|
+
});
|
|
82
70
|
}
|
|
83
71
|
|
|
84
72
|
return target;
|
|
@@ -173,7 +161,7 @@ var three = window.THREE ? window.THREE // Prefer consumption from global THREE,
|
|
|
173
161
|
var CAMERA_DISTANCE2NODES_FACTOR = 170; //
|
|
174
162
|
// Expose config from forceGraph
|
|
175
163
|
|
|
176
|
-
var bindFG = linkKapsule('forceGraph', ThreeForceGraph__default[
|
|
164
|
+
var bindFG = linkKapsule('forceGraph', ThreeForceGraph__default["default"]);
|
|
177
165
|
var linkedFGProps = Object.assign.apply(Object, _toConsumableArray(['jsonUrl', 'graphData', 'numDimensions', 'dagMode', 'dagLevelDistance', 'dagNodeFilter', 'onDagError', 'nodeRelSize', 'nodeId', 'nodeVal', 'nodeResolution', 'nodeColor', 'nodeAutoColorBy', 'nodeOpacity', 'nodeVisibility', 'nodeThreeObject', 'nodeThreeObjectExtend', 'linkSource', 'linkTarget', 'linkVisibility', 'linkColor', 'linkAutoColorBy', 'linkOpacity', 'linkWidth', 'linkResolution', 'linkCurvature', 'linkCurveRotation', 'linkMaterial', 'linkThreeObject', 'linkThreeObjectExtend', 'linkPositionUpdate', 'linkDirectionalArrowLength', 'linkDirectionalArrowColor', 'linkDirectionalArrowRelPos', 'linkDirectionalArrowResolution', 'linkDirectionalParticles', 'linkDirectionalParticleSpeed', 'linkDirectionalParticleWidth', 'linkDirectionalParticleColor', 'linkDirectionalParticleResolution', 'forceEngine', 'd3AlphaDecay', 'd3VelocityDecay', 'd3AlphaMin', 'ngraphPhysics', 'warmupTicks', 'cooldownTicks', 'cooldownTime', 'onEngineTick', 'onEngineStop'].map(function (p) {
|
|
178
166
|
return _defineProperty({}, p, bindFG.linkProp(p));
|
|
179
167
|
})));
|
|
@@ -181,7 +169,7 @@ var linkedFGMethods = Object.assign.apply(Object, _toConsumableArray(['refresh',
|
|
|
181
169
|
return _defineProperty({}, p, bindFG.linkMethod(p));
|
|
182
170
|
}))); // Expose config from renderObjs
|
|
183
171
|
|
|
184
|
-
var bindRenderObjs = linkKapsule('renderObjs', ThreeRenderObjects__default[
|
|
172
|
+
var bindRenderObjs = linkKapsule('renderObjs', ThreeRenderObjects__default["default"]);
|
|
185
173
|
var linkedRenderObjsProps = Object.assign.apply(Object, _toConsumableArray(['width', 'height', 'backgroundColor', 'showNavInfo', 'enablePointerInteraction'].map(function (p) {
|
|
186
174
|
return _defineProperty({}, p, bindRenderObjs.linkProp(p));
|
|
187
175
|
})));
|
|
@@ -192,7 +180,7 @@ var linkedRenderObjsMethods = Object.assign.apply(Object, _toConsumableArray(['c
|
|
|
192
180
|
screen2GraphCoords: bindRenderObjs.linkMethod('getSceneCoords')
|
|
193
181
|
}])); //
|
|
194
182
|
|
|
195
|
-
var _3dForceGraph = Kapsule__default[
|
|
183
|
+
var _3dForceGraph = Kapsule__default["default"]({
|
|
196
184
|
props: _objectSpread2(_objectSpread2({
|
|
197
185
|
nodeLabel: {
|
|
198
186
|
"default": 'name',
|
|
@@ -327,8 +315,8 @@ var _3dForceGraph = Kapsule__default['default']({
|
|
|
327
315
|
rendererConfig = _ref5.rendererConfig,
|
|
328
316
|
extraRenderers = _ref5.extraRenderers;
|
|
329
317
|
return {
|
|
330
|
-
forceGraph: new ThreeForceGraph__default[
|
|
331
|
-
renderObjs: ThreeRenderObjects__default[
|
|
318
|
+
forceGraph: new ThreeForceGraph__default["default"](),
|
|
319
|
+
renderObjs: ThreeRenderObjects__default["default"]({
|
|
332
320
|
controlType: controlType,
|
|
333
321
|
rendererConfig: rendererConfig,
|
|
334
322
|
extraRenderers: extraRenderers
|
|
@@ -497,7 +485,7 @@ var _3dForceGraph = Kapsule__default['default']({
|
|
|
497
485
|
|
|
498
486
|
controls.domElement && controls.domElement.ownerDocument && controls.domElement.ownerDocument.dispatchEvent( // simulate mouseup to ensure the controls don't take over after dragend
|
|
499
487
|
new PointerEvent('pointerup', {
|
|
500
|
-
pointerType: '
|
|
488
|
+
pointerType: 'touch'
|
|
501
489
|
}));
|
|
502
490
|
} // clear cursor
|
|
503
491
|
|
|
@@ -522,7 +510,7 @@ var _3dForceGraph = Kapsule__default['default']({
|
|
|
522
510
|
return isNode(bObj) - isNode(aObj);
|
|
523
511
|
}).tooltipContent(function (obj) {
|
|
524
512
|
var graphObj = getGraphObj(obj);
|
|
525
|
-
return graphObj ? accessorFn__default[
|
|
513
|
+
return graphObj ? accessorFn__default["default"](state["".concat(graphObj.__graphObjType, "Label")])(graphObj.__data) || '' : '';
|
|
526
514
|
}).hoverDuringDrag(false).onHover(function (obj) {
|
|
527
515
|
// Update tooltip and trigger onHover events
|
|
528
516
|
var hoverObj = getGraphObj(obj);
|
package/dist/3d-force-graph.d.ts
CHANGED
|
@@ -78,5 +78,4 @@ type ForceGraph3DInstance = ForceGraph3DGenericInstance<ForceGraph3DInstance>;
|
|
|
78
78
|
|
|
79
79
|
declare function ForceGraph3D(configOptions?: ConfigOptions): ForceGraph3DInstance;
|
|
80
80
|
|
|
81
|
-
export default
|
|
82
|
-
export { ConfigOptions, ForceGraph3DGenericInstance, ForceGraph3DInstance };
|
|
81
|
+
export { ConfigOptions, ForceGraph3DGenericInstance, ForceGraph3DInstance, ForceGraph3D as default };
|