3d-force-graph 1.74.7 → 1.76.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
@@ -107,7 +107,7 @@ new ForceGraph3d(<domElement>, { configOptions })
107
107
  | --- | --- | :--: |
108
108
  | <b>nodeRelSize</b>([<i>num</i>]) | Getter/setter for the ratio of node sphere volume (cubic px) per value unit. | 4 |
109
109
  | <b>nodeVal</b>([<i>num</i>, <i>str</i> or <i>fn</i>]) | Node object accessor function, attribute or a numeric constant for the node numeric value (affects sphere volume). | `val` |
110
- | <b>nodeLabel</b>([<i>str</i> or <i>fn</i>]) | Node object accessor function or attribute for name (shown in label). Supports plain text or HTML content. Note that this method uses `innerHTML` internally, so make sure to pre-sanitize any user-input content to prevent XSS vulnerabilities. | `name` |
110
+ | <b>nodeLabel</b>([<i>str</i> or <i>fn</i>]) | Node object accessor function or attribute for name (shown in label). Supports plain text, HTML string content or an [HTML element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement). | `name` |
111
111
  | <b>nodeVisibility</b>([<i>boolean</i>, <i>str</i> or <i>fn</i>]) | Node object accessor function, attribute or a boolean constant for whether to display the node. | `true` |
112
112
  | <b>nodeColor</b>([<i>str</i> or <i>fn</i>]) | Node object accessor function or attribute for node color (affects sphere color). | `color` |
113
113
  | <b>nodeAutoColorBy</b>([<i>str</i> or <i>fn</i>]) | Node object accessor function (`fn(node)`) or attribute (e.g. `'type'`) to automatically group colors by. Only affects nodes without a color attribute. | |
@@ -120,7 +120,7 @@ new ForceGraph3d(<domElement>, { configOptions })
120
120
 
121
121
  | Method | Description | Default |
122
122
  | --- | --- | :--: |
123
- | <b>linkLabel</b>([<i>str</i> or <i>fn</i>]) | Link object accessor function or attribute for name (shown in label). Supports plain text or HTML content. Note that this method uses `innerHTML` internally, so make sure to pre-sanitize any user-input content to prevent XSS vulnerabilities. | `name` |
123
+ | <b>linkLabel</b>([<i>str</i> or <i>fn</i>]) | Link object accessor function or attribute for name (shown in label). Supports plain text, HTML string content or an [HTML element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement). | `name` |
124
124
  | <b>linkVisibility</b>([<i>boolean</i>, <i>str</i> or <i>fn</i>]) | Link object accessor function, attribute or a boolean constant for whether to display the link line. A value of `false` maintains the link force without rendering it. | `true` |
125
125
  | <b>linkColor</b>([<i>str</i> or <i>fn</i>]) | Link object accessor function or attribute for line color. | `color` |
126
126
  | <b>linkAutoColorBy</b>([<i>str</i> or <i>fn</i>]) | Link object accessor function (`fn(link)`) or attribute (e.g. `'type'`) to automatically group colors by. Only affects links without a color attribute. | |
@@ -11,6 +11,8 @@ interface ConfigOptions {
11
11
  type Accessor<In, Out> = Out | string | ((obj: In) => Out);
12
12
  type ObjAccessor<T, InT = object> = Accessor<InT, T>;
13
13
 
14
+ type Label = string | HTMLElement;
15
+
14
16
  type Coords = { x: number; y: number; z: number; };
15
17
 
16
18
  // don't surface these internal props from inner ThreeForceGraph
@@ -32,10 +34,10 @@ interface ForceGraph3DGenericInstance<ChainableInstance, N extends NodeObject =
32
34
  showNavInfo(enabled: boolean): ChainableInstance;
33
35
 
34
36
  // Labels
35
- nodeLabel(): ObjAccessor<string, N>;
36
- nodeLabel(textAccessor: ObjAccessor<string, N>): ChainableInstance;
37
- linkLabel(): ObjAccessor<string, L>;
38
- linkLabel(textAccessor: ObjAccessor<string, L>): ChainableInstance;
37
+ nodeLabel(): ObjAccessor<Label, N>;
38
+ nodeLabel(textAccessor: ObjAccessor<Label, N>): ChainableInstance;
39
+ linkLabel(): ObjAccessor<Label, L>;
40
+ linkLabel(textAccessor: ObjAccessor<Label, L>): ChainableInstance;
39
41
 
40
42
  // Interaction
41
43
  onNodeClick(callback: (node: N, event: MouseEvent) => void): ChainableInstance;
@@ -1,4 +1,4 @@
1
- // Version 1.74.7 3d-force-graph - https://github.com/vasturiano/3d-force-graph
1
+ // Version 1.76.0 3d-force-graph - https://github.com/vasturiano/3d-force-graph
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) :
@@ -43,8 +43,8 @@
43
43
  function _arrayWithoutHoles$3(r) {
44
44
  if (Array.isArray(r)) return _arrayLikeToArray$5(r);
45
45
  }
46
- function _defineProperty$2(e, r, t) {
47
- return (r = _toPropertyKey$3(r)) in e ? Object.defineProperty(e, r, {
46
+ function _defineProperty$3(e, r, t) {
47
+ return (r = _toPropertyKey$4(r)) in e ? Object.defineProperty(e, r, {
48
48
  value: t,
49
49
  enumerable: true,
50
50
  configurable: true,
@@ -57,7 +57,7 @@
57
57
  function _nonIterableSpread$3() {
58
58
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
59
59
  }
60
- function ownKeys$1(e, r) {
60
+ function ownKeys$2(e, r) {
61
61
  var t = Object.keys(e);
62
62
  if (Object.getOwnPropertySymbols) {
63
63
  var o = Object.getOwnPropertySymbols(e);
@@ -67,12 +67,12 @@
67
67
  }
68
68
  return t;
69
69
  }
70
- function _objectSpread2$1(e) {
70
+ function _objectSpread2$2(e) {
71
71
  for (var r = 1; r < arguments.length; r++) {
72
72
  var t = null != arguments[r] ? arguments[r] : {};
73
- r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) {
74
- _defineProperty$2(e, r, t[r]);
75
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) {
73
+ r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) {
74
+ _defineProperty$3(e, r, t[r]);
75
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) {
76
76
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
77
77
  });
78
78
  }
@@ -81,7 +81,7 @@
81
81
  function _toConsumableArray$3(r) {
82
82
  return _arrayWithoutHoles$3(r) || _iterableToArray$3(r) || _unsupportedIterableToArray$5(r) || _nonIterableSpread$3();
83
83
  }
84
- function _toPrimitive$3(t, r) {
84
+ function _toPrimitive$4(t, r) {
85
85
  if ("object" != typeof t || !t) return t;
86
86
  var e = t[Symbol.toPrimitive];
87
87
  if (undefined !== e) {
@@ -91,8 +91,8 @@
91
91
  }
92
92
  return ("string" === r ? String : Number)(t);
93
93
  }
94
- function _toPropertyKey$3(t) {
95
- var i = _toPrimitive$3(t, "string");
94
+ function _toPropertyKey$4(t) {
95
+ var i = _toPrimitive$4(t, "string");
96
96
  return "symbol" == typeof i ? i : i + "";
97
97
  }
98
98
  function _unsupportedIterableToArray$5(r, a) {
@@ -39418,26 +39418,26 @@ void main() {
39418
39418
  }
39419
39419
 
39420
39420
  // https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use
39421
- const a = 1664525;
39422
- const c = 1013904223;
39423
- const m = 4294967296; // 2^32
39421
+ const a$1 = 1664525;
39422
+ const c$1 = 1013904223;
39423
+ const m$1 = 4294967296; // 2^32
39424
39424
 
39425
39425
  function lcg() {
39426
39426
  let s = 1;
39427
- return () => (s = (a * s + c) % m) / m;
39427
+ return () => (s = (a$1 * s + c$1) % m$1) / m$1;
39428
39428
  }
39429
39429
 
39430
39430
  var MAX_DIMENSIONS = 3;
39431
39431
 
39432
- function x(d) {
39432
+ function x$1(d) {
39433
39433
  return d.x;
39434
39434
  }
39435
39435
 
39436
- function y(d) {
39436
+ function y$1(d) {
39437
39437
  return d.y;
39438
39438
  }
39439
39439
 
39440
- function z(d) {
39440
+ function z$1(d) {
39441
39441
  return d.z;
39442
39442
  }
39443
39443
 
@@ -39639,9 +39639,9 @@ void main() {
39639
39639
  var i,
39640
39640
  n = nodes.length,
39641
39641
  tree =
39642
- (nDim === 1 ? binarytree(nodes, x)
39643
- :(nDim === 2 ? quadtree(nodes, x, y)
39644
- :(nDim === 3 ? octree(nodes, x, y, z)
39642
+ (nDim === 1 ? binarytree(nodes, x$1)
39643
+ :(nDim === 2 ? quadtree(nodes, x$1, y$1)
39644
+ :(nDim === 3 ? octree(nodes, x$1, y$1, z$1)
39645
39645
  :null
39646
39646
  ))).visitAfter(accumulate);
39647
39647
 
@@ -43186,7 +43186,7 @@ function InsertStackElement(node, body) {
43186
43186
  function _defineProperties$1(e, r) {
43187
43187
  for (var t = 0; t < r.length; t++) {
43188
43188
  var o = r[t];
43189
- o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey$2(o.key), o);
43189
+ o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey$3(o.key), o);
43190
43190
  }
43191
43191
  }
43192
43192
  function _createClass$1(e, r, t) {
@@ -43233,7 +43233,7 @@ function InsertStackElement(node, body) {
43233
43233
  function _toConsumableArray$2(r) {
43234
43234
  return _arrayWithoutHoles$2(r) || _iterableToArray$2(r) || _unsupportedIterableToArray$3(r) || _nonIterableSpread$2();
43235
43235
  }
43236
- function _toPrimitive$2(t, r) {
43236
+ function _toPrimitive$3(t, r) {
43237
43237
  if ("object" != typeof t || !t) return t;
43238
43238
  var e = t[Symbol.toPrimitive];
43239
43239
  if (undefined !== e) {
@@ -43243,8 +43243,8 @@ function InsertStackElement(node, body) {
43243
43243
  }
43244
43244
  return (String )(t);
43245
43245
  }
43246
- function _toPropertyKey$2(t) {
43247
- var i = _toPrimitive$2(t, "string");
43246
+ function _toPropertyKey$3(t) {
43247
+ var i = _toPrimitive$3(t, "string");
43248
43248
  return "symbol" == typeof i ? i : i + "";
43249
43249
  }
43250
43250
  function _unsupportedIterableToArray$3(r, a) {
@@ -44640,7 +44640,7 @@ function InsertStackElement(node, body) {
44640
44640
  function _defineProperties(e, r) {
44641
44641
  for (var t = 0; t < r.length; t++) {
44642
44642
  var o = r[t];
44643
- o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey$1(o.key), o);
44643
+ o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey$2(o.key), o);
44644
44644
  }
44645
44645
  }
44646
44646
  function _createClass(e, r, t) {
@@ -44648,8 +44648,8 @@ function InsertStackElement(node, body) {
44648
44648
  writable: false
44649
44649
  }), e;
44650
44650
  }
44651
- function _defineProperty$1(e, r, t) {
44652
- return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
44651
+ function _defineProperty$2(e, r, t) {
44652
+ return (r = _toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, {
44653
44653
  value: t,
44654
44654
  enumerable: true,
44655
44655
  configurable: true,
@@ -44723,7 +44723,7 @@ function InsertStackElement(node, body) {
44723
44723
  function _nonIterableSpread$1() {
44724
44724
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
44725
44725
  }
44726
- function ownKeys(e, r) {
44726
+ function ownKeys$1(e, r) {
44727
44727
  var t = Object.keys(e);
44728
44728
  if (Object.getOwnPropertySymbols) {
44729
44729
  var o = Object.getOwnPropertySymbols(e);
@@ -44733,12 +44733,12 @@ function InsertStackElement(node, body) {
44733
44733
  }
44734
44734
  return t;
44735
44735
  }
44736
- function _objectSpread2(e) {
44736
+ function _objectSpread2$1(e) {
44737
44737
  for (var r = 1; r < arguments.length; r++) {
44738
44738
  var t = null != arguments[r] ? arguments[r] : {};
44739
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
44740
- _defineProperty$1(e, r, t[r]);
44741
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
44739
+ r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) {
44740
+ _defineProperty$2(e, r, t[r]);
44741
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) {
44742
44742
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
44743
44743
  });
44744
44744
  }
@@ -44770,7 +44770,7 @@ function InsertStackElement(node, body) {
44770
44770
  function _toConsumableArray$1(r) {
44771
44771
  return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$2(r) || _nonIterableSpread$1();
44772
44772
  }
44773
- function _toPrimitive$1(t, r) {
44773
+ function _toPrimitive$2(t, r) {
44774
44774
  if ("object" != typeof t || !t) return t;
44775
44775
  var e = t[Symbol.toPrimitive];
44776
44776
  if (undefined !== e) {
@@ -44780,8 +44780,8 @@ function InsertStackElement(node, body) {
44780
44780
  }
44781
44781
  return ("string" === r ? String : Number)(t);
44782
44782
  }
44783
- function _toPropertyKey$1(t) {
44784
- var i = _toPrimitive$1(t, "string");
44783
+ function _toPropertyKey$2(t) {
44784
+ var i = _toPrimitive$2(t, "string");
44785
44785
  return "symbol" == typeof i ? i : i + "";
44786
44786
  }
44787
44787
  function _typeof$1(o) {
@@ -44845,7 +44845,7 @@ function InsertStackElement(node, body) {
44845
44845
  objBindAttr = _ref$objBindAttr === undefined ? '__threeObj' : _ref$objBindAttr;
44846
44846
  _classCallCheck(this, ThreeDigest);
44847
44847
  _this = _callSuper(this, ThreeDigest);
44848
- _defineProperty$1(_this, "scene", undefined);
44848
+ _defineProperty$2(_this, "scene", undefined);
44849
44849
  _classPrivateFieldInitSpec(_this, _dataBindAttr, undefined);
44850
44850
  _classPrivateFieldInitSpec(_this, _objBindAttr, undefined);
44851
44851
  _this.scene = scene;
@@ -44950,7 +44950,7 @@ function InsertStackElement(node, body) {
44950
44950
  var _ref7 = _slicedToArray$2(_ref6, 2),
44951
44951
  id = _ref7[0],
44952
44952
  node = _ref7[1];
44953
- return _defineProperty$1({}, id, node.depth);
44953
+ return _defineProperty$2({}, id, node.depth);
44954
44954
  }))));
44955
44955
  return nodeDepths;
44956
44956
  function traverse(nodes) {
@@ -45632,7 +45632,7 @@ function InsertStackElement(node, body) {
45632
45632
 
45633
45633
  // extract global x,y,z min/max
45634
45634
  return Object.assign.apply(Object, _toConsumableArray$1(['x', 'y', 'z'].map(function (c) {
45635
- return _defineProperty$1({}, c, [min(bboxes, function (bb) {
45635
+ return _defineProperty$2({}, c, [min(bboxes, function (bb) {
45636
45636
  return bb.min[c];
45637
45637
  }), max(bboxes, function (bb) {
45638
45638
  return bb.max[c];
@@ -46022,7 +46022,7 @@ function InsertStackElement(node, body) {
46022
46022
  state.graphData.links.forEach(function (link) {
46023
46023
  _graph.addLink(link.source, link.target);
46024
46024
  });
46025
- layout = ngraph.forcelayout(_graph, _objectSpread2({
46025
+ layout = ngraph.forcelayout(_graph, _objectSpread2$1({
46026
46026
  dimensions: state.numDimensions
46027
46027
  }, state.ngraphPhysics));
46028
46028
  layout.graph = _graph; // Attach graph reference to layout
@@ -106442,6 +106442,8 @@ var<${access}> ${name} : ${structName};`;
106442
106442
  return [event.pageX, event.pageY];
106443
106443
  }
106444
106444
 
106445
+ var n,l,u,t,i,r,o,e,f,c,s,a,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var u in l)n[u]=l[u];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function g(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps) undefined===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:undefined,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function k(n){return n.children}function x(n,l){this.props=n,this.context=l;}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?C(n):null}function S(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return S(n)}}function M(n){(!n.__d&&(n.__d=true)&&i.push(n)&&!P.__r++||r!==l.debounceRendering)&&((r=l.debounceRendering)||o)(P);}function P(){var n,u,t,r,o,f,c,s;for(i.sort(e);n=i.shift();)n.__d&&(u=i.length,r=undefined,f=(o=(t=n).__v).__e,c=[],s=[],t.__P&&((r=w({},o)).__v=o.__v+1,l.vnode&&l.vnode(r),j(t.__P,r,o,t.__n,t.__P.namespaceURI,32&o.__u?[f]:null,c,null==f?C(o):f,!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,z(c,r,s),r.__e!=f&&S(r)),i.length>u&&i.sort(e));P.__r=0;}function $(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,d,w,_,g=t&&t.__k||v,m=l.length;for(f=I(u,l,g,f,m),a=0;a<m;a++)null!=(y=u.__k[a])&&(h=-1===y.__i?p:g[y.__i]||p,y.__i=a,_=j(n,y,h,i,r,o,e,f,c,s),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&V(h.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),4&y.__u||h.__k===y.__k?f=A(y,f,n):"function"==typeof y.type&&undefined!==_?f=_:d&&(f=d.nextSibling),y.__u&=-7);return u.__e=w,f}function I(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?(f=r+h,(o=n.__k[r]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(k,{children:o},null,null,null):undefined===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!==(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null===e.__v?(-1==c&&h--,"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=C(e)),q(e,e));return t}function A(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=A(t[i],l,u));return l}n.__e!=l&&(l&&n.type&&!u.contains(l)&&(l=C(n)),u.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function L(n,l,u,t){var i,r,o=n.key,e=n.type,f=l[u];if(null===f||f&&o==f.key&&e===f.type&&0==(2&f.__u))return u;if(t>(null!=f&&0==(2&f.__u)?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;){if(i>=0){if((f=l[i])&&0==(2&f.__u)&&o==f.key&&e===f.type)return i;i--;}if(r<l.length){if((f=l[r])&&0==(2&f.__u)&&o==f.key&&e===f.type)return r;r++;}}return -1}function T(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px";}function F(n,l,u,t,i){var r;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||T(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f,"$1")),l=l.toLowerCase()in n||"onFocusOut"==l||"onFocusIn"==l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c,n.addEventListener(l,r?a:s,r)):n.removeEventListener(l,r?a:s,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||false===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function O(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function j(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,g,m,b,C,S,M,P,I,A,H,L,T,F=u.type;if(undefined!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l.__b)&&a(u);n:if("function"==typeof F)try{if(b=u.props,C="prototype"in F&&F.prototype.render,S=(a=F.contextType)&&i[a.__c],M=a?S?S.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(C?u.__c=h=new F(b,M):(u.__c=h=new x(b,M),h.constructor=F,h.render=B),S&&S.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),C&&null==h.__s&&(h.__s=h.state),C&&null!=F.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,F.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)C&&null==F.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),C&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(C&&null==F.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v==t.__v)){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),C&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,g);});}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,I=l.__r,A=0,C){for(h.state=h.__s,h.__d=!1,I&&I(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,I&&I(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=w(w({},i),h.getChildContext())),C&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(v,y)),f=$(n,d(L=null!=a&&a.type===k&&null==a.key?a.props.children:a)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null);}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f;}else for(T=o.length;T--;)_(o[T]);else u.__e=t.__e,u.__k=t.__k;l.__e(n,u,t);}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=N(t.__e,u,t,i,r,o,e,c,s);return (a=l.diffed)&&a(u),128&u.__u?undefined:f}function z(n,u,t){for(var i=0;i<t.length;i++)V(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l.__e(n,u.__v);}});}function N(u,t,i,r,o,e,f,c,s){var a,h,v,y,w,g,m,b=i.props,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((w=e[a])&&"setAttribute"in w==!!x&&(x?w.localName==x:3==w.nodeType)){u=w,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l.__m&&l.__m(t,e),c=false),e=null;}if(null===x)b===k||c&&u.data===k||(u.data=k);else {if(e=e&&n.call(u.childNodes),b=i.props||p,!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(w=u.attributes[a]).name]=w.value;for(a in b)if(w=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=w;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;F(u,a,null,w,o);}for(a in k)w=k[a],"children"==a?y=w:"dangerouslySetInnerHTML"==a?h=w:"value"==a?g=w:"checked"==a?m=w:c&&"function"!=typeof w||b[a]===w||F(u,a,w,b[a],o);if(h)c||v&&(h.__html===v.__html||h.__html===u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),$(u,d(y)?y:[y],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&C(i,0),c,s),null!=e)for(a=e.length;a--;)_(e[a]);c||(a="value","progress"==x&&null==g?u.removeAttribute("value"):undefined!==g&&(g!==u[a]||"progress"==x&&!g||"option"==x&&g!==b[a])&&F(u,a,g,b[a],o),a="checked",undefined!==m&&m!==u[a]&&F(u,a,m,b[a],o));}return u}function V(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l.__e(n,t);}}function q(n,u,t){var i,r;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||V(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l.__e(n,u);}i.base=i.__P=null;}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&q(i[r],u,t||"function"!=typeof n.type);t||_(n.__e),n.__c=n.__=n.__e=undefined;}function B(n,l,u){return this.constructor(n,u)}function D(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l.__&&l.__(u,t),o=(r="function"=="undefined")?null:t.__k,e=[],f=[],j(t,u=(t).__k=g(k,null,[u]),o||p,p,t.namespaceURI,o?null:t.firstChild?n.call(t.childNodes):null,e,o?o.__e:t.firstChild,r,f),z(e,u,f);}function G(l,u,t){var i,r,o,e,f=w({},l.props);for(o in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==o?i=u[o]:"ref"==o?r=u[o]:f[o]=undefined===u[o]&&undefined!==e?e[o]:u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,r||l.ref,null)}n=v.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l;}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},u),this.props)),n&&w(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this));},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=true,n&&this.__h.push(n),M(this));},x.prototype.render=k,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=O(false),a=O(true);
106446
+
106445
106447
  function _arrayLikeToArray$1(r, a) {
106446
106448
  (null == a || a > r.length) && (a = r.length);
106447
106449
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
@@ -106450,6 +106452,14 @@ var<${access}> ${name} : ${structName};`;
106450
106452
  function _arrayWithHoles$1(r) {
106451
106453
  if (Array.isArray(r)) return r;
106452
106454
  }
106455
+ function _defineProperty$1(e, r, t) {
106456
+ return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
106457
+ value: t,
106458
+ enumerable: true,
106459
+ configurable: true,
106460
+ writable: true
106461
+ }) : e[r] = t, e;
106462
+ }
106453
106463
  function _iterableToArrayLimit$1(r, l) {
106454
106464
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
106455
106465
  if (null != t) {
@@ -106477,9 +106487,44 @@ var<${access}> ${name} : ${structName};`;
106477
106487
  function _nonIterableRest$1() {
106478
106488
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
106479
106489
  }
106490
+ function ownKeys(e, r) {
106491
+ var t = Object.keys(e);
106492
+ if (Object.getOwnPropertySymbols) {
106493
+ var o = Object.getOwnPropertySymbols(e);
106494
+ r && (o = o.filter(function (r) {
106495
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
106496
+ })), t.push.apply(t, o);
106497
+ }
106498
+ return t;
106499
+ }
106500
+ function _objectSpread2(e) {
106501
+ for (var r = 1; r < arguments.length; r++) {
106502
+ var t = null != arguments[r] ? arguments[r] : {};
106503
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
106504
+ _defineProperty$1(e, r, t[r]);
106505
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
106506
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
106507
+ });
106508
+ }
106509
+ return e;
106510
+ }
106480
106511
  function _slicedToArray$1(r, e) {
106481
106512
  return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest$1();
106482
106513
  }
106514
+ function _toPrimitive$1(t, r) {
106515
+ if ("object" != typeof t || !t) return t;
106516
+ var e = t[Symbol.toPrimitive];
106517
+ if (undefined !== e) {
106518
+ var i = e.call(t, r || "default");
106519
+ if ("object" != typeof i) return i;
106520
+ throw new TypeError("@@toPrimitive must return a primitive value.");
106521
+ }
106522
+ return ("string" === r ? String : Number)(t);
106523
+ }
106524
+ function _toPropertyKey$1(t) {
106525
+ var i = _toPrimitive$1(t, "string");
106526
+ return "symbol" == typeof i ? i : i + "";
106527
+ }
106483
106528
  function _typeof(o) {
106484
106529
  "@babel/helpers - typeof";
106485
106530
 
@@ -106497,6 +106542,26 @@ var<${access}> ${name} : ${structName};`;
106497
106542
  }
106498
106543
  }
106499
106544
 
106545
+ var _reactElement2VNode = function reactElement2VNode(el) {
106546
+ // Among other things, react VNodes (and all its children) need to have constructor: undefined attributes in order to be recognised, cloneElement (applied recursively) does the necessary conversion
106547
+ if (!(_typeof(el) === 'object')) return el;
106548
+ var res = G(el);
106549
+ if (res.props) {
106550
+ var _res$props;
106551
+ res.props = _objectSpread2({}, res.props);
106552
+ if (res !== null && res !== undefined && (_res$props = res.props) !== null && _res$props !== undefined && _res$props.children) {
106553
+ res.props.children = Array.isArray(res.props.children) ? res.props.children.map(_reactElement2VNode) : _reactElement2VNode(res.props.children);
106554
+ }
106555
+ }
106556
+ return res;
106557
+ };
106558
+ var isReactRenderable = function isReactRenderable(o) {
106559
+ return t(G(o));
106560
+ };
106561
+ var render = function render(jsx, domEl) {
106562
+ return D(_reactElement2VNode(jsx), domEl);
106563
+ };
106564
+
106500
106565
  function styleInject$1(css, ref) {
106501
106566
  if (ref === undefined) ref = {};
106502
106567
  var insertAt = ref.insertAt;
@@ -106522,7 +106587,7 @@ var<${access}> ${name} : ${structName};`;
106522
106587
  }
106523
106588
  }
106524
106589
 
106525
- var css_248z$1 = ".float-tooltip-kap {\n position: absolute;\n width: max-content; /* prevent shrinking near right edge */\n padding: 3px 5px;\n border-radius: 3px;\n font: 12px sans-serif;\n color: #eee;\n background: rgba(0,0,0,0.6);\n pointer-events: none;\n}\n";
106590
+ var css_248z$1 = ".float-tooltip-kap {\n position: absolute;\n width: max-content; /* prevent shrinking near right edge */\n max-width: max(50%, 150px);\n padding: 3px 5px;\n border-radius: 3px;\n font: 12px sans-serif;\n color: #eee;\n background: rgba(0,0,0,0.6);\n pointer-events: none;\n}\n";
106526
106591
  styleInject$1(css_248z$1);
106527
106592
 
106528
106593
  var index = index$2({
@@ -106537,6 +106602,9 @@ var<${access}> ${name} : ${structName};`;
106537
106602
  style = _ref$style === undefined ? {} : _ref$style;
106538
106603
  var isD3Selection = !!domNode && _typeof(domNode) === 'object' && !!domNode.node && typeof domNode.node === 'function';
106539
106604
  var el = select(isD3Selection ? domNode.node() : domNode);
106605
+
106606
+ // make sure container is positioned, to provide anchor for tooltip
106607
+ el.style('position') === 'static' && el.style('position', 'relative');
106540
106608
  state.tooltipEl = el.append('div').attr('class', 'float-tooltip-kap');
106541
106609
  Object.entries(style).forEach(function (_ref2) {
106542
106610
  var _ref3 = _slicedToArray$1(_ref2, 2),
@@ -106570,7 +106638,22 @@ var<${access}> ${name} : ${structName};`;
106570
106638
  },
106571
106639
  update: function update(state) {
106572
106640
  state.tooltipEl.style('display', !!state.content && state.mouseInside ? 'inline' : 'none');
106573
- state.tooltipEl.html(state.content || '');
106641
+ if (!state.content) {
106642
+ state.tooltipEl.text('');
106643
+ } else if (state.content instanceof HTMLElement) {
106644
+ state.tooltipEl.text(''); // empty it
106645
+ state.tooltipEl.append(function () {
106646
+ return state.content;
106647
+ });
106648
+ } else if (typeof state.content === 'string') {
106649
+ state.tooltipEl.html(state.content);
106650
+ } else if (isReactRenderable(state.content)) {
106651
+ state.tooltipEl.text(''); // empty it
106652
+ render(state.content, state.tooltipEl.node());
106653
+ } else {
106654
+ state.tooltipEl.style('display', 'none');
106655
+ console.warn('Tooltip content is invalid, skipping.', state.content, state.content.toString());
106656
+ }
106574
106657
  }
106575
106658
  });
106576
106659
 
@@ -107254,19 +107337,19 @@ var<${access}> ${name} : ${structName};`;
107254
107337
  // Expose config from forceGraph
107255
107338
  var bindFG = linkKapsule('forceGraph', threeForcegraph);
107256
107339
  var linkedFGProps = Object.assign.apply(Object, _toConsumableArray$3(['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) {
107257
- return _defineProperty$2({}, p, bindFG.linkProp(p));
107340
+ return _defineProperty$3({}, p, bindFG.linkProp(p));
107258
107341
  })));
107259
107342
  var linkedFGMethods = Object.assign.apply(Object, _toConsumableArray$3(['refresh', 'getGraphBbox', 'd3Force', 'd3ReheatSimulation', 'emitParticle'].map(function (p) {
107260
- return _defineProperty$2({}, p, bindFG.linkMethod(p));
107343
+ return _defineProperty$3({}, p, bindFG.linkMethod(p));
107261
107344
  })));
107262
107345
 
107263
107346
  // Expose config from renderObjs
107264
107347
  var bindRenderObjs = linkKapsule('renderObjs', threeRenderObjects);
107265
107348
  var linkedRenderObjsProps = Object.assign.apply(Object, _toConsumableArray$3(['width', 'height', 'backgroundColor', 'showNavInfo', 'enablePointerInteraction'].map(function (p) {
107266
- return _defineProperty$2({}, p, bindRenderObjs.linkProp(p));
107349
+ return _defineProperty$3({}, p, bindRenderObjs.linkProp(p));
107267
107350
  })));
107268
107351
  var linkedRenderObjsMethods = Object.assign.apply(Object, _toConsumableArray$3(['lights', 'cameraPosition', 'postProcessingComposer'].map(function (p) {
107269
- return _defineProperty$2({}, p, bindRenderObjs.linkMethod(p));
107352
+ return _defineProperty$3({}, p, bindRenderObjs.linkMethod(p));
107270
107353
  })).concat([{
107271
107354
  graph2ScreenCoords: bindRenderObjs.linkMethod('getScreenCoords'),
107272
107355
  screen2GraphCoords: bindRenderObjs.linkMethod('getSceneCoords')
@@ -107275,7 +107358,7 @@ var<${access}> ${name} : ${structName};`;
107275
107358
  //
107276
107359
 
107277
107360
  var _3dForceGraph = index$2({
107278
- props: _objectSpread2$1(_objectSpread2$1({
107361
+ props: _objectSpread2$2(_objectSpread2$2({
107279
107362
  nodeLabel: {
107280
107363
  "default": 'name',
107281
107364
  triggerUpdate: false
@@ -107340,7 +107423,7 @@ var<${access}> ${name} : ${structName};`;
107340
107423
  triggerUpdate: false
107341
107424
  }
107342
107425
  }, linkedFGProps), linkedRenderObjsProps),
107343
- methods: _objectSpread2$1(_objectSpread2$1({
107426
+ methods: _objectSpread2$2(_objectSpread2$2({
107344
107427
  zoomToFit: function zoomToFit(state, transitionDuration, padding) {
107345
107428
  var _state$forceGraph;
107346
107429
  for (var _len = arguments.length, bboxArgs = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {