@dxos/plugin-explorer 0.8.4-main.7ace549 → 0.8.4-main.8baae0fced
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-EAKRB55W.mjs +277 -0
- package/dist/lib/neutral/ExplorerArticle-EAKRB55W.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/neutral/chunk-7SPMPHRS.mjs +72 -0
- package/dist/lib/neutral/chunk-7SPMPHRS.mjs.map +7 -0
- package/dist/lib/{browser/chunk-UBHZGWZQ.mjs → neutral/chunk-DXIWQFYO.mjs} +3 -5
- package/dist/lib/neutral/chunk-DXIWQFYO.mjs.map +7 -0
- package/dist/lib/neutral/chunk-EM2BV4PF.mjs +290 -0
- package/dist/lib/neutral/chunk-EM2BV4PF.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/neutral/chunk-V2OFO6PI.mjs +14 -0
- package/dist/lib/neutral/chunk-V2OFO6PI.mjs.map +7 -0
- package/dist/lib/{browser/chunk-ARBGXQFH.mjs → neutral/components/index.mjs} +858 -307
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- 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 +45 -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-APBW2VQG.mjs +26 -0
- package/dist/lib/neutral/react-surface-APBW2VQG.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +193 -0
- package/dist/lib/neutral/testing/index.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 -2
- 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 +3 -1
- 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 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Chart/Chart.d.ts +1 -1
- 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 +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} +2 -2
- 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/Lattice/Lattice.d.ts +20 -0
- package/dist/types/src/components/Lattice/Lattice.d.ts.map +1 -0
- package/dist/types/src/components/Lattice/Lattice.stories.d.ts +8 -0
- package/dist/types/src/components/Lattice/Lattice.stories.d.ts.map +1 -0
- package/dist/types/src/components/Lattice/index.d.ts +2 -0
- package/dist/types/src/components/Lattice/index.d.ts.map +1 -0
- 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 +2 -0
- package/dist/types/src/components/Tree/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts +37 -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/types/tree.d.ts +18 -16
- package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
- 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/components/index.d.ts +1 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts +9 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts +29 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/experimental.stories.d.ts +7 -0
- package/dist/types/src/containers/ExplorerArticle/experimental.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 +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/index.d.ts +1 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.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/{components/Tree/testing → testing}/generator.d.ts +1 -1
- package/dist/types/src/testing/generator.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +4 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/relations.d.ts +47 -0
- package/dist/types/src/testing/relations.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +29 -28
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/ExplorerAction.d.ts +0 -17
- package/dist/types/src/types/ExplorerAction.d.ts.map +1 -1
- package/dist/types/src/types/Graph.d.ts +10 -20
- package/dist/types/src/types/Graph.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +3 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/node-color.d.ts +13 -0
- package/dist/types/src/util/node-color.d.ts.map +1 -0
- package/dist/types/src/{components → util}/plot.d.ts +1 -1
- package/dist/types/src/util/plot.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +113 -62
- package/src/ExplorerPlugin.test.ts +26 -0
- package/src/ExplorerPlugin.tsx +15 -45
- package/src/capabilities/create-object.ts +36 -0
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/react-surface.tsx +24 -18
- package/src/components/Chart/Chart.stories.tsx +16 -23
- package/src/components/Chart/Chart.tsx +1 -1
- package/src/components/Globe/Globe.stories.tsx +19 -22
- package/src/components/Globe/Globe.tsx +1 -1
- package/src/components/Graph/CanvasForceGraph.stories.tsx +83 -0
- package/src/components/Graph/CanvasForceGraph.tsx +124 -0
- package/src/components/Graph/ForceGraph.stories.tsx +83 -44
- package/src/components/Graph/ForceGraph.tsx +104 -85
- package/src/components/Graph/{adapter.ts → graph-adapter.ts} +14 -8
- package/src/components/Graph/index.ts +1 -1
- package/src/components/Lattice/Lattice.stories.tsx +90 -0
- package/src/components/Lattice/Lattice.tsx +182 -0
- package/src/components/Lattice/index.ts +5 -0
- package/src/components/Tree/EdgeBundling.stories.tsx +144 -0
- package/src/components/Tree/Tree.stories.tsx +20 -38
- package/src/components/Tree/Tree.tsx +69 -95
- package/src/components/Tree/index.ts +2 -0
- package/src/components/Tree/layout/HierarchicalEdgeBundling.tsx +296 -0
- package/src/components/Tree/layout/RadialTree.tsx +242 -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/types/tree.test.ts +6 -5
- package/src/components/Tree/types/tree.ts +41 -20
- package/src/components/Tree/types/types.ts +38 -29
- package/src/components/index.ts +1 -4
- package/src/containers/ExplorerArticle/ExplorerArticle.stories.tsx +136 -0
- package/src/containers/ExplorerArticle/ExplorerArticle.tsx +465 -0
- package/src/containers/ExplorerArticle/experimental.stories.tsx +446 -0
- package/src/containers/ExplorerArticle/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/hooks/useGraphModel.ts +25 -14
- package/src/index.ts +1 -4
- package/src/meta.ts +4 -4
- package/src/plugin.ts +9 -0
- package/src/{components/Tree/testing → testing}/generator.ts +5 -3
- package/src/testing/index.ts +9 -0
- package/src/testing/relations.ts +192 -0
- package/src/translations.ts +14 -13
- package/src/types/ExplorerAction.ts +1 -18
- package/src/types/Graph.ts +13 -28
- package/src/typings.d.ts +8 -0
- package/src/util/index.ts +6 -0
- package/src/util/node-color.ts +23 -0
- package/src/{components → util}/plot.ts +16 -4
- package/dist/lib/browser/ExplorerContainer-NOLLVUTE.mjs +0 -50
- package/dist/lib/browser/ExplorerContainer-NOLLVUTE.mjs.map +0 -7
- package/dist/lib/browser/chunk-2MKBRIUT.mjs +0 -31
- package/dist/lib/browser/chunk-2MKBRIUT.mjs.map +0 -7
- package/dist/lib/browser/chunk-6BVXZQPP.mjs +0 -188
- package/dist/lib/browser/chunk-6BVXZQPP.mjs.map +0 -7
- package/dist/lib/browser/chunk-ARBGXQFH.mjs.map +0 -7
- package/dist/lib/browser/chunk-P6FFFVPM.mjs +0 -100
- package/dist/lib/browser/chunk-P6FFFVPM.mjs.map +0 -7
- package/dist/lib/browser/chunk-UBHZGWZQ.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -112
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-EWB3H5KH.mjs +0 -35
- package/dist/lib/browser/intent-resolver-EWB3H5KH.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-BY2DYCTH.mjs +0 -34
- package/dist/lib/browser/react-surface-BY2DYCTH.mjs.map +0 -7
- package/dist/lib/node-esm/ExplorerContainer-N3S5KSUX.mjs +0 -51
- package/dist/lib/node-esm/ExplorerContainer-N3S5KSUX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3ODK27PU.mjs +0 -33
- package/dist/lib/node-esm/chunk-3ODK27PU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4BY2XZET.mjs +0 -101
- package/dist/lib/node-esm/chunk-4BY2XZET.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CRSVAZNA.mjs +0 -190
- package/dist/lib/node-esm/chunk-CRSVAZNA.mjs.map +0 -7
- 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-NPIP4VEH.mjs +0 -11091
- package/dist/lib/node-esm/chunk-NPIP4VEH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UXZM5VJB.mjs +0 -26
- package/dist/lib/node-esm/chunk-UXZM5VJB.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -113
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-SH6PW7VF.mjs +0 -36
- package/dist/lib/node-esm/intent-resolver-SH6PW7VF.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/react-surface-7AAV7GBG.mjs +0 -35
- package/dist/lib/node-esm/react-surface-7AAV7GBG.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -12
- 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/components/ExplorerContainer.d.ts +0 -9
- package/dist/types/src/components/ExplorerContainer.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/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/components/Tree/testing/generator.d.ts.map +0 -1
- package/dist/types/src/components/Tree/testing/index.d.ts +0 -2
- package/dist/types/src/components/Tree/testing/index.d.ts.map +0 -1
- package/dist/types/src/components/plot.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -23
- package/src/components/ExplorerContainer.tsx +0 -54
- package/src/components/Graph/D3ForceGraph.stories.tsx +0 -80
- package/src/components/Graph/D3ForceGraph.tsx +0 -101
- package/src/components/Graph/testing.ts +0 -55
- 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/components/Tree/testing/index.ts +0 -5
- /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ExplorerPlugin.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/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/meta.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/types/index.mjs.map +0 -0
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2022 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getNodeFillForObject
|
|
3
|
+
} from "./chunk-V2OFO6PI.mjs";
|
|
4
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/containers/ExplorerArticle/ExplorerArticle.tsx
|
|
7
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
8
|
+
import { Obj } from "@dxos/echo";
|
|
9
|
+
import { QueryBuilder } from "@dxos/echo-query";
|
|
10
|
+
import { useObject } from "@dxos/react-client/echo";
|
|
11
|
+
import { DxAnchorActivate, Icon, Panel, Toolbar } from "@dxos/react-ui";
|
|
12
|
+
import { QueryEditor } from "@dxos/react-ui-components";
|
|
13
|
+
import { CLUSTER_NODE_TYPE_GROUP, CLUSTER_NODE_TYPE_LEAF, CLUSTER_NODE_TYPE_ROOT, GraphBundleProjector, GraphClusterProjector, GraphForceProjector, GraphLatticeProjector, SVG } from "@dxos/react-ui-graph";
|
|
14
|
+
import "@dxos/react-ui-graph/styles/graph.css";
|
|
15
|
+
import { useGraphModel } from "#hooks";
|
|
16
|
+
var VARIANTS = [
|
|
17
|
+
{
|
|
18
|
+
value: "force",
|
|
19
|
+
icon: "ph--graph--regular",
|
|
20
|
+
label: "Force-directed"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: "cluster",
|
|
24
|
+
icon: "ph--asterisk-simple--regular",
|
|
25
|
+
label: "Radial cluster"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: "bundle",
|
|
29
|
+
icon: "ph--circles-three-plus--regular",
|
|
30
|
+
label: "Edge bundling"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: "lattice",
|
|
34
|
+
icon: "ph--grid-four--regular",
|
|
35
|
+
label: "Lattice"
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
var ExplorerArticle = ({ role, subject, variant }) => {
|
|
39
|
+
const [view] = useObject(subject);
|
|
40
|
+
const db = view && Obj.getDatabase(view);
|
|
41
|
+
const [filter, setFilter] = useState();
|
|
42
|
+
const model = useGraphModel(db, filter);
|
|
43
|
+
const builder = useMemo(() => new QueryBuilder(), []);
|
|
44
|
+
const handleChange = useCallback((value) => {
|
|
45
|
+
setFilter(builder.build(value).filter);
|
|
46
|
+
}, []);
|
|
47
|
+
const [selected, setSelected] = useState(isVariant(variant) ? variant : "force");
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (isVariant(variant)) {
|
|
50
|
+
setSelected(variant);
|
|
51
|
+
}
|
|
52
|
+
}, [
|
|
53
|
+
variant
|
|
54
|
+
]);
|
|
55
|
+
const handleVariantChange = useCallback((value) => {
|
|
56
|
+
if (isVariant(value)) {
|
|
57
|
+
setSelected(value);
|
|
58
|
+
}
|
|
59
|
+
}, []);
|
|
60
|
+
const handleHoverPreview = useCallback((node, event) => {
|
|
61
|
+
if (!node || !event) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const obj = node.data;
|
|
65
|
+
if (!obj || !Obj.isObject(obj)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const dxn = Obj.getDXN(obj)?.toString();
|
|
69
|
+
if (!dxn) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const target = event.target;
|
|
73
|
+
target.dispatchEvent(new DxAnchorActivate({
|
|
74
|
+
dxn,
|
|
75
|
+
label: Obj.getLabel(obj) ?? dxn,
|
|
76
|
+
trigger: target,
|
|
77
|
+
kind: "card"
|
|
78
|
+
}));
|
|
79
|
+
}, []);
|
|
80
|
+
const showToolbar = role === "article";
|
|
81
|
+
if (!db || !model) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return /* @__PURE__ */ React.createElement(Panel.Root, {
|
|
85
|
+
role
|
|
86
|
+
}, showToolbar && /* @__PURE__ */ React.createElement(Panel.Toolbar, {
|
|
87
|
+
asChild: true
|
|
88
|
+
}, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(QueryEditor, {
|
|
89
|
+
db,
|
|
90
|
+
onChange: handleChange
|
|
91
|
+
}), /* @__PURE__ */ React.createElement(Toolbar.ToggleGroup, {
|
|
92
|
+
type: "single",
|
|
93
|
+
value: selected,
|
|
94
|
+
onValueChange: handleVariantChange
|
|
95
|
+
}, VARIANTS.map(({ value, icon, label }) => /* @__PURE__ */ React.createElement(Toolbar.ToggleGroupItem, {
|
|
96
|
+
key: value,
|
|
97
|
+
value,
|
|
98
|
+
"aria-label": label,
|
|
99
|
+
title: label
|
|
100
|
+
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
101
|
+
icon,
|
|
102
|
+
size: 4
|
|
103
|
+
})))))), /* @__PURE__ */ React.createElement(Panel.Content, null, /* @__PURE__ */ React.createElement(Visualization, {
|
|
104
|
+
variant: selected,
|
|
105
|
+
model,
|
|
106
|
+
onNodeHover: handleHoverPreview
|
|
107
|
+
})));
|
|
108
|
+
};
|
|
109
|
+
var isVariant = (value) => value === "force" || value === "cluster" || value === "bundle" || value === "lattice";
|
|
110
|
+
var Visualization = ({ variant, model, onNodeHover }) => {
|
|
111
|
+
const svgRef = useRef(null);
|
|
112
|
+
const [projector, setProjector] = useState();
|
|
113
|
+
const projectorRef = useRef(void 0);
|
|
114
|
+
projectorRef.current = projector;
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (!svgRef.current) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const prev = projectorRef.current?.layout;
|
|
120
|
+
setProjector(createProjector(variant, svgRef.current, prev));
|
|
121
|
+
}, [
|
|
122
|
+
variant
|
|
123
|
+
]);
|
|
124
|
+
const renderNode = useMemo(() => createRenderNode(variant), [
|
|
125
|
+
variant
|
|
126
|
+
]);
|
|
127
|
+
const handleInspect = useCallback((node, event) => {
|
|
128
|
+
if (!node) {
|
|
129
|
+
onNodeHover?.(null);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
onNodeHover?.({
|
|
133
|
+
id: node.id,
|
|
134
|
+
data: node.data?.data?.object
|
|
135
|
+
}, event);
|
|
136
|
+
}, [
|
|
137
|
+
onNodeHover
|
|
138
|
+
]);
|
|
139
|
+
const handleSelect = useCallback((node) => {
|
|
140
|
+
if (variant !== "cluster" || !node || node.type !== CLUSTER_NODE_TYPE_ROOT && node.type !== CLUSTER_NODE_TYPE_GROUP) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const cluster = projector;
|
|
144
|
+
cluster?.toggleCollapsed(node.id);
|
|
145
|
+
}, [
|
|
146
|
+
variant,
|
|
147
|
+
projector
|
|
148
|
+
]);
|
|
149
|
+
const inner = /* @__PURE__ */ React.createElement(SVG.Graph, {
|
|
150
|
+
model,
|
|
151
|
+
projector,
|
|
152
|
+
renderNode,
|
|
153
|
+
drag: variant === "force",
|
|
154
|
+
onInspect: handleInspect,
|
|
155
|
+
onSelect: handleSelect
|
|
156
|
+
});
|
|
157
|
+
return /* @__PURE__ */ React.createElement(SVG.Root, {
|
|
158
|
+
ref: svgRef
|
|
159
|
+
}, variant === "force" ? /* @__PURE__ */ React.createElement(SVG.Zoom, {
|
|
160
|
+
extent: [
|
|
161
|
+
1 / 2,
|
|
162
|
+
2
|
|
163
|
+
]
|
|
164
|
+
}, inner) : inner);
|
|
165
|
+
};
|
|
166
|
+
var TWEEN_MS = 500;
|
|
167
|
+
var createProjector = (variant, ctx, prev) => {
|
|
168
|
+
switch (variant) {
|
|
169
|
+
case "force":
|
|
170
|
+
return new GraphForceProjector(ctx, void 0, void 0, prev);
|
|
171
|
+
case "lattice":
|
|
172
|
+
return new GraphLatticeProjector(ctx, {
|
|
173
|
+
duration: TWEEN_MS,
|
|
174
|
+
// Plugin-explorer overrides the projector's force-matched default (6)
|
|
175
|
+
// with a smaller node so the lattice reads as a dense matrix.
|
|
176
|
+
radius: 4,
|
|
177
|
+
// Cluster by typename first so same-type rects sit together; break ties by label.
|
|
178
|
+
sortBy: (node) => {
|
|
179
|
+
const obj = node.data?.data?.object;
|
|
180
|
+
const typename = obj ? Obj.getTypename(obj) ?? "(untyped)" : "(untyped)";
|
|
181
|
+
const label = (obj && Obj.getLabel(obj)) ?? node.data?.data?.label ?? node.id;
|
|
182
|
+
return `${typename} ${label}`;
|
|
183
|
+
}
|
|
184
|
+
}, void 0, prev);
|
|
185
|
+
case "cluster":
|
|
186
|
+
return new GraphClusterProjector(ctx, {
|
|
187
|
+
duration: TWEEN_MS,
|
|
188
|
+
groupOf: typenameGroupOf,
|
|
189
|
+
rootLabel: "Database",
|
|
190
|
+
groupLabel: shortTypename,
|
|
191
|
+
// All three node kinds share the same radius — leaves, groups, and root read
|
|
192
|
+
// as members of the same circle rather than ranked by size.
|
|
193
|
+
rootRadius: 4,
|
|
194
|
+
groupRadius: 4
|
|
195
|
+
}, void 0, prev);
|
|
196
|
+
case "bundle":
|
|
197
|
+
return new GraphBundleProjector(ctx, {
|
|
198
|
+
duration: TWEEN_MS,
|
|
199
|
+
groupOf: typenameGroupOf
|
|
200
|
+
}, void 0, prev);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
var typenameGroupOf = (node) => {
|
|
204
|
+
const obj = node.data?.data?.object;
|
|
205
|
+
return obj ? Obj.getTypename(obj) ?? "(untyped)" : void 0;
|
|
206
|
+
};
|
|
207
|
+
var createRenderNode = (variant) => {
|
|
208
|
+
switch (variant) {
|
|
209
|
+
case "force":
|
|
210
|
+
return (group, node) => {
|
|
211
|
+
const r = node.r ?? 6;
|
|
212
|
+
group.append("circle").attr("r", r).style("cursor", "pointer").style("fill", getNodeFillForObject(node.data?.data?.object));
|
|
213
|
+
};
|
|
214
|
+
case "lattice":
|
|
215
|
+
return (group, node) => {
|
|
216
|
+
const r = node.r ?? 6;
|
|
217
|
+
const size = r * 2;
|
|
218
|
+
group.append("rect").attr("x", -r).attr("y", -r).attr("width", size).attr("height", size).attr("rx", r * 0.3).attr("ry", r * 0.3).style("cursor", "pointer").style("fill", getNodeFillForObject(node.data?.data?.object));
|
|
219
|
+
};
|
|
220
|
+
case "cluster":
|
|
221
|
+
return (group, node) => {
|
|
222
|
+
const obj = node.data?.data?.object;
|
|
223
|
+
const r = node.r ?? 4;
|
|
224
|
+
group.append("circle").attr("r", r).style("cursor", "pointer").style("fill", obj ? getNodeFillForObject(obj) : "var(--color-neutral-500)");
|
|
225
|
+
if (node.type === CLUSTER_NODE_TYPE_LEAF) {
|
|
226
|
+
appendRadialLeafLabel(group, node, obj, r);
|
|
227
|
+
} else if (node.type === CLUSTER_NODE_TYPE_ROOT) {
|
|
228
|
+
appendRootLabel(group, node, r);
|
|
229
|
+
} else if (node.type === CLUSTER_NODE_TYPE_GROUP) {
|
|
230
|
+
appendRadialGroupLabel(group, node, r);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
case "bundle":
|
|
234
|
+
return (group, node) => {
|
|
235
|
+
const obj = node.data?.data?.object;
|
|
236
|
+
const r = node.r ?? 4;
|
|
237
|
+
group.append("circle").attr("r", r).style("cursor", "pointer").style("fill", obj ? getNodeFillForObject(obj) : "var(--color-neutral-500)");
|
|
238
|
+
appendRadialLeafLabel(group, node, obj, r);
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
var LABEL_FADE_MS = 200;
|
|
243
|
+
var appendRadialLeafLabel = (group, node, obj, r) => {
|
|
244
|
+
const label = (obj && Obj.getLabel(obj)) ?? node.data?.data?.label ?? node.id;
|
|
245
|
+
if (!label) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const targetX = node.tx ?? node.x ?? 0;
|
|
249
|
+
const targetY = node.ty ?? node.y ?? 0;
|
|
250
|
+
const angleDeg = Math.atan2(targetY, targetX) * 180 / Math.PI;
|
|
251
|
+
const flipped = angleDeg > 90 || angleDeg < -90;
|
|
252
|
+
group.append("text").classed("dx-cluster-label", true).attr("dy", "0.32em").attr("transform", `rotate(${flipped ? angleDeg + 180 : angleDeg})`).attr("x", flipped ? -(r + 4) : r + 4).attr("text-anchor", flipped ? "end" : "start").attr("opacity", 0).style("pointer-events", "none").text(label).transition().delay(TWEEN_MS).duration(LABEL_FADE_MS).attr("opacity", 1);
|
|
253
|
+
};
|
|
254
|
+
var appendRadialGroupLabel = (group, node, r) => {
|
|
255
|
+
if (!node.label) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
const targetX = node.tx ?? node.x ?? 0;
|
|
259
|
+
const targetY = node.ty ?? node.y ?? 0;
|
|
260
|
+
const angleDeg = Math.atan2(targetY, targetX) * 180 / Math.PI;
|
|
261
|
+
const flipped = angleDeg > 90 || angleDeg < -90;
|
|
262
|
+
group.append("text").classed("dx-cluster-label", true).classed("dx-cluster-label-group", true).attr("dy", "0.32em").attr("transform", `rotate(${flipped ? angleDeg + 180 : angleDeg})`).attr("x", flipped ? r + 4 : -(r + 4)).attr("text-anchor", flipped ? "start" : "end").attr("opacity", 0).style("pointer-events", "none").text(node.label).transition().delay(TWEEN_MS).duration(LABEL_FADE_MS).attr("opacity", 1);
|
|
263
|
+
};
|
|
264
|
+
var appendRootLabel = (group, node, r) => {
|
|
265
|
+
if (!node.label) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
group.append("text").classed("dx-cluster-label", true).classed("dx-cluster-label-root", true).attr("text-anchor", "middle").attr("y", -(r + 6)).attr("opacity", 0).style("pointer-events", "none").text(node.label).transition().delay(TWEEN_MS).duration(LABEL_FADE_MS).attr("opacity", 1);
|
|
269
|
+
};
|
|
270
|
+
var shortTypename = (typename) => {
|
|
271
|
+
const last = typename.split(".").pop() ?? typename;
|
|
272
|
+
return last.charAt(0).toUpperCase() + last.slice(1);
|
|
273
|
+
};
|
|
274
|
+
export {
|
|
275
|
+
ExplorerArticle as default
|
|
276
|
+
};
|
|
277
|
+
//# sourceMappingURL=ExplorerArticle-EAKRB55W.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/ExplorerArticle/ExplorerArticle.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { type Filter, Obj, type View } from '@dxos/echo';\nimport { QueryBuilder } from '@dxos/echo-query';\nimport { useObject } from '@dxos/react-client/echo';\nimport { DxAnchorActivate, Icon, Panel, Toolbar } from '@dxos/react-ui';\nimport { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';\nimport {\n CLUSTER_NODE_TYPE_GROUP,\n CLUSTER_NODE_TYPE_LEAF,\n CLUSTER_NODE_TYPE_ROOT,\n GraphBundleProjector,\n GraphClusterProjector,\n GraphForceProjector,\n type GraphLayout,\n type GraphLayoutNode,\n GraphLatticeProjector,\n type GraphProjector,\n type RenderNode,\n SVG,\n type SVGContext,\n} from '@dxos/react-ui-graph';\nimport { type SpaceGraphEdge, type SpaceGraphNode } from '@dxos/schema';\n// Side-effect import: ExplorerArticle drives `SVG.Graph` directly (previously the CSS\n// was pulled in transitively via `ForceGraph.tsx`, which we no longer use). Without it\n// the `g.dx-edge path` rules — including `fill: none` — never reach the bundle and SVG\n// defaults (stroke: none, fill: black) make every edge invisible.\nimport '@dxos/react-ui-graph/styles/graph.css';\n\nimport { type TreeNode } from '#components';\nimport { useGraphModel } from '#hooks';\n\nimport { getNodeFillForObject } from '../../util/node-color';\n\n/** Visualization variants exposed by `ExplorerArticle`. */\nexport type ExplorerArticleVariant = 'force' | 'cluster' | 'bundle' | 'lattice';\n\nconst VARIANTS: { value: ExplorerArticleVariant; icon: string; label: string }[] = [\n {\n value: 'force',\n icon: 'ph--graph--regular',\n label: 'Force-directed',\n },\n {\n value: 'cluster',\n icon: 'ph--asterisk-simple--regular',\n label: 'Radial cluster',\n },\n {\n value: 'bundle',\n icon: 'ph--circles-three-plus--regular',\n label: 'Edge bundling',\n },\n {\n value: 'lattice',\n icon: 'ph--grid-four--regular',\n label: 'Lattice',\n },\n];\n\nexport type ExplorerArticleProps = AppSurface.ObjectArticleProps<View.View>;\n\nexport const ExplorerArticle = ({ role, subject, variant }: ExplorerArticleProps) => {\n const [view] = useObject(subject);\n const db = view && Obj.getDatabase(view);\n const [filter, setFilter] = useState<Filter.Any>();\n const model = useGraphModel(db, filter);\n\n const builder = useMemo(() => new QueryBuilder(), []);\n const handleChange = useCallback<NonNullable<QueryEditorProps['onChange']>>((value) => {\n setFilter(builder.build(value).filter);\n }, []);\n\n // The `variant` prop is the initial value; user can toggle via the toolbar tabs.\n const [selected, setSelected] = useState<ExplorerArticleVariant>(isVariant(variant) ? variant : 'force');\n useEffect(() => {\n if (isVariant(variant)) {\n setSelected(variant);\n }\n }, [variant]);\n const handleVariantChange = useCallback((value: string) => {\n if (isVariant(value)) {\n setSelected(value);\n }\n }, []);\n\n const handleHoverPreview = useCallback((node: TreeNode | null, event?: MouseEvent) => {\n if (!node || !event) {\n return;\n }\n const obj = node.data;\n if (!obj || !Obj.isObject(obj)) {\n return;\n }\n const dxn = Obj.getDXN(obj)?.toString();\n if (!dxn) {\n return;\n }\n const target = event.target as HTMLElement;\n target.dispatchEvent(\n new DxAnchorActivate({\n dxn,\n label: Obj.getLabel(obj) ?? dxn,\n trigger: target,\n kind: 'card',\n }),\n );\n }, []);\n\n const showToolbar = role === 'article';\n\n if (!db || !model) {\n return null;\n }\n\n return (\n <Panel.Root role={role}>\n {showToolbar && (\n <Panel.Toolbar asChild>\n <Toolbar.Root>\n <QueryEditor db={db} onChange={handleChange} />\n <Toolbar.ToggleGroup type='single' value={selected} onValueChange={handleVariantChange}>\n {VARIANTS.map(({ value, icon, label }) => (\n <Toolbar.ToggleGroupItem key={value} value={value} aria-label={label} title={label}>\n <Icon icon={icon} size={4} />\n </Toolbar.ToggleGroupItem>\n ))}\n </Toolbar.ToggleGroup>\n </Toolbar.Root>\n </Panel.Toolbar>\n )}\n <Panel.Content>\n <Visualization variant={selected} model={model} onNodeHover={handleHoverPreview} />\n </Panel.Content>\n </Panel.Root>\n );\n};\n\nconst isVariant = (value: unknown): value is ExplorerArticleVariant =>\n value === 'force' || value === 'cluster' || value === 'bundle' || value === 'lattice';\n\ntype VisualizationProps = {\n variant: ExplorerArticleVariant;\n model: NonNullable<ReturnType<typeof useGraphModel>>;\n onNodeHover?: (node: TreeNode | null, event?: MouseEvent) => void;\n};\n\n/**\n * One persistent `<SVG.Graph>` mount for all four variants. When the variant\n * changes, a new projector is instantiated and seeded with the previous\n * projector's layout so node x/y survive the swap — the new projector's\n * `animate()` then tweens each node from its current position to the new\n * target, and per-frame edge generators (cluster, bundle) keep curves glued\n * to the moving endpoints.\n */\nconst Visualization = ({ variant, model, onNodeHover }: VisualizationProps) => {\n const svgRef = useRef<SVGContext>(null);\n const [projector, setProjector] = useState<GraphProjector<SpaceGraphNode> | undefined>();\n const projectorRef = useRef<GraphProjector<SpaceGraphNode> | undefined>(undefined);\n projectorRef.current = projector;\n\n // Recreate the projector when the variant changes. Pass the previous projector's\n // layout to the constructor so existing node x/y persist across the swap, then\n // the new projector's animate() tweens to its target positions.\n useEffect(() => {\n if (!svgRef.current) {\n return;\n }\n const prev = projectorRef.current?.layout as GraphLayout<SpaceGraphNode> | undefined;\n setProjector(createProjector(variant, svgRef.current, prev));\n }, [variant]);\n\n const renderNode = useMemo(() => createRenderNode(variant), [variant]);\n\n const handleInspect = useCallback(\n (node: GraphLayoutNode<SpaceGraphNode> | null, event: MouseEvent) => {\n // null = pointerleave: forward to the shared hover handler so it can clear any preview.\n if (!node) {\n onNodeHover?.(null);\n return;\n }\n onNodeHover?.({ id: node.id, data: node.data?.data?.object }, event);\n },\n [onNodeHover],\n );\n\n // Cluster-only: clicking a root / group node toggles its subtree open/closed.\n const handleSelect = useCallback(\n (node: GraphLayoutNode<SpaceGraphNode>) => {\n if (\n variant !== 'cluster' ||\n !node ||\n (node.type !== CLUSTER_NODE_TYPE_ROOT && node.type !== CLUSTER_NODE_TYPE_GROUP)\n ) {\n return;\n }\n const cluster = projector as GraphClusterProjector<SpaceGraphNode> | undefined;\n cluster?.toggleCollapsed(node.id);\n },\n [variant, projector],\n );\n\n // Force needs SVG.Zoom (drag interaction). Cluster/lattice don't, AND including the zoom\n // wrapper makes their curve edges render incorrectly in some contexts (see iteration\n // history in graph-cluster-projector.ts). So mount with vs. without zoom conditionally.\n const inner = (\n <SVG.Graph<SpaceGraphNode, SpaceGraphEdge>\n model={model}\n projector={projector}\n renderNode={renderNode}\n drag={variant === 'force'}\n onInspect={handleInspect}\n onSelect={handleSelect}\n />\n );\n return (\n <SVG.Root ref={svgRef}>{variant === 'force' ? <SVG.Zoom extent={[1 / 2, 2]}>{inner}</SVG.Zoom> : inner}</SVG.Root>\n );\n};\n\n/** Cross-variant tween duration. Matches the renderer's edge fade timing so node\n * movement and edge enter/exit complete together. */\nconst TWEEN_MS = 500;\n\nconst createProjector = (\n variant: ExplorerArticleVariant,\n ctx: SVGContext,\n prev?: GraphLayout<SpaceGraphNode>,\n): GraphProjector<SpaceGraphNode> => {\n switch (variant) {\n case 'force':\n // Force has no `duration` — its own simulation drives motion via ticks.\n return new GraphForceProjector<SpaceGraphNode>(ctx, undefined, undefined, prev);\n case 'lattice':\n return new GraphLatticeProjector<SpaceGraphNode>(\n ctx,\n {\n duration: TWEEN_MS,\n // Plugin-explorer overrides the projector's force-matched default (6)\n // with a smaller node so the lattice reads as a dense matrix.\n radius: 4,\n // Cluster by typename first so same-type rects sit together; break ties by label.\n sortBy: (node: GraphLayoutNode<SpaceGraphNode>) => {\n const obj = node.data?.data?.object;\n const typename = obj ? (Obj.getTypename(obj) ?? '(untyped)') : '(untyped)';\n const label = (obj && Obj.getLabel(obj)) ?? node.data?.data?.label ?? node.id;\n return `${typename} ${label}`;\n },\n },\n undefined,\n prev,\n );\n case 'cluster':\n return new GraphClusterProjector<SpaceGraphNode>(\n ctx,\n {\n duration: TWEEN_MS,\n groupOf: typenameGroupOf,\n rootLabel: 'Database',\n groupLabel: shortTypename,\n // All three node kinds share the same radius — leaves, groups, and root read\n // as members of the same circle rather than ranked by size.\n rootRadius: 4,\n groupRadius: 4,\n },\n undefined,\n prev,\n );\n case 'bundle':\n return new GraphBundleProjector<SpaceGraphNode>(\n ctx,\n {\n duration: TWEEN_MS,\n groupOf: typenameGroupOf,\n },\n undefined,\n prev,\n );\n }\n};\n\n/** Group leaves by typename so same-type leaves cluster together — used by both the\n * cluster (visible structural nodes) and bundle (invisible routing anchors) projectors. */\nconst typenameGroupOf = (node: GraphLayoutNode<SpaceGraphNode>): string | undefined => {\n const obj = node.data?.data?.object;\n return obj ? (Obj.getTypename(obj) ?? '(untyped)') : undefined;\n};\n\nconst createRenderNode = (variant: ExplorerArticleVariant): RenderNode<SpaceGraphNode> | undefined => {\n switch (variant) {\n case 'force':\n return (group, node) => {\n const r = node.r ?? 6;\n group\n .append('circle')\n .attr('r', r)\n .style('cursor', 'pointer')\n .style('fill', getNodeFillForObject(node.data?.data?.object as Obj.Unknown | undefined));\n };\n case 'lattice':\n return (group, node) => {\n const r = node.r ?? 6;\n const size = r * 2;\n group\n .append('rect')\n .attr('x', -r)\n .attr('y', -r)\n .attr('width', size)\n .attr('height', size)\n .attr('rx', r * 0.3)\n .attr('ry', r * 0.3)\n .style('cursor', 'pointer')\n .style('fill', getNodeFillForObject(node.data?.data?.object as Obj.Unknown | undefined));\n };\n case 'cluster':\n return (group, node) => {\n const obj = node.data?.data?.object as Obj.Unknown | undefined;\n const r = node.r ?? 4;\n // Synthetic root / group nodes have no underlying ECHO object; render them as\n // smaller, neutral circles so the hierarchy reads as \"structure + leaves\".\n group\n .append('circle')\n .attr('r', r)\n .style('cursor', 'pointer')\n .style('fill', obj ? getNodeFillForObject(obj) : 'var(--color-neutral-500)');\n if (node.type === CLUSTER_NODE_TYPE_LEAF) {\n appendRadialLeafLabel(group, node, obj, r);\n } else if (node.type === CLUSTER_NODE_TYPE_ROOT) {\n appendRootLabel(group, node, r);\n } else if (node.type === CLUSTER_NODE_TYPE_GROUP) {\n appendRadialGroupLabel(group, node, r);\n }\n };\n case 'bundle':\n // Bundle layout renders ONLY leaves (root/group are invisible routing anchors).\n // Every node here is a leaf — same circle + radial label shape as cluster.\n return (group, node) => {\n const obj = node.data?.data?.object as Obj.Unknown | undefined;\n const r = node.r ?? 4;\n group\n .append('circle')\n .attr('r', r)\n .style('cursor', 'pointer')\n .style('fill', obj ? getNodeFillForObject(obj) : 'var(--color-neutral-500)');\n appendRadialLeafLabel(group, node, obj, r);\n };\n }\n};\n\n/** Fade-in duration applied to labels after the layout tween completes. */\nconst LABEL_FADE_MS = 200;\n\n/**\n * Append a radial leaf label outside the ring, oriented outward. Compute orientation\n * from the TARGET position (tx/ty) — at enter time node.x/y is still at the previous\n * projector's coordinates, so using current x/y would orient the label by the\n * pre-transition layout (wrong) and the rotation wouldn't update during the tween.\n *\n * Label appears with opacity 0 and fades in after a `TWEEN_MS` delay so the text isn't\n * sliding across the screen mid-tween — leaves first, labels after.\n */\nconst appendRadialLeafLabel = (\n group: Parameters<RenderNode<SpaceGraphNode>>[0],\n node: GraphLayoutNode<SpaceGraphNode>,\n obj: Obj.Unknown | undefined,\n r: number,\n): void => {\n const label = (obj && Obj.getLabel(obj)) ?? node.data?.data?.label ?? node.id;\n if (!label) {\n return;\n }\n const targetX = (node as any).tx ?? node.x ?? 0;\n const targetY = (node as any).ty ?? node.y ?? 0;\n const angleDeg = (Math.atan2(targetY, targetX) * 180) / Math.PI;\n // Flip text 180° on the left half of the layout so it still reads left-to-right.\n const flipped = angleDeg > 90 || angleDeg < -90;\n group\n .append('text')\n .classed('dx-cluster-label', true)\n .attr('dy', '0.32em')\n .attr('transform', `rotate(${flipped ? angleDeg + 180 : angleDeg})`)\n .attr('x', flipped ? -(r + 4) : r + 4)\n .attr('text-anchor', flipped ? 'end' : 'start')\n .attr('opacity', 0)\n .style('pointer-events', 'none')\n .text(label)\n .transition()\n .delay(TWEEN_MS)\n .duration(LABEL_FADE_MS)\n .attr('opacity', 1);\n};\n\n/**\n * Append a radial label INSIDE the ring (toward origin) for a synthetic group node.\n * Same rotation/flip rules as the leaf label, but offset and anchor inverted so the\n * text reads from the group circle back toward the center rather than outward.\n */\nconst appendRadialGroupLabel = (\n group: Parameters<RenderNode<SpaceGraphNode>>[0],\n node: GraphLayoutNode<SpaceGraphNode>,\n r: number,\n): void => {\n if (!node.label) {\n return;\n }\n const targetX = (node as any).tx ?? node.x ?? 0;\n const targetY = (node as any).ty ?? node.y ?? 0;\n const angleDeg = (Math.atan2(targetY, targetX) * 180) / Math.PI;\n const flipped = angleDeg > 90 || angleDeg < -90;\n group\n .append('text')\n .classed('dx-cluster-label', true)\n .classed('dx-cluster-label-group', true)\n .attr('dy', '0.32em')\n .attr('transform', `rotate(${flipped ? angleDeg + 180 : angleDeg})`)\n // Inverse of the leaf offset / anchor — push the text inward, toward the origin.\n .attr('x', flipped ? r + 4 : -(r + 4))\n .attr('text-anchor', flipped ? 'start' : 'end')\n .attr('opacity', 0)\n .style('pointer-events', 'none')\n .text(node.label)\n .transition()\n .delay(TWEEN_MS)\n .duration(LABEL_FADE_MS)\n .attr('opacity', 1);\n};\n\n/**\n * Append a centered label below the root node. Root sits at origin where there's no\n * meaningful radial direction; render the label as a plain horizontal caption with\n * the standard halo style.\n */\nconst appendRootLabel = (\n group: Parameters<RenderNode<SpaceGraphNode>>[0],\n node: GraphLayoutNode<SpaceGraphNode>,\n r: number,\n): void => {\n if (!node.label) {\n return;\n }\n group\n .append('text')\n .classed('dx-cluster-label', true)\n .classed('dx-cluster-label-root', true)\n .attr('text-anchor', 'middle')\n .attr('y', -(r + 6))\n .attr('opacity', 0)\n .style('pointer-events', 'none')\n .text(node.label)\n .transition()\n .delay(TWEEN_MS)\n .duration(LABEL_FADE_MS)\n .attr('opacity', 1);\n};\n\n/** Drop the package prefix from a typename for display: `org.dxos.type.Person` → `Person`. */\nconst shortTypename = (typename: string): string => {\n const last = typename.split('.').pop() ?? typename;\n return last.charAt(0).toUpperCase() + last.slice(1);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,OAAOA,SAASC,aAAaC,WAAWC,SAASC,QAAQC,gBAAgB;AAGzE,SAAsBC,WAAsB;AAC5C,SAASC,oBAAoB;AAC7B,SAASC,iBAAiB;AAC1B,SAASC,kBAAkBC,MAAMC,OAAOC,eAAe;AACvD,SAASC,mBAA0C;AACnD,SACEC,yBACAC,wBACAC,wBACAC,sBACAC,uBACAC,qBAGAC,uBAGAC,WAEK;AAMP,OAAO;AAGP,SAASC,qBAAqB;AAO9B,IAAMC,WAA6E;EACjF;IACEC,OAAO;IACPC,MAAM;IACNC,OAAO;EACT;EACA;IACEF,OAAO;IACPC,MAAM;IACNC,OAAO;EACT;EACA;IACEF,OAAO;IACPC,MAAM;IACNC,OAAO;EACT;EACA;IACEF,OAAO;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;AAEA,MAAI,CAAClF,KAAK3B,OAAO;AACf;EACF;AACA4G,QACGE,OAAO,MAAA,EACPoB,QAAQ,oBAAoB,IAAA,EAC5BA,QAAQ,yBAAyB,IAAA,EACjCnB,KAAK,eAAe,QAAA,EACpBA,KAAK,KAAK,EAAEF,IAAI,EAAA,EAChBE,KAAK,WAAW,CAAA,EAChBC,MAAM,kBAAkB,MAAA,EACxBmB,KAAKxG,KAAK3B,KAAK,EACfoI,WAAU,EACVC,MAAM3C,QAAAA,EACNI,SAASwB,aAAAA,EACTP,KAAK,WAAW,CAAA;AACrB;AAGA,IAAMP,gBAAgB,CAACP,aAAAA;AACrB,QAAMqC,OAAOrC,SAASsC,MAAM,GAAA,EAAKC,IAAG,KAAMvC;AAC1C,SAAOqC,KAAKG,OAAO,CAAA,EAAGC,YAAW,IAAKJ,KAAKK,MAAM,CAAA;AACnD;",
|
|
6
|
+
"names": ["React", "useCallback", "useEffect", "useMemo", "useRef", "useState", "Obj", "QueryBuilder", "useObject", "DxAnchorActivate", "Icon", "Panel", "Toolbar", "QueryEditor", "CLUSTER_NODE_TYPE_GROUP", "CLUSTER_NODE_TYPE_LEAF", "CLUSTER_NODE_TYPE_ROOT", "GraphBundleProjector", "GraphClusterProjector", "GraphForceProjector", "GraphLatticeProjector", "SVG", "useGraphModel", "VARIANTS", "value", "icon", "label", "ExplorerArticle", "role", "subject", "variant", "view", "useObject", "db", "Obj", "getDatabase", "filter", "setFilter", "useState", "model", "useGraphModel", "builder", "useMemo", "QueryBuilder", "handleChange", "useCallback", "build", "selected", "setSelected", "isVariant", "useEffect", "handleVariantChange", "handleHoverPreview", "node", "event", "obj", "data", "isObject", "dxn", "getDXN", "toString", "target", "dispatchEvent", "DxAnchorActivate", "getLabel", "trigger", "kind", "showToolbar", "Panel", "Root", "Toolbar", "asChild", "QueryEditor", "onChange", "ToggleGroup", "type", "onValueChange", "map", "ToggleGroupItem", "key", "aria-label", "title", "Icon", "size", "Content", "Visualization", "onNodeHover", "svgRef", "useRef", "projector", "setProjector", "projectorRef", "undefined", "current", "prev", "layout", "createProjector", "renderNode", "createRenderNode", "handleInspect", "id", "object", "handleSelect", "CLUSTER_NODE_TYPE_ROOT", "CLUSTER_NODE_TYPE_GROUP", "cluster", "toggleCollapsed", "inner", "SVG", "Graph", "drag", "onInspect", "onSelect", "ref", "Zoom", "extent", "TWEEN_MS", "ctx", "GraphForceProjector", "GraphLatticeProjector", "duration", "radius", "sortBy", "typename", "getTypename", "GraphClusterProjector", "groupOf", "typenameGroupOf", "rootLabel", "groupLabel", "shortTypename", "rootRadius", "groupRadius", "GraphBundleProjector", "group", "r", "append", "attr", "style", "getNodeFillForObject", "CLUSTER_NODE_TYPE_LEAF", "appendRadialLeafLabel", "appendRootLabel", "appendRadialGroupLabel", "LABEL_FADE_MS", "targetX", "tx", "x", "targetY", "ty", "y", "angleDeg", "Math", "atan2", "PI", "flipped", "classed", "text", "transition", "delay", "last", "split", "pop", "charAt", "toUpperCase", "slice"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/index.ts
|
|
4
|
+
import { Capability } from "@dxos/app-framework";
|
|
5
|
+
var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-F6TKVAGV.mjs"));
|
|
6
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-APBW2VQG.mjs"));
|
|
7
|
+
export {
|
|
8
|
+
CreateObject,
|
|
9
|
+
ReactSurface
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/capabilities/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,kBAAkB;AAEpB,IAAMC,eAAeD,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMC,eAAeH,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "CreateObject", "lazy", "ReactSurface"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
4
|
+
|
|
5
|
+
// src/types/ExplorerAction.ts
|
|
6
|
+
var ExplorerAction_exports = {};
|
|
7
|
+
__export(ExplorerAction_exports, {
|
|
8
|
+
GraphProps: () => GraphProps
|
|
9
|
+
});
|
|
10
|
+
import * as Schema from "effect/Schema";
|
|
11
|
+
import { TypeInputOptionsAnnotation } from "@dxos/plugin-space";
|
|
12
|
+
var GraphProps = Schema.Struct({
|
|
13
|
+
name: Schema.optional(Schema.String),
|
|
14
|
+
// TODO(wittjosiah): This should be a query input instead.
|
|
15
|
+
typename: Schema.String.pipe(Schema.annotations({
|
|
16
|
+
title: "Select type"
|
|
17
|
+
}), TypeInputOptionsAnnotation.set({
|
|
18
|
+
location: [
|
|
19
|
+
"database",
|
|
20
|
+
"runtime"
|
|
21
|
+
],
|
|
22
|
+
kind: [
|
|
23
|
+
"user"
|
|
24
|
+
]
|
|
25
|
+
}), Schema.optional)
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// src/types/Graph.ts
|
|
29
|
+
var Graph_exports = {};
|
|
30
|
+
__export(Graph_exports, {
|
|
31
|
+
Graph: () => Graph,
|
|
32
|
+
make: () => make
|
|
33
|
+
});
|
|
34
|
+
import * as Schema2 from "effect/Schema";
|
|
35
|
+
import { Annotation, Filter, Obj, Query, QueryAST, Ref, Type, View } from "@dxos/echo";
|
|
36
|
+
import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/internal";
|
|
37
|
+
import { ViewAnnotation } from "@dxos/schema";
|
|
38
|
+
var GraphSchema = Schema2.Struct({
|
|
39
|
+
name: Schema2.optional(Schema2.String),
|
|
40
|
+
view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false)),
|
|
41
|
+
query: Schema2.Struct({
|
|
42
|
+
raw: Schema2.optional(Schema2.String),
|
|
43
|
+
ast: QueryAST.Query
|
|
44
|
+
}).pipe(FormInputAnnotation.set(false))
|
|
45
|
+
}).pipe(Type.object({
|
|
46
|
+
typename: "org.dxos.type.graph",
|
|
47
|
+
version: "0.1.0"
|
|
48
|
+
}), LabelAnnotation.set([
|
|
49
|
+
"name"
|
|
50
|
+
]), ViewAnnotation.set([
|
|
51
|
+
"view"
|
|
52
|
+
]), Annotation.IconAnnotation.set({
|
|
53
|
+
icon: "ph--graph--regular",
|
|
54
|
+
hue: "green"
|
|
55
|
+
}));
|
|
56
|
+
var Graph = GraphSchema;
|
|
57
|
+
var make = ({ name, query = {
|
|
58
|
+
raw: "",
|
|
59
|
+
ast: Query.select(Filter.nothing()).ast
|
|
60
|
+
}, view }) => {
|
|
61
|
+
return Obj.make(Graph, {
|
|
62
|
+
name,
|
|
63
|
+
view: Ref.make(view),
|
|
64
|
+
query
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
ExplorerAction_exports,
|
|
70
|
+
Graph_exports
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=chunk-7SPMPHRS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/ExplorerAction.ts", "../../../src/types/Graph.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { TypeInputOptionsAnnotation } from '@dxos/plugin-space';\n\nexport const GraphProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n // TODO(wittjosiah): This should be a query input instead.\n typename: Schema.String.pipe(\n Schema.annotations({ title: 'Select type' }),\n TypeInputOptionsAnnotation.set({\n location: ['database', 'runtime'],\n kind: ['user'],\n }),\n Schema.optional,\n ),\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Filter, Obj, Query, QueryAST, Ref, Type, View } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { ViewAnnotation } from '@dxos/schema';\n\nconst GraphSchema = Schema.Struct({\n name: Schema.optional(Schema.String),\n\n view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false)),\n\n query: Schema.Struct({\n raw: Schema.optional(Schema.String),\n ast: QueryAST.Query,\n }).pipe(FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.graph',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n ViewAnnotation.set(['view']),\n Annotation.IconAnnotation.set({\n icon: 'ph--graph--regular',\n hue: 'green',\n }),\n);\nexport interface Graph extends Schema.Schema.Type<typeof GraphSchema> {}\nexport const Graph: Type.Obj<Graph> = GraphSchema as any;\n\ntype MakeProps = Omit<Partial<Obj.MakeProps<typeof Graph>>, 'view'> & {\n view: View.View;\n};\n\n/**\n * Make a graph as a view of a data set.\n */\nexport const make = ({\n name,\n query = { raw: '', ast: Query.select(Filter.nothing()).ast },\n view,\n}: MakeProps): Graph => {\n return Obj.make(Graph, { name, view: Ref.make(view), query });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kCAAkC;AAEpC,IAAMC,aAAoBC,cAAO;EACtCC,MAAaC,gBAAgBC,aAAM;;EAEnCC,UAAiBD,cAAOE,KACfC,mBAAY;IAAEC,OAAO;EAAc,CAAA,GAC1CT,2BAA2BU,IAAI;IAC7BC,UAAU;MAAC;MAAY;;IACvBC,MAAM;MAAC;;EACT,CAAA,GACOR,eAAQ;AAEnB,CAAA;;;ACnBA;;;;;AAIA,YAAYS,aAAY;AAExB,SAASC,YAAYC,QAAQC,KAAKC,OAAOC,UAAUC,KAAKC,MAAMC,YAAY;AAC1E,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,sBAAsB;AAE/B,IAAMC,cAAqBC,eAAO;EAChCC,MAAaC,iBAAgBC,cAAM;EAEnCC,MAAMX,IAAIA,IAAIE,KAAKA,IAAI,EAAEU,KAAKT,oBAAoBU,IAAI,KAAA,CAAA;EAEtDC,OAAcP,eAAO;IACnBQ,KAAYN,iBAAgBC,cAAM;IAClCM,KAAKjB,SAASD;EAChB,CAAA,EAAGc,KAAKT,oBAAoBU,IAAI,KAAA,CAAA;AAClC,CAAA,EAAGD,KACDX,KAAKgB,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAf,gBAAgBS,IAAI;EAAC;CAAO,GAC5BR,eAAeQ,IAAI;EAAC;CAAO,GAC3BlB,WAAWyB,eAAeP,IAAI;EAC5BQ,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAGK,IAAMC,QAAyBjB;AAS/B,IAAMkB,OAAO,CAAC,EACnBhB,MACAM,QAAQ;EAAEC,KAAK;EAAIC,KAAKlB,MAAM2B,OAAO7B,OAAO8B,QAAO,CAAA,EAAIV;AAAI,GAC3DL,KAAI,MACM;AACV,SAAOd,IAAI2B,KAAKD,OAAO;IAAEf;IAAMG,MAAMX,IAAIwB,KAAKb,IAAAA;IAAOG;EAAM,CAAA;AAC7D;",
|
|
6
|
+
"names": ["Schema", "TypeInputOptionsAnnotation", "GraphProps", "Struct", "name", "optional", "String", "typename", "pipe", "annotations", "title", "set", "location", "kind", "Schema", "Annotation", "Filter", "Obj", "Query", "QueryAST", "Ref", "Type", "View", "FormInputAnnotation", "LabelAnnotation", "ViewAnnotation", "GraphSchema", "Struct", "name", "optional", "String", "view", "pipe", "set", "query", "raw", "ast", "object", "typename", "version", "IconAnnotation", "icon", "hue", "Graph", "make", "select", "nothing"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// src/meta.ts
|
|
2
2
|
import { trim } from "@dxos/util";
|
|
3
3
|
var meta = {
|
|
4
|
-
id: "dxos.
|
|
4
|
+
id: "org.dxos.plugin.explorer",
|
|
5
5
|
name: "Explorer",
|
|
6
|
+
author: "DXOS",
|
|
6
7
|
description: trim`
|
|
7
8
|
Interactive hypergraph visualization that reveals relationships between objects in your workspace.
|
|
8
9
|
Navigate complex data structures and discover connections through a dynamic network view.
|
|
@@ -10,9 +11,6 @@ var meta = {
|
|
|
10
11
|
icon: "ph--graph--regular",
|
|
11
12
|
iconHue: "green",
|
|
12
13
|
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer",
|
|
13
|
-
tags: [
|
|
14
|
-
"labs"
|
|
15
|
-
],
|
|
16
14
|
screenshots: [
|
|
17
15
|
"https://dxos.network/plugin-details-explorer-dark.png"
|
|
18
16
|
]
|
|
@@ -21,4 +19,4 @@ var meta = {
|
|
|
21
19
|
export {
|
|
22
20
|
meta
|
|
23
21
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
22
|
+
//# sourceMappingURL=chunk-DXIWQFYO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.explorer',\n name: 'Explorer',\n author: 'DXOS',\n description: trim`\n Interactive hypergraph visualization that reveals relationships between objects in your workspace.\n Navigate complex data structures and discover connections through a dynamic network view.\n `,\n icon: 'ph--graph--regular',\n iconHue: 'green',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
|
|
5
|
+
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC,aAAaL;;;;EAIbM,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,aAAa;IAAC;;AAChB;",
|
|
6
|
+
"names": ["trim", "meta", "id", "name", "author", "description", "icon", "iconHue", "source", "screenshots"]
|
|
7
|
+
}
|