@dxos/react-ui-graph 0.8.2-main.10c050d
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/LICENSE +8 -0
- package/README.md +25 -0
- package/dist/lib/browser/chunk-2YMRPQU7.mjs +979 -0
- package/dist/lib/browser/chunk-2YMRPQU7.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1546 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/testing/index.mjs +180 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/node/chunk-WFHWEMPB.cjs +919 -0
- package/dist/lib/node/chunk-WFHWEMPB.cjs.map +7 -0
- package/dist/lib/node/index.cjs +1547 -0
- package/dist/lib/node/index.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node/testing/index.cjs +214 -0
- package/dist/lib/node/testing/index.cjs.map +7 -0
- package/dist/lib/node-esm/chunk-ITHTKQOY.mjs +981 -0
- package/dist/lib/node-esm/chunk-ITHTKQOY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1547 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/testing/index.mjs +181 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/types/src/components/Graph/Graph.d.ts +26 -0
- package/dist/types/src/components/Graph/Graph.d.ts.map +1 -0
- package/dist/types/src/components/Graph/Graph.stories.d.ts +29 -0
- package/dist/types/src/components/Graph/Graph.stories.d.ts.map +1 -0
- package/dist/types/src/components/Graph/index.d.ts +2 -0
- package/dist/types/src/components/Graph/index.d.ts.map +1 -0
- package/dist/types/src/components/Mesh/Mesh.d.ts +6 -0
- package/dist/types/src/components/Mesh/Mesh.d.ts.map +1 -0
- package/dist/types/src/components/Mesh/Mesh.stories.d.ts +12 -0
- package/dist/types/src/components/Mesh/Mesh.stories.d.ts.map +1 -0
- package/dist/types/src/components/Mesh/index.d.ts +2 -0
- package/dist/types/src/components/Mesh/index.d.ts.map +1 -0
- package/dist/types/src/components/SVG/Grid.d.ts +9 -0
- package/dist/types/src/components/SVG/Grid.d.ts.map +1 -0
- package/dist/types/src/components/SVG/Markers.d.ts +10 -0
- package/dist/types/src/components/SVG/Markers.d.ts.map +1 -0
- package/dist/types/src/components/SVG/Root.d.ts +12 -0
- package/dist/types/src/components/SVG/Root.d.ts.map +1 -0
- package/dist/types/src/components/SVG/SVG.d.ts +23 -0
- package/dist/types/src/components/SVG/SVG.d.ts.map +1 -0
- package/dist/types/src/components/SVG/Svg.stories.d.ts +17 -0
- package/dist/types/src/components/SVG/Svg.stories.d.ts.map +1 -0
- package/dist/types/src/components/SVG/Zoom.d.ts +12 -0
- package/dist/types/src/components/SVG/Zoom.d.ts.map +1 -0
- package/dist/types/src/components/SVG/index.d.ts +2 -0
- package/dist/types/src/components/SVG/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +4 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/fx/fx.stories.d.ts +19 -0
- package/dist/types/src/fx/fx.stories.d.ts.map +1 -0
- package/dist/types/src/fx/index.d.ts +2 -0
- package/dist/types/src/fx/index.d.ts.map +1 -0
- package/dist/types/src/fx/pulsar.d.ts +17 -0
- package/dist/types/src/fx/pulsar.d.ts.map +1 -0
- package/dist/types/src/graph/index.d.ts +5 -0
- package/dist/types/src/graph/index.d.ts.map +1 -0
- package/dist/types/src/graph/markers.d.ts +11 -0
- package/dist/types/src/graph/markers.d.ts.map +1 -0
- package/dist/types/src/graph/projector/graph-drag.d.ts +16 -0
- package/dist/types/src/graph/projector/graph-drag.d.ts.map +1 -0
- package/dist/types/src/graph/projector/graph-force-projector.d.ts +96 -0
- package/dist/types/src/graph/projector/graph-force-projector.d.ts.map +1 -0
- package/dist/types/src/graph/projector/graph-forces.d.ts +8 -0
- package/dist/types/src/graph/projector/graph-forces.d.ts.map +1 -0
- package/dist/types/src/graph/projector/graph-hierarchical-projector.d.ts +14 -0
- package/dist/types/src/graph/projector/graph-hierarchical-projector.d.ts.map +1 -0
- package/dist/types/src/graph/projector/graph-projector.d.ts +25 -0
- package/dist/types/src/graph/projector/graph-projector.d.ts.map +1 -0
- package/dist/types/src/graph/projector/graph-radial-projector.d.ts +34 -0
- package/dist/types/src/graph/projector/graph-radial-projector.d.ts.map +1 -0
- package/dist/types/src/graph/projector/graph-relational-projector.d.ts +14 -0
- package/dist/types/src/graph/projector/graph-relational-projector.d.ts.map +1 -0
- package/dist/types/src/graph/projector/index.d.ts +8 -0
- package/dist/types/src/graph/projector/index.d.ts.map +1 -0
- package/dist/types/src/graph/projector/projector.d.ts +32 -0
- package/dist/types/src/graph/projector/projector.d.ts.map +1 -0
- package/dist/types/src/graph/renderer/bullets.d.ts +16 -0
- package/dist/types/src/graph/renderer/bullets.d.ts.map +1 -0
- package/dist/types/src/graph/renderer/graph-renderer.d.ts +43 -0
- package/dist/types/src/graph/renderer/graph-renderer.d.ts.map +1 -0
- package/dist/types/src/graph/renderer/index.d.ts +4 -0
- package/dist/types/src/graph/renderer/index.d.ts.map +1 -0
- package/dist/types/src/graph/renderer/linker.d.ts +12 -0
- package/dist/types/src/graph/renderer/linker.d.ts.map +1 -0
- package/dist/types/src/graph/renderer/renderer.d.ts +20 -0
- package/dist/types/src/graph/renderer/renderer.d.ts.map +1 -0
- package/dist/types/src/graph/types.d.ts +52 -0
- package/dist/types/src/graph/types.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +5 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useGrid.d.ts +24 -0
- package/dist/types/src/hooks/useGrid.d.ts.map +1 -0
- package/dist/types/src/hooks/useStateRef.d.ts +22 -0
- package/dist/types/src/hooks/useStateRef.d.ts.map +1 -0
- package/dist/types/src/hooks/useSvgContext.d.ts +41 -0
- package/dist/types/src/hooks/useSvgContext.d.ts.map +1 -0
- package/dist/types/src/hooks/useZoom.d.ts +34 -0
- package/dist/types/src/hooks/useZoom.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +6 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/stories/hooks.stories.d.ts +22 -0
- package/dist/types/src/stories/hooks.stories.d.ts.map +1 -0
- package/dist/types/src/testing/data.d.ts +27 -0
- package/dist/types/src/testing/data.d.ts.map +1 -0
- package/dist/types/src/testing/data.test.d.ts +2 -0
- package/dist/types/src/testing/data.test.d.ts.map +1 -0
- package/dist/types/src/testing/hooks.d.ts +42 -0
- package/dist/types/src/testing/hooks.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +4 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/model.d.ts +14 -0
- package/dist/types/src/testing/model.d.ts.map +1 -0
- package/dist/types/src/util/d3-types.d.ts +5 -0
- package/dist/types/src/util/d3-types.d.ts.map +1 -0
- package/dist/types/src/util/events.d.ts +10 -0
- package/dist/types/src/util/events.d.ts.map +1 -0
- package/dist/types/src/util/fraction.d.ts +65 -0
- package/dist/types/src/util/fraction.d.ts.map +1 -0
- package/dist/types/src/util/fraction.test.d.ts +2 -0
- package/dist/types/src/util/fraction.test.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +9 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/points.d.ts +15 -0
- package/dist/types/src/util/points.d.ts.map +1 -0
- package/dist/types/src/util/scale.d.ts +57 -0
- package/dist/types/src/util/scale.d.ts.map +1 -0
- package/dist/types/src/util/scale.test.d.ts +2 -0
- package/dist/types/src/util/scale.test.d.ts.map +1 -0
- package/dist/types/src/util/screen.d.ts +25 -0
- package/dist/types/src/util/screen.d.ts.map +1 -0
- package/dist/types/src/util/screen.test.d.ts +2 -0
- package/dist/types/src/util/screen.test.d.ts.map +1 -0
- package/dist/types/src/util/types.d.ts +4 -0
- package/dist/types/src/util/types.d.ts.map +1 -0
- package/dist/types/src/util/vector.d.ts +48 -0
- package/dist/types/src/util/vector.d.ts.map +1 -0
- package/dist/types/src/util/vector.test.d.ts +2 -0
- package/dist/types/src/util/vector.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +86 -0
- package/src/components/Graph/Graph.stories.tsx +457 -0
- package/src/components/Graph/Graph.tsx +130 -0
- package/src/components/Graph/index.ts +5 -0
- package/src/components/Mesh/Mesh.stories.tsx +62 -0
- package/src/components/Mesh/Mesh.tsx +143 -0
- package/src/components/Mesh/index.ts +5 -0
- package/src/components/SVG/Grid.tsx +20 -0
- package/src/components/SVG/Markers.tsx +25 -0
- package/src/components/SVG/Root.tsx +55 -0
- package/src/components/SVG/SVG.tsx +27 -0
- package/src/components/SVG/Svg.stories.tsx +57 -0
- package/src/components/SVG/Zoom.tsx +27 -0
- package/src/components/SVG/index.ts +5 -0
- package/src/components/index.ts +7 -0
- package/src/fx/fx.stories.tsx +116 -0
- package/src/fx/index.ts +5 -0
- package/src/fx/pulsar.ts +58 -0
- package/src/graph/index.ts +8 -0
- package/src/graph/markers.ts +85 -0
- package/src/graph/projector/graph-drag.ts +124 -0
- package/src/graph/projector/graph-force-projector.ts +414 -0
- package/src/graph/projector/graph-forces.ts +35 -0
- package/src/graph/projector/graph-hierarchical-projector.ts +80 -0
- package/src/graph/projector/graph-projector.ts +99 -0
- package/src/graph/projector/graph-radial-projector.ts +142 -0
- package/src/graph/projector/graph-relational-projector.ts +110 -0
- package/src/graph/projector/index.ts +11 -0
- package/src/graph/projector/projector.ts +72 -0
- package/src/graph/renderer/bullets.ts +72 -0
- package/src/graph/renderer/graph-renderer.ts +484 -0
- package/src/graph/renderer/index.ts +7 -0
- package/src/graph/renderer/linker.ts +42 -0
- package/src/graph/renderer/renderer.ts +49 -0
- package/src/graph/types.ts +80 -0
- package/src/hooks/index.ts +8 -0
- package/src/hooks/useGrid.ts +194 -0
- package/src/hooks/useStateRef.ts +60 -0
- package/src/hooks/useSvgContext.ts +96 -0
- package/src/hooks/useZoom.ts +118 -0
- package/src/index.ts +9 -0
- package/src/stories/hooks.stories.tsx +212 -0
- package/src/testing/data.test.ts +12 -0
- package/src/testing/data.ts +100 -0
- package/src/testing/hooks.ts +103 -0
- package/src/testing/index.ts +7 -0
- package/src/testing/model.ts +29 -0
- package/src/typings.d.ts +5 -0
- package/src/util/d3-types.ts +26 -0
- package/src/util/events.ts +24 -0
- package/src/util/fraction.test.ts +76 -0
- package/src/util/fraction.ts +175 -0
- package/src/util/index.ts +12 -0
- package/src/util/points.ts +68 -0
- package/src/util/scale.test.ts +31 -0
- package/src/util/scale.ts +137 -0
- package/src/util/screen.test.ts +41 -0
- package/src/util/screen.ts +91 -0
- package/src/util/types.ts +9 -0
- package/src/util/vector.test.ts +15 -0
- package/src/util/vector.ts +67 -0
- package/styles/graph.css +142 -0
- package/testing.d.ts +11 -0
- package/testing.js +5 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type SVGContext } from '../../hooks';
|
|
2
|
+
import { EventEmitter } from '../../util';
|
|
3
|
+
import { type IdAccessor } from '../types';
|
|
4
|
+
export type ProjectorOptions = {
|
|
5
|
+
idAccessor?: IdAccessor;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Generates a layout to be rendered.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class Projector<NodeData, Layout, Options extends ProjectorOptions> {
|
|
11
|
+
private readonly _context;
|
|
12
|
+
readonly updated: EventEmitter<{
|
|
13
|
+
layout: Layout;
|
|
14
|
+
}>;
|
|
15
|
+
private readonly _options;
|
|
16
|
+
constructor(_context: SVGContext, options?: Partial<Options>);
|
|
17
|
+
abstract get layout(): Layout;
|
|
18
|
+
get context(): SVGContext;
|
|
19
|
+
get options(): Options;
|
|
20
|
+
refresh(dragging?: boolean): void;
|
|
21
|
+
updateData(data?: NodeData): void;
|
|
22
|
+
emitUpdate(): void;
|
|
23
|
+
clear(): Promise<void>;
|
|
24
|
+
start(): Promise<void>;
|
|
25
|
+
stop(): Promise<void>;
|
|
26
|
+
protected onRefresh(dragging?: boolean): void;
|
|
27
|
+
protected onUpdate(data?: NodeData): void;
|
|
28
|
+
protected onClear(): Promise<void>;
|
|
29
|
+
protected onStart(): Promise<void>;
|
|
30
|
+
protected onStop(): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=projector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projector.d.ts","sourceRoot":"","sources":["../../../../../src/graph/projector/projector.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,8BAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,SAAS,gBAAgB;IAM9E,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAL3B,SAAgB,OAAO;gBAA8B,MAAM;OAAM;IAEjE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;gBAGhB,QAAQ,EAAE,UAAU,EACrC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;IAU5B,QAAQ,KAAK,MAAM,IAAI,MAAM,CAAC;IAE9B,IAAI,OAAO,IAAI,UAAU,CAExB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,OAAO,CAAC,QAAQ,UAAQ;IAIxB,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ;IAI1B,UAAU;IAIJ,KAAK;IAIL,KAAK;IAIL,IAAI;IAIV,SAAS,CAAC,SAAS,CAAC,QAAQ,UAAQ,GAAG,IAAI;IAC3C,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI;cACzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;cACxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;cACxB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CACxC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type D3Callable } from '../../util';
|
|
2
|
+
export type BulletOptions = {
|
|
3
|
+
max?: number;
|
|
4
|
+
radius?: number;
|
|
5
|
+
delay?: number;
|
|
6
|
+
minDuration?: number;
|
|
7
|
+
maxDuration?: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Generate animated bullets that follow selected paths.
|
|
11
|
+
* @param group
|
|
12
|
+
* @param nodeId
|
|
13
|
+
* @param options
|
|
14
|
+
*/
|
|
15
|
+
export declare const createBullets: (group: SVGGElement, nodeId: string, options?: BulletOptions) => D3Callable;
|
|
16
|
+
//# sourceMappingURL=bullets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bullets.d.ts","sourceRoot":"","sources":["../../../../../src/graph/renderer/bullets.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,WAAW,EAAE,QAAQ,MAAM,EAAE,UAAS,aAAkB,KAAG,UAiD/F,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Renderer, type RendererOptions } from './renderer';
|
|
2
|
+
import { type D3Callable } from '../../util';
|
|
3
|
+
import { type GraphLayout, type GraphLayoutEdge, type GraphLayoutNode } from '../types';
|
|
4
|
+
export type LabelOptions<NodeData = any> = {
|
|
5
|
+
text: (node: GraphLayoutNode<NodeData>, highlight?: boolean) => string | undefined;
|
|
6
|
+
};
|
|
7
|
+
export type AttributesOptions<NodeData = any, EdgeData = any> = {
|
|
8
|
+
node?: (node: GraphLayoutNode<NodeData>) => {
|
|
9
|
+
classes?: Record<string, boolean>;
|
|
10
|
+
data?: Record<string, string | undefined>;
|
|
11
|
+
};
|
|
12
|
+
edge?: (edge: GraphLayoutEdge<NodeData, EdgeData>) => {
|
|
13
|
+
classes?: Record<string, boolean>;
|
|
14
|
+
data?: Record<string, string | undefined>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type GraphRendererOptions<NodeData = any, EdgeData = any> = RendererOptions<{
|
|
18
|
+
drag?: D3Callable;
|
|
19
|
+
arrows?: {
|
|
20
|
+
start?: boolean;
|
|
21
|
+
end?: boolean;
|
|
22
|
+
};
|
|
23
|
+
highlight?: boolean;
|
|
24
|
+
labels?: LabelOptions<NodeData>;
|
|
25
|
+
subgraphs?: boolean;
|
|
26
|
+
attributes?: AttributesOptions<NodeData>;
|
|
27
|
+
transition?: () => any;
|
|
28
|
+
onNodeClick?: (node: GraphLayoutNode<NodeData>, event: MouseEvent) => void;
|
|
29
|
+
onNodePointerEnter?: (node: GraphLayoutNode<NodeData>, event: MouseEvent) => void;
|
|
30
|
+
onLinkClick?: (link: GraphLayoutEdge<NodeData, EdgeData>, event: MouseEvent) => void;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Renders the Graph layout.
|
|
34
|
+
*/
|
|
35
|
+
export declare class GraphRenderer<NodeData = any, EdgeData = any> extends Renderer<GraphLayout<NodeData, EdgeData>, GraphRendererOptions<NodeData, EdgeData>> {
|
|
36
|
+
render(layout: GraphLayout<NodeData, EdgeData>): void;
|
|
37
|
+
/**
|
|
38
|
+
* Trigger path bullets.
|
|
39
|
+
* @param node
|
|
40
|
+
*/
|
|
41
|
+
fireBullet(node: GraphLayoutNode<NodeData>): void;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=graph-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/graph/renderer/graph-renderer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAA4C,KAAK,UAAU,EAAc,MAAM,YAAY,CAAC;AACnG,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAIxF,MAAM,MAAM,YAAY,CAAC,QAAQ,GAAG,GAAG,IAAI;IACzC,IAAI,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAAC;CACpF,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,QAAQ,GAAG,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI;IAC9D,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK;QAC1C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KAC3C,CAAC;IAEF,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK;QACpD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KAC3C,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,oBA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src/graph/renderer/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type D3Callable, type Point } from '../../util';
|
|
2
|
+
import { type GraphLayoutNode } from '../types';
|
|
3
|
+
export type LinkOptions = {
|
|
4
|
+
source?: GraphLayoutNode<any>;
|
|
5
|
+
target?: GraphLayoutNode<any>;
|
|
6
|
+
point?: Point;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Render linker while dragging.
|
|
10
|
+
*/
|
|
11
|
+
export declare const linkerRenderer: D3Callable;
|
|
12
|
+
//# sourceMappingURL=linker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linker.d.ts","sourceRoot":"","sources":["../../../../../src/graph/renderer/linker.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,UAoB5B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import { type SVGContext } from '../../hooks';
|
|
3
|
+
import { type IdAccessor } from '../types';
|
|
4
|
+
export type RendererOptions<T = any> = {
|
|
5
|
+
idAccessor: IdAccessor;
|
|
6
|
+
} & T;
|
|
7
|
+
/**
|
|
8
|
+
* Base class for renderer that draw layouts.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class Renderer<LAYOUT, OPTIONS extends RendererOptions> {
|
|
11
|
+
protected readonly _context: SVGContext;
|
|
12
|
+
protected readonly _root: RefObject<SVGGElement>;
|
|
13
|
+
protected readonly _options?: OPTIONS;
|
|
14
|
+
constructor(_context: SVGContext, _root: RefObject<SVGGElement>, options?: Partial<OPTIONS>);
|
|
15
|
+
get context(): SVGContext;
|
|
16
|
+
get root(): SVGGElement;
|
|
17
|
+
get options(): OPTIONS;
|
|
18
|
+
abstract render(layout: LAYOUT): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../../../src/graph/renderer/renderer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE9D,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,GAAG,IAAI;IACrC,UAAU,EAAE,UAAU,CAAC;CACxB,GAAG,CAAC,CAAC;AAEN;;GAEG;AACH,8BAAsB,QAAQ,CAAC,MAAM,EAAE,OAAO,SAAS,eAAe;IAIlE,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU;IACvC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC;IAJlD,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;gBAGjB,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,EAChD,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;IAU5B,IAAI,OAAO,IAAI,UAAU,CAExB;IAED,IAAI,IAAI,IAAI,WAAW,CAGtB;IAED,IAAI,OAAO,YAEV;IAED,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CACtC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type Graph } from '@dxos/graph';
|
|
2
|
+
import { type Point } from '../util';
|
|
3
|
+
export type IdAccessor<N = any> = (node: N) => string;
|
|
4
|
+
export declare const defaultIdAccessor: IdAccessor;
|
|
5
|
+
export declare const emptyGraph: Graph;
|
|
6
|
+
export type GraphGuide = {
|
|
7
|
+
id: string;
|
|
8
|
+
type: string;
|
|
9
|
+
cx: number;
|
|
10
|
+
cy: number;
|
|
11
|
+
r: number;
|
|
12
|
+
classes?: {
|
|
13
|
+
circle?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type GraphLayoutNode<NodeData = any> = {
|
|
17
|
+
id: string;
|
|
18
|
+
type?: string;
|
|
19
|
+
order?: number;
|
|
20
|
+
data?: NodeData;
|
|
21
|
+
x?: number;
|
|
22
|
+
y?: number;
|
|
23
|
+
r?: number;
|
|
24
|
+
classes?: {
|
|
25
|
+
circle?: string;
|
|
26
|
+
text?: string;
|
|
27
|
+
};
|
|
28
|
+
children?: number;
|
|
29
|
+
initialized?: boolean;
|
|
30
|
+
last?: Point;
|
|
31
|
+
};
|
|
32
|
+
export type GraphLayoutEdge<NodeData = any, EdgeData = any> = {
|
|
33
|
+
id: string;
|
|
34
|
+
type?: string;
|
|
35
|
+
order?: number;
|
|
36
|
+
source: GraphLayoutNode<NodeData>;
|
|
37
|
+
target: GraphLayoutNode<NodeData>;
|
|
38
|
+
data?: EdgeData;
|
|
39
|
+
linkForce?: boolean;
|
|
40
|
+
classes?: {
|
|
41
|
+
path?: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type GraphLayout<NodeData = any, EdgeData = any> = {
|
|
45
|
+
id?: string;
|
|
46
|
+
guides?: GraphGuide[];
|
|
47
|
+
graph: {
|
|
48
|
+
nodes: GraphLayoutNode<NodeData>[];
|
|
49
|
+
edges: GraphLayoutEdge<NodeData, EdgeData>[];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/graph/types.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;AAEtD,eAAO,MAAM,iBAAiB,EAAE,UAG/B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAGxB,CAAC;AAOF,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,QAAQ,GAAG,GAAG,IAAI;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,QAAQ,GAAG,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IAClC,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,QAAQ,GAAG,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI;IACxD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,KAAK,EAAE;QACL,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnC,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;KAC9C,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import { type SVGContext } from './useSvgContext';
|
|
3
|
+
export type GridOptions = {
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
axis?: boolean;
|
|
6
|
+
grid?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare class GridController {
|
|
9
|
+
private readonly _ref;
|
|
10
|
+
private readonly _context;
|
|
11
|
+
private readonly _options;
|
|
12
|
+
_visible: boolean;
|
|
13
|
+
constructor(_ref: RefObject<SVGGElement>, _context: SVGContext, _options: GridOptions);
|
|
14
|
+
get ref(): RefObject<SVGGElement>;
|
|
15
|
+
get visible(): boolean;
|
|
16
|
+
draw(): void;
|
|
17
|
+
setVisible(visible: boolean): this;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates a reference to a SVG Group element which renders a grid.
|
|
21
|
+
* @param options
|
|
22
|
+
*/
|
|
23
|
+
export declare const useGrid: (options?: GridOptions) => GridController;
|
|
24
|
+
//# sourceMappingURL=useGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGrid.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useGrid.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAA8B,MAAM,OAAO,CAAC;AAEnE,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,iBAAiB,CAAC;AAmHjE,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAQF,qBAAa,cAAc;IAIvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAL3B,QAAQ,UAAS;gBAGE,IAAI,EAAE,SAAS,CAAC,WAAW,CAAC,EAC5B,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,WAAW;IAKxC,IAAI,GAAG,2BAEN;IAED,IAAI,OAAO,YAEV;IAED,IAAI,IAAI,IAAI;IAuBZ,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;CAKnC;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO,GAAI,UAAS,WAAgC,KAAG,cAMnE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Dispatch, type RefObject, type SetStateAction } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Extension of useState to return an up-to-date reference.
|
|
4
|
+
* E.g., to use in callbacks where the state value is stale.
|
|
5
|
+
* @param initialValue
|
|
6
|
+
*
|
|
7
|
+
* @deprecated This function has been deprecated.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useStateRef: <V>(initialValue?: V | (() => V)) => [V | undefined, Dispatch<SetStateAction<V | undefined>>, RefObject<V | undefined>];
|
|
10
|
+
/**
|
|
11
|
+
* Extension of useRef that contains computed values based on dependencies.
|
|
12
|
+
* E.g., to use in callbacks where the state value is stale.
|
|
13
|
+
* @param initialValue
|
|
14
|
+
* @param deps
|
|
15
|
+
*/
|
|
16
|
+
export declare const useDynamicRef: <V>(initialValue: () => V, deps: any[]) => RefObject<V>;
|
|
17
|
+
/**
|
|
18
|
+
* State setters to force repaint.
|
|
19
|
+
* @param deps
|
|
20
|
+
*/
|
|
21
|
+
export declare const useTimestamp: (deps?: any[]) => [number, () => void, number?];
|
|
22
|
+
//# sourceMappingURL=useStateRef.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStateRef.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useStateRef.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAA+B,MAAM,OAAO,CAAC;AAExG;;;;;;GAMG;AAEH,eAAO,MAAM,WAAW,GAAI,CAAC,EAC3B,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,KAC3B,CAAC,CAAC,GAAG,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC,CAQnF,CAAC;AAEF;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,cAAc,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,KAAG,SAAS,CAAC,CAAC,CAUhF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,GAAG,EAAE,KAAG,CAAC,MAAM,EAAE,MAAM,IAAI,EAAE,MAAM,CAAC,CAUvE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ZoomTransform } from 'd3';
|
|
2
|
+
import { type RefObject } from 'react';
|
|
3
|
+
import { EventEmitter, type Point, Scale, type Size } from '../util';
|
|
4
|
+
export type SVGContextOptions = {
|
|
5
|
+
scale?: Scale;
|
|
6
|
+
centered?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Contains a reference to the root SVG element and objects and configuration required by child nodes.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SVGContext {
|
|
12
|
+
private readonly _ref;
|
|
13
|
+
private _scale;
|
|
14
|
+
private _centered;
|
|
15
|
+
private _size?;
|
|
16
|
+
private _center?;
|
|
17
|
+
readonly resized: EventEmitter<SVGContext>;
|
|
18
|
+
constructor({ scale, centered }: SVGContextOptions);
|
|
19
|
+
get ref(): RefObject<SVGSVGElement>;
|
|
20
|
+
get svg(): SVGSVGElement;
|
|
21
|
+
get scale(): Scale;
|
|
22
|
+
get center(): Point;
|
|
23
|
+
get size(): Size | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox
|
|
26
|
+
*/
|
|
27
|
+
get viewBox(): string;
|
|
28
|
+
setSize(size: Size): void;
|
|
29
|
+
setTransform(transform: ZoomTransform): void;
|
|
30
|
+
/**
|
|
31
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Document/elementFromPoint
|
|
32
|
+
* @param point
|
|
33
|
+
*/
|
|
34
|
+
elementFromPoint(point: Point): Element;
|
|
35
|
+
}
|
|
36
|
+
export declare const SVGContextProvider: import("react").Provider<SVGContext>;
|
|
37
|
+
/**
|
|
38
|
+
* Get SVG context from the React context.
|
|
39
|
+
*/
|
|
40
|
+
export declare const useSvgContext: () => SVGContext;
|
|
41
|
+
//# sourceMappingURL=useSvgContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSvgContext.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSvgContext.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,IAAI,CAAC;AAExC,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAIlD,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,SAAS,CAAC;AAErE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA8B;IAEnD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,OAAO,CAAC,OAAO,CAAC,CAAQ;IAExB,QAAQ,CAAC,OAAO,2BAAkC;gBAEtC,EAAE,KAAmB,EAAE,QAAe,EAAE,EAAE,iBAAiB;IAKvE,IAAI,GAAG,IAAI,SAAS,CAAC,aAAa,CAAC,CAElC;IAED,IAAI,GAAG,IAAI,aAAa,CAEvB;IAED,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED,IAAI,MAAM,IAAI,KAAK,CAElB;IAED,IAAI,IAAI,IAAI,IAAI,GAAG,SAAS,CAE3B;IAED;;OAEG;IACH,IAAI,OAAO,WAGV;IAED,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAMzB,YAAY,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI;IAM5C;;;OAGG;IACH,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;CAKxC;AAID,eAAO,MAAM,kBAAkB,sCAA0B,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,UAEhC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ZoomBehavior } from 'd3';
|
|
2
|
+
import { type RefObject } from 'react';
|
|
3
|
+
import { type SVGContext } from './useSvgContext';
|
|
4
|
+
export type ZoomExtent = [min: number, max: number];
|
|
5
|
+
export type ZoomOptions = {
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
extent?: ZoomExtent;
|
|
8
|
+
onDblClick?: (zoom: ZoomHandler) => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Zoom API.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ZoomHandler {
|
|
14
|
+
private readonly _ref;
|
|
15
|
+
private readonly _context;
|
|
16
|
+
private readonly _zoom;
|
|
17
|
+
private readonly _options;
|
|
18
|
+
private _enabled;
|
|
19
|
+
constructor(_ref: RefObject<SVGGElement>, _context: SVGContext, options: ZoomOptions);
|
|
20
|
+
/**
|
|
21
|
+
* Gets the reference which the transform is applied to.
|
|
22
|
+
*/
|
|
23
|
+
get ref(): RefObject<SVGGElement>;
|
|
24
|
+
get zoom(): ZoomBehavior<SVGGElement, unknown>;
|
|
25
|
+
init(): this;
|
|
26
|
+
setEnabled(enable: boolean): this;
|
|
27
|
+
reset(duration?: number): this;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Creates the zoom handler.
|
|
31
|
+
* @param options
|
|
32
|
+
*/
|
|
33
|
+
export declare const useZoom: (options?: ZoomOptions) => ZoomHandler;
|
|
34
|
+
//# sourceMappingURL=useZoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useZoom.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useZoom.ts"],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,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import '@dxos-theme';
|
|
2
|
+
import { type StoryObj } from '@storybook/react';
|
|
3
|
+
import React, { type PropsWithChildren } from 'react';
|
|
4
|
+
import { type Meta } from '@dxos/storybook-utils';
|
|
5
|
+
import { type GraphForceProjectorOptions } from '../graph';
|
|
6
|
+
import { TestGraphModel } from '../testing';
|
|
7
|
+
import '../../styles/graph.css';
|
|
8
|
+
type StoryProps = PropsWithChildren<{
|
|
9
|
+
model: TestGraphModel;
|
|
10
|
+
projectorOptions?: GraphForceProjectorOptions;
|
|
11
|
+
count?: number;
|
|
12
|
+
interval?: number;
|
|
13
|
+
link?: boolean;
|
|
14
|
+
grid?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
declare const DefaultStory: ({ children, ...props }: StoryProps) => React.JSX.Element;
|
|
17
|
+
declare const meta: Meta;
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof DefaultStory>;
|
|
20
|
+
export declare const Default: Story;
|
|
21
|
+
export declare const Bullets: Story;
|
|
22
|
+
//# sourceMappingURL=hooks.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/hooks.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAA8B,MAAM,OAAO,CAAC;AAIlF,OAAO,EAAE,KAAK,IAAI,EAAyB,MAAM,uBAAuB,CAAC;AAGzE,OAAO,EAKL,KAAK,0BAA0B,EAIhC,MAAM,UAAU,CAAC;AAElB,OAAO,EAAkC,cAAc,EAAiB,MAAM,YAAY,CAAC;AAE3F,OAAO,wBAAwB,CAAC;AAEhC,KAAK,UAAU,GAAG,iBAAiB,CAAC;IAClC,KAAK,EAAE,cAAc,CAAC;IACtB,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC,CAAC;AAEH,QAAA,MAAM,YAAY,GAAI,wBAAwB,UAAU,sBASvD,CAAC;AAyGF,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,eAAO,MAAM,OAAO,EAAE,KAuBrB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAuBrB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type BaseGraphEdge, type Graph } from '@dxos/graph';
|
|
2
|
+
import { type TestNode } from './model';
|
|
3
|
+
export declare const seed: (seed: number) => void;
|
|
4
|
+
export declare const createNode: (type?: string) => TestNode;
|
|
5
|
+
export declare const createNodes: (n?: number, types?: string[]) => TestNode[];
|
|
6
|
+
export declare const createEdge: (source: TestNode, target: TestNode) => BaseGraphEdge;
|
|
7
|
+
/**
|
|
8
|
+
* Creates a random tree.
|
|
9
|
+
* @param depth Depth of tree.
|
|
10
|
+
* @param children Branching factor.
|
|
11
|
+
*/
|
|
12
|
+
export declare const createTree: ({ depth, children }?: {
|
|
13
|
+
depth?: number;
|
|
14
|
+
children?: number;
|
|
15
|
+
}) => TestNode;
|
|
16
|
+
/**
|
|
17
|
+
* Converts a tree into a graph.
|
|
18
|
+
* @param root
|
|
19
|
+
*/
|
|
20
|
+
export declare const convertTreeToGraph: (root: TestNode) => Graph;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a random graph.
|
|
23
|
+
* @param numNodes
|
|
24
|
+
* @param numEdges
|
|
25
|
+
*/
|
|
26
|
+
export declare const createGraph: (numNodes?: number, numEdges?: number, types?: string[]) => Graph;
|
|
27
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/testing/data.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAG7D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,SAAqB,CAAC;AAMvD,eAAO,MAAM,UAAU,GAAI,OAAM,MAAkB,KAAG,QAIpD,CAAC;AAEH,eAAO,MAAM,WAAW,GAAI,UAAK,EAAE,QAAQ,MAAM,EAAE,KAAG,QAAQ,EACsC,CAAC;AAErG,eAAO,MAAM,UAAU,GAAI,QAAQ,QAAQ,EAAE,QAAQ,QAAQ,KAAG,aAI9D,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI;;;CAAgC,KAAG,QAc7D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,QAAQ,KAAG,KAenD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,iBAAY,EAAE,iBAAY,EAAE,QAAQ,MAAM,EAAE,KAAG,KAqB1E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.test.d.ts","sourceRoot":"","sources":["../../../../src/testing/data.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Graph } from '@dxos/graph';
|
|
2
|
+
export type ObjectMutator<T> = [
|
|
3
|
+
T,
|
|
4
|
+
(data: T) => void,
|
|
5
|
+
(mutation: any) => T
|
|
6
|
+
];
|
|
7
|
+
/**
|
|
8
|
+
* Returns a state object and setter, with addition live getter and updater (for the current up-to-date reference).
|
|
9
|
+
* https://reactjs.org/docs/hooks-faq.html#why-am-i-seeing-stale-props-or-state-inside-my-function
|
|
10
|
+
*/
|
|
11
|
+
export declare const useObjectMutator: <T>(initalValue: T) => ObjectMutator<T>;
|
|
12
|
+
/**
|
|
13
|
+
* Test data set generator and mutator.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useGraphGenerator: (options?: {
|
|
16
|
+
data?: Graph;
|
|
17
|
+
}) => {
|
|
18
|
+
data: {
|
|
19
|
+
readonly id?: string;
|
|
20
|
+
readonly nodes: {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly data?: any;
|
|
23
|
+
readonly type?: string;
|
|
24
|
+
}[];
|
|
25
|
+
readonly edges: {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly data?: any;
|
|
28
|
+
readonly source: string;
|
|
29
|
+
readonly type?: string;
|
|
30
|
+
readonly target: string;
|
|
31
|
+
}[];
|
|
32
|
+
};
|
|
33
|
+
mutator: () => void;
|
|
34
|
+
reset: (options?: {
|
|
35
|
+
count: number;
|
|
36
|
+
}) => void;
|
|
37
|
+
start: ({ delay }?: {
|
|
38
|
+
delay?: number;
|
|
39
|
+
}) => () => void;
|
|
40
|
+
stop: () => void;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../src/testing/hooks.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAOzC,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,CAAC;IACD,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI;IACjB,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAE,aAAa,CAAC,KAAG,aAAa,CAAC,CAAC,CAoBnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAS;IAAE,IAAI,CAAC,EAAE,KAAK,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;;;;CAsD/D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type BaseGraphNode, ReactiveGraphModel } from '@dxos/graph';
|
|
2
|
+
export type TestNode = BaseGraphNode & {
|
|
3
|
+
label?: string;
|
|
4
|
+
children?: TestNode[];
|
|
5
|
+
};
|
|
6
|
+
export declare class TestGraphModel extends ReactiveGraphModel<TestNode> {
|
|
7
|
+
getRandomNode(): {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly data?: any;
|
|
10
|
+
readonly type?: string;
|
|
11
|
+
};
|
|
12
|
+
createNodes(node?: TestNode, n?: number): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../src/testing/model.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKrE,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF,qBAAa,cAAe,SAAQ,kBAAkB,CAAC,QAAQ,CAAC;IAC9D,aAAa;;;;;IAIb,WAAW,CAAC,IAAI,GAAE,QAAoB,EAAE,CAAC,SAAI,GAAG,IAAI;CASrD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BaseType, D3DragEvent as DragEvent, DraggedElementBaseType, Selection } from 'd3';
|
|
2
|
+
export type D3DragEvent<GElement extends DraggedElementBaseType = any, Datum = any, Subject = any> = DragEvent<GElement, Datum, Subject>;
|
|
3
|
+
export type D3Selection<GElement extends BaseType = any, Datum = any, PElement extends BaseType = any, PDatum = any> = Selection<GElement, Datum, PElement, PDatum>;
|
|
4
|
+
export type D3Callable<GElement extends BaseType = any, Datum = any, PElement extends BaseType = any, PDatum = any> = (selection: D3Selection<GElement, Datum, PElement, PDatum>, ...args: any[]) => void;
|
|
5
|
+
//# sourceMappingURL=d3-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"d3-types.d.ts","sourceRoot":"","sources":["../../../../src/util/d3-types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,IAAI,SAAS,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAGhG,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,sBAAsB,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,SAAS,CAC5G,QAAQ,EACR,KAAK,EACL,OAAO,CACR,CAAC;AAGF,MAAM,MAAM,WAAW,CACrB,QAAQ,SAAS,QAAQ,GAAG,GAAG,EAC/B,KAAK,GAAG,GAAG,EACX,QAAQ,SAAS,QAAQ,GAAG,GAAG,EAC/B,MAAM,GAAG,GAAG,IACV,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAGjD,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG,EAAE,QAAQ,SAAS,QAAQ,GAAG,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,CACpH,SAAS,EAAE,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,EACzD,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,IAAI,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type EventListener<T> = (value: T) => void;
|
|
2
|
+
export type EventHandle = () => void;
|
|
3
|
+
export declare class EventEmitter<T> {
|
|
4
|
+
private readonly _listeners;
|
|
5
|
+
clear(): void;
|
|
6
|
+
on(onEvent: EventListener<T>): EventHandle;
|
|
7
|
+
emit(value: T): void;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/util/events.ts"],"names":[],"mappings":"AAIA,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC;AAErC,qBAAa,YAAY,CAAC,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAE1D,KAAK,IAAI,IAAI;IAIb,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,WAAW;IAKnC,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;CAG5B"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export type Fraction = [num: number, denum: number];
|
|
2
|
+
export type Num = number | Fraction;
|
|
3
|
+
export declare class FractionUtil {
|
|
4
|
+
/**
|
|
5
|
+
* Convert number to fraction.
|
|
6
|
+
* @param n
|
|
7
|
+
*/
|
|
8
|
+
static toFraction: (n: Num) => Fraction;
|
|
9
|
+
static validate: (...fraction: Fraction[]) => Fraction[];
|
|
10
|
+
/**
|
|
11
|
+
* @param {Fraction}
|
|
12
|
+
* Convert to rounded number.
|
|
13
|
+
*/
|
|
14
|
+
static toNumber: ([n, d]: Fraction) => number;
|
|
15
|
+
/**
|
|
16
|
+
* Round the number to the nearest fraction.
|
|
17
|
+
* Example: 3/5 => 1/1; 3/5 (precision 2) => 1/2.
|
|
18
|
+
* @param {Fraction}
|
|
19
|
+
* @param p Precision (e.g., 1/2, 1/4, etc.)
|
|
20
|
+
*/
|
|
21
|
+
static round: ([n, d]: Fraction, p?: number) => Fraction;
|
|
22
|
+
/**
|
|
23
|
+
* Tests if equals.
|
|
24
|
+
* @param n1
|
|
25
|
+
* @param n2
|
|
26
|
+
*/
|
|
27
|
+
static equals: (n1: Fraction, n2: Fraction) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @param {Fraction}
|
|
30
|
+
* True if zero.
|
|
31
|
+
*/
|
|
32
|
+
static isZero: ([n]: Fraction) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Simplify fraction finding LCDs.
|
|
35
|
+
* @param n
|
|
36
|
+
* @param d
|
|
37
|
+
*/
|
|
38
|
+
static simplify: ([n, d]: Fraction) => Fraction;
|
|
39
|
+
/**
|
|
40
|
+
* Return common factors.
|
|
41
|
+
* @param n
|
|
42
|
+
*/
|
|
43
|
+
static factors: (n: number) => number[];
|
|
44
|
+
/**
|
|
45
|
+
* @param n1
|
|
46
|
+
* @param n2
|
|
47
|
+
*/
|
|
48
|
+
static add: (n1: Fraction, n2: Fraction) => Fraction;
|
|
49
|
+
/**
|
|
50
|
+
* @param n1
|
|
51
|
+
* @param n2
|
|
52
|
+
*/
|
|
53
|
+
static subtract: (n1: Fraction, n2: Fraction) => Fraction;
|
|
54
|
+
/**
|
|
55
|
+
* @param n1
|
|
56
|
+
* @param n2
|
|
57
|
+
*/
|
|
58
|
+
static multiply: (n1: Fraction, n2: Fraction) => Fraction;
|
|
59
|
+
/**
|
|
60
|
+
* @param n1
|
|
61
|
+
* @param n2
|
|
62
|
+
*/
|
|
63
|
+
static divide: (n1: Fraction, n2: Fraction) => Fraction;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=fraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fraction.d.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