@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,26 @@
|
|
|
1
|
+
import { type JSX, type Ref } from 'react';
|
|
2
|
+
import { type BaseGraphEdge, type BaseGraphNode, type GraphModel } from '@dxos/graph';
|
|
3
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
+
import { type GraphLayoutNode, type GraphProjector, GraphRenderer, type GraphRendererOptions } from '../../graph';
|
|
5
|
+
export type GraphController = {
|
|
6
|
+
refresh: () => void;
|
|
7
|
+
repaint: () => void;
|
|
8
|
+
findNode: (id: string) => SVGGElement | null;
|
|
9
|
+
};
|
|
10
|
+
export type GraphProps<Node extends BaseGraphNode = any, Edge extends BaseGraphEdge = any> = ThemedClassName<Pick<GraphRendererOptions<Node>, 'labels' | 'subgraphs' | 'attributes'> & {
|
|
11
|
+
model?: GraphModel<Node, Edge>;
|
|
12
|
+
projector?: GraphProjector<Node>;
|
|
13
|
+
renderer?: GraphRenderer<Node>;
|
|
14
|
+
drag?: boolean;
|
|
15
|
+
arrows?: boolean;
|
|
16
|
+
onSelect?: (node: GraphLayoutNode<Node>, event: MouseEvent) => void;
|
|
17
|
+
onInspect?: (node: GraphLayoutNode<Node>, event: MouseEvent) => void;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const GraphInner: <Node extends BaseGraphNode = any, Edge extends BaseGraphEdge = any>({ classNames, model, projector: _projector, renderer: _renderer, drag, arrows, onSelect, onInspect, ...props }: GraphProps<Node, Edge>, forwardedRef: Ref<GraphController>) => JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* SVG Graph.
|
|
22
|
+
*/
|
|
23
|
+
export declare const Graph: <Node extends BaseGraphNode = any, Edge extends BaseGraphEdge = any>(props: GraphProps<Node, Edge> & {
|
|
24
|
+
ref?: Ref<GraphController>;
|
|
25
|
+
}) => JSX.Element;
|
|
26
|
+
//# sourceMappingURL=Graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Graph.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/Graph.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,KAAK,GAAG,EAAE,KAAK,GAAG,EAA+D,MAAM,OAAO,CAAC;AAG/G,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,aAAa,EACb,KAAK,oBAAoB,EAC1B,MAAM,aAAa,CAAC;AAGrB,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,IAAI,SAAS,aAAa,GAAG,GAAG,EAAE,IAAI,SAAS,aAAa,GAAG,GAAG,IAAI,eAAe,CAC1G,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,YAAY,CAAC,GAAG;IACxE,KAAK,CAAC,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACpE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACtE,CACF,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,IAAI,SAAS,aAAa,GAAG,GAAG,EAAE,IAAI,SAAS,aAAa,GAAG,GAAG,EAC3F,gHAUG,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,EACzB,cAAc,GAAG,CAAC,eAAe,CAAC,gBAqEnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,EAA6B,CAAC,IAAI,SAAS,aAAa,GAAG,GAAG,EAAE,IAAI,SAAS,aAAa,GAAG,GAAG,EAChH,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAA;CAAE,KAC3D,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import '@dxos-theme';
|
|
2
|
+
import { type StoryObj } from '@storybook/react';
|
|
3
|
+
import { type Graph } from '@dxos/graph';
|
|
4
|
+
import { type Meta } from '@dxos/storybook-utils';
|
|
5
|
+
import { type GraphProps } from './Graph';
|
|
6
|
+
import { type GraphForceProjectorOptions, type GraphHierarchicalProjectorOptions, type GraphRadialProjectorOptions, type GraphRelationalProjectorOptions } from '../../graph';
|
|
7
|
+
import { type SVGGridProps } from '../SVG';
|
|
8
|
+
import '../../../styles/graph.css';
|
|
9
|
+
type ProjectorType = 'force' | 'radial' | 'hierarchical' | 'relational';
|
|
10
|
+
type StoryProps = GraphProps & {
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
grid?: boolean | SVGGridProps;
|
|
13
|
+
inspect?: boolean;
|
|
14
|
+
singleSelect?: boolean;
|
|
15
|
+
graph: () => Graph;
|
|
16
|
+
projectorType?: ProjectorType;
|
|
17
|
+
projectorOptions?: GraphForceProjectorOptions | GraphHierarchicalProjectorOptions | GraphRadialProjectorOptions | GraphRelationalProjectorOptions;
|
|
18
|
+
};
|
|
19
|
+
declare const meta: Meta<StoryProps>;
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<StoryProps>;
|
|
22
|
+
export declare const Default: Story;
|
|
23
|
+
export declare const Projector: Story;
|
|
24
|
+
export declare const Force: Story;
|
|
25
|
+
export declare const Select: Story;
|
|
26
|
+
export declare const WithSubgraphs: Story;
|
|
27
|
+
export declare const WithPopover: Story;
|
|
28
|
+
export declare const Empty: Story;
|
|
29
|
+
//# sourceMappingURL=Graph.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Graph.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/Graph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIjD,OAAO,EAAmC,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAI1E,OAAO,EAAE,KAAK,IAAI,EAAyB,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAiD,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAEzF,OAAO,EAEL,KAAK,0BAA0B,EAE/B,KAAK,iCAAiC,EAEtC,KAAK,2BAA2B,EAEhC,KAAK,+BAA+B,EAIrC,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,2BAA2B,CAAC;AAEnC,KAAK,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,cAAc,GAAG,YAAY,CAAC;AAaxE,KAAK,UAAU,GAAG,UAAU,GAAG;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,KAAK,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,gBAAgB,CAAC,EACb,0BAA0B,GAC1B,iCAAiC,GACjC,2BAA2B,GAC3B,+BAA+B,CAAC;CACrC,CAAC;AAmQF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAI1B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAYvB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KA+BnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAmBpB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAe3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAezB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAUnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mesh.d.ts","sourceRoot":"","sources":["../../../../../src/components/Mesh/Mesh.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF,eAAO,MAAM,IAAI,GAAI,mBAA8B,SAAS,QA2C3D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import '@dxos-theme';
|
|
2
|
+
import { type StoryObj } from '@storybook/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { type Meta } from '@dxos/storybook-utils';
|
|
5
|
+
import { type SVGRootProps } from '../SVG';
|
|
6
|
+
declare const DefaultStory: (props: SVGRootProps) => React.JSX.Element;
|
|
7
|
+
declare const meta: Meta<typeof DefaultStory>;
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof DefaultStory>;
|
|
10
|
+
export declare const Default: Story;
|
|
11
|
+
export declare const Outline: Story;
|
|
12
|
+
//# sourceMappingURL=Mesh.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mesh.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Mesh/Mesh.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,KAAK,IAAI,EAAyB,MAAM,uBAAuB,CAAC;AAGzE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGhD,QAAA,MAAM,YAAY,GAAI,OAAO,YAAY,sBAoBxC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAInC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Mesh/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
import { type GridOptions } from '../../hooks';
|
|
4
|
+
export type GridProps = ThemedClassName<GridOptions>;
|
|
5
|
+
/**
|
|
6
|
+
* SVG grid wrapper.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Grid: ({ classNames, ...props }: GridProps) => React.JSX.Element;
|
|
9
|
+
//# sourceMappingURL=Grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../../../src/components/SVG/Grid.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,SAAS,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,0BAA0B,SAAS,sBAGvD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type MarkersProps = {
|
|
3
|
+
arrowSize?: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* SVG markers wrapper.
|
|
8
|
+
*/
|
|
9
|
+
export declare const Markers: ({ arrowSize, className }: MarkersProps) => React.JSX.Element;
|
|
10
|
+
//# sourceMappingURL=Markers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markers.d.ts","sourceRoot":"","sources":["../../../../../src/components/SVG/Markers.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,0BAA0B,YAAY,sBAO7D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
import { SVGContext, type SVGContextOptions } from '../../hooks';
|
|
4
|
+
export type RootProps = ThemedClassName<PropsWithChildren<SVGContextOptions>>;
|
|
5
|
+
/**
|
|
6
|
+
* Makes the SVG context available to child nodes.
|
|
7
|
+
* Automatically resizes the SVG element, which expands to fit the container.
|
|
8
|
+
*/
|
|
9
|
+
export declare const Root: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<SVGContextOptions>, "className"> & {
|
|
10
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
11
|
+
} & React.RefAttributes<SVGContext>>;
|
|
12
|
+
//# sourceMappingURL=Root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../../../../../src/components/SVG/Root.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAc,KAAK,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAG3G,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAsB,MAAM,aAAa,CAAC;AAErF,MAAM,MAAM,SAAS,GAAG,eAAe,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,IAAI;;oCAmCf,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
import { type GridProps as SVGGridProps } from './Grid';
|
|
4
|
+
import { type MarkersProps as SVGMarkersProps } from './Markers';
|
|
5
|
+
import { type RootProps as SVGRootProps } from './Root';
|
|
6
|
+
import { type ZoomProps as SVGZoomProps } from './Zoom';
|
|
7
|
+
import { type GraphProps as SVGGraphProps } from '../Graph';
|
|
8
|
+
import { type MeshProps as SVGMeshProps } from '../Mesh';
|
|
9
|
+
export type SVGProps = PropsWithChildren<ThemedClassName>;
|
|
10
|
+
export declare const SVG: {
|
|
11
|
+
Root: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<import("../..").SVGContextOptions>, "className"> & {
|
|
12
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
13
|
+
} & import("react").RefAttributes<import("../..").SVGContext>>;
|
|
14
|
+
Grid: ({ classNames, ...props }: SVGGridProps) => import("react").JSX.Element;
|
|
15
|
+
Markers: ({ arrowSize, className }: SVGMarkersProps) => import("react").JSX.Element;
|
|
16
|
+
Mesh: ({ radius, value }: SVGMeshProps) => any;
|
|
17
|
+
Zoom: import("react").MemoExoticComponent<({ extent, className, children }: SVGZoomProps) => import("react").JSX.Element>;
|
|
18
|
+
Graph: <Node extends import("@dxos/graph").BaseGraphNode = any, Edge extends import("@dxos/graph").BaseGraphEdge = any>(props: SVGGraphProps<Node, Edge> & {
|
|
19
|
+
ref?: import("react").Ref<import("..").GraphController>;
|
|
20
|
+
}) => import("react").JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export type { SVGRootProps, SVGGridProps, SVGMarkersProps, SVGZoomProps, SVGGraphProps, SVGMeshProps };
|
|
23
|
+
//# sourceMappingURL=SVG.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SVG.d.ts","sourceRoot":"","sources":["../../../../../src/components/SVG/SVG.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAQ,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAW,KAAK,YAAY,IAAI,eAAe,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAQ,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAQ,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAS,KAAK,UAAU,IAAI,aAAa,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAQ,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/D,MAAM,MAAM,QAAQ,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAAC;AAE1D,eAAO,MAAM,GAAG;;;;;;;;;WAUuzF,CAAC;;CAHv0F,CAAC;AAEF,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import '@dxos-theme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type Meta } from '@dxos/storybook-utils';
|
|
4
|
+
import '../../../styles/graph.css';
|
|
5
|
+
type ComponentProps = {
|
|
6
|
+
grid?: boolean;
|
|
7
|
+
zoom?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const Component: (options: ComponentProps) => React.JSX.Element;
|
|
10
|
+
declare const meta: Meta<typeof Component>;
|
|
11
|
+
export default meta;
|
|
12
|
+
export declare const Default: {
|
|
13
|
+
args: {
|
|
14
|
+
grid: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Svg.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Svg.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/SVG/Svg.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,KAAK,IAAI,EAAyB,MAAM,uBAAuB,CAAC;AAKzE,OAAO,2BAA2B,CAAC;AAEnC,KAAK,cAAc,GAAG;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAYF,QAAA,MAAM,SAAS,GAAI,SAAS,cAAc,sBAYzC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAIhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO;;;;CAInB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type ZoomExtent } from '../../hooks';
|
|
3
|
+
export type ZoomProps = {
|
|
4
|
+
extent?: ZoomExtent;
|
|
5
|
+
className?: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* SVG zoomable component wrapper.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Zoom: React.MemoExoticComponent<({ extent, className, children }: ZoomProps) => React.JSX.Element>;
|
|
12
|
+
//# sourceMappingURL=Zoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Zoom.d.ts","sourceRoot":"","sources":["../../../../../src/components/SVG/Zoom.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAiB,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,IAAI,8DAA0C,SAAS,uBASlE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/SVG/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import '@dxos-theme';
|
|
2
|
+
import { type Meta } from '@storybook/react';
|
|
3
|
+
import '../../styles/graph.css';
|
|
4
|
+
declare const meta: Meta;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const DefaultPulse: {
|
|
7
|
+
args: {
|
|
8
|
+
count: number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const RapidPulse: {
|
|
12
|
+
args: {
|
|
13
|
+
count: number;
|
|
14
|
+
duration: number;
|
|
15
|
+
period: number;
|
|
16
|
+
ratio: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=fx.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fx.stories.d.ts","sourceRoot":"","sources":["../../../../src/fx/fx.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAW7C,OAAO,wBAAwB,CAAC;AA6EhC,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;CAOtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/fx/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type D3Callable, type D3Selection } from '../util';
|
|
2
|
+
/**
|
|
3
|
+
* Pulsar effect.
|
|
4
|
+
*/
|
|
5
|
+
export declare namespace Pulsar {
|
|
6
|
+
const has: (group: D3Selection<SVGGElement>) => boolean;
|
|
7
|
+
const create: D3Callable<SVGGElement>;
|
|
8
|
+
const remove: D3Callable<SVGGElement>;
|
|
9
|
+
type Options = PulsarOptions;
|
|
10
|
+
}
|
|
11
|
+
type PulsarOptions = {
|
|
12
|
+
period?: number;
|
|
13
|
+
duration?: number;
|
|
14
|
+
ratio?: number;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=pulsar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pulsar.d.ts","sourceRoot":"","sources":["../../../../src/fx/pulsar.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAI5D;;GAEG;AACH,yBAAiB,MAAM,CAAC;IACf,MAAM,GAAG,GAAI,OAAO,WAAW,CAAC,WAAW,CAAC,YAA6C,CAAC;IAE1F,MAAM,MAAM,EAAE,UAAU,CAAC,WAAW,CAQ1C,CAAC;IAEK,MAAM,MAAM,EAAE,UAAU,CAAC,WAAW,CAE1C,CAAC;IAEF,KAAY,OAAO,GAAG,aAAa,CAAC;CACrC;AAED,KAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/graph/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type D3Callable } from '../util';
|
|
2
|
+
export type MarkerOptions = {
|
|
3
|
+
arrowSize?: number;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* https://developer.mozilla.org/en-US/docs/Web/SVG/Element/marker
|
|
7
|
+
* https://www.dashingd3js.com/svg-paths-and-d3js
|
|
8
|
+
* http://bl.ocks.org/dustinlarimer/5888271
|
|
9
|
+
*/
|
|
10
|
+
export declare const createMarkers: ({ arrowSize }?: MarkerOptions) => D3Callable;
|
|
11
|
+
//# sourceMappingURL=markers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../../../src/graph/markers.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAI1C,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAsCF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACvB,gBAAoB,aAAkB,KAAG,UA4BzC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type GraphProjector } from './graph-projector';
|
|
2
|
+
import { type SVGContext } from '../../hooks';
|
|
3
|
+
import { type Point } from '../../util';
|
|
4
|
+
import { type GraphLayoutNode } from '../types';
|
|
5
|
+
export interface DragOptions<N> {
|
|
6
|
+
dragMod?: string;
|
|
7
|
+
linkMod?: string;
|
|
8
|
+
freezeMod?: string;
|
|
9
|
+
onDrag?: (source?: GraphLayoutNode<N>, target?: GraphLayoutNode<N>, point?: Point) => void;
|
|
10
|
+
onDrop?: (source: GraphLayoutNode<N>, target?: GraphLayoutNode<N>) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Create drag handler.
|
|
14
|
+
*/
|
|
15
|
+
export declare const createGraphDrag: <NodeData>(context: SVGContext, projector: GraphProjector<NodeData>, options?: DragOptions<NodeData>) => import("d3").DragBehavior<SVGElement, GraphLayoutNode<NodeData>, GraphLayoutNode<NodeData> | import("d3").SubjectPosition>;
|
|
16
|
+
//# sourceMappingURL=graph-drag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-drag.d.ts","sourceRoot":"","sources":["../../../../../src/graph/projector/graph-drag.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAOhD,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IAC3F,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAC5E;AAOD;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,EACtC,SAAS,UAAU,EACnB,WAAW,cAAc,CAAC,QAAQ,CAAC,EACnC,UAAS,WAAW,CAAC,QAAQ,CAAsB,+HAwFpD,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type Graph } from '@dxos/graph';
|
|
2
|
+
import { GraphProjector, type GraphProjectorOptions } from './graph-projector';
|
|
3
|
+
import { type GraphLayoutEdge, type GraphLayoutNode } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* https://github.com/d3/d3-force#forceLink
|
|
6
|
+
*/
|
|
7
|
+
export type ForceLinkOptions = {
|
|
8
|
+
strength?: number | ((edge: GraphLayoutEdge<any>) => number);
|
|
9
|
+
distance?: number;
|
|
10
|
+
iterations?: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* https://github.com/d3/d3-force#forceManyBody
|
|
14
|
+
*/
|
|
15
|
+
export type ForceManyBodyOptions = {
|
|
16
|
+
strength?: number | ((node: GraphLayoutNode<any>) => number);
|
|
17
|
+
distanceMax?: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* https://github.com/d3/d3-force#centering
|
|
21
|
+
*/
|
|
22
|
+
export type ForceCenterOptions = {
|
|
23
|
+
x?: number;
|
|
24
|
+
y?: number;
|
|
25
|
+
strength?: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* https://github.com/d3/d3-force#forceCollide
|
|
29
|
+
*/
|
|
30
|
+
export type ForceCollideOptions = {
|
|
31
|
+
radius?: number;
|
|
32
|
+
strength?: number;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* https://github.com/d3/d3-force#forceRadial
|
|
36
|
+
*/
|
|
37
|
+
export type ForceRadialOptions = {
|
|
38
|
+
delay?: number;
|
|
39
|
+
x?: number;
|
|
40
|
+
y?: number;
|
|
41
|
+
radius?: number;
|
|
42
|
+
strength?: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* https://github.com/d3/d3-force#positioning
|
|
46
|
+
*/
|
|
47
|
+
export type ForcePositioningOptions = {
|
|
48
|
+
x?: number;
|
|
49
|
+
y?: number;
|
|
50
|
+
strength?: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* All force options.
|
|
54
|
+
* NOTE: A value of `true` enables the force with the default option.
|
|
55
|
+
*/
|
|
56
|
+
export type ForceOptions = {
|
|
57
|
+
link?: boolean | ForceLinkOptions;
|
|
58
|
+
manyBody?: boolean | ForceManyBodyOptions;
|
|
59
|
+
center?: boolean | ForceCenterOptions;
|
|
60
|
+
collide?: boolean | ForceCollideOptions;
|
|
61
|
+
radial?: boolean | ForceRadialOptions;
|
|
62
|
+
point?: boolean | ForcePositioningOptions;
|
|
63
|
+
x?: boolean | ForcePositioningOptions;
|
|
64
|
+
y?: boolean | ForcePositioningOptions;
|
|
65
|
+
};
|
|
66
|
+
export declare const defaultForceOptions: ForceOptions;
|
|
67
|
+
export type GraphForceProjectorOptions = GraphProjectorOptions & {
|
|
68
|
+
guides?: boolean;
|
|
69
|
+
forces?: ForceOptions;
|
|
70
|
+
radius?: number;
|
|
71
|
+
attributes?: {
|
|
72
|
+
radius?: number | ((node: GraphLayoutNode<any>, children: number) => number);
|
|
73
|
+
linkForce?: boolean | ((edge: GraphLayoutEdge<any>) => boolean);
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* D3 force directed graph layout using d3 simulation..
|
|
78
|
+
*/
|
|
79
|
+
export declare class GraphForceProjector<NodeData = any> extends GraphProjector<NodeData, GraphForceProjectorOptions> {
|
|
80
|
+
private _simulation;
|
|
81
|
+
private _timeout?;
|
|
82
|
+
get forces(): ForceOptions;
|
|
83
|
+
get simulation(): import("d3").Simulation<GraphLayoutNode, GraphLayoutEdge>;
|
|
84
|
+
restart(): void;
|
|
85
|
+
findNode(x: number, y: number, radius: number): GraphLayoutNode<NodeData> | undefined;
|
|
86
|
+
onStart(): Promise<void>;
|
|
87
|
+
onStop(): Promise<void>;
|
|
88
|
+
onRefresh(dragging?: boolean): void;
|
|
89
|
+
onUpdate(graph?: Graph): void;
|
|
90
|
+
private updateLayout;
|
|
91
|
+
/**
|
|
92
|
+
* Update all forces.
|
|
93
|
+
*/
|
|
94
|
+
private updateForces;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=graph-force-projector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-force-projector.d.ts","sourceRoot":"","sources":["../../../../../src/graph/projector/graph-force-projector.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Force, type SimulationLinkDatum, type SimulationNodeDatum } from 'd3';
|
|
2
|
+
export type ForcePointOptions = {
|
|
3
|
+
x?: number;
|
|
4
|
+
y?: number;
|
|
5
|
+
strength?: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const forcePoint: <NodeDatum extends SimulationNodeDatum, LinkDatum extends SimulationLinkDatum<NodeDatum> | undefined>({ x, y, strength, }: ForcePointOptions) => Force<NodeDatum, LinkDatum>;
|
|
8
|
+
//# sourceMappingURL=graph-forces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-forces.d.ts","sourceRoot":"","sources":["../../../../../src/graph/projector/graph-forces.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAkB,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,IAAI,CAAC;AAEpG,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,SAAS,SAAS,mBAAmB,EACrC,SAAS,SAAS,mBAAmB,CAAC,SAAS,CAAC,GAAG,SAAS,EAC5D,qBAIC,iBAAiB,KAAG,KAAK,CAAC,SAAS,EAAE,SAAS,CAehD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Graph } from '@dxos/graph';
|
|
2
|
+
import { type GraphProjectorOptions } from './graph-projector';
|
|
3
|
+
import { GraphRadialProjector } from './graph-radial-projector';
|
|
4
|
+
import { type GraphLayoutNode } from '../types';
|
|
5
|
+
export type GraphHierarchicalProjectorOptions = GraphProjectorOptions & {
|
|
6
|
+
radius?: number;
|
|
7
|
+
margin?: number;
|
|
8
|
+
duration?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare class GraphHierarchicalProjector<NodeData = any, Options extends GraphHierarchicalProjectorOptions = any> extends GraphRadialProjector<NodeData, Options> {
|
|
11
|
+
protected onUpdate(graph?: Graph): void;
|
|
12
|
+
protected doHierarchicalLayout(selected: GraphLayoutNode): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=graph-hierarchical-projector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-hierarchical-projector.d.ts","sourceRoot":"","sources":["../../../../../src/graph/projector/graph-hierarchical-projector.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAA4B,MAAM,0BAA0B,CAAC;AAC1F,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,iCAAiC,GAAG,qBAAqB,GAAG;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,qBAAa,0BAA0B,CACrC,QAAQ,GAAG,GAAG,EACd,OAAO,SAAS,iCAAiC,GAAG,GAAG,CACvD,SAAQ,oBAAoB,CAAC,QAAQ,EAAE,OAAO,CAAC;cAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK;IAmBzC,SAAS,CAAC,oBAAoB,CAAC,QAAQ,EAAE,eAAe;CAuCzD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type SelectionModel, type Graph } from '@dxos/graph';
|
|
2
|
+
import { Projector, type ProjectorOptions } from './projector';
|
|
3
|
+
import { type SVGContext } from '../../hooks';
|
|
4
|
+
import { type GraphLayout, type GraphLayoutNode } from '../types';
|
|
5
|
+
export type GraphProjectorOptions = ProjectorOptions & {};
|
|
6
|
+
/**
|
|
7
|
+
* Base class for graph projectors.
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class GraphProjector<NodeData = any, Options extends GraphProjectorOptions = any> extends Projector<Graph, GraphLayout<NodeData>, Options> {
|
|
10
|
+
private readonly _selection?;
|
|
11
|
+
private readonly _layout;
|
|
12
|
+
constructor(context: SVGContext, options?: Options, _selection?: SelectionModel, layout?: GraphLayout<NodeData>);
|
|
13
|
+
get layout(): GraphLayout<NodeData>;
|
|
14
|
+
get selection(): SelectionModel;
|
|
15
|
+
numChildren(node: GraphLayoutNode): number;
|
|
16
|
+
reset(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Merge external data with internal representation (e.g., so force properties like position are preserved).
|
|
19
|
+
* @param data
|
|
20
|
+
*/
|
|
21
|
+
protected mergeData(data?: Graph): void;
|
|
22
|
+
onClear(): Promise<void>;
|
|
23
|
+
abstract findNode(x: number, y: number, radius: number): GraphLayoutNode<NodeData> | undefined;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=graph-projector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-projector.d.ts","sourceRoot":"","sources":["../../../../../src/graph/projector/graph-projector.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAc,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9E,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,EAAE,CAAC;AAE1D;;GAEG;AACH,8BAAsB,cAAc,CAAC,QAAQ,GAAG,GAAG,EAAE,OAAO,SAAS,qBAAqB,GAAG,GAAG,CAAE,SAAQ,SAAS,CACjH,KAAK,EACL,WAAW,CAAC,QAAQ,CAAC,EACrB,OAAO,CACR;IAOG,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IAN9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;gBAI9C,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,OAAO,EACA,UAAU,CAAC,EAAE,cAAc,EAC5C,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC;IAYhC,IAAI,MAAM,0BAET;IAED,IAAI,SAAS,mBAEZ;IAED,WAAW,CAAC,IAAI,EAAE,eAAe;IAIjC,KAAK;IAML;;;OAGG;IACH,SAAS,CAAC,SAAS,CAAC,IAAI,GAAE,KAAkB;IAgC7B,OAAO;IAItB,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAAC,QAAQ,CAAC,GAAG,SAAS;CAC/F"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Graph } from '@dxos/graph';
|
|
2
|
+
import { GraphProjector, type GraphProjectorOptions } from './graph-projector';
|
|
3
|
+
import { type Point } from '../../util';
|
|
4
|
+
import { type GraphLayoutNode } from '../types';
|
|
5
|
+
export type GraphRadialProjectorOptions = GraphProjectorOptions & {
|
|
6
|
+
radius?: number;
|
|
7
|
+
margin?: number;
|
|
8
|
+
duration?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare class GraphRadialProjector<NodeData = any, Options extends GraphRadialProjectorOptions = any> extends GraphProjector<NodeData, Options> {
|
|
11
|
+
private _timer?;
|
|
12
|
+
findNode(x: number, y: number, radius: number): GraphLayoutNode<NodeData> | undefined;
|
|
13
|
+
protected onUpdate(graph?: Graph): void;
|
|
14
|
+
protected animate(): void;
|
|
15
|
+
protected onStop(): Promise<void>;
|
|
16
|
+
protected doRadialLayout(): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Update node target.
|
|
20
|
+
*/
|
|
21
|
+
export declare const updateNode: (node: GraphLayoutNode, [tx, ty]: Point, tr?: number) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Radial position generator.
|
|
24
|
+
*/
|
|
25
|
+
export declare const layoutRadial: (x: number, y: number, r: number, n: number, start?: number) => (i: number) => Point;
|
|
26
|
+
/**
|
|
27
|
+
* Horizontal position generator.
|
|
28
|
+
*/
|
|
29
|
+
export declare const layoutHorizontal: (x: number, y: number, w: number, n: number) => (i: number) => Point;
|
|
30
|
+
/**
|
|
31
|
+
* Vertical position generator.
|
|
32
|
+
*/
|
|
33
|
+
export declare const layoutVertical: (x: number, y: number, h: number, n: number) => (i: number) => Point;
|
|
34
|
+
//# sourceMappingURL=graph-radial-projector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-radial-projector.d.ts","sourceRoot":"","sources":["../../../../../src/graph/projector/graph-radial-projector.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,2BAA2B,GAAG,qBAAqB,GAAG;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,qBAAa,oBAAoB,CAC/B,QAAQ,GAAG,GAAG,EACd,OAAO,SAAS,2BAA2B,GAAG,GAAG,CACjD,SAAQ,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC;IACzC,OAAO,CAAC,MAAM,CAAC,CAAQ;IAEd,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAAC,QAAQ,CAAC,GAAG,SAAS;cAI3E,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK;IAMzC,SAAS,CAAC,OAAO;cAwBQ,MAAM;IAK/B,SAAS,CAAC,cAAc;CAoBzB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,eAAe,EAAE,UAAU,KAAK,EAAE,WAAM,SAmBxE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,cAAoB,MAEnF,GAAG,MAAM,KAAG,KAIrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,MAGjE,GAAG,MAAM,KAAG,KAGrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,MAG/D,GAAG,MAAM,KAAG,KAGrB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Graph } from '@dxos/graph';
|
|
2
|
+
import { type GraphProjectorOptions } from './graph-projector';
|
|
3
|
+
import { GraphRadialProjector } from './graph-radial-projector';
|
|
4
|
+
import { type GraphLayoutNode } from '../types';
|
|
5
|
+
export type GraphRelationalProjectorOptions = GraphProjectorOptions & {
|
|
6
|
+
radius?: number;
|
|
7
|
+
margin?: number;
|
|
8
|
+
duration?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare class GraphRelationalProjector<NodeData = any, Options extends GraphRelationalProjectorOptions = any> extends GraphRadialProjector<NodeData, Options> {
|
|
11
|
+
protected onUpdate(graph?: Graph): void;
|
|
12
|
+
protected doRelationalLayout(selected: GraphLayoutNode): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=graph-relational-projector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-relational-projector.d.ts","sourceRoot":"","sources":["../../../../../src/graph/projector/graph-relational-projector.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAA8C,MAAM,0BAA0B,CAAC;AAC5G,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,+BAA+B,GAAG,qBAAqB,GAAG;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,qBAAa,wBAAwB,CACnC,QAAQ,GAAG,GAAG,EACd,OAAO,SAAS,+BAA+B,GAAG,GAAG,CACrD,SAAQ,oBAAoB,CAAC,QAAQ,EAAE,OAAO,CAAC;cAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK;IAmBzC,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE,eAAe;CAqEvD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './graph-drag';
|
|
2
|
+
export * from './graph-projector';
|
|
3
|
+
export * from './graph-force-projector';
|
|
4
|
+
export * from './graph-hierarchical-projector';
|
|
5
|
+
export * from './graph-relational-projector';
|
|
6
|
+
export * from './graph-radial-projector';
|
|
7
|
+
export * from './projector';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/graph/projector/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC"}
|