@dxos/plugin-explorer 0.8.4-main.c85a9c8dae → 0.8.4-main.dfabb4ec29
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-4RB2TY3G.mjs → neutral/ExplorerContainer-5TOK2ZEY.mjs} +8 -16
- package/dist/lib/neutral/ExplorerContainer-5TOK2ZEY.mjs.map +7 -0
- package/dist/lib/neutral/ExplorerPlugin.mjs +26 -0
- package/dist/lib/neutral/ExplorerPlugin.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-4NFGHCGO.mjs → neutral/chunk-5X5ATGCS.mjs} +11 -22
- package/dist/lib/neutral/chunk-5X5ATGCS.mjs.map +7 -0
- package/dist/lib/{browser/chunk-YNQF4CPY.mjs → neutral/chunk-HPIS2WXY.mjs} +2 -2
- package/dist/lib/{browser/chunk-YNQF4CPY.mjs.map → neutral/chunk-HPIS2WXY.mjs.map} +3 -3
- package/dist/lib/{browser/chunk-6AZY4CDH.mjs → neutral/components/index.mjs} +144 -148
- package/dist/lib/{node-esm/chunk-DOXAIJEC.mjs.map → 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/neutral/hooks/index.mjs +40 -0
- 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 → neutral}/meta.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-U3JEY7V7.mjs +26 -0
- package/dist/lib/neutral/react-surface-U3JEY7V7.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +33 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/types/index.mjs +1 -1
- package/dist/types/data/cities.d.ts +4 -4
- package/dist/types/data/cities.d.ts.map +1 -1
- package/dist/types/data/countries-110m.d.ts +19 -22
- package/dist/types/data/countries-110m.d.ts.map +1 -1
- package/dist/types/src/ExplorerPlugin.d.ts +1 -0
- package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
- package/dist/types/src/ExplorerPlugin.test.d.ts +2 -0
- package/dist/types/src/ExplorerPlugin.test.d.ts.map +1 -0
- 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 +8 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/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 +4 -1
- 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 +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/CanvasForceGraph.stories.d.ts +17 -0
- 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 +4 -2
- 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/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 +5 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/RadialTree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/TidyTree.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 +6 -6
- package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/types/types.d.ts.map +1 -1
- package/dist/types/src/components/plot.d.ts.map +1 -1
- package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts +3 -3
- package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ExplorerContainer/index.d.ts +1 -2
- package/dist/types/src/containers/ExplorerContainer/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -3
- 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/translations.d.ts +28 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/ExplorerAction.d.ts.map +1 -1
- package/dist/types/src/types/Graph.d.ts +2 -9
- package/dist/types/src/types/Graph.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +98 -57
- package/src/ExplorerPlugin.test.ts +26 -0
- package/src/ExplorerPlugin.tsx +7 -24
- package/src/capabilities/create-object.ts +36 -0
- package/src/capabilities/index.ts +4 -1
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +10 -9
- package/src/components/Chart/Chart.stories.tsx +14 -21
- package/src/components/Globe/Globe.stories.tsx +17 -20
- package/src/components/Graph/CanvasForceGraph.stories.tsx +83 -0
- package/src/components/Graph/CanvasForceGraph.tsx +124 -0
- package/src/components/Graph/ForceGraph.stories.tsx +75 -44
- package/src/components/Graph/ForceGraph.tsx +104 -85
- package/src/components/Graph/index.ts +1 -1
- package/src/components/Tree/Tree.stories.tsx +43 -36
- package/src/components/Tree/testing/generator.ts +1 -1
- package/src/components/Tree/types/tree.test.ts +3 -4
- package/src/components/Tree/types/tree.ts +13 -13
- package/src/containers/ExplorerContainer/ExplorerContainer.tsx +7 -9
- package/src/containers/ExplorerContainer/index.ts +1 -3
- package/src/hooks/useGraphModel.ts +14 -10
- package/src/index.ts +1 -4
- package/src/meta.ts +1 -1
- package/src/plugin.ts +9 -0
- package/src/translations.ts +14 -13
- package/src/types/ExplorerAction.ts +1 -2
- package/src/types/Graph.ts +8 -22
- package/src/typings.d.ts +8 -0
- package/dist/lib/browser/ExplorerContainer-4RB2TY3G.mjs.map +0 -7
- package/dist/lib/browser/chunk-4NFGHCGO.mjs.map +0 -7
- package/dist/lib/browser/chunk-6AZY4CDH.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -95
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-KAHVDMFX.mjs +0 -38
- package/dist/lib/browser/react-surface-KAHVDMFX.mjs.map +0 -7
- package/dist/lib/node-esm/ExplorerContainer-LCG425I7.mjs +0 -49
- package/dist/lib/node-esm/ExplorerContainer-LCG425I7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DK77RB6M.mjs +0 -26
- package/dist/lib/node-esm/chunk-DK77RB6M.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DOXAIJEC.mjs +0 -11280
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V42OFY7B.mjs +0 -85
- package/dist/lib/node-esm/chunk-V42OFY7B.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -96
- 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/meta.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7XILIUI4.mjs +0 -39
- package/dist/lib/node-esm/react-surface-7XILIUI4.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -11
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts +0 -14
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +0 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +0 -15
- 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/src/capabilities/react-surface/index.ts +0 -7
- package/src/components/Graph/D3ForceGraph.stories.tsx +0 -84
- package/src/components/Graph/D3ForceGraph.tsx +0 -102
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/meta.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/types/index.mjs.map +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
- /package/src/components/Graph/{adapter.ts → graph-adapter.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-explorer",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.dfabb4ec29",
|
|
4
4
|
"description": "Braneframe data visualization plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,37 +12,76 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"source": "./src/index.ts",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": "./src/capabilities/index.ts",
|
|
18
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#components": {
|
|
22
|
+
"source": "./src/components/index.ts",
|
|
23
|
+
"types": "./dist/types/src/components/index.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/components/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"#containers": {
|
|
27
|
+
"source": "./src/containers/index.ts",
|
|
28
|
+
"types": "./dist/types/src/containers/index.d.ts",
|
|
29
|
+
"default": "./dist/lib/neutral/containers/index.mjs"
|
|
21
30
|
},
|
|
22
|
-
"
|
|
31
|
+
"#hooks": {
|
|
32
|
+
"source": "./src/hooks/index.ts",
|
|
33
|
+
"types": "./dist/types/src/hooks/index.d.ts",
|
|
34
|
+
"default": "./dist/lib/neutral/hooks/index.mjs"
|
|
35
|
+
},
|
|
36
|
+
"#meta": {
|
|
23
37
|
"source": "./src/meta.ts",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
38
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
39
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
40
|
+
},
|
|
41
|
+
"#plugin": {
|
|
42
|
+
"source": "./src/ExplorerPlugin.tsx",
|
|
43
|
+
"types": "./dist/types/src/ExplorerPlugin.d.ts",
|
|
44
|
+
"default": "./dist/lib/neutral/ExplorerPlugin.mjs"
|
|
27
45
|
},
|
|
28
|
-
"
|
|
46
|
+
"#translations": {
|
|
47
|
+
"source": "./src/translations.ts",
|
|
48
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
49
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
50
|
+
},
|
|
51
|
+
"#types": {
|
|
29
52
|
"source": "./src/types/index.ts",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"types": "./dist/types/src/types/index.d.ts"
|
|
53
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
54
|
+
"default": "./dist/lib/neutral/types/index.mjs"
|
|
33
55
|
}
|
|
34
56
|
},
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
57
|
+
"exports": {
|
|
58
|
+
".": {
|
|
59
|
+
"source": "./src/index.ts",
|
|
60
|
+
"types": "./dist/types/src/index.d.ts",
|
|
61
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
62
|
+
},
|
|
63
|
+
"./components": {
|
|
64
|
+
"source": "./src/components/index.ts",
|
|
65
|
+
"types": "./dist/types/src/components/index.d.ts",
|
|
66
|
+
"default": "./dist/lib/neutral/components/index.mjs"
|
|
67
|
+
},
|
|
68
|
+
"./hooks": {
|
|
69
|
+
"source": "./src/hooks/index.ts",
|
|
70
|
+
"types": "./dist/types/src/hooks/index.d.ts",
|
|
71
|
+
"default": "./dist/lib/neutral/hooks/index.mjs"
|
|
72
|
+
},
|
|
73
|
+
"./plugin": {
|
|
74
|
+
"source": "./src/plugin.ts",
|
|
75
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
76
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
77
|
+
},
|
|
78
|
+
"./translations": {
|
|
79
|
+
"source": "./src/translations.ts",
|
|
80
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
81
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
44
82
|
}
|
|
45
83
|
},
|
|
84
|
+
"types": "dist/types/src/index.d.ts",
|
|
46
85
|
"files": [
|
|
47
86
|
"dist",
|
|
48
87
|
"src"
|
|
@@ -52,35 +91,35 @@
|
|
|
52
91
|
"@effect-atom/atom-react": "^0.5.0",
|
|
53
92
|
"@observablehq/plot": "^0.6.11",
|
|
54
93
|
"d3": "^7.9.0",
|
|
55
|
-
"effect": "3.
|
|
94
|
+
"effect": "3.20.0",
|
|
56
95
|
"force-graph": "^1.49.4",
|
|
57
96
|
"lodash.defaultsdeep": "^4.6.1",
|
|
58
97
|
"react-resize-detector": "^11.0.1",
|
|
59
98
|
"three": "^0.178.0",
|
|
60
99
|
"topojson-client": "^3.1.0",
|
|
61
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/client": "0.8.4-main.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/invariant": "0.8.4-main.
|
|
70
|
-
"@dxos/log": "0.8.4-main.
|
|
71
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
72
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
73
|
-
"@dxos/react-client": "0.8.4-main.
|
|
74
|
-
"@dxos/plugin-search": "0.8.4-main.
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/react-ui-
|
|
77
|
-
"@dxos/react-ui-
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/react-ui-
|
|
80
|
-
"@dxos/schema": "0.8.4-main.
|
|
81
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
100
|
+
"@dxos/app-framework": "0.8.4-main.dfabb4ec29",
|
|
101
|
+
"@dxos/app-toolkit": "0.8.4-main.dfabb4ec29",
|
|
102
|
+
"@dxos/async": "0.8.4-main.dfabb4ec29",
|
|
103
|
+
"@dxos/client": "0.8.4-main.dfabb4ec29",
|
|
104
|
+
"@dxos/compute": "0.8.4-main.dfabb4ec29",
|
|
105
|
+
"@dxos/graph": "0.8.4-main.dfabb4ec29",
|
|
106
|
+
"@dxos/echo": "0.8.4-main.dfabb4ec29",
|
|
107
|
+
"@dxos/echo-query": "0.8.4-main.dfabb4ec29",
|
|
108
|
+
"@dxos/invariant": "0.8.4-main.dfabb4ec29",
|
|
109
|
+
"@dxos/log": "0.8.4-main.dfabb4ec29",
|
|
110
|
+
"@dxos/plugin-client": "0.8.4-main.dfabb4ec29",
|
|
111
|
+
"@dxos/plugin-graph": "0.8.4-main.dfabb4ec29",
|
|
112
|
+
"@dxos/react-client": "0.8.4-main.dfabb4ec29",
|
|
113
|
+
"@dxos/plugin-search": "0.8.4-main.dfabb4ec29",
|
|
114
|
+
"@dxos/react-ui-attention": "0.8.4-main.dfabb4ec29",
|
|
115
|
+
"@dxos/react-ui-components": "0.8.4-main.dfabb4ec29",
|
|
116
|
+
"@dxos/react-ui-graph": "0.8.4-main.dfabb4ec29",
|
|
117
|
+
"@dxos/plugin-space": "0.8.4-main.dfabb4ec29",
|
|
118
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.dfabb4ec29",
|
|
119
|
+
"@dxos/schema": "0.8.4-main.dfabb4ec29",
|
|
120
|
+
"@dxos/react-ui-stack": "0.8.4-main.dfabb4ec29",
|
|
121
|
+
"@dxos/util": "0.8.4-main.dfabb4ec29",
|
|
122
|
+
"@dxos/types": "0.8.4-main.dfabb4ec29"
|
|
84
123
|
},
|
|
85
124
|
"devDependencies": {
|
|
86
125
|
"@types/d3": "^7.4.3",
|
|
@@ -92,19 +131,21 @@
|
|
|
92
131
|
"@types/topojson-specification": "^1.0.5",
|
|
93
132
|
"react": "~19.2.3",
|
|
94
133
|
"react-dom": "~19.2.3",
|
|
95
|
-
"vite": "^
|
|
96
|
-
"@dxos/
|
|
97
|
-
"@dxos/
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/
|
|
100
|
-
"@dxos/
|
|
134
|
+
"vite": "^8.0.10",
|
|
135
|
+
"@dxos/plugin-preview": "0.8.4-main.dfabb4ec29",
|
|
136
|
+
"@dxos/echo-generator": "0.8.4-main.dfabb4ec29",
|
|
137
|
+
"@dxos/react-ui": "0.8.4-main.dfabb4ec29",
|
|
138
|
+
"@dxos/plugin-testing": "0.8.4-main.dfabb4ec29",
|
|
139
|
+
"@dxos/random": "0.8.4-main.dfabb4ec29",
|
|
140
|
+
"@dxos/storybook-utils": "0.8.4-main.dfabb4ec29",
|
|
141
|
+
"@dxos/ui-theme": "0.8.4-main.dfabb4ec29"
|
|
101
142
|
},
|
|
102
143
|
"peerDependencies": {
|
|
103
|
-
"effect": "3.
|
|
144
|
+
"effect": "3.20.0",
|
|
104
145
|
"react": "~19.2.3",
|
|
105
146
|
"react-dom": "~19.2.3",
|
|
106
|
-
"@dxos/ui
|
|
107
|
-
"@dxos/
|
|
147
|
+
"@dxos/react-ui": "0.8.4-main.dfabb4ec29",
|
|
148
|
+
"@dxos/ui-theme": "0.8.4-main.dfabb4ec29"
|
|
108
149
|
},
|
|
109
150
|
"publishConfig": {
|
|
110
151
|
"access": "public"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
8
|
+
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
9
|
+
|
|
10
|
+
import { ExplorerPlugin } from '#plugin';
|
|
11
|
+
|
|
12
|
+
import { meta } from './meta';
|
|
13
|
+
|
|
14
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
15
|
+
|
|
16
|
+
describe('ExplorerPlugin', () => {
|
|
17
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
18
|
+
await using harness = await createComposerTestApp({
|
|
19
|
+
plugins: [ClientPlugin({}), ExplorerPlugin()],
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
expect(harness.manager.getActive()).toEqual(
|
|
23
|
+
expect.arrayContaining([moduleId('CreateObject'), moduleId('schema'), moduleId('ReactSurface')]),
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
});
|
package/src/ExplorerPlugin.tsx
CHANGED
|
@@ -2,37 +2,20 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
5
|
import { Plugin } from '@dxos/app-framework';
|
|
8
6
|
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
7
|
|
|
13
|
-
import { ReactSurface } from '
|
|
14
|
-
import { meta } from '
|
|
15
|
-
import { translations } from '
|
|
16
|
-
import {
|
|
8
|
+
import { CreateObject, ReactSurface } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { translations } from '#translations';
|
|
11
|
+
import { Graph } from '#types';
|
|
17
12
|
|
|
18
13
|
export const ExplorerPlugin = Plugin.define(meta).pipe(
|
|
19
|
-
AppPlugin.
|
|
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
|
-
}),
|
|
14
|
+
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
34
15
|
AppPlugin.addSchemaModule({ schema: [Graph.Graph] }),
|
|
35
16
|
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
36
17
|
AppPlugin.addTranslationsModule({ translations }),
|
|
37
18
|
Plugin.make,
|
|
38
19
|
);
|
|
20
|
+
|
|
21
|
+
export default ExplorerPlugin;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Type } from '@dxos/echo';
|
|
10
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
11
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
12
|
+
import { ViewModel } from '@dxos/schema';
|
|
13
|
+
|
|
14
|
+
import { ExplorerAction, Graph } from '#types';
|
|
15
|
+
|
|
16
|
+
export default Capability.makeModule(
|
|
17
|
+
Effect.fnUntraced(function* () {
|
|
18
|
+
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
19
|
+
id: Type.getTypename(Graph.Graph),
|
|
20
|
+
inputSchema: ExplorerAction.GraphProps,
|
|
21
|
+
createObject: (props, options) =>
|
|
22
|
+
Effect.gen(function* () {
|
|
23
|
+
const object = yield* Effect.promise(async () => {
|
|
24
|
+
const { view } = await ViewModel.makeFromDatabase({ db: options.db, typename: props.typename });
|
|
25
|
+
return Graph.make({ name: props.name, view });
|
|
26
|
+
});
|
|
27
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
28
|
+
object,
|
|
29
|
+
target: options.target,
|
|
30
|
+
hidden: true,
|
|
31
|
+
targetNodeId: options.targetNodeId,
|
|
32
|
+
});
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
@@ -2,4 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
8
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
@@ -7,23 +7,24 @@ import React from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
-
import {
|
|
11
|
-
import { type View } from '@dxos/echo';
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
12
11
|
|
|
13
|
-
import { ExplorerContainer } from '
|
|
14
|
-
import {
|
|
15
|
-
import { Graph } from '../../types';
|
|
12
|
+
import { ExplorerContainer } from '#containers';
|
|
13
|
+
import { Graph } from '#types';
|
|
16
14
|
|
|
17
15
|
export default Capability.makeModule(() =>
|
|
18
16
|
Effect.succeed(
|
|
19
17
|
Capability.contributes(
|
|
20
18
|
Capabilities.ReactSurface,
|
|
21
19
|
Surface.create({
|
|
22
|
-
id:
|
|
23
|
-
|
|
24
|
-
filter:
|
|
20
|
+
id: 'article',
|
|
21
|
+
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
22
|
+
filter: AppSurface.oneOf(
|
|
23
|
+
AppSurface.object(AppSurface.Article, Graph.Graph),
|
|
24
|
+
AppSurface.object(AppSurface.Section, Graph.Graph),
|
|
25
|
+
),
|
|
25
26
|
component: ({ data, role }) => {
|
|
26
|
-
return <ExplorerContainer role={role} subject={data.subject} />;
|
|
27
|
+
return <ExplorerContainer role={role} subject={data.subject} attendableId={data.attendableId} />;
|
|
27
28
|
},
|
|
28
29
|
}),
|
|
29
30
|
),
|
|
@@ -2,42 +2,35 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
9
8
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
10
9
|
|
|
11
10
|
import CitiesData from '../../../data/cities.js';
|
|
12
|
-
|
|
13
11
|
import { Chart } from './Chart';
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (!CitiesData) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const items = CitiesData.features.map((feature: any) => ({
|
|
24
|
-
x: feature.geometry.coordinates[0],
|
|
25
|
-
y: feature.geometry.coordinates[1],
|
|
26
|
-
}));
|
|
13
|
+
const items = CitiesData.features.map((feature: any) => ({
|
|
14
|
+
x: feature.geometry.coordinates[0],
|
|
15
|
+
y: feature.geometry.coordinates[1],
|
|
16
|
+
}));
|
|
27
17
|
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// TODO(burdon): Change to decorator.
|
|
32
|
-
export const Default = () => <ClientRepeater component={Story} />;
|
|
18
|
+
const DefaultStory = () => (
|
|
19
|
+
<Chart items={items} accessor={(obj) => ({ x: obj.x, y: obj.y })} options={{ stroke: 'blue' }} />
|
|
20
|
+
);
|
|
33
21
|
|
|
34
22
|
const meta = {
|
|
35
23
|
title: 'plugins/plugin-explorer/components/Chart',
|
|
36
24
|
component: Chart,
|
|
37
|
-
|
|
25
|
+
render: DefaultStory,
|
|
26
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
38
27
|
parameters: {
|
|
39
28
|
layout: 'fullscreen',
|
|
40
29
|
},
|
|
41
30
|
} satisfies Meta<typeof Chart>;
|
|
42
31
|
|
|
43
32
|
export default meta;
|
|
33
|
+
|
|
34
|
+
type Story = StoryObj<typeof meta>;
|
|
35
|
+
|
|
36
|
+
export const Default: Story = {};
|
|
@@ -3,31 +3,27 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { dot, geo, graticule, plot, sphere } from '@observablehq/plot';
|
|
6
|
-
import { type Meta } from '@storybook/react-vite';
|
|
6
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
7
|
import { geoCircle } from 'd3';
|
|
8
8
|
import React, { useEffect } from 'react';
|
|
9
9
|
import { useResizeDetector } from 'react-resize-detector';
|
|
10
10
|
import { feature } from 'topojson-client';
|
|
11
11
|
|
|
12
|
-
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
13
12
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
14
13
|
|
|
15
14
|
import CitiesData from '../../../data/cities.js';
|
|
16
15
|
import CountriesData from '../../../data/countries-110m.js';
|
|
17
|
-
|
|
18
16
|
import { Globe } from './Globe';
|
|
19
17
|
|
|
20
18
|
// TODO(burdon): Generate data with geo lat/lng.
|
|
21
19
|
// TODO(burdon): How to provide geo service via agent?
|
|
22
20
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}));
|
|
21
|
+
const items = CitiesData.features.map((feature: any) => ({
|
|
22
|
+
lat: feature.geometry.coordinates[0],
|
|
23
|
+
lng: feature.geometry.coordinates[1],
|
|
24
|
+
}));
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
};
|
|
26
|
+
const DefaultStory = () => <Globe items={items} />;
|
|
31
27
|
|
|
32
28
|
const ExtendedStory = () => {
|
|
33
29
|
const { ref: containerRef, width = 0, height = 0 } = useResizeDetector({ refreshRate: 200 });
|
|
@@ -37,11 +33,6 @@ const ExtendedStory = () => {
|
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
const land = feature(CountriesData as any, CountriesData.objects.land as any);
|
|
40
|
-
const items = CitiesData.features.map((feature: any) => ({
|
|
41
|
-
lat: feature.geometry.coordinates[0],
|
|
42
|
-
lng: feature.geometry.coordinates[1],
|
|
43
|
-
}));
|
|
44
|
-
|
|
45
36
|
const city = items[0];
|
|
46
37
|
const circle = geoCircle().center([city.lat, city.lng]).radius(16)();
|
|
47
38
|
|
|
@@ -50,7 +41,6 @@ const ExtendedStory = () => {
|
|
|
50
41
|
const drawing = plot({
|
|
51
42
|
// https://observablehq.com/plot/features/projections
|
|
52
43
|
projection: { type: 'orthographic', rotate: [-city.lat + 30, -30] },
|
|
53
|
-
// projection: { type: 'equirectangular', rotate: [-140, -30] },
|
|
54
44
|
width,
|
|
55
45
|
height,
|
|
56
46
|
style: {
|
|
@@ -81,14 +71,21 @@ const ExtendedStory = () => {
|
|
|
81
71
|
|
|
82
72
|
const meta = {
|
|
83
73
|
title: 'plugins/plugin-explorer/components/Globe',
|
|
84
|
-
|
|
74
|
+
component: Globe,
|
|
75
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
85
76
|
parameters: {
|
|
86
77
|
layout: 'fullscreen',
|
|
87
78
|
},
|
|
88
|
-
} satisfies Meta
|
|
79
|
+
} satisfies Meta<typeof Globe>;
|
|
89
80
|
|
|
90
81
|
export default meta;
|
|
91
82
|
|
|
92
|
-
|
|
83
|
+
type Story = StoryObj<typeof meta>;
|
|
93
84
|
|
|
94
|
-
export const
|
|
85
|
+
export const Default: Story = {
|
|
86
|
+
render: DefaultStory,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const Extended: Story = {
|
|
90
|
+
render: ExtendedStory,
|
|
91
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { Type, View } from '@dxos/echo';
|
|
11
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
12
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
13
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
14
|
+
import { random } from '@dxos/random';
|
|
15
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
16
|
+
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
17
|
+
import { ViewModel } from '@dxos/schema';
|
|
18
|
+
import { type ValueGenerator } from '@dxos/schema/testing';
|
|
19
|
+
import { HasRelationship, Organization, Person, Pipeline } from '@dxos/types';
|
|
20
|
+
|
|
21
|
+
import { useGraphModel } from '#hooks';
|
|
22
|
+
import { Graph } from '#types';
|
|
23
|
+
|
|
24
|
+
import { CanvasForceGraph } from './CanvasForceGraph';
|
|
25
|
+
import { generate } from './testing';
|
|
26
|
+
|
|
27
|
+
const generator = random as any as ValueGenerator;
|
|
28
|
+
|
|
29
|
+
random.seed(1);
|
|
30
|
+
|
|
31
|
+
const DefaultStory = () => {
|
|
32
|
+
const [space] = useSpaces();
|
|
33
|
+
const model = useGraphModel(space);
|
|
34
|
+
if (!space || !model) {
|
|
35
|
+
return <Loading data={{ space: !!space, model: !!model }} />;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return <CanvasForceGraph model={model} />;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const meta = {
|
|
42
|
+
title: 'plugins/plugin-explorer/components/CanvasForceGraph',
|
|
43
|
+
component: CanvasForceGraph,
|
|
44
|
+
render: DefaultStory,
|
|
45
|
+
decorators: [
|
|
46
|
+
withTheme(),
|
|
47
|
+
withLayout({ layout: 'fullscreen' }),
|
|
48
|
+
withPluginManager({
|
|
49
|
+
plugins: [
|
|
50
|
+
...corePlugins(),
|
|
51
|
+
ClientPlugin({
|
|
52
|
+
types: [
|
|
53
|
+
Graph.Graph,
|
|
54
|
+
View.View,
|
|
55
|
+
HasRelationship.HasRelationship,
|
|
56
|
+
Organization.Organization,
|
|
57
|
+
Pipeline.Pipeline,
|
|
58
|
+
Person.Person,
|
|
59
|
+
],
|
|
60
|
+
onClientInitialized: ({ client }) =>
|
|
61
|
+
Effect.gen(function* () {
|
|
62
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
63
|
+
yield* Effect.promise(() => generate(personalSpace, generator));
|
|
64
|
+
const { view } = yield* Effect.promise(() =>
|
|
65
|
+
ViewModel.makeFromDatabase({ db: personalSpace.db, typename: Type.getTypename(Graph.Graph) }),
|
|
66
|
+
);
|
|
67
|
+
personalSpace.db.add(Graph.make({ name: 'Test', view }));
|
|
68
|
+
yield* Effect.promise(() => personalSpace.db.flush({ indexes: true }));
|
|
69
|
+
}),
|
|
70
|
+
}),
|
|
71
|
+
],
|
|
72
|
+
}),
|
|
73
|
+
],
|
|
74
|
+
parameters: {
|
|
75
|
+
layout: 'fullscreen',
|
|
76
|
+
},
|
|
77
|
+
} satisfies Meta<typeof CanvasForceGraph>;
|
|
78
|
+
|
|
79
|
+
export default meta;
|
|
80
|
+
|
|
81
|
+
type Story = StoryObj<typeof meta>;
|
|
82
|
+
|
|
83
|
+
export const Default: Story = {};
|