@dxos/plugin-explorer 0.8.4-main.67995b8 → 0.8.4-main.6fa680abb7
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/dist/lib/browser/ExplorerContainer-JBCVWH3M.mjs +48 -0
- package/dist/lib/browser/ExplorerContainer-JBCVWH3M.mjs.map +7 -0
- package/dist/lib/browser/chunk-3Y7INKYN.mjs +68 -0
- package/dist/lib/browser/chunk-3Y7INKYN.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-LSUP47BZ.mjs +24 -0
- package/dist/lib/browser/chunk-LSUP47BZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PVFZFKQ6.mjs → chunk-WX7QIZMF.mjs} +345 -396
- package/dist/lib/{node-esm/chunk-S5A2EUSJ.mjs.map → browser/chunk-WX7QIZMF.mjs.map} +4 -4
- package/dist/lib/browser/index.mjs +55 -71
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +2 -3
- package/dist/lib/browser/react-surface-FWNW2HFX.mjs +38 -0
- package/dist/lib/browser/react-surface-FWNW2HFX.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +6 -6
- package/dist/lib/node-esm/ExplorerContainer-5JTSMOCL.mjs +49 -0
- package/dist/lib/node-esm/ExplorerContainer-5JTSMOCL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-S5A2EUSJ.mjs → chunk-3Z2WBI3N.mjs} +345 -396
- package/dist/lib/{browser/chunk-PVFZFKQ6.mjs.map → node-esm/chunk-3Z2WBI3N.mjs.map} +4 -4
- package/dist/lib/node-esm/chunk-6OG6G75N.mjs +69 -0
- package/dist/lib/node-esm/chunk-6OG6G75N.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PIAXA43R.mjs → chunk-EN3JZNEY.mjs} +8 -5
- package/dist/lib/node-esm/chunk-EN3JZNEY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +55 -71
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +2 -3
- package/dist/lib/node-esm/react-surface-BDRG4ZLM.mjs +39 -0
- package/dist/lib/node-esm/react-surface-BDRG4ZLM.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +6 -6
- package/dist/types/src/ExplorerPlugin.d.ts +2 -1
- package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/Chart/Chart.d.ts.map +1 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts +8 -4
- package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +8 -4
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts +3 -3
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +1 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +13 -4
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +13 -4
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/adapter.d.ts +1 -1
- package/dist/types/src/components/Graph/adapter.d.ts.map +1 -1
- package/dist/types/src/components/Graph/testing.d.ts +1 -1
- package/dist/types/src/components/Graph/testing.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +13 -16
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/testing/generator.d.ts.map +1 -1
- package/dist/types/src/components/Tree/types/tree.d.ts +19 -17
- package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/types/types.d.ts +1 -1
- package/dist/types/src/components/Tree/types/types.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts +6 -0
- package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerContainer/index.d.ts +3 -0
- package/dist/types/src/containers/ExplorerContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- 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/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +26 -5
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/ExplorerAction.d.ts +6 -0
- package/dist/types/src/types/ExplorerAction.d.ts.map +1 -0
- package/dist/types/src/types/Graph.d.ts +23 -0
- package/dist/types/src/types/Graph.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +51 -44
- package/src/ExplorerPlugin.tsx +30 -52
- package/src/capabilities/index.ts +1 -4
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +31 -0
- package/src/components/Chart/Chart.stories.tsx +10 -8
- package/src/components/Chart/Chart.tsx +1 -1
- package/src/components/Globe/Globe.stories.tsx +14 -12
- package/src/components/Globe/Globe.tsx +1 -1
- package/src/components/Graph/D3ForceGraph.stories.tsx +43 -24
- package/src/components/Graph/D3ForceGraph.tsx +10 -9
- package/src/components/Graph/ForceGraph.stories.tsx +43 -24
- package/src/components/Graph/ForceGraph.tsx +4 -4
- package/src/components/Graph/adapter.ts +14 -8
- package/src/components/Graph/testing.ts +13 -10
- package/src/components/Tree/Tree.stories.tsx +29 -22
- package/src/components/Tree/Tree.tsx +11 -6
- package/src/components/Tree/testing/generator.ts +4 -2
- package/src/components/Tree/types/tree.test.ts +7 -4
- package/src/components/Tree/types/tree.ts +42 -21
- package/src/components/Tree/types/types.ts +1 -1
- package/src/components/index.ts +0 -4
- package/src/containers/ExplorerContainer/ExplorerContainer.tsx +53 -0
- package/src/containers/ExplorerContainer/index.ts +7 -0
- package/src/containers/index.ts +7 -0
- package/src/hooks/useGraphModel.ts +9 -5
- package/src/meta.ts +9 -6
- package/src/translations.ts +7 -2
- package/src/types/ExplorerAction.ts +20 -0
- package/src/types/Graph.ts +45 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/browser/ExplorerContainer-OGHSHZD5.mjs +0 -37
- package/dist/lib/browser/ExplorerContainer-OGHSHZD5.mjs.map +0 -7
- package/dist/lib/browser/chunk-EF4BFHTI.mjs +0 -38
- package/dist/lib/browser/chunk-EF4BFHTI.mjs.map +0 -7
- package/dist/lib/browser/chunk-J2BBZOSF.mjs +0 -187
- package/dist/lib/browser/chunk-J2BBZOSF.mjs.map +0 -7
- package/dist/lib/browser/chunk-OAOY7SHY.mjs +0 -30
- package/dist/lib/browser/chunk-OAOY7SHY.mjs.map +0 -7
- package/dist/lib/browser/chunk-UL5EDJPE.mjs +0 -21
- package/dist/lib/browser/chunk-UL5EDJPE.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-XH2UO2FM.mjs +0 -24
- package/dist/lib/browser/intent-resolver-XH2UO2FM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-65VQ42HX.mjs +0 -31
- package/dist/lib/browser/react-surface-65VQ42HX.mjs.map +0 -7
- package/dist/lib/node-esm/ExplorerContainer-6ON5NA2P.mjs +0 -38
- package/dist/lib/node-esm/ExplorerContainer-6ON5NA2P.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4VMSNXYL.mjs +0 -189
- package/dist/lib/node-esm/chunk-4VMSNXYL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PIAXA43R.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PPBUWC7F.mjs +0 -32
- package/dist/lib/node-esm/chunk-PPBUWC7F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VKCOKQRG.mjs +0 -39
- package/dist/lib/node-esm/chunk-VKCOKQRG.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-AGBBNA67.mjs +0 -25
- package/dist/lib/node-esm/intent-resolver-AGBBNA67.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-IJIMYAST.mjs +0 -32
- package/dist/lib/node-esm/react-surface-IJIMYAST.mjs.map +0 -7
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/ExplorerContainer.d.ts +0 -9
- package/dist/types/src/components/ExplorerContainer.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -12
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -18
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -19
- package/src/capabilities/react-surface.tsx +0 -23
- package/src/components/ExplorerContainer.tsx +0 -36
- package/src/types/schema.ts +0 -16
- package/src/types/types.ts +0 -21
package/package.json
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-explorer",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.6fa680abb7",
|
|
4
4
|
"description": "Braneframe data visualization plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"sideEffects": true,
|
|
10
14
|
"type": "module",
|
|
11
15
|
"exports": {
|
|
12
16
|
".": {
|
|
13
|
-
"
|
|
17
|
+
"source": "./src/index.ts",
|
|
14
18
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
19
|
"node": "./dist/lib/node-esm/index.mjs",
|
|
16
|
-
"
|
|
20
|
+
"types": "./dist/types/src/index.d.ts"
|
|
17
21
|
},
|
|
18
22
|
"./meta": {
|
|
19
|
-
"
|
|
23
|
+
"source": "./src/meta.ts",
|
|
20
24
|
"browser": "./dist/lib/browser/meta.mjs",
|
|
21
25
|
"node": "./dist/lib/node-esm/meta.mjs",
|
|
22
|
-
"
|
|
26
|
+
"types": "./dist/types/src/meta.d.ts"
|
|
23
27
|
},
|
|
24
28
|
"./types": {
|
|
25
|
-
"
|
|
29
|
+
"source": "./src/types/index.ts",
|
|
26
30
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
27
31
|
"node": "./dist/lib/node-esm/types/index.mjs",
|
|
28
|
-
"
|
|
32
|
+
"types": "./dist/types/src/types/index.d.ts"
|
|
29
33
|
}
|
|
30
34
|
},
|
|
31
35
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -45,59 +49,62 @@
|
|
|
45
49
|
],
|
|
46
50
|
"dependencies": {
|
|
47
51
|
"3d-force-graph": "^1.76.1",
|
|
52
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
48
53
|
"@observablehq/plot": "^0.6.11",
|
|
49
|
-
"@preact-signals/safe-react": "^0.9.0",
|
|
50
|
-
"@preact/signals-core": "^1.9.0",
|
|
51
54
|
"d3": "^7.9.0",
|
|
52
|
-
"effect": "3.
|
|
55
|
+
"effect": "3.19.16",
|
|
53
56
|
"force-graph": "^1.49.4",
|
|
54
57
|
"lodash.defaultsdeep": "^4.6.1",
|
|
55
58
|
"react-resize-detector": "^11.0.1",
|
|
56
59
|
"three": "^0.178.0",
|
|
57
60
|
"topojson-client": "^3.1.0",
|
|
58
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
59
|
-
"@dxos/async": "0.8.4-main.
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/echo": "0.8.4-main.
|
|
62
|
-
"@dxos/graph": "0.8.4-main.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/plugin-
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/react-
|
|
73
|
-
"@dxos/react-ui-
|
|
74
|
-
"@dxos/react-ui-
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
61
|
+
"@dxos/app-framework": "0.8.4-main.6fa680abb7",
|
|
62
|
+
"@dxos/async": "0.8.4-main.6fa680abb7",
|
|
63
|
+
"@dxos/echo-query": "0.8.4-main.6fa680abb7",
|
|
64
|
+
"@dxos/echo": "0.8.4-main.6fa680abb7",
|
|
65
|
+
"@dxos/graph": "0.8.4-main.6fa680abb7",
|
|
66
|
+
"@dxos/invariant": "0.8.4-main.6fa680abb7",
|
|
67
|
+
"@dxos/log": "0.8.4-main.6fa680abb7",
|
|
68
|
+
"@dxos/operation": "0.8.4-main.6fa680abb7",
|
|
69
|
+
"@dxos/plugin-client": "0.8.4-main.6fa680abb7",
|
|
70
|
+
"@dxos/client": "0.8.4-main.6fa680abb7",
|
|
71
|
+
"@dxos/plugin-graph": "0.8.4-main.6fa680abb7",
|
|
72
|
+
"@dxos/plugin-search": "0.8.4-main.6fa680abb7",
|
|
73
|
+
"@dxos/react-client": "0.8.4-main.6fa680abb7",
|
|
74
|
+
"@dxos/plugin-space": "0.8.4-main.6fa680abb7",
|
|
75
|
+
"@dxos/react-ui-attention": "0.8.4-main.6fa680abb7",
|
|
76
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.6fa680abb7",
|
|
77
|
+
"@dxos/react-ui-components": "0.8.4-main.6fa680abb7",
|
|
78
|
+
"@dxos/react-ui-stack": "0.8.4-main.6fa680abb7",
|
|
79
|
+
"@dxos/schema": "0.8.4-main.6fa680abb7",
|
|
80
|
+
"@dxos/util": "0.8.4-main.6fa680abb7",
|
|
81
|
+
"@dxos/react-ui-graph": "0.8.4-main.6fa680abb7",
|
|
82
|
+
"@dxos/types": "0.8.4-main.6fa680abb7",
|
|
83
|
+
"@dxos/app-toolkit": "0.8.4-main.6fa680abb7"
|
|
77
84
|
},
|
|
78
85
|
"devDependencies": {
|
|
79
86
|
"@types/d3": "^7.4.3",
|
|
80
87
|
"@types/d3-hierarchy": "^3.1.6",
|
|
81
88
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
82
|
-
"@types/react": "~
|
|
83
|
-
"@types/react-dom": "~
|
|
89
|
+
"@types/react": "~19.2.7",
|
|
90
|
+
"@types/react-dom": "~19.2.3",
|
|
84
91
|
"@types/topojson-client": "^3.1.4",
|
|
85
92
|
"@types/topojson-specification": "^1.0.5",
|
|
86
|
-
"react": "~
|
|
87
|
-
"react-dom": "~
|
|
88
|
-
"vite": "
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
93
|
+
"react": "~19.2.3",
|
|
94
|
+
"react-dom": "~19.2.3",
|
|
95
|
+
"vite": "^7.1.11",
|
|
96
|
+
"@dxos/echo-generator": "0.8.4-main.6fa680abb7",
|
|
97
|
+
"@dxos/random": "0.8.4-main.6fa680abb7",
|
|
98
|
+
"@dxos/react-ui": "0.8.4-main.6fa680abb7",
|
|
99
|
+
"@dxos/storybook-utils": "0.8.4-main.6fa680abb7",
|
|
100
|
+
"@dxos/ui-theme": "0.8.4-main.6fa680abb7"
|
|
94
101
|
},
|
|
95
102
|
"peerDependencies": {
|
|
96
|
-
"effect": "
|
|
97
|
-
"react": "~
|
|
98
|
-
"react-dom": "~
|
|
99
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
100
|
-
"@dxos/
|
|
103
|
+
"effect": "3.19.16",
|
|
104
|
+
"react": "~19.2.3",
|
|
105
|
+
"react-dom": "~19.2.3",
|
|
106
|
+
"@dxos/react-ui": "0.8.4-main.6fa680abb7",
|
|
107
|
+
"@dxos/ui-theme": "0.8.4-main.6fa680abb7"
|
|
101
108
|
},
|
|
102
109
|
"publishConfig": {
|
|
103
110
|
"access": "public"
|
package/src/ExplorerPlugin.tsx
CHANGED
|
@@ -2,59 +2,37 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
7
|
-
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
8
|
-
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
9
6
|
|
|
10
|
-
import {
|
|
7
|
+
import { Plugin } from '@dxos/app-framework';
|
|
8
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
9
|
+
import { Type } from '@dxos/echo';
|
|
10
|
+
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
11
|
+
import { ViewModel } from '@dxos/schema';
|
|
12
|
+
|
|
13
|
+
import { ReactSurface } from './capabilities';
|
|
11
14
|
import { meta } from './meta';
|
|
12
15
|
import { translations } from './translations';
|
|
13
|
-
import {
|
|
16
|
+
import { ExplorerAction, Graph } from './types';
|
|
14
17
|
|
|
15
|
-
export const ExplorerPlugin = ()
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
id:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
activate: () =>
|
|
37
|
-
contributes(
|
|
38
|
-
SpaceCapabilities.ObjectForm,
|
|
39
|
-
defineObjectForm({
|
|
40
|
-
objectSchema: ViewType,
|
|
41
|
-
getIntent: () => createIntent(ExplorerAction.Create),
|
|
42
|
-
}),
|
|
43
|
-
),
|
|
44
|
-
}),
|
|
45
|
-
defineModule({
|
|
46
|
-
id: `${meta.id}/module/schema`,
|
|
47
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
48
|
-
activate: () => contributes(ClientCapabilities.Schema, [ViewType]),
|
|
49
|
-
}),
|
|
50
|
-
defineModule({
|
|
51
|
-
id: `${meta.id}/module/react-surface`,
|
|
52
|
-
activatesOn: Events.SetupReactSurface,
|
|
53
|
-
activate: ReactSurface,
|
|
54
|
-
}),
|
|
55
|
-
defineModule({
|
|
56
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
57
|
-
activatesOn: Events.SetupIntentResolver,
|
|
58
|
-
activate: IntentResolver,
|
|
59
|
-
}),
|
|
60
|
-
]);
|
|
18
|
+
export const ExplorerPlugin = Plugin.define(meta).pipe(
|
|
19
|
+
AppPlugin.addMetadataModule({
|
|
20
|
+
metadata: {
|
|
21
|
+
id: Type.getTypename(Graph.Graph),
|
|
22
|
+
metadata: {
|
|
23
|
+
icon: 'ph--graph--regular',
|
|
24
|
+
iconHue: 'green',
|
|
25
|
+
inputSchema: ExplorerAction.GraphProps,
|
|
26
|
+
createObject: ((props, { db }) =>
|
|
27
|
+
Effect.promise(async () => {
|
|
28
|
+
const { view } = await ViewModel.makeFromDatabase({ db, typename: props.typename });
|
|
29
|
+
return Graph.make({ name: props.name, view });
|
|
30
|
+
})) satisfies CreateObject,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
AppPlugin.addSchemaModule({ schema: [Graph.Graph] }),
|
|
35
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
36
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
37
|
+
Plugin.make,
|
|
38
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { type View } from '@dxos/echo';
|
|
12
|
+
|
|
13
|
+
import { ExplorerContainer } from '../../containers';
|
|
14
|
+
import { meta } from '../../meta';
|
|
15
|
+
import { Graph } from '../../types';
|
|
16
|
+
|
|
17
|
+
export default Capability.makeModule(() =>
|
|
18
|
+
Effect.succeed(
|
|
19
|
+
Capability.contributes(
|
|
20
|
+
Capabilities.ReactSurface,
|
|
21
|
+
Surface.create({
|
|
22
|
+
id: `${meta.id}.article`,
|
|
23
|
+
role: ['article', 'section'],
|
|
24
|
+
filter: (data): data is { subject: View.View } => Obj.instanceOf(Graph.Graph, data.subject),
|
|
25
|
+
component: ({ data, role }) => {
|
|
26
|
+
return <ExplorerContainer role={role} subject={data.subject} />;
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
),
|
|
30
|
+
),
|
|
31
|
+
);
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
8
|
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
11
|
-
import { withLayout, withTheme } from '@dxos/
|
|
9
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
12
10
|
|
|
13
|
-
import { Chart } from './Chart';
|
|
14
11
|
import CitiesData from '../../../data/cities.js';
|
|
15
12
|
|
|
13
|
+
import { Chart } from './Chart';
|
|
14
|
+
|
|
16
15
|
// TODO(burdon): Generate data with geo lat/lng.
|
|
17
16
|
// TODO(burdon): How to provide geo service via agent?
|
|
18
17
|
|
|
@@ -32,10 +31,13 @@ const Story = () => {
|
|
|
32
31
|
// TODO(burdon): Change to decorator.
|
|
33
32
|
export const Default = () => <ClientRepeater component={Story} />;
|
|
34
33
|
|
|
35
|
-
const meta
|
|
36
|
-
title: 'plugins/plugin-explorer/Chart',
|
|
34
|
+
const meta = {
|
|
35
|
+
title: 'plugins/plugin-explorer/components/Chart',
|
|
37
36
|
component: Chart,
|
|
38
|
-
decorators: [withTheme, withLayout(
|
|
39
|
-
|
|
37
|
+
decorators: [withTheme(), withLayout()],
|
|
38
|
+
parameters: {
|
|
39
|
+
layout: 'fullscreen',
|
|
40
|
+
},
|
|
41
|
+
} satisfies Meta<typeof Chart>;
|
|
40
42
|
|
|
41
43
|
export default meta;
|
|
@@ -7,7 +7,7 @@ import { type DotOptions } from '@observablehq/plot';
|
|
|
7
7
|
import React, { useEffect } from 'react';
|
|
8
8
|
import { useResizeDetector } from 'react-resize-detector';
|
|
9
9
|
|
|
10
|
-
import { type Accessor,
|
|
10
|
+
import { type Accessor, type Point, createAdapter } from '../plot';
|
|
11
11
|
|
|
12
12
|
const defaultOptions: DotOptions = {
|
|
13
13
|
r: 4,
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { plot, sphere, geo, graticule, dot } from '@observablehq/plot';
|
|
5
|
+
import { dot, geo, graticule, plot, sphere } from '@observablehq/plot';
|
|
8
6
|
import { type Meta } from '@storybook/react-vite';
|
|
9
7
|
import { geoCircle } from 'd3';
|
|
10
8
|
import React, { useEffect } from 'react';
|
|
@@ -12,12 +10,13 @@ import { useResizeDetector } from 'react-resize-detector';
|
|
|
12
10
|
import { feature } from 'topojson-client';
|
|
13
11
|
|
|
14
12
|
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
15
|
-
import { withLayout, withTheme } from '@dxos/
|
|
13
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
16
14
|
|
|
17
|
-
import { Globe } from './Globe';
|
|
18
15
|
import CitiesData from '../../../data/cities.js';
|
|
19
16
|
import CountriesData from '../../../data/countries-110m.js';
|
|
20
17
|
|
|
18
|
+
import { Globe } from './Globe';
|
|
19
|
+
|
|
21
20
|
// TODO(burdon): Generate data with geo lat/lng.
|
|
22
21
|
// TODO(burdon): How to provide geo service via agent?
|
|
23
22
|
|
|
@@ -80,13 +79,16 @@ const ExtendedStory = () => {
|
|
|
80
79
|
return <div ref={containerRef} className='grow p-8' />;
|
|
81
80
|
};
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
const meta = {
|
|
83
|
+
title: 'plugins/plugin-explorer/components/Globe',
|
|
84
|
+
decorators: [withTheme(), withLayout()],
|
|
85
|
+
parameters: {
|
|
86
|
+
layout: 'fullscreen',
|
|
87
|
+
},
|
|
88
|
+
} satisfies Meta;
|
|
84
89
|
|
|
85
|
-
export
|
|
90
|
+
export default meta;
|
|
86
91
|
|
|
87
|
-
const
|
|
88
|
-
title: 'plugins/plugin-explorer/Globe',
|
|
89
|
-
decorators: [withTheme, withLayout({ fullscreen: true })],
|
|
90
|
-
};
|
|
92
|
+
export const Default = () => <ClientRepeater component={DefaultStory} createSpace />;
|
|
91
93
|
|
|
92
|
-
export
|
|
94
|
+
export const Extended = () => <ClientRepeater component={ExtendedStory} createSpace />;
|
|
@@ -9,7 +9,7 @@ import { useResizeDetector } from 'react-resize-detector';
|
|
|
9
9
|
import * as topojson from 'topojson-client';
|
|
10
10
|
|
|
11
11
|
import CountriesData from '../../../data/countries-110m.js';
|
|
12
|
-
import { type Accessor,
|
|
12
|
+
import { type Accessor, type GeoLocation, createAdapter } from '../plot';
|
|
13
13
|
|
|
14
14
|
const defaultOptions: DotOptions = {
|
|
15
15
|
r: 4,
|
|
@@ -2,24 +2,27 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useState } from 'react';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import { Obj } from '@dxos/echo';
|
|
8
|
+
import { Type } from '@dxos/echo';
|
|
9
|
+
import { View } from '@dxos/echo';
|
|
11
10
|
import { faker } from '@dxos/random';
|
|
12
11
|
import { useClient } from '@dxos/react-client';
|
|
13
12
|
import { type Space } from '@dxos/react-client/echo';
|
|
14
13
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
15
|
-
import {
|
|
14
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
15
|
+
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
16
|
+
import { ViewModel } from '@dxos/schema';
|
|
16
17
|
import { type ValueGenerator } from '@dxos/schema/testing';
|
|
17
|
-
import {
|
|
18
|
+
import { withRegistry } from '@dxos/storybook-utils';
|
|
19
|
+
import { HasRelationship, Organization, Person, Pipeline } from '@dxos/types';
|
|
20
|
+
|
|
21
|
+
import { useGraphModel } from '../../hooks';
|
|
22
|
+
import { Graph } from '../../types';
|
|
18
23
|
|
|
19
24
|
import { D3ForceGraph } from './D3ForceGraph';
|
|
20
25
|
import { generate } from './testing';
|
|
21
|
-
import { useGraphModel } from '../../hooks';
|
|
22
|
-
import { ViewType } from '../../types';
|
|
23
26
|
|
|
24
27
|
const generator = faker as any as ValueGenerator;
|
|
25
28
|
|
|
@@ -28,37 +31,53 @@ faker.seed(1);
|
|
|
28
31
|
const DefaultStory = () => {
|
|
29
32
|
const client = useClient();
|
|
30
33
|
const [space, setSpace] = useState<Space>();
|
|
31
|
-
const [
|
|
32
|
-
|
|
34
|
+
const [graph, setGraph] = useState<Graph.Graph>();
|
|
35
|
+
|
|
36
|
+
useAsyncEffect(async () => {
|
|
33
37
|
const space = client.spaces.default;
|
|
34
38
|
void generate(space, generator);
|
|
35
|
-
const view =
|
|
39
|
+
const { view } = await ViewModel.makeFromDatabase({ db: space.db, typename: Type.getTypename(Graph.Graph) });
|
|
40
|
+
const graph = Graph.make({ name: 'Test', view });
|
|
41
|
+
space.db.add(graph);
|
|
36
42
|
setSpace(space);
|
|
37
|
-
|
|
38
|
-
}, []);
|
|
43
|
+
setGraph(graph);
|
|
44
|
+
}, [client]);
|
|
39
45
|
|
|
40
46
|
const model = useGraphModel(space);
|
|
41
|
-
if (!model || !space || !
|
|
42
|
-
return
|
|
47
|
+
if (!model || !space || !graph) {
|
|
48
|
+
return <Loading data={{ model: !!model, space: !!space, graph: !!graph }} />;
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
return <D3ForceGraph model={model} />;
|
|
46
52
|
};
|
|
47
53
|
|
|
48
|
-
const meta
|
|
49
|
-
title: 'plugins/plugin-explorer/D3ForceGraph',
|
|
54
|
+
const meta = {
|
|
55
|
+
title: 'plugins/plugin-explorer/components/D3ForceGraph',
|
|
50
56
|
component: D3ForceGraph,
|
|
51
|
-
render:
|
|
57
|
+
render: DefaultStory,
|
|
52
58
|
decorators: [
|
|
59
|
+
withRegistry,
|
|
60
|
+
withTheme(),
|
|
61
|
+
withLayout(),
|
|
53
62
|
withClientProvider({
|
|
54
63
|
createSpace: true,
|
|
55
|
-
types: [
|
|
64
|
+
types: [
|
|
65
|
+
Graph.Graph,
|
|
66
|
+
View.View,
|
|
67
|
+
Organization.Organization,
|
|
68
|
+
Pipeline.Pipeline,
|
|
69
|
+
Person.Person,
|
|
70
|
+
HasRelationship.HasRelationship,
|
|
71
|
+
],
|
|
56
72
|
}),
|
|
57
|
-
withTheme,
|
|
58
|
-
withLayout({ fullscreen: true }),
|
|
59
73
|
],
|
|
60
|
-
|
|
74
|
+
parameters: {
|
|
75
|
+
layout: 'fullscreen',
|
|
76
|
+
},
|
|
77
|
+
} satisfies Meta<typeof D3ForceGraph>;
|
|
61
78
|
|
|
62
79
|
export default meta;
|
|
63
80
|
|
|
64
|
-
|
|
81
|
+
type Story = StoryObj<typeof meta>;
|
|
82
|
+
|
|
83
|
+
export const Default: Story = {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { type
|
|
5
|
+
import React, { type ComponentPropsWithoutRef, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Obj } from '@dxos/echo';
|
|
8
8
|
import { SelectionModel } from '@dxos/graph';
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
SVG,
|
|
16
16
|
type SVGContext,
|
|
17
17
|
} from '@dxos/react-ui-graph';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { type SpaceGraphEdge, type SpaceGraphModel, type SpaceGraphNode } from '@dxos/schema';
|
|
19
|
+
import { getHashStyles } from '@dxos/ui-theme';
|
|
20
20
|
|
|
21
21
|
import '@dxos/react-ui-graph/styles/graph.css';
|
|
22
22
|
|
|
@@ -26,10 +26,11 @@ export type D3ForceGraphProps = ThemedClassName<
|
|
|
26
26
|
match?: RegExp;
|
|
27
27
|
selection?: SelectionModel;
|
|
28
28
|
grid?: boolean;
|
|
29
|
-
} & Pick<GraphProps, 'drag'>
|
|
29
|
+
} & Pick<GraphProps, 'drag'> &
|
|
30
|
+
ComponentPropsWithoutRef<'div'>
|
|
30
31
|
>;
|
|
31
32
|
|
|
32
|
-
export const D3ForceGraph
|
|
33
|
+
export const D3ForceGraph = ({ classNames, model, selection: _selection, grid, drag, ...props }: D3ForceGraphProps) => {
|
|
33
34
|
const context = useRef<SVGContext>(null);
|
|
34
35
|
const projector = useMemo<GraphForceProjector | undefined>(() => {
|
|
35
36
|
if (context.current) {
|
|
@@ -52,7 +53,7 @@ export const D3ForceGraph: FC<D3ForceGraphProps> = ({ classNames, model, selecti
|
|
|
52
53
|
|
|
53
54
|
const graph = useRef<GraphController>(null);
|
|
54
55
|
const selection = useMemo(() => _selection ?? new SelectionModel(), [_selection]);
|
|
55
|
-
useEffect(() => graph.current?.repaint(), [selection
|
|
56
|
+
useEffect(() => selection.subscribe(() => graph.current?.repaint()), [selection]);
|
|
56
57
|
|
|
57
58
|
const handleSelect = useCallback<NonNullable<GraphProps['onSelect']>>(
|
|
58
59
|
(node) => {
|
|
@@ -66,12 +67,12 @@ export const D3ForceGraph: FC<D3ForceGraphProps> = ({ classNames, model, selecti
|
|
|
66
67
|
);
|
|
67
68
|
|
|
68
69
|
return (
|
|
69
|
-
<SVG.Root ref={context} classNames={classNames}>
|
|
70
|
+
<SVG.Root ref={context} classNames={classNames} {...props}>
|
|
70
71
|
<SVG.Markers />
|
|
71
72
|
{grid && <SVG.Grid axis />}
|
|
72
73
|
<SVG.Zoom extent={[1 / 2, 2]}>
|
|
73
74
|
<SVG.Graph<SpaceGraphNode, SpaceGraphEdge>
|
|
74
|
-
{
|
|
75
|
+
drag={drag}
|
|
75
76
|
ref={graph}
|
|
76
77
|
model={model}
|
|
77
78
|
projector={projector}
|
|
@@ -85,7 +86,7 @@ export const D3ForceGraph: FC<D3ForceGraphProps> = ({ classNames, model, selecti
|
|
|
85
86
|
const obj = node.data?.data.object;
|
|
86
87
|
return {
|
|
87
88
|
data: {
|
|
88
|
-
color:
|
|
89
|
+
color: getHashStyles(obj && Obj.getTypename(obj))?.hue,
|
|
89
90
|
},
|
|
90
91
|
classes: {
|
|
91
92
|
'dx-selected': selection.contains(node.id),
|