@dxos/plugin-explorer 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc
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 +102 -5
- package/dist/lib/neutral/ExplorerArticle-EW2MBCRK.mjs +141 -0
- package/dist/lib/neutral/ExplorerArticle-EW2MBCRK.mjs.map +7 -0
- package/dist/lib/neutral/ExplorerPlugin.mjs +10 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/types/index.mjs → neutral/chunk-7SPMPHRS.mjs} +7 -7
- package/dist/lib/neutral/chunk-7SPMPHRS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GRJXLL4Z.mjs +25 -0
- package/dist/lib/neutral/chunk-GRJXLL4Z.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/components/index.mjs +661 -297
- package/dist/lib/{browser → neutral}/components/index.mjs.map +4 -4
- package/dist/lib/neutral/containers/index.mjs +9 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-object-F6TKVAGV.mjs +39 -0
- package/dist/lib/neutral/create-object-F6TKVAGV.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/hooks/index.mjs +11 -6
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +14 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/{browser/index.mjs → neutral/plugin.mjs} +3 -4
- package/dist/lib/{browser/index.mjs.map → neutral/plugin.mjs.map} +3 -3
- package/dist/lib/neutral/react-surface-APBW2VQG.mjs +26 -0
- package/dist/lib/neutral/react-surface-APBW2VQG.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +33 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts +4 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +5 -2
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/CanvasForceGraph.d.ts +13 -0
- package/dist/types/src/components/Graph/CanvasForceGraph.d.ts.map +1 -0
- package/dist/types/src/components/Graph/{D3ForceGraph.stories.d.ts → CanvasForceGraph.stories.d.ts} +2 -2
- package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts.map +1 -0
- package/dist/types/src/components/Graph/ForceGraph.d.ts +12 -5
- package/dist/types/src/components/Graph/ForceGraph.d.ts.map +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +3 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/{adapter.d.ts → graph-adapter.d.ts} +1 -1
- package/dist/types/src/components/Graph/graph-adapter.d.ts.map +1 -0
- package/dist/types/src/components/Graph/index.d.ts +1 -1
- package/dist/types/src/components/Graph/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/EdgeBundling.stories.d.ts +21 -0
- package/dist/types/src/components/Tree/EdgeBundling.stories.d.ts.map +1 -0
- package/dist/types/src/components/Tree/Tree.d.ts +20 -23
- package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +5 -12
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/index.d.ts +3 -0
- package/dist/types/src/components/Tree/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts +35 -2
- package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/RadialTree.d.ts +35 -2
- package/dist/types/src/components/Tree/layout/RadialTree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/TidyTree.d.ts +24 -2
- package/dist/types/src/components/Tree/layout/TidyTree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/hierarchy.d.ts +17 -0
- package/dist/types/src/components/Tree/layout/hierarchy.d.ts.map +1 -0
- package/dist/types/src/components/Tree/layout/index.d.ts +5 -4
- package/dist/types/src/components/Tree/layout/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/slots.d.ts +7 -0
- package/dist/types/src/components/Tree/layout/slots.d.ts.map +1 -0
- package/dist/types/src/components/Tree/layout/useContainerSize.d.ts +15 -0
- package/dist/types/src/components/Tree/layout/useContainerSize.d.ts.map +1 -0
- package/dist/types/src/components/Tree/space-graph-adapter.d.ts +32 -0
- package/dist/types/src/components/Tree/space-graph-adapter.d.ts.map +1 -0
- package/dist/types/src/components/Tree/testing/index.d.ts +1 -0
- package/dist/types/src/components/Tree/testing/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/testing/relations.d.ts +47 -0
- package/dist/types/src/components/Tree/testing/relations.d.ts.map +1 -0
- package/dist/types/src/components/Tree/types/types.d.ts +14 -4
- package/dist/types/src/components/Tree/types/types.d.ts.map +1 -1
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts +8 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts +24 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ExplorerArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useGraphModel.d.ts +2 -2
- package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/types/Graph.d.ts +1 -2
- package/dist/types/src/types/Graph.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +94 -67
- package/src/ExplorerPlugin.test.ts +2 -2
- package/src/ExplorerPlugin.tsx +3 -33
- package/src/capabilities/create-object.ts +36 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/react-surface.tsx +2 -2
- package/src/components/Chart/Chart.stories.tsx +14 -20
- package/src/components/Globe/Globe.stories.tsx +17 -19
- package/src/components/Graph/CanvasForceGraph.stories.tsx +83 -0
- package/src/components/Graph/CanvasForceGraph.tsx +124 -0
- package/src/components/Graph/ForceGraph.stories.tsx +69 -37
- package/src/components/Graph/ForceGraph.tsx +104 -85
- package/src/components/Graph/index.ts +1 -1
- package/src/components/Tree/EdgeBundling.stories.tsx +144 -0
- package/src/components/Tree/Tree.stories.tsx +17 -38
- package/src/components/Tree/Tree.tsx +69 -100
- package/src/components/Tree/index.ts +3 -0
- package/src/components/Tree/layout/HierarchicalEdgeBundling.tsx +277 -0
- package/src/components/Tree/layout/RadialTree.tsx +237 -0
- package/src/components/Tree/layout/TidyTree.tsx +246 -0
- package/src/components/Tree/layout/hierarchy.ts +32 -0
- package/src/components/Tree/layout/index.ts +5 -5
- package/src/components/Tree/layout/slots.ts +19 -0
- package/src/components/Tree/layout/useContainerSize.ts +43 -0
- package/src/components/Tree/space-graph-adapter.ts +96 -0
- package/src/components/Tree/testing/index.ts +1 -0
- package/src/components/Tree/testing/relations.ts +182 -0
- package/src/components/Tree/types/types.ts +38 -29
- package/src/containers/ExplorerArticle/ExplorerArticle.stories.tsx +119 -0
- package/src/containers/ExplorerArticle/ExplorerArticle.tsx +153 -0
- package/src/containers/ExplorerArticle/index.ts +5 -0
- package/src/containers/index.ts +1 -1
- package/src/hooks/useGraphModel.ts +10 -6
- package/src/index.ts +1 -6
- package/src/plugin.ts +9 -0
- package/src/testing.ts +7 -0
- package/src/types/ExplorerAction.ts +1 -1
- package/src/types/Graph.ts +1 -2
- package/dist/lib/browser/hooks/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/types/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6EUBRHHX.mjs +0 -26
- package/dist/lib/node-esm/chunk-6EUBRHHX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/components/index.mjs +0 -11255
- package/dist/lib/node-esm/components/index.mjs.map +0 -7
- package/dist/lib/node-esm/hooks/index.mjs +0 -41
- package/dist/lib/node-esm/hooks/index.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -14
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/meta.mjs +0 -9
- package/dist/lib/node-esm/types/index.mjs +0 -73
- package/dist/lib/node-esm/types/index.mjs.map +0 -7
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts +0 -15
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +0 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +0 -1
- package/dist/types/src/components/Graph/adapter.d.ts.map +0 -1
- package/dist/types/src/components/Graph/testing.d.ts +0 -14
- package/dist/types/src/components/Graph/testing.d.ts.map +0 -1
- package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts +0 -6
- package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ExplorerContainer/index.d.ts +0 -2
- package/dist/types/src/containers/ExplorerContainer/index.d.ts.map +0 -1
- package/src/components/Graph/D3ForceGraph.stories.tsx +0 -83
- package/src/components/Graph/D3ForceGraph.tsx +0 -108
- package/src/components/Graph/testing.ts +0 -58
- package/src/components/Tree/layout/HierarchicalEdgeBundling.ts +0 -162
- package/src/components/Tree/layout/RadialTree.ts +0 -94
- package/src/components/Tree/layout/TidyTree.ts +0 -101
- package/src/containers/ExplorerContainer/ExplorerContainer.tsx +0 -53
- package/src/containers/ExplorerContainer/index.ts +0 -5
- /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ExplorerPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser → neutral}/chunk-HPIS2WXY.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-HPIS2WXY.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser/meta.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/index.mjs.map} +0 -0
- /package/dist/lib/{browser → neutral}/meta.mjs +0 -0
- /package/dist/lib/{node-esm → neutral}/meta.mjs.map +0 -0
- /package/src/components/Graph/{adapter.ts → graph-adapter.ts} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type TreeComponentProps } from './Tree';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: any;
|
|
7
|
+
render: ({ variant, tension }: {
|
|
8
|
+
variant?: TreeComponentProps['variant'];
|
|
9
|
+
tension?: number;
|
|
10
|
+
}) => React.JSX.Element;
|
|
11
|
+
decorators: import("@storybook/react").Decorator[];
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
export declare const Default: Story;
|
|
19
|
+
export declare const Tidy: Story;
|
|
20
|
+
export declare const Radial: Story;
|
|
21
|
+
//# sourceMappingURL=EdgeBundling.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EdgeBundling.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/EdgeBundling.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAuC,MAAM,OAAO,CAAC;AAa5D,OAAO,EAAQ,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAuEvD,QAAA,MAAM,IAAI;;eAEW,GAAG;mCAlE6B;QAAE,OAAO,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;;;QA6F9G,MAAM;;CAE2B,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAIlB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAIpB,CAAC"}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
import { type BundleEdge, type TreeLayoutSlots } from './layout';
|
|
4
|
+
import { type TreeNode } from './types';
|
|
3
5
|
export type LayoutVariant = 'tidy' | 'radial' | 'edge';
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
export type TreeOptions = {
|
|
10
|
-
label: (d: any) => string;
|
|
11
|
-
slots?: TreeLayoutSlots;
|
|
12
|
-
radius?: number;
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
margin?: number;
|
|
16
|
-
padding?: number;
|
|
17
|
-
r?: number;
|
|
18
|
-
};
|
|
19
|
-
export declare const defaultTreeLayoutSlots: TreeLayoutSlots;
|
|
20
|
-
export type TreeComponentProps<N = unknown> = {
|
|
21
|
-
space: Space;
|
|
22
|
-
selected?: string;
|
|
6
|
+
export type TreeComponentProps = ThemedClassName<{
|
|
7
|
+
data: TreeNode;
|
|
8
|
+
/** Optional edges for the `edge` variant (hierarchical edge bundling). */
|
|
9
|
+
edges?: BundleEdge[];
|
|
23
10
|
variant?: LayoutVariant;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
label?: (node: TreeNode) => string;
|
|
12
|
+
slots?: TreeLayoutSlots;
|
|
13
|
+
initialCollapsed?: Iterable<string>;
|
|
14
|
+
onNodeClick?: (node: TreeNode) => void;
|
|
15
|
+
onNodeHover?: (node: TreeNode | null, event?: MouseEvent) => void;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Tree visualization wrapping the three layout variants.
|
|
19
|
+
* - `tidy` — horizontal tidy tree (collapsible)
|
|
20
|
+
* - `radial` — radial tree (collapsible)
|
|
21
|
+
* - `edge` — hierarchical edge bundling (`edges` connect leaves)
|
|
22
|
+
*/
|
|
23
|
+
export declare const Tree: ({ classNames, data, edges, variant, label, slots, initialCollapsed, onNodeClick, onNodeHover, }: TreeComponentProps) => React.JSX.Element;
|
|
27
24
|
//# sourceMappingURL=Tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/Tree.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/Tree.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,KAAK,UAAU,EAAkD,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AACjH,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC;IAC/C,IAAI,EAAE,QAAQ,CAAC;IACf,0EAA0E;IAC1E,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;IACnC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CACnE,CAAC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,IAAI,oGAUd,kBAAkB,sBAuCpB,CAAC"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
component: any;
|
|
6
|
-
render: () => React.JSX.Element;
|
|
7
|
-
decorators: import("@storybook/react").Decorator[];
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { type TreeComponentProps } from './Tree';
|
|
3
|
+
type StoryArgs = Pick<TreeComponentProps, 'variant'>;
|
|
4
|
+
declare const meta: Meta<StoryArgs>;
|
|
12
5
|
export default meta;
|
|
13
|
-
type Story = StoryObj<
|
|
6
|
+
type Story = StoryObj<StoryArgs>;
|
|
14
7
|
export declare const Tidy: Story;
|
|
15
8
|
export declare const Radial: Story;
|
|
16
9
|
export declare const Edge: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/Tree.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"Tree.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/Tree.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAOjE,OAAO,EAAQ,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAKvD,KAAK,SAAS,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;AAWrD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,CAOzB,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEjC,eAAO,MAAM,IAAI,EAAE,KAIlB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAIpB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAIlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,KAAK,QAAQ,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,5 +1,38 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
2
3
|
import { type TreeNode } from '../types';
|
|
3
|
-
|
|
4
|
+
import { type TreeLayoutSlots } from './slots';
|
|
5
|
+
/** A directed edge between two leaves of the hierarchy, identified by node id. */
|
|
6
|
+
export type BundleEdge = {
|
|
7
|
+
source: string;
|
|
8
|
+
target: string;
|
|
9
|
+
kind?: string;
|
|
10
|
+
};
|
|
11
|
+
export type HierarchicalEdgeBundlingProps = ThemedClassName<{
|
|
12
|
+
/** Hierarchical data; leaves are the connectable entities. */
|
|
13
|
+
data: TreeNode;
|
|
14
|
+
/** Edges between leaves (by id). Bundled through the hierarchy. */
|
|
15
|
+
edges?: BundleEdge[];
|
|
16
|
+
/** Label accessor for leaf nodes. */
|
|
17
|
+
label?: (d: TreeNode) => string;
|
|
18
|
+
/** Padding (in screen pixels) reserved around the radial layout. */
|
|
19
|
+
padding?: number;
|
|
20
|
+
/** Bundling tension; 0 = straight, 1 = maximally bundled. */
|
|
21
|
+
tension?: number;
|
|
22
|
+
slots?: TreeLayoutSlots;
|
|
23
|
+
/**
|
|
24
|
+
* Called when the user hovers a leaf node (with the event so callers can dispatch
|
|
25
|
+
* `DxAnchorActivate` for previews). Receives `null` on leave.
|
|
26
|
+
*/
|
|
27
|
+
onNodeHover?: (node: TreeNode | null, event?: MouseEvent) => void;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Hierarchical edge bundling.
|
|
31
|
+
* https://observablehq.com/@d3/hierarchical-edge-bundling?intent=fork
|
|
32
|
+
*
|
|
33
|
+
* Leaves are placed on a circle, grouped by their parent in the hierarchy.
|
|
34
|
+
* Edges between leaves are drawn as bundled curves that route through their lowest common ancestor.
|
|
35
|
+
*/
|
|
36
|
+
export declare const HierarchicalEdgeBundling: ({ classNames, data, edges, label, padding, tension, slots, onNodeHover, }: HierarchicalEdgeBundlingProps) => React.JSX.Element;
|
|
4
37
|
export default HierarchicalEdgeBundling;
|
|
5
38
|
//# sourceMappingURL=HierarchicalEdgeBundling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchicalEdgeBundling.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/layout/HierarchicalEdgeBundling.
|
|
1
|
+
{"version":3,"file":"HierarchicalEdgeBundling.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/layout/HierarchicalEdgeBundling.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,SAAS,CAAC;AAKvE,kFAAkF;AAClF,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,eAAe,CAAC;IAC1D,8DAA8D;IAC9D,IAAI,EAAE,QAAQ,CAAC;IACf,mEAAmE;IACnE,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,qCAAqC;IACrC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,KAAK,MAAM,CAAC;IAChC,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CACnE,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,8EASlC,6BAA6B,sBAsC/B,CAAC;eAkLa,wBAAwB"}
|
|
@@ -1,4 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
import { type TreeNode } from '../types';
|
|
4
|
+
import { type TreeLayoutSlots } from './slots';
|
|
5
|
+
export type RadialTreeProps = ThemedClassName<{
|
|
6
|
+
data: TreeNode;
|
|
7
|
+
label?: (d: TreeNode) => string;
|
|
8
|
+
slots?: TreeLayoutSlots;
|
|
9
|
+
/** Node radius. */
|
|
10
|
+
r?: number;
|
|
11
|
+
/** Optional padding (in screen pixels) reserved around the radial layout. */
|
|
12
|
+
padding?: number;
|
|
13
|
+
/** Initial set of collapsed node ids. */
|
|
14
|
+
initialCollapsed?: Iterable<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Use `d3.cluster` (all leaves equidistant from center) instead of `d3.tree`.
|
|
17
|
+
* Matches https://observablehq.com/@d3/radial-cluster.
|
|
18
|
+
*/
|
|
19
|
+
cluster?: boolean;
|
|
20
|
+
/** Notified when the user clicks a node. */
|
|
21
|
+
onNodeClick?: (node: TreeNode) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Notified on pointerenter (and `null` on pointerleave) for nodes. Used to wire previews
|
|
24
|
+
* (dispatch `DxAnchorActivate`). The event target on enter is the hovered circle — dispatch
|
|
25
|
+
* from it so the preview anchors there.
|
|
26
|
+
*/
|
|
27
|
+
onNodeHover?: (node: TreeNode | null, event?: MouseEvent) => void;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Radial tree layout based on the D3 reference component.
|
|
31
|
+
* https://observablehq.com/@d3/radial-tree-component
|
|
32
|
+
*
|
|
33
|
+
* Click a node with children to toggle collapse / expand.
|
|
34
|
+
*/
|
|
35
|
+
export declare const RadialTree: ({ classNames, data, label, slots, r, padding, initialCollapsed, cluster, onNodeClick, onNodeHover, }: RadialTreeProps) => React.JSX.Element;
|
|
3
36
|
export default RadialTree;
|
|
4
37
|
//# sourceMappingURL=RadialTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadialTree.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/layout/RadialTree.
|
|
1
|
+
{"version":3,"file":"RadialTree.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/layout/RadialTree.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,SAAS,CAAC;AAKvE,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC;IAC5C,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,KAAK,MAAM,CAAC;IAChC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,mBAAmB;IACnB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CACnE,CAAC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,UAAU,yGAWpB,eAAe,sBA6DjB,CAAC;eAmHa,UAAU"}
|
|
@@ -1,4 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
import { type TreeNode } from '../types';
|
|
4
|
+
import { type TreeLayoutSlots } from './slots';
|
|
5
|
+
export type TidyTreeProps = ThemedClassName<{
|
|
6
|
+
data: TreeNode;
|
|
7
|
+
label?: (d: TreeNode) => string;
|
|
8
|
+
slots?: TreeLayoutSlots;
|
|
9
|
+
/** Node radius. */
|
|
10
|
+
r?: number;
|
|
11
|
+
/** Margin in screen pixels reserved around the layout. */
|
|
12
|
+
margin?: number;
|
|
13
|
+
/** Initial set of collapsed node ids. */
|
|
14
|
+
initialCollapsed?: Iterable<string>;
|
|
15
|
+
/** Notified when the user clicks a node. */
|
|
16
|
+
onNodeClick?: (node: TreeNode) => void;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Tidy (horizontal) tree layout based on the D3 reference component.
|
|
20
|
+
* https://observablehq.com/@d3/tree-component
|
|
21
|
+
*
|
|
22
|
+
* Click a node with children to toggle collapse / expand.
|
|
23
|
+
*/
|
|
24
|
+
export declare const TidyTree: ({ classNames, data, label, slots, r, margin, initialCollapsed, onNodeClick, }: TidyTreeProps) => React.JSX.Element;
|
|
3
25
|
export default TidyTree;
|
|
4
26
|
//# sourceMappingURL=TidyTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TidyTree.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/layout/TidyTree.
|
|
1
|
+
{"version":3,"file":"TidyTree.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/layout/TidyTree.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,SAAS,CAAC;AAKvE,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC;IAC1C,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,KAAK,MAAM,CAAC;IAChC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,mBAAmB;IACnB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpC,4CAA4C;IAC5C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CACxC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,kFASlB,aAAa,sBA0Df,CAAC;eA4Ia,QAAQ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type HierarchyNode } from 'd3';
|
|
2
|
+
import { type TreeNode } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Build a d3 hierarchy from a TreeNode, pruning children of nodes whose ids are in `collapsed`.
|
|
5
|
+
* Nodes that have children but are collapsed retain their identity in the hierarchy and can be
|
|
6
|
+
* distinguished by `node._children` (the original list).
|
|
7
|
+
*/
|
|
8
|
+
export declare const buildHierarchy: (data: TreeNode, collapsed?: Set<string>) => HierarchyNode<TreeNode>;
|
|
9
|
+
/**
|
|
10
|
+
* True when the node has children that have been hidden via collapse.
|
|
11
|
+
*/
|
|
12
|
+
export declare const isCollapsed: (data: TreeNode, collapsed: Set<string>) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* True when the node has no children at all (a real leaf, not a collapsed branch).
|
|
15
|
+
*/
|
|
16
|
+
export declare const isLeaf: (data: TreeNode) => boolean;
|
|
17
|
+
//# sourceMappingURL=hierarchy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hierarchy.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/layout/hierarchy.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAA4B,MAAM,IAAI,CAAC;AAElE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,cAAc,SAAU,QAAQ,cAAa,GAAG,CAAC,MAAM,CAAC,KAAe,aAAa,CAAC,QAAQ,CAOzG,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,SAAU,QAAQ,aAAa,GAAG,CAAC,MAAM,CAAC,KAAG,OACX,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,MAAM,SAAU,QAAQ,KAAG,OAAiC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
export * from './HierarchicalEdgeBundling';
|
|
2
|
+
export * from './RadialTree';
|
|
3
|
+
export * from './TidyTree';
|
|
4
|
+
export * from './hierarchy';
|
|
5
|
+
export * from './slots';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/layout/index.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/layout/index.ts"],"names":[],"mappings":"AAIA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/layout/slots.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAQpC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Track an element's content-box size via ResizeObserver.
|
|
3
|
+
* Returns the most recently observed `{ width, height }` plus a callback ref to attach to the element.
|
|
4
|
+
*
|
|
5
|
+
* Why not `react-resize-detector` directly: its `targetRef` API doesn't pick up a ref whose
|
|
6
|
+
* `.current` is set later than the hook runs, and the returned-`ref` API forces the consumer to
|
|
7
|
+
* forward a callback ref through their own component — which is awkward for class refs.
|
|
8
|
+
* This hook returns a setter so the consumer assigns it directly to `<div ref={setRef}>`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useContainerSize: () => {
|
|
11
|
+
setRef: (el: HTMLDivElement | null) => void;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=useContainerSize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContainerSize.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/layout/useContainerSize.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,QAAO;IAClC,MAAM,EAAE,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAwBhB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Obj } from '@dxos/echo';
|
|
2
|
+
import { type SpaceGraphModel } from '@dxos/schema';
|
|
3
|
+
import { type BundleEdge } from './layout';
|
|
4
|
+
import { type TreeNode } from './types';
|
|
5
|
+
export type SpaceGraphHierarchy = {
|
|
6
|
+
/** Hierarchy where leaves carry the underlying ECHO object on `node.data`. */
|
|
7
|
+
tree: TreeNode<Obj.Unknown>;
|
|
8
|
+
/** Edges between leaf objects derived from relations and refs in the graph. */
|
|
9
|
+
edges: BundleEdge[];
|
|
10
|
+
};
|
|
11
|
+
export type SpaceGraphHierarchyOptions = {
|
|
12
|
+
rootLabel?: string;
|
|
13
|
+
rootId?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Convert a {@link SpaceGraphModel} graph into a hierarchy suitable for the cluster / bundling layouts:
|
|
17
|
+
*
|
|
18
|
+
* Root (db)
|
|
19
|
+
* ├── Schema A
|
|
20
|
+
* │ ├── Object a1
|
|
21
|
+
* │ └── Object a2
|
|
22
|
+
* └── Schema B
|
|
23
|
+
* └── Object b1
|
|
24
|
+
*
|
|
25
|
+
* Leaves are ECHO objects. Their schema typename is the intermediate group.
|
|
26
|
+
* `rootLabel` is shown on the root node (typically the database name or "Space").
|
|
27
|
+
*
|
|
28
|
+
* `edges` exposes object-to-object edges (relations + refs) so the bundling
|
|
29
|
+
* layout can route bundled curves between leaves through their common ancestor.
|
|
30
|
+
*/
|
|
31
|
+
export declare const spaceGraphToHierarchy: (model: SpaceGraphModel, { rootLabel, rootId }?: SpaceGraphHierarchyOptions) => SpaceGraphHierarchy;
|
|
32
|
+
//# sourceMappingURL=space-graph-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space-graph-adapter.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/space-graph-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAuB,KAAK,eAAe,EAAuB,MAAM,cAAc,CAAC;AAE9F,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AASxC,MAAM,MAAM,mBAAmB,GAAG;IAChC,8EAA8E;IAC9E,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5B,+EAA+E;IAC/E,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,UACzB,eAAe,0BACwB,0BAA0B,KACvE,mBAyCF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type Space } from '@dxos/client/echo';
|
|
2
|
+
import { Obj } from '@dxos/echo';
|
|
3
|
+
import { type TypeSpec, type ValueGenerator } from '@dxos/schema/testing';
|
|
4
|
+
import { type BundleEdge } from '../layout';
|
|
5
|
+
import { type TreeNode } from '../types';
|
|
6
|
+
export type ConnectedOrgsResult = {
|
|
7
|
+
organizations: Obj.Any[];
|
|
8
|
+
people: Obj.Any[];
|
|
9
|
+
connections: Obj.Any[];
|
|
10
|
+
};
|
|
11
|
+
export type ConnectedOrgsOptions = {
|
|
12
|
+
organizationCount?: number;
|
|
13
|
+
personCount?: number;
|
|
14
|
+
connectionCount?: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Populate a space with Organizations, People, and HasConnection relations between organizations.
|
|
18
|
+
* Uses `createObjectFactory` to generate Org/Person properties from their `GeneratorAnnotation`s,
|
|
19
|
+
* then layers manual HasConnection relations on top — the connection schema is fixed
|
|
20
|
+
* (Org→Org) so it isn't a fit for the generator's reference inference.
|
|
21
|
+
*/
|
|
22
|
+
export declare const generateConnectedOrgs: (space: Space, generator: ValueGenerator, { organizationCount, personCount, connectionCount }?: ConnectedOrgsOptions) => Promise<ConnectedOrgsResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Build a TreeNode hierarchy: Root → Sector → Organization (leaf).
|
|
25
|
+
* Organizations are deterministically bucketed into `SECTORS` so the demo has visible groups.
|
|
26
|
+
*/
|
|
27
|
+
export declare const buildOrgHierarchy: (organizations: Obj.Any[], sectors?: readonly string[]) => TreeNode;
|
|
28
|
+
export type GenerateOptions = {
|
|
29
|
+
spec?: TypeSpec[];
|
|
30
|
+
relations?: {
|
|
31
|
+
count: number;
|
|
32
|
+
kind: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Populate a space with a mixed dataset (Orgs, Pipelines, People) plus
|
|
37
|
+
* `HasRelationship` edges between random pairs of People.
|
|
38
|
+
*
|
|
39
|
+
* Used by the force-directed and canvas-force graph stories that want a
|
|
40
|
+
* heterogeneous typed dataset without caring about the precise shape of relations.
|
|
41
|
+
*/
|
|
42
|
+
export declare const generate: (space: Space, generator: ValueGenerator, { spec, relations }?: GenerateOptions) => Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Convert HasConnection relations into bundle edges between organization ids.
|
|
45
|
+
*/
|
|
46
|
+
export declare const connectionsToEdges: (connections: Obj.Any[]) => BundleEdge[];
|
|
47
|
+
//# sourceMappingURL=relations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/testing/relations.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAmB,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAuB,MAAM,sBAAsB,CAAC;AAI/F,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAOzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;IACzB,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;IAClB,WAAW,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,UACzB,KAAK,aACD,cAAc,wDAC2C,oBAAoB,KACvF,OAAO,CAAC,mBAAmB,CAqC7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,kBAAmB,GAAG,CAAC,GAAG,EAAE,YAAW,SAAS,MAAM,EAAE,KAAa,QAyBlG,CAAC;AAQF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC;AAOF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UACZ,KAAK,aACD,cAAc,wBAC8C,eAAe,kBAsBvF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,gBAAiB,GAAG,CAAC,GAAG,EAAE,KAAG,UAAU,EAerE,CAAC"}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
1
|
+
import { type Key } from '@dxos/echo';
|
|
2
|
+
import { type TreeType } from './tree';
|
|
3
|
+
/**
|
|
4
|
+
* In-memory tree shape used by the d3 layouts.
|
|
5
|
+
* `data` carries through to layout callbacks (e.g. hover/inspect) — typically an ECHO object on leaves.
|
|
6
|
+
*/
|
|
7
|
+
export type TreeNode<TData = unknown> = {
|
|
3
8
|
id: string;
|
|
4
9
|
label?: string;
|
|
5
|
-
|
|
10
|
+
data?: TData;
|
|
11
|
+
children?: TreeNode<TData>[];
|
|
6
12
|
};
|
|
7
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Convert an ECHO `TreeType` (id-keyed node map) into a nested `TreeNode` hierarchy.
|
|
15
|
+
* Returns `undefined` if the root id is missing — the tree is then incomplete and shouldn't render.
|
|
16
|
+
*/
|
|
17
|
+
export declare const treeTypeToTreeNode: (tree: TreeType, rootId?: Key.ObjectId, visited?: Set<string>) => TreeNode | undefined;
|
|
8
18
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,KAAK,GAAG,OAAO,IAAI;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;CAC9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,SACvB,QAAQ,WACN,GAAG,CAAC,QAAQ,YACX,GAAG,CAAC,MAAM,CAAC,KACnB,QAAQ,GAAG,SAkBb,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
3
|
+
import { type View } from '@dxos/echo';
|
|
4
|
+
/** Visualization variants exposed by `ExplorerArticle`. */
|
|
5
|
+
export type ExplorerArticleVariant = 'force' | 'cluster' | 'bundle';
|
|
6
|
+
export type ExplorerArticleProps = AppSurface.ObjectArticleProps<View.View>;
|
|
7
|
+
export declare const ExplorerArticle: ({ role, subject, variant }: ExplorerArticleProps) => React.JSX.Element | null;
|
|
8
|
+
//# sourceMappingURL=ExplorerArticle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExplorerArticle.d.ts","sourceRoot":"","sources":["../../../../../src/containers/ExplorerArticle/ExplorerArticle.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAoB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAUzD,2DAA2D;AAC3D,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAoBpE,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE5E,eAAO,MAAM,eAAe,+BAAgC,oBAAoB,6BA0E/E,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { type ExplorerArticleVariant } from './ExplorerArticle';
|
|
3
|
+
type StoryArgs = {
|
|
4
|
+
variant: ExplorerArticleVariant;
|
|
5
|
+
};
|
|
6
|
+
declare const meta: Meta<StoryArgs>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<StoryArgs>;
|
|
9
|
+
/**
|
|
10
|
+
* Default force-directed view (the production layout).
|
|
11
|
+
*/
|
|
12
|
+
export declare const Force: Story;
|
|
13
|
+
/**
|
|
14
|
+
* Radial cluster: every object on the perimeter, grouped by its schema, all under
|
|
15
|
+
* a single database root. Inspired by https://observablehq.com/@d3/radial-cluster.
|
|
16
|
+
*/
|
|
17
|
+
export declare const Cluster: Story;
|
|
18
|
+
/**
|
|
19
|
+
* Hierarchical edge bundling: same hierarchy as `cluster`, with bundled curves
|
|
20
|
+
* routed through the lowest common ancestor for every relation / ref in the space.
|
|
21
|
+
* Inspired by https://observablehq.com/@d3/hierarchical-edge-bundling.
|
|
22
|
+
*/
|
|
23
|
+
export declare const Bundle: Story;
|
|
24
|
+
//# sourceMappingURL=ExplorerArticle.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExplorerArticle.stories.d.ts","sourceRoot":"","sources":["../../../../../src/containers/ExplorerArticle/ExplorerArticle.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAkBjE,OAAO,EAAmB,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAMjF,KAAK,SAAS,GAAG;IAAE,OAAO,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAYrD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,CA4CzB,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,KAInB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,KAIpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/ExplorerArticle/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/containers/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAQ,MAAM,OAAO,CAAC;AAEjD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/containers/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAQ,MAAM,OAAO,CAAC;AAEjD,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,GAAG,CAA2C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Database, type Entity, type Filter } from '@dxos/echo';
|
|
2
2
|
import { SpaceGraphModel, type SpaceGraphModelOptions } from '@dxos/schema';
|
|
3
|
-
export declare const useGraphModel: (
|
|
3
|
+
export declare const useGraphModel: (db: Database.Database | undefined, filter?: Filter.Any | undefined, options?: SpaceGraphModelOptions, items?: readonly Entity.Unknown[]) => SpaceGraphModel | undefined;
|
|
4
4
|
//# sourceMappingURL=useGraphModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGraphModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useGraphModel.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"useGraphModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useGraphModel.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAG5E,eAAO,MAAM,aAAa,OACpB,QAAQ,CAAC,QAAQ,GAAG,SAAS,WACxB,MAAM,CAAC,GAAG,GAAG,SAAS,YACrB,sBAAsB,UACxB,SAAS,MAAM,CAAC,OAAO,EAAE,KAChC,eAAe,GAAG,SA6BpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,eAAO,MAAM,cAAc,4BAA6C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing.ts"],"names":[],"mappings":"AAMA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as Schema from 'effect/Schema';
|
|
2
|
-
import { Obj, QueryAST, Type } from '@dxos/echo';
|
|
3
|
-
import { View } from '@dxos/echo';
|
|
2
|
+
import { Obj, QueryAST, Type, View } from '@dxos/echo';
|
|
4
3
|
declare const GraphSchema: Type.Obj<{
|
|
5
4
|
readonly name?: string | undefined;
|
|
6
5
|
readonly view: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & View.View>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Graph.d.ts","sourceRoot":"","sources":["../../../../src/types/Graph.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAsB,GAAG,EAAS,QAAQ,EAAO,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Graph.d.ts","sourceRoot":"","sources":["../../../../src/types/Graph.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAsB,GAAG,EAAS,QAAQ,EAAO,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIvF,QAAA,MAAM,WAAW;;;;;;;wBAoBhB,CAAC;AACF,MAAM,WAAW,KAAM,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC;CAAG;AACxE,eAAO,MAAM,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAsB,CAAC;AAEzD,KAAK,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IACpE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,IAAI,2BAId,SAAS,KAAG,KAEd,CAAC"}
|