@dxos/react-ui-graph 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5
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 +5 -7
- package/dist/lib/browser/chunk-LKC455GK.mjs +52 -0
- package/dist/lib/browser/chunk-LKC455GK.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1089 -240
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +16 -16
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/chunk-JE4KZCUF.mjs +54 -0
- package/dist/lib/node-esm/chunk-JE4KZCUF.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1089 -240
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +16 -16
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/components/Graph/Graph.d.ts +4 -5
- package/dist/types/src/components/Graph/Graph.d.ts.map +1 -1
- package/dist/types/src/components/Graph/Graph.stories.d.ts +17 -8
- package/dist/types/src/components/Graph/Graph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Mesh/Mesh.stories.d.ts +9 -5
- package/dist/types/src/components/Mesh/Mesh.stories.d.ts.map +1 -1
- package/dist/types/src/components/SVG/Root.d.ts +4 -4
- package/dist/types/src/components/SVG/Root.d.ts.map +1 -1
- package/dist/types/src/components/SVG/SVG.d.ts +14 -17
- package/dist/types/src/components/SVG/SVG.d.ts.map +1 -1
- package/dist/types/src/components/SVG/Svg.stories.d.ts +11 -9
- package/dist/types/src/components/SVG/Svg.stories.d.ts.map +1 -1
- package/dist/types/src/fx/fx.stories.d.ts +16 -15
- package/dist/types/src/fx/fx.stories.d.ts.map +1 -1
- package/dist/types/src/graph/projector/graph-drag.d.ts.map +1 -1
- package/dist/types/src/graph/projector/graph-force-projector.d.ts +1 -1
- package/dist/types/src/graph/projector/graph-force-projector.d.ts.map +1 -1
- package/dist/types/src/graph/projector/graph-hierarchical-projector.d.ts +1 -1
- package/dist/types/src/graph/projector/graph-hierarchical-projector.d.ts.map +1 -1
- package/dist/types/src/graph/projector/graph-projector.d.ts +2 -2
- package/dist/types/src/graph/projector/graph-projector.d.ts.map +1 -1
- package/dist/types/src/graph/projector/graph-radial-projector.d.ts +1 -1
- package/dist/types/src/graph/projector/graph-radial-projector.d.ts.map +1 -1
- package/dist/types/src/graph/projector/graph-relational-projector.d.ts +1 -1
- package/dist/types/src/graph/projector/graph-relational-projector.d.ts.map +1 -1
- package/dist/types/src/graph/renderer/graph-renderer.d.ts.map +1 -1
- package/dist/types/src/graph/types.d.ts +1 -1
- package/dist/types/src/graph/types.d.ts.map +1 -1
- package/dist/types/src/stories/hooks.stories.d.ts +14 -9
- package/dist/types/src/stories/hooks.stories.d.ts.map +1 -1
- package/dist/types/src/testing/data.d.ts +4 -4
- package/dist/types/src/testing/data.d.ts.map +1 -1
- package/dist/types/src/testing/hooks.d.ts +2 -16
- package/dist/types/src/testing/hooks.d.ts.map +1 -1
- package/dist/types/src/testing/model.d.ts +4 -8
- package/dist/types/src/testing/model.d.ts.map +1 -1
- package/dist/types/src/util/fraction.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -26
- package/src/components/Graph/Graph.stories.tsx +61 -56
- package/src/components/Graph/Graph.tsx +24 -16
- package/src/components/Mesh/Mesh.stories.tsx +9 -9
- package/src/components/SVG/Grid.tsx +1 -1
- package/src/components/SVG/Markers.tsx +1 -1
- package/src/components/SVG/Root.tsx +14 -7
- package/src/components/SVG/SVG.tsx +10 -2
- package/src/components/SVG/Svg.stories.tsx +22 -19
- package/src/fx/fx.stories.tsx +17 -15
- package/src/graph/projector/graph-drag.ts +0 -1
- package/src/graph/projector/graph-force-projector.ts +1 -2
- package/src/graph/projector/graph-hierarchical-projector.ts +3 -4
- package/src/graph/projector/graph-projector.ts +2 -3
- package/src/graph/projector/graph-radial-projector.ts +1 -2
- package/src/graph/projector/graph-relational-projector.ts +3 -4
- package/src/graph/renderer/graph-renderer.ts +0 -1
- package/src/graph/types.ts +1 -1
- package/src/hooks/useStateRef.ts +1 -1
- package/src/stories/hooks.stories.tsx +38 -31
- package/src/testing/data.ts +14 -14
- package/src/testing/hooks.ts +3 -4
- package/src/testing/model.ts +6 -6
- package/src/util/fraction.ts +1 -1
- package/styles/graph.css +292 -43
- package/dist/lib/browser/chunk-HLAKLUDC.mjs +0 -958
- package/dist/lib/browser/chunk-HLAKLUDC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O6GWCXDC.mjs +0 -960
- package/dist/lib/node-esm/chunk-O6GWCXDC.mjs.map +0 -7
|
@@ -1,958 +0,0 @@
|
|
|
1
|
-
// src/util/events.ts
|
|
2
|
-
var EventEmitter = class {
|
|
3
|
-
_listeners = /* @__PURE__ */ new Set();
|
|
4
|
-
clear() {
|
|
5
|
-
this._listeners.clear();
|
|
6
|
-
}
|
|
7
|
-
on(onEvent) {
|
|
8
|
-
this._listeners.add(onEvent);
|
|
9
|
-
return () => this._listeners.delete(onEvent);
|
|
10
|
-
}
|
|
11
|
-
emit(value) {
|
|
12
|
-
this._listeners.forEach((listener) => listener(value));
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// src/util/fraction.ts
|
|
17
|
-
import { invariant } from "@dxos/invariant";
|
|
18
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/ui/react-ui-graph/src/util/fraction.ts";
|
|
19
|
-
var FractionUtil = class _FractionUtil {
|
|
20
|
-
/**
|
|
21
|
-
* Convert number to fraction.
|
|
22
|
-
* @param n
|
|
23
|
-
*/
|
|
24
|
-
static toFraction = (n) => {
|
|
25
|
-
return typeof n === "number" ? [
|
|
26
|
-
n,
|
|
27
|
-
1
|
|
28
|
-
] : n;
|
|
29
|
-
};
|
|
30
|
-
static validate = (...fraction) => {
|
|
31
|
-
fraction.forEach(([n, d]) => {
|
|
32
|
-
if (!Number.isFinite(n) || !Number.isFinite(d) || d === 0) {
|
|
33
|
-
throw new Error(`Invalid fraction: ${n}/${d}`);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return fraction;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* @param {Fraction}
|
|
40
|
-
* Convert to rounded number.
|
|
41
|
-
*/
|
|
42
|
-
static toNumber = ([n, d]) => {
|
|
43
|
-
_FractionUtil.validate([
|
|
44
|
-
n,
|
|
45
|
-
d
|
|
46
|
-
]);
|
|
47
|
-
return n / d;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Round the number to the nearest fraction.
|
|
51
|
-
* Example: 3/5 => 1/1; 3/5 (precision 2) => 1/2.
|
|
52
|
-
* @param {Fraction}
|
|
53
|
-
* @param p Precision (e.g., 1/2, 1/4, etc.)
|
|
54
|
-
*/
|
|
55
|
-
static round = ([n, d], p = 1) => {
|
|
56
|
-
_FractionUtil.validate([
|
|
57
|
-
n,
|
|
58
|
-
d
|
|
59
|
-
]);
|
|
60
|
-
const v = Math.round(_FractionUtil.toNumber(_FractionUtil.divide([
|
|
61
|
-
n,
|
|
62
|
-
d
|
|
63
|
-
], [
|
|
64
|
-
1,
|
|
65
|
-
p
|
|
66
|
-
])));
|
|
67
|
-
return _FractionUtil.simplify([
|
|
68
|
-
v,
|
|
69
|
-
p
|
|
70
|
-
]);
|
|
71
|
-
};
|
|
72
|
-
//
|
|
73
|
-
// Boolean.
|
|
74
|
-
//
|
|
75
|
-
/**
|
|
76
|
-
* Tests if equals.
|
|
77
|
-
* @param n1
|
|
78
|
-
* @param n2
|
|
79
|
-
*/
|
|
80
|
-
static equals = (n1, n2) => {
|
|
81
|
-
return n1[0] * n2[1] === n1[1] * n2[0];
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* @param {Fraction}
|
|
85
|
-
* True if zero.
|
|
86
|
-
*/
|
|
87
|
-
static isZero = ([n]) => {
|
|
88
|
-
return n === 0;
|
|
89
|
-
};
|
|
90
|
-
//
|
|
91
|
-
// Normalization.
|
|
92
|
-
//
|
|
93
|
-
/**
|
|
94
|
-
* Simplify fraction finding LCDs.
|
|
95
|
-
* @param n
|
|
96
|
-
* @param d
|
|
97
|
-
*/
|
|
98
|
-
static simplify = ([n, d]) => {
|
|
99
|
-
_FractionUtil.validate([
|
|
100
|
-
n,
|
|
101
|
-
d
|
|
102
|
-
]);
|
|
103
|
-
if (d < 1) {
|
|
104
|
-
const t = n / d;
|
|
105
|
-
if (Math.floor(t) === t) {
|
|
106
|
-
n = t;
|
|
107
|
-
d = 1;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
const fn = _FractionUtil.factors(n).reverse();
|
|
111
|
-
const fd = _FractionUtil.factors(d).reverse();
|
|
112
|
-
let c;
|
|
113
|
-
for (let i = 0; i < fn.length; i++) {
|
|
114
|
-
c = fd.find((n2) => n2 === fn[i]);
|
|
115
|
-
if (c) {
|
|
116
|
-
return [
|
|
117
|
-
n / c,
|
|
118
|
-
d / c
|
|
119
|
-
];
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return [
|
|
123
|
-
n,
|
|
124
|
-
d
|
|
125
|
-
];
|
|
126
|
-
};
|
|
127
|
-
/**
|
|
128
|
-
* Return common factors.
|
|
129
|
-
* @param n
|
|
130
|
-
*/
|
|
131
|
-
static factors = (n) => {
|
|
132
|
-
invariant(Number.isFinite(n), `Invalid number: ${n}`, {
|
|
133
|
-
F: __dxlog_file,
|
|
134
|
-
L: 113,
|
|
135
|
-
S: this,
|
|
136
|
-
A: [
|
|
137
|
-
"Number.isFinite(n)",
|
|
138
|
-
"`Invalid number: ${n}`"
|
|
139
|
-
]
|
|
140
|
-
});
|
|
141
|
-
const factors = [
|
|
142
|
-
1
|
|
143
|
-
];
|
|
144
|
-
if (Number.isSafeInteger(n)) {
|
|
145
|
-
let f = 1;
|
|
146
|
-
do {
|
|
147
|
-
if (n % ++f === 0) {
|
|
148
|
-
factors.push(f);
|
|
149
|
-
}
|
|
150
|
-
} while (n / f > 1 && f < 100);
|
|
151
|
-
}
|
|
152
|
-
return factors;
|
|
153
|
-
};
|
|
154
|
-
//
|
|
155
|
-
// Basic arithmetic.
|
|
156
|
-
//
|
|
157
|
-
/**
|
|
158
|
-
* @param n1
|
|
159
|
-
* @param n2
|
|
160
|
-
*/
|
|
161
|
-
static add = (n1, n2) => {
|
|
162
|
-
_FractionUtil.validate(n1, n2);
|
|
163
|
-
const d = n1[1] * n2[1];
|
|
164
|
-
const n = n1[0] * n2[1] + n2[0] * n1[1];
|
|
165
|
-
return _FractionUtil.simplify([
|
|
166
|
-
n,
|
|
167
|
-
d
|
|
168
|
-
]);
|
|
169
|
-
};
|
|
170
|
-
/**
|
|
171
|
-
* @param n1
|
|
172
|
-
* @param n2
|
|
173
|
-
*/
|
|
174
|
-
static subtract = (n1, n2) => {
|
|
175
|
-
_FractionUtil.validate(n1, n2);
|
|
176
|
-
const d = n1[1] * n2[1];
|
|
177
|
-
const n = n1[0] * n2[1] - n2[0] * n1[1];
|
|
178
|
-
return _FractionUtil.simplify([
|
|
179
|
-
n,
|
|
180
|
-
d
|
|
181
|
-
]);
|
|
182
|
-
};
|
|
183
|
-
/**
|
|
184
|
-
* @param n1
|
|
185
|
-
* @param n2
|
|
186
|
-
*/
|
|
187
|
-
static multiply = (n1, n2) => {
|
|
188
|
-
_FractionUtil.validate(n1, n2);
|
|
189
|
-
const n = n1[0] * n2[0];
|
|
190
|
-
const d = n1[1] * n2[1];
|
|
191
|
-
return _FractionUtil.simplify([
|
|
192
|
-
n,
|
|
193
|
-
d
|
|
194
|
-
]);
|
|
195
|
-
};
|
|
196
|
-
/**
|
|
197
|
-
* @param n1
|
|
198
|
-
* @param n2
|
|
199
|
-
*/
|
|
200
|
-
static divide = (n1, n2) => {
|
|
201
|
-
_FractionUtil.validate(n1, n2);
|
|
202
|
-
const n = n1[0] * n2[1];
|
|
203
|
-
const d = n1[1] * n2[0];
|
|
204
|
-
return _FractionUtil.simplify([
|
|
205
|
-
n,
|
|
206
|
-
d
|
|
207
|
-
]);
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
// src/util/points.ts
|
|
212
|
-
var getCircumferencePoints = (p1, p2, r1 = 0, r2 = 0) => {
|
|
213
|
-
const [x1, y1] = p1;
|
|
214
|
-
const [x2, y2] = p2;
|
|
215
|
-
const theta = Math.atan2(x2 - x1, y2 - y1);
|
|
216
|
-
return [
|
|
217
|
-
[
|
|
218
|
-
// p1
|
|
219
|
-
x1 + (r1 === 0 ? 0 : r1 * Math.sin(theta)),
|
|
220
|
-
y1 + (r1 === 0 ? 0 : r1 * Math.cos(theta))
|
|
221
|
-
],
|
|
222
|
-
[
|
|
223
|
-
// p2
|
|
224
|
-
x2 - (r2 === 0 ? 0 : r2 * Math.cos(Math.PI / 2 - theta)),
|
|
225
|
-
y2 - (r2 === 0 ? 0 : r2 * Math.sin(Math.PI / 2 - theta))
|
|
226
|
-
]
|
|
227
|
-
];
|
|
228
|
-
};
|
|
229
|
-
var normal = (p1, p2) => {
|
|
230
|
-
const dx = p2[0] - p1[0];
|
|
231
|
-
const dy = p2[1] - p1[1];
|
|
232
|
-
const len = Math.hypot(dx, dy);
|
|
233
|
-
return [
|
|
234
|
-
dy / len,
|
|
235
|
-
-dx / len
|
|
236
|
-
];
|
|
237
|
-
};
|
|
238
|
-
var offsetPoints = (points, distance, closed) => {
|
|
239
|
-
const len = points.length;
|
|
240
|
-
const out = [];
|
|
241
|
-
for (let i = 0; i < len; i++) {
|
|
242
|
-
const p0 = points[(i - 1 + len) % len];
|
|
243
|
-
const p1 = points[i];
|
|
244
|
-
const p2 = points[(i + 1) % len];
|
|
245
|
-
const n1 = normal(p0, p1);
|
|
246
|
-
const n2 = normal(p1, p2);
|
|
247
|
-
const nx = (n1[0] + n2[0]) / 2;
|
|
248
|
-
const ny = (n1[1] + n2[1]) / 2;
|
|
249
|
-
const norm = Math.hypot(nx, ny) || 1;
|
|
250
|
-
out.push([
|
|
251
|
-
p1[0] + distance * nx / norm,
|
|
252
|
-
p1[1] + distance * ny / norm
|
|
253
|
-
]);
|
|
254
|
-
if (!closed && (i === 0 || i === len - 1)) {
|
|
255
|
-
out[i] = [
|
|
256
|
-
p1[0] + distance * normal(p0, p1)[0],
|
|
257
|
-
p1[1] + distance * normal(p0, p1)[1]
|
|
258
|
-
];
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
return out;
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
// src/util/scale.ts
|
|
265
|
-
import { zoomIdentity } from "d3";
|
|
266
|
-
var Scale = class {
|
|
267
|
-
_gridSize;
|
|
268
|
-
_transform;
|
|
269
|
-
constructor(_gridSize = 32) {
|
|
270
|
-
this._gridSize = _gridSize;
|
|
271
|
-
this.model = {
|
|
272
|
-
// TODO(burdon): Precision depends on scale.
|
|
273
|
-
snapValues: (array) => array.map((n) => FractionUtil.round(n)),
|
|
274
|
-
snapVertex: ({ x, y }) => {
|
|
275
|
-
const [sx, sy] = this.model.snapValues([
|
|
276
|
-
x,
|
|
277
|
-
y
|
|
278
|
-
]);
|
|
279
|
-
return {
|
|
280
|
-
x: sx,
|
|
281
|
-
y: sy
|
|
282
|
-
};
|
|
283
|
-
},
|
|
284
|
-
snapBounds: ({ x, y, width, height }) => {
|
|
285
|
-
[x, y, width, height] = this.model.snapValues([
|
|
286
|
-
x,
|
|
287
|
-
y,
|
|
288
|
-
width,
|
|
289
|
-
height
|
|
290
|
-
]);
|
|
291
|
-
return {
|
|
292
|
-
x,
|
|
293
|
-
y,
|
|
294
|
-
width,
|
|
295
|
-
height
|
|
296
|
-
};
|
|
297
|
-
},
|
|
298
|
-
toValue: (value) => {
|
|
299
|
-
return Math.round(FractionUtil.toNumber(value) * this._gridSize);
|
|
300
|
-
},
|
|
301
|
-
toValues: (values) => {
|
|
302
|
-
return values.map((value) => Math.round(FractionUtil.toNumber(value) * this._gridSize));
|
|
303
|
-
},
|
|
304
|
-
toPoint: (point) => {
|
|
305
|
-
const [x, y] = this.model.toValues([
|
|
306
|
-
point.x,
|
|
307
|
-
point.y
|
|
308
|
-
]);
|
|
309
|
-
return [
|
|
310
|
-
x,
|
|
311
|
-
y === 0 ? 0 : -y
|
|
312
|
-
];
|
|
313
|
-
},
|
|
314
|
-
toBounds: ({ x, y, width, height }) => {
|
|
315
|
-
const point = this.model.toPoint({
|
|
316
|
-
x,
|
|
317
|
-
y
|
|
318
|
-
});
|
|
319
|
-
const [width2, height2] = this.model.toValues([
|
|
320
|
-
width,
|
|
321
|
-
height
|
|
322
|
-
]);
|
|
323
|
-
return {
|
|
324
|
-
x: point[0],
|
|
325
|
-
y: point[1] - height2,
|
|
326
|
-
width: width2,
|
|
327
|
-
height: height2
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
this.screen = {
|
|
332
|
-
snapValues: (array) => array.map((n) => Math.round(n / this._gridSize) * this._gridSize),
|
|
333
|
-
snapPoint: ([x, y]) => [
|
|
334
|
-
x,
|
|
335
|
-
y
|
|
336
|
-
].map((n) => Math.round(n / this._gridSize) * this._gridSize),
|
|
337
|
-
snapBounds: ({ x, y, width, height }) => {
|
|
338
|
-
[x, y, width, height] = this.screen.snapValues([
|
|
339
|
-
x,
|
|
340
|
-
y,
|
|
341
|
-
width,
|
|
342
|
-
height
|
|
343
|
-
]);
|
|
344
|
-
return {
|
|
345
|
-
x,
|
|
346
|
-
y,
|
|
347
|
-
width,
|
|
348
|
-
height
|
|
349
|
-
};
|
|
350
|
-
},
|
|
351
|
-
toValue: (value) => {
|
|
352
|
-
return FractionUtil.divide(FractionUtil.toFraction(value), [
|
|
353
|
-
this._gridSize,
|
|
354
|
-
1
|
|
355
|
-
]);
|
|
356
|
-
},
|
|
357
|
-
toValues: (values) => {
|
|
358
|
-
return values.map((value) => FractionUtil.divide(FractionUtil.toFraction(value), [
|
|
359
|
-
this._gridSize,
|
|
360
|
-
1
|
|
361
|
-
]));
|
|
362
|
-
},
|
|
363
|
-
toVertex: (point) => {
|
|
364
|
-
const [x, y] = point;
|
|
365
|
-
return {
|
|
366
|
-
x: FractionUtil.toFraction(x / this._gridSize),
|
|
367
|
-
y: FractionUtil.toFraction(-y / this._gridSize)
|
|
368
|
-
};
|
|
369
|
-
},
|
|
370
|
-
toBounds: (bounds) => {
|
|
371
|
-
const { x, y } = this.screen.toVertex([
|
|
372
|
-
bounds.x,
|
|
373
|
-
bounds.y
|
|
374
|
-
]);
|
|
375
|
-
const [width, height] = this.screen.toValues([
|
|
376
|
-
bounds.width,
|
|
377
|
-
bounds.height
|
|
378
|
-
]);
|
|
379
|
-
return {
|
|
380
|
-
x,
|
|
381
|
-
y: FractionUtil.subtract(y, height),
|
|
382
|
-
width,
|
|
383
|
-
height
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
get gridSize() {
|
|
389
|
-
return this._gridSize;
|
|
390
|
-
}
|
|
391
|
-
get transform() {
|
|
392
|
-
return this._transform || zoomIdentity;
|
|
393
|
-
}
|
|
394
|
-
setTransform(transform) {
|
|
395
|
-
if (this._transform?.x === transform.x && this._transform?.y === transform.y && this._transform?.k === transform.k) {
|
|
396
|
-
return false;
|
|
397
|
-
}
|
|
398
|
-
this._transform = transform;
|
|
399
|
-
return true;
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Translate a screen point to a logical point.
|
|
403
|
-
* @param point
|
|
404
|
-
*/
|
|
405
|
-
translate(point) {
|
|
406
|
-
const { x, y, k } = this._transform ?? {
|
|
407
|
-
x: 0,
|
|
408
|
-
y: 0,
|
|
409
|
-
k: 1
|
|
410
|
-
};
|
|
411
|
-
return [
|
|
412
|
-
(point[0] - x) / k,
|
|
413
|
-
(point[1] - y) / k
|
|
414
|
-
];
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Map model to screen.
|
|
418
|
-
* Model points are represented by fractions (to preserve precision) and use normal cartesian coordinates.
|
|
419
|
-
*/
|
|
420
|
-
model;
|
|
421
|
-
/**
|
|
422
|
-
* Map screen to model.
|
|
423
|
-
* Screen points are represented by floating numbers and use translated SVG coordinates (with the y-axis inverted).
|
|
424
|
-
*/
|
|
425
|
-
screen;
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
// src/util/screen.ts
|
|
429
|
-
var Screen = class {
|
|
430
|
-
static createBounds = ([x1, y1], [x2, y2], mod = {}) => {
|
|
431
|
-
const { constrain, center } = mod;
|
|
432
|
-
const x = Math.min(x1, x2);
|
|
433
|
-
const y = Math.min(y1, y2);
|
|
434
|
-
let width = Math.abs(x2 - x1);
|
|
435
|
-
let height = Math.abs(y2 - y1);
|
|
436
|
-
if (constrain) {
|
|
437
|
-
width = height = Math.max(width, height);
|
|
438
|
-
}
|
|
439
|
-
if (center) {
|
|
440
|
-
return {
|
|
441
|
-
x: x - width,
|
|
442
|
-
y: y - height,
|
|
443
|
-
width: width * 2,
|
|
444
|
-
height: height * 2
|
|
445
|
-
};
|
|
446
|
-
} else {
|
|
447
|
-
return {
|
|
448
|
-
x,
|
|
449
|
-
y,
|
|
450
|
-
width,
|
|
451
|
-
height
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
};
|
|
455
|
-
static center = ({ x, y, width, height }) => {
|
|
456
|
-
return [
|
|
457
|
-
x + width / 2,
|
|
458
|
-
y + height / 2
|
|
459
|
-
];
|
|
460
|
-
};
|
|
461
|
-
static contains = (bounds, point) => {
|
|
462
|
-
const [x, y] = point;
|
|
463
|
-
if (x < bounds.x || y < bounds.y) {
|
|
464
|
-
return false;
|
|
465
|
-
}
|
|
466
|
-
if (x > bounds.x + bounds.width || y > bounds.y + bounds.height) {
|
|
467
|
-
return false;
|
|
468
|
-
}
|
|
469
|
-
return true;
|
|
470
|
-
};
|
|
471
|
-
/**
|
|
472
|
-
* Distance between two points.
|
|
473
|
-
* @param p1
|
|
474
|
-
* @param p2
|
|
475
|
-
*/
|
|
476
|
-
static len = (p1, p2) => {
|
|
477
|
-
return Math.sqrt(Math.pow(Math.abs(p1[0] - p2[0]), 2) + Math.pow(Math.abs(p1[1] - p2[1]), 2));
|
|
478
|
-
};
|
|
479
|
-
/**
|
|
480
|
-
* Distance to line segment.
|
|
481
|
-
* https://stackoverflow.com/questions/849211/shortest-distance-between-a-point-and-a-line-segment#1501725
|
|
482
|
-
* @param v1
|
|
483
|
-
* @param v2
|
|
484
|
-
* @param p
|
|
485
|
-
*/
|
|
486
|
-
static normal = (v1, v2, p) => {
|
|
487
|
-
const d2 = (p1, p2) => Math.pow(Math.abs(p1[0] - p2[0]), 2) + Math.pow(Math.abs(p1[1] - p2[1]), 2);
|
|
488
|
-
let d;
|
|
489
|
-
const len2 = d2(v1, v2);
|
|
490
|
-
if (len2 === 0) {
|
|
491
|
-
d = d2(p, v1);
|
|
492
|
-
} else {
|
|
493
|
-
let t = ((p[0] - v1[0]) * (v2[0] - v1[0]) + (p[1] - v1[1]) * (v2[1] - v1[1])) / len2;
|
|
494
|
-
t = Math.max(0, Math.min(1, t));
|
|
495
|
-
d = d2(p, [
|
|
496
|
-
v1[0] + t * (v2[0] - v1[0]),
|
|
497
|
-
v1[1] + t * (v2[1] - v1[1])
|
|
498
|
-
]);
|
|
499
|
-
}
|
|
500
|
-
return Math.sqrt(d);
|
|
501
|
-
};
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
// src/util/vector.ts
|
|
505
|
-
var Vector = class {
|
|
506
|
-
/**
|
|
507
|
-
* Convert to Vertex.
|
|
508
|
-
* @param x
|
|
509
|
-
* @param y
|
|
510
|
-
*/
|
|
511
|
-
static toVertex = ({ x, y }) => ({
|
|
512
|
-
x: FractionUtil.toFraction(x),
|
|
513
|
-
y: FractionUtil.toFraction(y)
|
|
514
|
-
});
|
|
515
|
-
/**
|
|
516
|
-
* Convert to Bounds.
|
|
517
|
-
* @param bounds
|
|
518
|
-
*/
|
|
519
|
-
static toBounds = ({ x, y, width, height }) => ({
|
|
520
|
-
x: FractionUtil.toFraction(x),
|
|
521
|
-
y: FractionUtil.toFraction(y),
|
|
522
|
-
width: FractionUtil.toFraction(width),
|
|
523
|
-
height: FractionUtil.toFraction(height)
|
|
524
|
-
});
|
|
525
|
-
/**
|
|
526
|
-
* Calculate center point.
|
|
527
|
-
* @param bounds
|
|
528
|
-
*/
|
|
529
|
-
static center = ({ x, y, width, height }) => {
|
|
530
|
-
const cx = FractionUtil.add(x, FractionUtil.multiply(width, [
|
|
531
|
-
1,
|
|
532
|
-
2
|
|
533
|
-
]));
|
|
534
|
-
const cy = FractionUtil.add(y, FractionUtil.multiply(height, [
|
|
535
|
-
1,
|
|
536
|
-
2
|
|
537
|
-
]));
|
|
538
|
-
return {
|
|
539
|
-
x: cx,
|
|
540
|
-
y: cy
|
|
541
|
-
};
|
|
542
|
-
};
|
|
543
|
-
/**
|
|
544
|
-
* Calculate centered left edge.
|
|
545
|
-
* @param bounds
|
|
546
|
-
*/
|
|
547
|
-
static left = ({ x, y, height }) => {
|
|
548
|
-
const cx = x;
|
|
549
|
-
const cy = FractionUtil.add(y, FractionUtil.multiply(height, [
|
|
550
|
-
1,
|
|
551
|
-
2
|
|
552
|
-
]));
|
|
553
|
-
return {
|
|
554
|
-
x: cx,
|
|
555
|
-
y: cy
|
|
556
|
-
};
|
|
557
|
-
};
|
|
558
|
-
/**
|
|
559
|
-
* Calculate centered right edge.
|
|
560
|
-
* @param bounds
|
|
561
|
-
*/
|
|
562
|
-
static right = ({ x, y, width, height }) => {
|
|
563
|
-
const cx = FractionUtil.add(x, width);
|
|
564
|
-
const cy = FractionUtil.add(y, FractionUtil.multiply(height, [
|
|
565
|
-
1,
|
|
566
|
-
2
|
|
567
|
-
]));
|
|
568
|
-
return {
|
|
569
|
-
x: cx,
|
|
570
|
-
y: cy
|
|
571
|
-
};
|
|
572
|
-
};
|
|
573
|
-
};
|
|
574
|
-
|
|
575
|
-
// src/hooks/useSvgContext.ts
|
|
576
|
-
import { createContext, useContext } from "react";
|
|
577
|
-
import { createRef } from "react";
|
|
578
|
-
import { raise } from "@dxos/debug";
|
|
579
|
-
var SVGContext = class {
|
|
580
|
-
_ref = createRef();
|
|
581
|
-
_scale;
|
|
582
|
-
_centered;
|
|
583
|
-
_size;
|
|
584
|
-
_center;
|
|
585
|
-
resized = new EventEmitter();
|
|
586
|
-
constructor({ scale = new Scale(), centered = true }) {
|
|
587
|
-
this._scale = scale;
|
|
588
|
-
this._centered = centered;
|
|
589
|
-
}
|
|
590
|
-
get ref() {
|
|
591
|
-
return this._ref;
|
|
592
|
-
}
|
|
593
|
-
get svg() {
|
|
594
|
-
return this._ref.current;
|
|
595
|
-
}
|
|
596
|
-
get scale() {
|
|
597
|
-
return this._scale;
|
|
598
|
-
}
|
|
599
|
-
get center() {
|
|
600
|
-
return this._center;
|
|
601
|
-
}
|
|
602
|
-
get size() {
|
|
603
|
-
return this._size;
|
|
604
|
-
}
|
|
605
|
-
/**
|
|
606
|
-
* https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox
|
|
607
|
-
*/
|
|
608
|
-
get viewBox() {
|
|
609
|
-
const [x, y] = this.center;
|
|
610
|
-
return `${x},${y},${this._size.width},${this._size.height}`;
|
|
611
|
-
}
|
|
612
|
-
setSize(size) {
|
|
613
|
-
this._size = {
|
|
614
|
-
...size
|
|
615
|
-
};
|
|
616
|
-
this._center = this._centered ? [
|
|
617
|
-
-Math.floor(size.width / 2),
|
|
618
|
-
-Math.floor(size.height / 2)
|
|
619
|
-
] : [
|
|
620
|
-
0,
|
|
621
|
-
0
|
|
622
|
-
];
|
|
623
|
-
this.resized.emit(this);
|
|
624
|
-
}
|
|
625
|
-
setTransform(transform) {
|
|
626
|
-
if (this._scale.setTransform(transform)) {
|
|
627
|
-
this.resized.emit(this);
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
/**
|
|
631
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/Document/elementFromPoint
|
|
632
|
-
* @param point
|
|
633
|
-
*/
|
|
634
|
-
elementFromPoint(point) {
|
|
635
|
-
const [x, y] = point;
|
|
636
|
-
const [cx, cy] = this._center;
|
|
637
|
-
return document.elementFromPoint(cx + x, cy + y);
|
|
638
|
-
}
|
|
639
|
-
};
|
|
640
|
-
var SVGContextType = createContext(void 0);
|
|
641
|
-
var SVGContextProvider = SVGContextType.Provider;
|
|
642
|
-
var useSvgContext = () => {
|
|
643
|
-
return useContext(SVGContextType) ?? raise(new Error("Missing SVGRoot"));
|
|
644
|
-
};
|
|
645
|
-
|
|
646
|
-
// src/hooks/useGrid.ts
|
|
647
|
-
import { line, range, select } from "d3";
|
|
648
|
-
import { useEffect, useMemo, useRef } from "react";
|
|
649
|
-
var createLine = line();
|
|
650
|
-
var createGrid = (context, options) => {
|
|
651
|
-
if (!context.size) {
|
|
652
|
-
return [];
|
|
653
|
-
}
|
|
654
|
-
const paths = [];
|
|
655
|
-
const { width, height } = context.size;
|
|
656
|
-
const { x, y, k } = context.scale.transform;
|
|
657
|
-
const s = 1 / k;
|
|
658
|
-
const w = width * s;
|
|
659
|
-
const h = height * s;
|
|
660
|
-
const dx = -(x + width / 2) * s;
|
|
661
|
-
const dy = -(y + height / 2) * s;
|
|
662
|
-
if (options.axis) {
|
|
663
|
-
const axis = [
|
|
664
|
-
[
|
|
665
|
-
[
|
|
666
|
-
0,
|
|
667
|
-
dy
|
|
668
|
-
],
|
|
669
|
-
[
|
|
670
|
-
0,
|
|
671
|
-
dy + h
|
|
672
|
-
]
|
|
673
|
-
],
|
|
674
|
-
[
|
|
675
|
-
[
|
|
676
|
-
dx,
|
|
677
|
-
0
|
|
678
|
-
],
|
|
679
|
-
[
|
|
680
|
-
dx + w,
|
|
681
|
-
0
|
|
682
|
-
]
|
|
683
|
-
]
|
|
684
|
-
];
|
|
685
|
-
paths.push({
|
|
686
|
-
id: "axis",
|
|
687
|
-
class: "dx-axis",
|
|
688
|
-
path: axis.map((line2) => createLine(line2)).join()
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
|
-
if (options.grid) {
|
|
692
|
-
const mod = (n, size, delta = 0) => Math.floor(n / size + delta) * size;
|
|
693
|
-
const majorSize = context.scale.gridSize;
|
|
694
|
-
const xMajor = range(-mod((x + width / 2) * s, majorSize), mod((-x + width / 2) * s, majorSize, 1), majorSize);
|
|
695
|
-
const yMajor = range(-mod((y + height / 2) * s, majorSize), mod((-y + height / 2) * s, majorSize, 1), majorSize);
|
|
696
|
-
const major = [
|
|
697
|
-
...xMajor.filter((x2) => !options.axis || x2).map((x2) => [
|
|
698
|
-
[
|
|
699
|
-
x2,
|
|
700
|
-
dy
|
|
701
|
-
],
|
|
702
|
-
[
|
|
703
|
-
x2,
|
|
704
|
-
dy + h
|
|
705
|
-
]
|
|
706
|
-
]),
|
|
707
|
-
...yMajor.filter((y2) => !options.axis || y2).map((y2) => [
|
|
708
|
-
[
|
|
709
|
-
dx,
|
|
710
|
-
y2
|
|
711
|
-
],
|
|
712
|
-
[
|
|
713
|
-
dx + w,
|
|
714
|
-
y2
|
|
715
|
-
]
|
|
716
|
-
])
|
|
717
|
-
];
|
|
718
|
-
paths.push({
|
|
719
|
-
id: "major",
|
|
720
|
-
class: "dx-major",
|
|
721
|
-
path: major.map((line2) => createLine(line2)).join()
|
|
722
|
-
});
|
|
723
|
-
const minorSize = Math.pow(2, Math.round(Math.log2(s * context.scale.gridSize)));
|
|
724
|
-
if (majorSize > minorSize) {
|
|
725
|
-
const xMinor = range(-mod((x + width / 2) * s, minorSize), mod((-x + width / 2) * s, minorSize, 1), minorSize);
|
|
726
|
-
const yMinor = range(-mod((y + height / 2) * s, minorSize), mod((-y + height / 2) * s, minorSize, 1), minorSize);
|
|
727
|
-
const minor = [
|
|
728
|
-
...xMinor.filter((x2) => xMajor.indexOf(x2) === -1).map((x2) => [
|
|
729
|
-
[
|
|
730
|
-
x2,
|
|
731
|
-
dy
|
|
732
|
-
],
|
|
733
|
-
[
|
|
734
|
-
x2,
|
|
735
|
-
dy + h
|
|
736
|
-
]
|
|
737
|
-
]),
|
|
738
|
-
...yMinor.filter((y2) => yMajor.indexOf(y2) === -1).map((y2) => [
|
|
739
|
-
[
|
|
740
|
-
dx,
|
|
741
|
-
y2
|
|
742
|
-
],
|
|
743
|
-
[
|
|
744
|
-
dx + w,
|
|
745
|
-
y2
|
|
746
|
-
]
|
|
747
|
-
])
|
|
748
|
-
];
|
|
749
|
-
paths.push({
|
|
750
|
-
id: "minor",
|
|
751
|
-
class: "dx-minor",
|
|
752
|
-
path: minor.map((line2) => createLine(line2)).join()
|
|
753
|
-
});
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
return paths;
|
|
757
|
-
};
|
|
758
|
-
var defaultGridOptions = {
|
|
759
|
-
visible: true,
|
|
760
|
-
axis: true,
|
|
761
|
-
grid: true
|
|
762
|
-
};
|
|
763
|
-
var GridController = class {
|
|
764
|
-
_ref;
|
|
765
|
-
_context;
|
|
766
|
-
_options;
|
|
767
|
-
_visible;
|
|
768
|
-
constructor(_ref, _context, _options) {
|
|
769
|
-
this._ref = _ref;
|
|
770
|
-
this._context = _context;
|
|
771
|
-
this._options = _options;
|
|
772
|
-
this._visible = false;
|
|
773
|
-
this._visible = this._options.visible ?? true;
|
|
774
|
-
}
|
|
775
|
-
get ref() {
|
|
776
|
-
return this._ref;
|
|
777
|
-
}
|
|
778
|
-
get visible() {
|
|
779
|
-
return this._visible;
|
|
780
|
-
}
|
|
781
|
-
draw() {
|
|
782
|
-
if (!this._context.size) {
|
|
783
|
-
return;
|
|
784
|
-
}
|
|
785
|
-
const paths = this._visible ? createGrid(this._context, this._options) : [];
|
|
786
|
-
const root = select(this._ref.current);
|
|
787
|
-
root.selectAll("path").data(paths, (path) => path.id).join("path").style("pointer-events", "none").attr("d", (d) => d.path).attr("class", (d) => d.class);
|
|
788
|
-
const transform = this._context.scale.transform;
|
|
789
|
-
if (transform) {
|
|
790
|
-
root.attr("transform", transform);
|
|
791
|
-
root.attr("stroke-width", 1 / transform.k);
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
setVisible(visible) {
|
|
795
|
-
this._visible = visible;
|
|
796
|
-
this.draw();
|
|
797
|
-
return this;
|
|
798
|
-
}
|
|
799
|
-
};
|
|
800
|
-
var useGrid = (options = defaultGridOptions) => {
|
|
801
|
-
const ref = useRef(null);
|
|
802
|
-
const context = useSvgContext();
|
|
803
|
-
const controller = useMemo(() => new GridController(ref, context, options), []);
|
|
804
|
-
useEffect(() => context.resized.on(() => controller.draw()), [
|
|
805
|
-
context,
|
|
806
|
-
controller
|
|
807
|
-
]);
|
|
808
|
-
return controller;
|
|
809
|
-
};
|
|
810
|
-
|
|
811
|
-
// src/hooks/useStateRef.ts
|
|
812
|
-
import { useEffect as useEffect2, useRef as useRef2, useState } from "react";
|
|
813
|
-
var useStateRef = (initialValue) => {
|
|
814
|
-
const [value, setValue] = useState(initialValue);
|
|
815
|
-
const ref = useRef2();
|
|
816
|
-
useEffect2(() => {
|
|
817
|
-
ref.current = value;
|
|
818
|
-
}, [
|
|
819
|
-
initialValue,
|
|
820
|
-
value
|
|
821
|
-
]);
|
|
822
|
-
return [
|
|
823
|
-
value,
|
|
824
|
-
setValue,
|
|
825
|
-
ref
|
|
826
|
-
];
|
|
827
|
-
};
|
|
828
|
-
var useDynamicRef = (initialValue, deps) => {
|
|
829
|
-
const [, setValue] = useState(initialValue);
|
|
830
|
-
const ref = useRef2(initialValue());
|
|
831
|
-
useEffect2(() => {
|
|
832
|
-
ref.current = initialValue();
|
|
833
|
-
setValue(ref.current);
|
|
834
|
-
}, deps);
|
|
835
|
-
return ref;
|
|
836
|
-
};
|
|
837
|
-
var useTimestamp = (deps) => {
|
|
838
|
-
const [{ timestamp, previous }, setTimestamp] = useState({
|
|
839
|
-
timestamp: Date.now()
|
|
840
|
-
});
|
|
841
|
-
useEffect2(() => {
|
|
842
|
-
setTimestamp({
|
|
843
|
-
timestamp: Date.now(),
|
|
844
|
-
previous: timestamp
|
|
845
|
-
});
|
|
846
|
-
}, deps ?? []);
|
|
847
|
-
return [
|
|
848
|
-
timestamp,
|
|
849
|
-
() => setTimestamp({
|
|
850
|
-
timestamp: Date.now(),
|
|
851
|
-
previous: timestamp
|
|
852
|
-
}),
|
|
853
|
-
previous
|
|
854
|
-
];
|
|
855
|
-
};
|
|
856
|
-
|
|
857
|
-
// src/hooks/useZoom.ts
|
|
858
|
-
import { select as select2, zoom, zoomIdentity as zoomIdentity2 } from "d3";
|
|
859
|
-
import defaultsDeep from "lodash.defaultsdeep";
|
|
860
|
-
import { useEffect as useEffect3, useMemo as useMemo2, useRef as useRef3 } from "react";
|
|
861
|
-
var defaultZoomOptions = {
|
|
862
|
-
enabled: true,
|
|
863
|
-
extent: [
|
|
864
|
-
1 / 4,
|
|
865
|
-
4
|
|
866
|
-
],
|
|
867
|
-
onDblClick: (zoom2) => zoom2.reset()
|
|
868
|
-
};
|
|
869
|
-
var ZoomHandler = class {
|
|
870
|
-
_ref;
|
|
871
|
-
_context;
|
|
872
|
-
_zoom;
|
|
873
|
-
_options;
|
|
874
|
-
_enabled;
|
|
875
|
-
constructor(_ref, _context, options) {
|
|
876
|
-
this._ref = _ref;
|
|
877
|
-
this._context = _context;
|
|
878
|
-
this._options = defaultsDeep({}, options, defaultZoomOptions);
|
|
879
|
-
this._enabled = this._options.enabled ?? true;
|
|
880
|
-
this._zoom = zoom().scaleExtent(this._options.extent ?? defaultZoomOptions.extent);
|
|
881
|
-
}
|
|
882
|
-
/**
|
|
883
|
-
* Gets the reference which the transform is applied to.
|
|
884
|
-
*/
|
|
885
|
-
get ref() {
|
|
886
|
-
return this._ref;
|
|
887
|
-
}
|
|
888
|
-
get zoom() {
|
|
889
|
-
return this._zoom;
|
|
890
|
-
}
|
|
891
|
-
init() {
|
|
892
|
-
this.setEnabled(this._enabled);
|
|
893
|
-
this.reset(0);
|
|
894
|
-
return this;
|
|
895
|
-
}
|
|
896
|
-
setEnabled(enable) {
|
|
897
|
-
if (enable) {
|
|
898
|
-
select2(this._context.svg).call(this._zoom).on(
|
|
899
|
-
"dblclick.zoom",
|
|
900
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
901
|
-
// @ts-ignore
|
|
902
|
-
this._options?.onDblClick ? () => {
|
|
903
|
-
this._options?.onDblClick(this);
|
|
904
|
-
} : null
|
|
905
|
-
);
|
|
906
|
-
} else {
|
|
907
|
-
select2(this._context.svg).on(".zoom", null);
|
|
908
|
-
}
|
|
909
|
-
this._enabled = enable;
|
|
910
|
-
return this;
|
|
911
|
-
}
|
|
912
|
-
reset(duration = 500) {
|
|
913
|
-
const scale = 1;
|
|
914
|
-
const transform = zoomIdentity2.scale(scale);
|
|
915
|
-
select2(this._context.svg).transition().duration(duration).call(this._zoom.transform, transform);
|
|
916
|
-
return this;
|
|
917
|
-
}
|
|
918
|
-
};
|
|
919
|
-
var useZoom = (options = defaultZoomOptions) => {
|
|
920
|
-
const context = useSvgContext();
|
|
921
|
-
const ref = useRef3(null);
|
|
922
|
-
const handler = useMemo2(() => new ZoomHandler(ref, context, options), [
|
|
923
|
-
context,
|
|
924
|
-
options
|
|
925
|
-
]);
|
|
926
|
-
useEffect3(() => {
|
|
927
|
-
handler.zoom.on("zoom", ({ transform }) => {
|
|
928
|
-
context.setTransform(transform);
|
|
929
|
-
select2(ref.current).attr("transform", transform);
|
|
930
|
-
});
|
|
931
|
-
handler.init();
|
|
932
|
-
}, [
|
|
933
|
-
handler
|
|
934
|
-
]);
|
|
935
|
-
return handler;
|
|
936
|
-
};
|
|
937
|
-
|
|
938
|
-
export {
|
|
939
|
-
EventEmitter,
|
|
940
|
-
FractionUtil,
|
|
941
|
-
getCircumferencePoints,
|
|
942
|
-
normal,
|
|
943
|
-
offsetPoints,
|
|
944
|
-
Scale,
|
|
945
|
-
Screen,
|
|
946
|
-
Vector,
|
|
947
|
-
SVGContext,
|
|
948
|
-
SVGContextProvider,
|
|
949
|
-
useSvgContext,
|
|
950
|
-
GridController,
|
|
951
|
-
useGrid,
|
|
952
|
-
useStateRef,
|
|
953
|
-
useDynamicRef,
|
|
954
|
-
useTimestamp,
|
|
955
|
-
ZoomHandler,
|
|
956
|
-
useZoom
|
|
957
|
-
};
|
|
958
|
-
//# sourceMappingURL=chunk-HLAKLUDC.mjs.map
|