@aiready/components 0.11.11 → 0.11.13
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/components",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.13",
|
|
4
4
|
"description": "Unified shared components library (UI, charts, hooks, utilities) for AIReady",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"d3": "^7.9.0",
|
|
64
64
|
"d3-force": "^3.0.0",
|
|
65
65
|
"tailwind-merge": "^3.0.0",
|
|
66
|
-
"@aiready/core": "0.21.
|
|
66
|
+
"@aiready/core": "0.21.13"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@testing-library/jest-dom": "^6.6.5",
|
|
@@ -344,10 +344,7 @@ export const ForceDirectedGraph = forwardRef<
|
|
|
344
344
|
svg
|
|
345
345
|
.transition()
|
|
346
346
|
.duration(300)
|
|
347
|
-
.call(
|
|
348
|
-
d3.zoom<SVGSVGElement, unknown>().transform as any,
|
|
349
|
-
newTransform
|
|
350
|
-
);
|
|
347
|
+
.call((d3 as any).zoom().transform as any, newTransform);
|
|
351
348
|
setTransform(newTransform);
|
|
352
349
|
}
|
|
353
350
|
},
|
|
@@ -384,10 +381,10 @@ export const ForceDirectedGraph = forwardRef<
|
|
|
384
381
|
const svg = d3.select(svgRef.current);
|
|
385
382
|
const g = d3.select(gRef.current);
|
|
386
383
|
|
|
387
|
-
const zoom = d3
|
|
388
|
-
.zoom
|
|
384
|
+
const zoom = (d3 as any)
|
|
385
|
+
.zoom()
|
|
389
386
|
.scaleExtent([0.1, 10])
|
|
390
|
-
.on('zoom', (event) => {
|
|
387
|
+
.on('zoom', (event: any) => {
|
|
391
388
|
g.attr('transform', event.transform);
|
|
392
389
|
transformRef.current = event.transform;
|
|
393
390
|
setTransform(event.transform);
|
|
@@ -406,9 +403,7 @@ export const ForceDirectedGraph = forwardRef<
|
|
|
406
403
|
if (!gRef.current) return;
|
|
407
404
|
try {
|
|
408
405
|
const g = d3.select(gRef.current);
|
|
409
|
-
g.selectAll
|
|
410
|
-
this: SVGGElement
|
|
411
|
-
) {
|
|
406
|
+
g.selectAll('g.node').each(function (this: any) {
|
|
412
407
|
const datum = d3.select(this).datum() as any;
|
|
413
408
|
if (!datum) return;
|
|
414
409
|
d3.select(this).attr(
|
|
@@ -417,9 +412,7 @@ export const ForceDirectedGraph = forwardRef<
|
|
|
417
412
|
);
|
|
418
413
|
});
|
|
419
414
|
|
|
420
|
-
g.selectAll
|
|
421
|
-
this: SVGLineElement
|
|
422
|
-
) {
|
|
415
|
+
g.selectAll('line').each(function (this: any) {
|
|
423
416
|
const l = d3.select(this).datum() as any;
|
|
424
417
|
if (!l) return;
|
|
425
418
|
const s: any =
|
|
@@ -513,9 +506,9 @@ export const ForceDirectedGraph = forwardRef<
|
|
|
513
506
|
useEffect(() => {
|
|
514
507
|
if (!gRef.current || !enableDrag) return;
|
|
515
508
|
const g = d3.select(gRef.current);
|
|
516
|
-
const dragBehavior = d3
|
|
517
|
-
.drag
|
|
518
|
-
.on('start', function (event) {
|
|
509
|
+
const dragBehavior = (d3 as any)
|
|
510
|
+
.drag()
|
|
511
|
+
.on('start', function (this: any, event: any) {
|
|
519
512
|
try {
|
|
520
513
|
const target =
|
|
521
514
|
(event.sourceEvent && (event.sourceEvent.target as Element)) ||
|
|
@@ -538,7 +531,7 @@ export const ForceDirectedGraph = forwardRef<
|
|
|
538
531
|
void e;
|
|
539
532
|
}
|
|
540
533
|
})
|
|
541
|
-
.on('drag', function (event) {
|
|
534
|
+
.on('drag', function (this: any, event: any) {
|
|
542
535
|
if (!dragActiveRef.current || !dragNodeRef.current) return;
|
|
543
536
|
const svg = svgRef.current;
|
|
544
537
|
if (!svg) return;
|