@react-fabric/graph 1.0.0-beta.62 → 1.0.0-beta.63

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.
Files changed (40) hide show
  1. package/css/styles.css +1 -1
  2. package/dist/cjs/_virtual/elk-worker.js +1 -1
  3. package/dist/cjs/components/ContextMenu.js +7 -7
  4. package/dist/cjs/components/{Context.js → Provider.js} +2 -6
  5. package/dist/cjs/components/Tools.js +38 -38
  6. package/dist/cjs/components/Viewer.js +6 -5
  7. package/dist/cjs/components/context.js +34 -0
  8. package/dist/cjs/graph/index.js +15 -15
  9. package/dist/cjs/programs/node-badge/factory.js +3 -2
  10. package/dist/cjs/programs/node-badge/texture.js +30 -30
  11. package/dist/cjs/programs/node-image/factory.js +3 -2
  12. package/dist/cjs/programs/node-image/texture.js +36 -36
  13. package/dist/esm/_virtual/elk-worker.js +1 -1
  14. package/dist/esm/components/ContextMenu.js +3 -3
  15. package/dist/esm/components/{Context.js → Provider.js} +3 -6
  16. package/dist/esm/components/Tools.js +37 -37
  17. package/dist/esm/components/Viewer.js +4 -3
  18. package/dist/esm/components/context.js +33 -0
  19. package/dist/esm/graph/index.js +15 -15
  20. package/dist/esm/programs/node-badge/factory.js +3 -2
  21. package/dist/esm/programs/node-badge/texture.js +30 -30
  22. package/dist/esm/programs/node-image/factory.js +3 -2
  23. package/dist/esm/programs/node-image/texture.js +36 -36
  24. package/dist/types/components/Provider.d.ts +3 -0
  25. package/dist/types/components/{Context.d.ts → context.d.ts} +3 -4
  26. package/dist/types/programs/edge-curve/drawLabel.d.ts +1 -1
  27. package/package.json +12 -12
  28. package/src/components/ContextMenu.tsx +11 -47
  29. package/src/components/{Context.tsx → Provider.tsx} +3 -30
  30. package/src/components/Tools.tsx +13 -51
  31. package/src/components/Viewer.tsx +6 -7
  32. package/src/components/context.ts +43 -0
  33. package/src/programs/arrow-head/index.ts +0 -1
  34. package/src/programs/edge-curve/drawLabel.ts +1 -1
  35. package/src/programs/edge-curve/index.ts +0 -2
  36. package/src/programs/edge-line/index.ts +0 -2
  37. package/src/programs/node-badge/factory.ts +0 -2
  38. package/src/programs/node-circle/base/index.ts +0 -2
  39. package/src/programs/node-image/factory.ts +0 -2
  40. package/src/programs/node-rect/base/index.ts +0 -2
@@ -6,7 +6,7 @@ var react$1 = require('@floating-ui/react');
6
6
  var core = require('@react-fabric/core');
7
7
  var react = require('react');
8
8
  var index = require('../constants/index.js');
9
- var Context = require('./Context.js');
9
+ var context = require('./context.js');
10
10
  var jsxRuntime = require('react/jsx-runtime');
11
11
 
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -18,7 +18,7 @@ var GraphContextMenu = function GraphContextMenu() {
18
18
  isOpen = _useState2[0],
19
19
  setIsOpen = _useState2[1];
20
20
  var nodeId = react$1.useFloatingNodeId();
21
- var _useGraph = Context.useGraph(),
21
+ var _useGraph = context.useGraph(),
22
22
  sigma = _useGraph.sigma;
23
23
  var _useState3 = react.useState([]),
24
24
  _useState4 = _slicedToArray(_useState3, 2),
@@ -38,12 +38,12 @@ var GraphContextMenu = function GraphContextMenu() {
38
38
  }),
39
39
  refs = _useFloating.refs,
40
40
  floatingStyles = _useFloating.floatingStyles,
41
- context = _useFloating.context;
42
- var click = react$1.useClick(context, {
41
+ context$1 = _useFloating.context;
42
+ var click = react$1.useClick(context$1, {
43
43
  toggle: true,
44
44
  ignoreMouse: true
45
45
  });
46
- var dismiss = react$1.useDismiss(context, {
46
+ var dismiss = react$1.useDismiss(context$1, {
47
47
  bubbles: true
48
48
  });
49
49
  var _useInteractions = react$1.useInteractions([dismiss, click]),
@@ -115,7 +115,7 @@ var GraphContextMenu = function GraphContextMenu() {
115
115
  }, [sigma]);
116
116
  return isOpen && /*#__PURE__*/jsxRuntime.jsx(react$1.FloatingPortal, {
117
117
  root: (_refs$domReference$cu = (_refs$domReference$cu2 = refs.domReference.current) === null || _refs$domReference$cu2 === void 0 ? void 0 : _refs$domReference$cu2.closest(".theme-base")) !== null && _refs$domReference$cu !== void 0 ? _refs$domReference$cu : undefined,
118
- children: /*#__PURE__*/react.cloneElement( /*#__PURE__*/jsxRuntime.jsx(core.Menu, {
118
+ children: /*#__PURE__*/react.cloneElement(/*#__PURE__*/jsxRuntime.jsx(core.Menu, {
119
119
  children: menu
120
120
  }), _objectSpread(_objectSpread({}, getFloatingProps()), {}, {
121
121
  style: _objectSpread(_objectSpread({}, floatingStyles), {}, {
@@ -123,7 +123,7 @@ var GraphContextMenu = function GraphContextMenu() {
123
123
  zIndex: "var(--z-popover)",
124
124
  fontSize: "0.75rem"
125
125
  }),
126
- className: "bg-base outline rounded-capped shadow-lg",
126
+ className: "bg-default outline rounded-capped shadow-lg",
127
127
  ref: refs.setFloating,
128
128
  onMouseUp: tryClosing.current
129
129
  }))
@@ -7,12 +7,9 @@ var react = require('react');
7
7
  var sigmaDragSelect = require('../hooks/sigmaDragSelect.js');
8
8
  var useGraphology = require('../hooks/useGraphology.js');
9
9
  var useSigma = require('../hooks/useSigma.js');
10
+ var context = require('./context.js');
10
11
  var jsxRuntime = require('react/jsx-runtime');
11
12
 
12
- var GraphContext = /*#__PURE__*/react.createContext({});
13
- var useGraph = function useGraph() {
14
- return react.useContext(GraphContext);
15
- };
16
13
  var GraphProvider = function GraphProvider(_ref) {
17
14
  var ref = _ref.ref,
18
15
  data = _ref.data,
@@ -83,7 +80,7 @@ var GraphProvider = function GraphProvider(_ref) {
83
80
  sigma: sigma
84
81
  };
85
82
  }, [graph, sigma]);
86
- return /*#__PURE__*/jsxRuntime.jsxs(GraphContext.Provider, {
83
+ return /*#__PURE__*/jsxRuntime.jsxs(context.GraphContext.Provider, {
87
84
  value: {
88
85
  sigma: sigma,
89
86
  graph: graph,
@@ -104,4 +101,3 @@ var GraphProvider = function GraphProvider(_ref) {
104
101
  };
105
102
 
106
103
  exports.GraphProvider = GraphProvider;
107
- exports.useGraph = useGraph;
@@ -4,11 +4,11 @@ var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
4
4
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
5
5
  var core = require('@react-fabric/core');
6
6
  var index = require('../constants/index.js');
7
- var Context = require('./Context.js');
7
+ var context = require('./context.js');
8
8
  var jsxRuntime = require('react/jsx-runtime');
9
9
 
10
10
  var Tools = function Tools() {
11
- var _useGraph = Context.useGraph(),
11
+ var _useGraph = context.useGraph(),
12
12
  dragSelector = _useGraph.dragSelector,
13
13
  graph = _useGraph.graph,
14
14
  selected = _useGraph.selected,
@@ -16,7 +16,7 @@ var Tools = function Tools() {
16
16
  zoomIn = _useGraph.zoomIn,
17
17
  zoomOut = _useGraph.zoomOut;
18
18
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
19
- className: "flex flex-nowrap outline absolute top-0 start-0 p-0 z-1 bg-base",
19
+ className: "flex flex-nowrap outline absolute top-0 start-0 p-0 z-1 bg-default",
20
20
  children: [/*#__PURE__*/jsxRuntime.jsxs(core.ButtonGroup, {
21
21
  variant: "link",
22
22
  children: [/*#__PURE__*/jsxRuntime.jsx(core.Button, {
@@ -67,15 +67,15 @@ var Tools = function Tools() {
67
67
  className: "text-sm",
68
68
  children: [/*#__PURE__*/jsxRuntime.jsx(core.MenuItem, {
69
69
  label: "box",
70
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
71
- return _regeneratorRuntime.wrap(function _callee$(_context) {
70
+ onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
71
+ return _regeneratorRuntime.wrap(function (_context) {
72
72
  while (1) switch (_context.prev = _context.next) {
73
73
  case 0:
74
- _context.next = 2;
74
+ _context.next = 1;
75
75
  return graph.elkLayout("box");
76
- case 2:
76
+ case 1:
77
77
  return _context.abrupt("return", _context.sent);
78
- case 3:
78
+ case 2:
79
79
  case "end":
80
80
  return _context.stop();
81
81
  }
@@ -83,15 +83,15 @@ var Tools = function Tools() {
83
83
  }))
84
84
  }), /*#__PURE__*/jsxRuntime.jsx(core.MenuItem, {
85
85
  label: "force",
86
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
87
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
86
+ onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
87
+ return _regeneratorRuntime.wrap(function (_context2) {
88
88
  while (1) switch (_context2.prev = _context2.next) {
89
89
  case 0:
90
- _context2.next = 2;
90
+ _context2.next = 1;
91
91
  return graph.elkLayout("force");
92
- case 2:
92
+ case 1:
93
93
  return _context2.abrupt("return", _context2.sent);
94
- case 3:
94
+ case 2:
95
95
  case "end":
96
96
  return _context2.stop();
97
97
  }
@@ -99,15 +99,15 @@ var Tools = function Tools() {
99
99
  }))
100
100
  }), /*#__PURE__*/jsxRuntime.jsx(core.MenuItem, {
101
101
  label: "layered",
102
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
103
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
102
+ onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
103
+ return _regeneratorRuntime.wrap(function (_context3) {
104
104
  while (1) switch (_context3.prev = _context3.next) {
105
105
  case 0:
106
- _context3.next = 2;
106
+ _context3.next = 1;
107
107
  return graph.elkLayout("layered");
108
- case 2:
108
+ case 1:
109
109
  return _context3.abrupt("return", _context3.sent);
110
- case 3:
110
+ case 2:
111
111
  case "end":
112
112
  return _context3.stop();
113
113
  }
@@ -115,15 +115,15 @@ var Tools = function Tools() {
115
115
  }))
116
116
  }), /*#__PURE__*/jsxRuntime.jsx(core.MenuItem, {
117
117
  label: "stress",
118
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
119
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
118
+ onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
119
+ return _regeneratorRuntime.wrap(function (_context4) {
120
120
  while (1) switch (_context4.prev = _context4.next) {
121
121
  case 0:
122
- _context4.next = 2;
122
+ _context4.next = 1;
123
123
  return graph.elkLayout("stress");
124
- case 2:
124
+ case 1:
125
125
  return _context4.abrupt("return", _context4.sent);
126
- case 3:
126
+ case 2:
127
127
  case "end":
128
128
  return _context4.stop();
129
129
  }
@@ -131,15 +131,15 @@ var Tools = function Tools() {
131
131
  }))
132
132
  }), /*#__PURE__*/jsxRuntime.jsx(core.MenuItem, {
133
133
  label: "radial",
134
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
135
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
134
+ onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
135
+ return _regeneratorRuntime.wrap(function (_context5) {
136
136
  while (1) switch (_context5.prev = _context5.next) {
137
137
  case 0:
138
- _context5.next = 2;
138
+ _context5.next = 1;
139
139
  return graph.elkLayout("radial");
140
- case 2:
140
+ case 1:
141
141
  return _context5.abrupt("return", _context5.sent);
142
- case 3:
142
+ case 2:
143
143
  case "end":
144
144
  return _context5.stop();
145
145
  }
@@ -147,15 +147,15 @@ var Tools = function Tools() {
147
147
  }))
148
148
  }), /*#__PURE__*/jsxRuntime.jsx(core.MenuItem, {
149
149
  label: "sporeOverlap",
150
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
151
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
150
+ onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
151
+ return _regeneratorRuntime.wrap(function (_context6) {
152
152
  while (1) switch (_context6.prev = _context6.next) {
153
153
  case 0:
154
- _context6.next = 2;
154
+ _context6.next = 1;
155
155
  return graph.elkLayout("sporeOverlap");
156
- case 2:
156
+ case 1:
157
157
  return _context6.abrupt("return", _context6.sent);
158
- case 3:
158
+ case 2:
159
159
  case "end":
160
160
  return _context6.stop();
161
161
  }
@@ -163,15 +163,15 @@ var Tools = function Tools() {
163
163
  }))
164
164
  }), /*#__PURE__*/jsxRuntime.jsx(core.MenuItem, {
165
165
  label: "sporeCompaction",
166
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
167
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
166
+ onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
167
+ return _regeneratorRuntime.wrap(function (_context7) {
168
168
  while (1) switch (_context7.prev = _context7.next) {
169
169
  case 0:
170
- _context7.next = 2;
170
+ _context7.next = 1;
171
171
  return graph.elkLayout("sporeCompaction");
172
- case 2:
172
+ case 1:
173
173
  return _context7.abrupt("return", _context7.sent);
174
- case 3:
174
+ case 2:
175
175
  case "end":
176
176
  return _context7.stop();
177
177
  }
@@ -2,16 +2,17 @@
2
2
 
3
3
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
4
  var core = require('@react-fabric/core');
5
- var Context = require('./Context.js');
6
- var Tools = require('./Tools.js');
7
5
  var react = require('react');
8
6
  var ContextMenu = require('./ContextMenu.js');
7
+ var Provider = require('./Provider.js');
8
+ var Tools = require('./Tools.js');
9
+ var context = require('./context.js');
9
10
  var jsxRuntime = require('react/jsx-runtime');
10
11
 
11
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
14
  var Graph = function Graph() {
14
- var _useGraph = Context.useGraph(),
15
+ var _useGraph = context.useGraph(),
15
16
  sigma = _useGraph.sigma,
16
17
  graph = _useGraph.graph;
17
18
  var handlesRef = react.useRef(null);
@@ -29,7 +30,7 @@ var Graph = function Graph() {
29
30
  };
30
31
  }, [graph]);
31
32
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
32
- className: "area-content relative bg-base graph-viewer",
33
+ className: "area-content relative bg-default graph-viewer",
33
34
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
34
35
  dir: "ltr",
35
36
  ref: sigma.containerRef,
@@ -49,7 +50,7 @@ var Graph = function Graph() {
49
50
  var SigmaGraph = function SigmaGraph(props) {
50
51
  return /*#__PURE__*/jsxRuntime.jsx(core.Section, {
51
52
  className: "relative",
52
- children: /*#__PURE__*/jsxRuntime.jsxs(Context.GraphProvider, _objectSpread(_objectSpread({}, props), {}, {
53
+ children: /*#__PURE__*/jsxRuntime.jsxs(Provider.GraphProvider, _objectSpread(_objectSpread({}, props), {}, {
53
54
  children: [/*#__PURE__*/jsxRuntime.jsx(Tools.Tools, {}), /*#__PURE__*/jsxRuntime.jsx(Graph, {}), /*#__PURE__*/jsxRuntime.jsx(ContextMenu.GraphContextMenu, {})]
54
55
  }))
55
56
  });
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+
5
+ /*
6
+ * React Fabric
7
+ * @version: 1.0.0
8
+ *
9
+ *
10
+ * The MIT License (MIT)
11
+ * Copyright (c) 2026 Adarsh Pastakia
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
14
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
15
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
16
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
17
+ * subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
20
+ * portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
23
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
+ */
27
+
28
+ var GraphContext = /*#__PURE__*/react.createContext({});
29
+ var useGraph = function useGraph() {
30
+ return react.useContext(GraphContext);
31
+ };
32
+
33
+ exports.GraphContext = GraphContext;
34
+ exports.useGraph = useGraph;
@@ -7,8 +7,8 @@ var _typeof = require('@babel/runtime/helpers/typeof');
7
7
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
8
8
  var _createClass = require('@babel/runtime/helpers/createClass');
9
9
  var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstructorReturn');
10
- var _get = require('@babel/runtime/helpers/get');
11
10
  var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
11
+ var _get = require('@babel/runtime/helpers/get');
12
12
  var _inherits = require('@babel/runtime/helpers/inherits');
13
13
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
14
14
  var utilities = require('@react-fabric/utilities');
@@ -25,6 +25,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
25
25
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26
26
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
27
27
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
28
+ function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
28
29
  var Graph = /*#__PURE__*/function (_Graphology) {
29
30
  function Graph(options) {
30
31
  var _this;
@@ -54,21 +55,20 @@ var Graph = /*#__PURE__*/function (_Graphology) {
54
55
  return _createClass(Graph, [{
55
56
  key: "on",
56
57
  value: function on(type, listener) {
57
- return _get(_getPrototypeOf(Graph.prototype), "on", this).call(this, type, listener);
58
+ return _superPropGet(Graph, "on", this, 3)([type, listener]);
58
59
  }
59
60
  }, {
60
61
  key: "off",
61
62
  value: function off(type, listener) {
62
- return _get(_getPrototypeOf(Graph.prototype), "off", this).call(this, type, listener);
63
+ return _superPropGet(Graph, "off", this, 3)([type, listener]);
63
64
  }
64
65
  }, {
65
66
  key: "emit",
66
67
  value: function emit(type) {
67
- var _get2;
68
68
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
69
69
  args[_key - 1] = arguments[_key];
70
70
  }
71
- return (_get2 = _get(_getPrototypeOf(Graph.prototype), "emit", this)).call.apply(_get2, [this, type].concat(args));
71
+ return _superPropGet(Graph, "emit", this, 3)([type].concat(args));
72
72
  }
73
73
  }, {
74
74
  key: "mergeNodes",
@@ -240,7 +240,7 @@ var Graph = /*#__PURE__*/function (_Graphology) {
240
240
  return n.key;
241
241
  })));
242
242
  }
243
- _get(_getPrototypeOf(Graph.prototype), "import", this).call(this, data, merge);
243
+ _superPropGet(Graph, "import", this, 3)([data, merge]);
244
244
  // fire events for nodes added
245
245
  this.emit("nodesLoaded", newNodes);
246
246
  // apply random positions for nodes
@@ -306,9 +306,9 @@ var Graph = /*#__PURE__*/function (_Graphology) {
306
306
  }, {
307
307
  key: "elkLayout",
308
308
  value: function () {
309
- var _elkLayout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(type) {
309
+ var _elkLayout = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(type) {
310
310
  var _this8 = this;
311
- return _regeneratorRuntime.wrap(function _callee$(_context) {
311
+ return _regeneratorRuntime.wrap(function (_context) {
312
312
  while (1) switch (_context.prev = _context.next) {
313
313
  case 0:
314
314
  if (!this.elk) this.elk = new ElkConstructor({
@@ -361,7 +361,7 @@ var Graph = /*#__PURE__*/function (_Graphology) {
361
361
  })["catch"](console.error)["finally"](function () {
362
362
  _this8.emit("layoutRunning", false);
363
363
  });
364
- case 3:
364
+ case 1:
365
365
  case "end":
366
366
  return _context.stop();
367
367
  }
@@ -398,7 +398,7 @@ var Graph = /*#__PURE__*/function (_Graphology) {
398
398
  }, {
399
399
  key: "checkParallelEdges",
400
400
  value: function checkParallelEdges() {
401
- var _this10 = this;
401
+ var _this0 = this;
402
402
  // Use dedicated helper to identify parallel edges:
403
403
  // @ts-expect-error ignore
404
404
  edgeCurve.indexParallelEdgesIndex(this, {
@@ -412,17 +412,17 @@ var Graph = /*#__PURE__*/function (_Graphology) {
412
412
  parallelMinIndex = _ref2.parallelMinIndex,
413
413
  parallelMaxIndex = _ref2.parallelMaxIndex;
414
414
  if (typeof parallelMinIndex === "number") {
415
- _this10.mergeEdgeAttributes(edge, {
415
+ _this0.mergeEdgeAttributes(edge, {
416
416
  type: parallelIndex ? "curved" : "line",
417
- curvature: _this10.getCurvature(parallelIndex !== null && parallelIndex !== void 0 ? parallelIndex : 1, parallelMaxIndex !== null && parallelMaxIndex !== void 0 ? parallelMaxIndex : 1)
417
+ curvature: _this0.getCurvature(parallelIndex !== null && parallelIndex !== void 0 ? parallelIndex : 1, parallelMaxIndex !== null && parallelMaxIndex !== void 0 ? parallelMaxIndex : 1)
418
418
  });
419
419
  } else if (typeof parallelIndex === "number") {
420
- _this10.mergeEdgeAttributes(edge, {
420
+ _this0.mergeEdgeAttributes(edge, {
421
421
  type: "curved",
422
- curvature: _this10.getCurvature(parallelIndex !== null && parallelIndex !== void 0 ? parallelIndex : 1, parallelMaxIndex !== null && parallelMaxIndex !== void 0 ? parallelMaxIndex : 1)
422
+ curvature: _this0.getCurvature(parallelIndex !== null && parallelIndex !== void 0 ? parallelIndex : 1, parallelMaxIndex !== null && parallelMaxIndex !== void 0 ? parallelMaxIndex : 1)
423
423
  });
424
424
  } else {
425
- _this10.setEdgeAttribute(edge, "type", "line");
425
+ _this0.setEdgeAttribute(edge, "type", "line");
426
426
  }
427
427
  });
428
428
  }
@@ -3,8 +3,8 @@
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
5
  var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstructorReturn');
6
- var _get = require('@babel/runtime/helpers/get');
7
6
  var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
7
+ var _get = require('@babel/runtime/helpers/get');
8
8
  var _inherits = require('@babel/runtime/helpers/inherits');
9
9
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
10
10
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
@@ -17,6 +17,7 @@ var vert_glsl = require('./vert.glsl.js');
17
17
  var _excluded = ["drawHover", "drawLabel", "drawingMode", "keepWithinCircle", "padding", "colorAttribute", "badgePosition"];
18
18
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
19
19
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
20
+ function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
20
21
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
22
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
23
  var ICON_MAP = {
@@ -180,7 +181,7 @@ function getNodeImageProgram(options) {
180
181
  var gl = programInfo.gl;
181
182
  gl.bindTexture(gl.TEXTURE_2D, this.texture);
182
183
  }
183
- _get(_getPrototypeOf(NodeImageProgram.prototype), "renderProgram", this).call(this, params, programInfo);
184
+ _superPropGet(NodeImageProgram, "renderProgram", this, 3)([params, programInfo]);
184
185
  }
185
186
  }, {
186
187
  key: "processVisibleItem",
@@ -47,11 +47,11 @@ function loadRasterImage(_x) {
47
47
  return _loadRasterImage.apply(this, arguments);
48
48
  }
49
49
  function _loadRasterImage() {
50
- _loadRasterImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(imageSource) {
51
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
50
+ _loadRasterImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(imageSource) {
51
+ return _regeneratorRuntime.wrap(function (_context2) {
52
52
  while (1) switch (_context2.prev = _context2.next) {
53
53
  case 0:
54
- _context2.next = 2;
54
+ _context2.next = 1;
55
55
  return new Promise(function (resolve, reject) {
56
56
  var image = new Image();
57
57
  image.addEventListener("load", function () {
@@ -69,9 +69,9 @@ function _loadRasterImage() {
69
69
  image.setAttribute("crossOrigin", "");
70
70
  image.src = imageSource;
71
71
  });
72
- case 2:
72
+ case 1:
73
73
  return _context2.abrupt("return", _context2.sent);
74
- case 3:
74
+ case 2:
75
75
  case "end":
76
76
  return _context2.stop();
77
77
  }
@@ -97,7 +97,7 @@ function loadSVGImage(_x2) {
97
97
  * This helper loads an image using the proper function.
98
98
  */
99
99
  function _loadSVGImage() {
100
- _loadSVGImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(imageSource) {
100
+ _loadSVGImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(imageSource) {
101
101
  var _ref,
102
102
  size,
103
103
  svg,
@@ -109,7 +109,7 @@ function _loadSVGImage() {
109
109
  url,
110
110
  res,
111
111
  _args3 = arguments;
112
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
112
+ return _regeneratorRuntime.wrap(function (_context3) {
113
113
  while (1) switch (_context3.prev = _context3.next) {
114
114
  case 0:
115
115
  _ref = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {}, size = _ref.size;
@@ -118,11 +118,11 @@ function _loadSVGImage() {
118
118
  originalWidth = root.getAttribute("width");
119
119
  originalHeight = root.getAttribute("height");
120
120
  if (!(!originalWidth || !originalHeight)) {
121
- _context3.next = 7;
121
+ _context3.next = 1;
122
122
  break;
123
123
  }
124
124
  throw new Error("loadSVGImage: cannot use `size` if target SVG has no definite dimensions.");
125
- case 7:
125
+ case 1:
126
126
  if (typeof size === "number") {
127
127
  root.setAttribute("width", "" + size);
128
128
  root.setAttribute("height", "" + size);
@@ -140,11 +140,11 @@ function _loadSVGImage() {
140
140
  void res["finally"](function () {
141
141
  return URL.revokeObjectURL(url);
142
142
  });
143
- _context3.next = 15;
143
+ _context3.next = 2;
144
144
  return res;
145
- case 15:
145
+ case 2:
146
146
  return _context3.abrupt("return", _context3.sent);
147
- case 16:
147
+ case 3:
148
148
  case "end":
149
149
  return _context3.stop();
150
150
  }
@@ -160,20 +160,20 @@ function loadImage(_x3) {
160
160
  * This helper computes exact coordinates to draw an image onto a texture.
161
161
  */
162
162
  function _loadImage() {
163
- _loadImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(imageSource) {
163
+ _loadImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(imageSource) {
164
164
  var _ref2,
165
165
  _args4 = arguments;
166
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
166
+ return _regeneratorRuntime.wrap(function (_context4) {
167
167
  while (1) switch (_context4.prev = _context4.next) {
168
168
  case 0:
169
169
  _ref2 = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {}, _ref2.size;
170
- _context4.next = 3;
170
+ _context4.next = 1;
171
171
  return loadSVGImage(imageSource, {
172
172
  size: 128
173
173
  });
174
- case 3:
174
+ case 1:
175
175
  return _context4.abrupt("return", _context4.sent);
176
- case 4:
176
+ case 2:
177
177
  case "end":
178
178
  return _context4.stop();
179
179
  }
@@ -382,46 +382,46 @@ var TextureManager = /*#__PURE__*/function (_EventEmitter) {
382
382
  }, {
383
383
  key: "registerImage",
384
384
  value: function () {
385
- var _registerImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(source) {
385
+ var _registerImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(source) {
386
386
  var size, image;
387
- return _regeneratorRuntime.wrap(function _callee$(_context) {
387
+ return _regeneratorRuntime.wrap(function (_context) {
388
388
  while (1) switch (_context.prev = _context.next) {
389
389
  case 0:
390
390
  if (!this.imageStates[source]) {
391
- _context.next = 2;
391
+ _context.next = 1;
392
392
  break;
393
393
  }
394
394
  return _context.abrupt("return");
395
- case 2:
395
+ case 1:
396
396
  this.imageStates[source] = {
397
397
  status: "loading"
398
398
  };
399
- _context.prev = 3;
399
+ _context.prev = 2;
400
400
  size = this.options.size;
401
- _context.next = 7;
401
+ _context.next = 3;
402
402
  return loadImage(source, {
403
403
  size: size.mode === "force" ? size.value : undefined
404
404
  });
405
- case 7:
405
+ case 3:
406
406
  image = _context.sent;
407
407
  this.imageStates[source] = _objectSpread({
408
408
  status: "ready",
409
409
  image: image
410
410
  }, refineImage(image, this.corrector, this.options));
411
411
  this.scheduleGenerateTexture();
412
- _context.next = 15;
412
+ _context.next = 5;
413
413
  break;
414
- case 12:
415
- _context.prev = 12;
416
- _context.t0 = _context["catch"](3);
414
+ case 4:
415
+ _context.prev = 4;
416
+ _context["catch"](2);
417
417
  this.imageStates[source] = {
418
418
  status: "error"
419
419
  };
420
- case 15:
420
+ case 5:
421
421
  case "end":
422
422
  return _context.stop();
423
423
  }
424
- }, _callee, this, [[3, 12]]);
424
+ }, _callee, this, [[2, 4]]);
425
425
  }));
426
426
  function registerImage(_x4) {
427
427
  return _registerImage.apply(this, arguments);
@@ -3,8 +3,8 @@
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
5
  var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstructorReturn');
6
- var _get = require('@babel/runtime/helpers/get');
7
6
  var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
7
+ var _get = require('@babel/runtime/helpers/get');
8
8
  var _inherits = require('@babel/runtime/helpers/inherits');
9
9
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
10
10
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
@@ -18,6 +18,7 @@ var vert_glsl = require('./vert.glsl.js');
18
18
  var _excluded = ["drawHover", "drawLabel", "drawingMode", "keepWithinCircle", "padding", "colorAttribute"];
19
19
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
20
20
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
21
+ function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
21
22
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
23
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23
24
 
@@ -158,7 +159,7 @@ function getNodeImageProgram(options) {
158
159
  var gl = programInfo.gl;
159
160
  gl.bindTexture(gl.TEXTURE_2D, this.texture);
160
161
  }
161
- _get(_getPrototypeOf(NodeImageProgram.prototype), "renderProgram", this).call(this, params, programInfo);
162
+ _superPropGet(NodeImageProgram, "renderProgram", this, 3)([params, programInfo]);
162
163
  }
163
164
  }, {
164
165
  key: "processVisibleItem",