@dxos/plugin-explorer 0.7.5-main.b19bfc8 → 0.7.5-main.d9d2d4e

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.
Files changed (52) hide show
  1. package/dist/lib/browser/{ExplorerContainer-THLT3CQZ.mjs → ExplorerContainer-T5CTMBIS.mjs} +2 -2
  2. package/dist/lib/browser/{chunk-YN4YVXVL.mjs → chunk-SU3K2HL7.mjs} +241 -2
  3. package/dist/lib/{node-esm/chunk-JYW3CDBT.mjs.map → browser/chunk-SU3K2HL7.mjs.map} +4 -4
  4. package/dist/lib/browser/chunk-V23FAKIX.mjs +205 -0
  5. package/dist/lib/browser/chunk-V23FAKIX.mjs.map +7 -0
  6. package/dist/lib/browser/index.mjs +7 -7
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/{react-surface-UMUN6CTH.mjs → react-surface-Q7OT6GXC.mjs} +3 -3
  9. package/dist/lib/node/{ExplorerContainer-EJPGD4WR.cjs → ExplorerContainer-SO5XAXFS.cjs} +6 -6
  10. package/dist/lib/node/chunk-6GTOKVKH.cjs +236 -0
  11. package/dist/lib/node/chunk-6GTOKVKH.cjs.map +7 -0
  12. package/dist/lib/node/{chunk-H5CHI722.cjs → chunk-CQYBCGC4.cjs} +234 -8
  13. package/dist/lib/node/chunk-CQYBCGC4.cjs.map +7 -0
  14. package/dist/lib/node/index.cjs +10 -10
  15. package/dist/lib/node/meta.json +1 -1
  16. package/dist/lib/node/{react-surface-UVMGNAA6.cjs → react-surface-5G52HSJW.cjs} +7 -7
  17. package/dist/lib/node-esm/{ExplorerContainer-MEZP34AY.mjs → ExplorerContainer-DTUTEZLK.mjs} +2 -2
  18. package/dist/lib/node-esm/{chunk-JYW3CDBT.mjs → chunk-4IST6Y3Z.mjs} +240 -2
  19. package/dist/lib/{browser/chunk-YN4YVXVL.mjs.map → node-esm/chunk-4IST6Y3Z.mjs.map} +4 -4
  20. package/dist/lib/node-esm/chunk-Q2IQDIKJ.mjs +207 -0
  21. package/dist/lib/node-esm/chunk-Q2IQDIKJ.mjs.map +7 -0
  22. package/dist/lib/node-esm/index.mjs +7 -7
  23. package/dist/lib/node-esm/meta.json +1 -1
  24. package/dist/lib/node-esm/{react-surface-5BTZOU3H.mjs → react-surface-QSQVINGP.mjs} +3 -3
  25. package/dist/types/src/components/Graph/Graph.d.ts +0 -2
  26. package/dist/types/src/components/Graph/Graph.d.ts.map +1 -1
  27. package/dist/types/src/components/Graph/Graph.stories.d.ts +1 -1
  28. package/dist/types/src/components/Graph/Graph.stories.d.ts.map +1 -1
  29. package/dist/types/src/components/Graph/graph-model.d.ts +11 -5
  30. package/dist/types/src/components/Graph/graph-model.d.ts.map +1 -1
  31. package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
  32. package/dist/types/src/components/Tree/types.d.ts +1 -1
  33. package/dist/types/src/components/Tree/types.d.ts.map +1 -1
  34. package/package.json +25 -24
  35. package/src/components/Graph/Graph.stories.tsx +2 -2
  36. package/src/components/Graph/Graph.tsx +65 -125
  37. package/src/components/Graph/graph-model.ts +123 -71
  38. package/src/components/Tree/Tree.tsx +7 -2
  39. package/src/components/Tree/types.ts +2 -1
  40. package/dist/lib/browser/chunk-TDUEJNAN.mjs +0 -474
  41. package/dist/lib/browser/chunk-TDUEJNAN.mjs.map +0 -7
  42. package/dist/lib/node/chunk-H5CHI722.cjs.map +0 -7
  43. package/dist/lib/node/chunk-QASZ24JS.cjs +0 -495
  44. package/dist/lib/node/chunk-QASZ24JS.cjs.map +0 -7
  45. package/dist/lib/node-esm/chunk-45DTVHHL.mjs +0 -476
  46. package/dist/lib/node-esm/chunk-45DTVHHL.mjs.map +0 -7
  47. /package/dist/lib/browser/{ExplorerContainer-THLT3CQZ.mjs.map → ExplorerContainer-T5CTMBIS.mjs.map} +0 -0
  48. /package/dist/lib/browser/{react-surface-UMUN6CTH.mjs.map → react-surface-Q7OT6GXC.mjs.map} +0 -0
  49. /package/dist/lib/node/{ExplorerContainer-EJPGD4WR.cjs.map → ExplorerContainer-SO5XAXFS.cjs.map} +0 -0
  50. /package/dist/lib/node/{react-surface-UVMGNAA6.cjs.map → react-surface-5G52HSJW.cjs.map} +0 -0
  51. /package/dist/lib/node-esm/{ExplorerContainer-MEZP34AY.mjs.map → ExplorerContainer-DTUTEZLK.mjs.map} +0 -0
  52. /package/dist/lib/node-esm/{react-surface-5BTZOU3H.mjs.map → react-surface-QSQVINGP.mjs.map} +0 -0
@@ -1,495 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_QASZ24JS_exports = {};
30
- __export(chunk_QASZ24JS_exports, {
31
- Graph: () => Graph,
32
- SpaceGraphModel: () => SpaceGraphModel,
33
- Tree: () => Tree,
34
- defaultTreeLayoutSlots: () => defaultTreeLayoutSlots
35
- });
36
- module.exports = __toCommonJS(chunk_QASZ24JS_exports);
37
- var import_echo_schema = require("@dxos/echo-schema");
38
- var import_gem_spore = require("@dxos/gem-spore");
39
- var import_log = require("@dxos/log");
40
- var import_types = require("@dxos/plugin-space/types");
41
- var import_echo = require("@dxos/react-client/echo");
42
- var import_react = __toESM(require("react"));
43
- var import_react_resize_detector = require("react-resize-detector");
44
- var import_gem_core = require("@dxos/gem-core");
45
- var d3 = __toESM(require("d3"));
46
- var d32 = __toESM(require("d3"));
47
- var d33 = __toESM(require("d3"));
48
- var import_react2 = __toESM(require("react"));
49
- var import_echo2 = require("@dxos/client/echo");
50
- var import_gem_core2 = require("@dxos/gem-core");
51
- var import_gem_spore2 = require("@dxos/gem-spore");
52
- var import_plugin_search = require("@dxos/plugin-search");
53
- var import_react_ui = require("@dxos/react-ui");
54
- var import_react_ui_theme = require("@dxos/react-ui-theme");
55
- var import_styles = require("@dxos/gem-spore/styles");
56
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-explorer/src/components/Graph/graph-model.ts";
57
- var SpaceGraphModel = class extends import_gem_spore.GraphModel {
58
- constructor(_options = {}) {
59
- super();
60
- this._options = _options;
61
- this._graph = {
62
- nodes: [],
63
- links: []
64
- };
65
- }
66
- get graph() {
67
- return this._graph;
68
- }
69
- get objects() {
70
- return this._objects ?? [];
71
- }
72
- open(space, objectId) {
73
- if (!this._subscription) {
74
- const query = space.db.query((object) => !(object instanceof import_types.CollectionType));
75
- this._subscription = query.subscribe(({ objects }) => {
76
- this._objects = objects;
77
- this._graph.nodes = objects.map((object) => {
78
- if (object instanceof import_echo_schema.StoredSchema) {
79
- const effectSchema = space.db.schemaRegistry.getSchemaById(object.id);
80
- return {
81
- type: "schema",
82
- id: object.id,
83
- schema: effectSchema.schema
84
- };
85
- }
86
- return {
87
- type: "object",
88
- id: object.id,
89
- object
90
- };
91
- });
92
- this._graph.links = objects.reduce((links, object) => {
93
- const objectSchema = (0, import_echo.getSchema)(object);
94
- const typename = (0, import_echo.getType)(object)?.objectId;
95
- if (objectSchema == null || typename == null) {
96
- import_log.log.info("no schema for object:", {
97
- id: object.id.slice(0, 8)
98
- }, {
99
- F: __dxlog_file,
100
- L: 76,
101
- S: this,
102
- C: (f, a) => f(...a)
103
- });
104
- return links;
105
- }
106
- if (!(objectSchema instanceof import_echo_schema.EchoSchema)) {
107
- const idx = objects.findIndex((obj) => obj.id === typename);
108
- if (idx === -1) {
109
- this._graph.nodes.push({
110
- id: typename,
111
- type: "schema",
112
- schema: objectSchema
113
- });
114
- }
115
- }
116
- if (this._options.schema) {
117
- links.push({
118
- id: `${object.id}-${typename}`,
119
- source: object.id,
120
- target: typename
121
- });
122
- }
123
- import_echo_schema.AST.getPropertySignatures(objectSchema.ast).forEach((prop) => {
124
- if (!import_echo_schema.SchemaValidator.hasTypeAnnotation(objectSchema, prop.name.toString(), import_echo_schema.ReferenceAnnotationId)) {
125
- return;
126
- }
127
- const value = object[String(prop.name)];
128
- if (value) {
129
- const refs = Array.isArray(value) ? value : [
130
- value
131
- ];
132
- for (const ref of refs) {
133
- if (objects.findIndex((obj) => obj.id === ref.id) !== -1) {
134
- links.push({
135
- id: `${object.id}-${String(prop.name)}-${ref.id}`,
136
- source: object.id,
137
- target: ref.id
138
- });
139
- }
140
- }
141
- }
142
- });
143
- return links;
144
- }, []);
145
- this.triggerUpdate();
146
- }, {
147
- fire: true
148
- });
149
- }
150
- this.setSelected(objectId);
151
- return this;
152
- }
153
- close() {
154
- if (this._subscription) {
155
- this._subscription();
156
- this._subscription = void 0;
157
- }
158
- return this;
159
- }
160
- };
161
- var HierarchicalEdgeBundling = (s, data, options) => {
162
- const svg = d3.select(s);
163
- svg.selectAll("*").remove();
164
- const { radius = 600, padding = 100, slots: slots2 } = options;
165
- const root = d3.hierarchy(flatten(data));
166
- const tree3 = d3.cluster().size([
167
- 2 * Math.PI,
168
- radius - padding
169
- ]);
170
- const layout = tree3(addLinks(root));
171
- const node = svg.append("g").selectAll().data(layout.leaves()).join("g").attr("transform", (d) => `rotate(${d.x * (180 / Math.PI) - 90}) translate(${d.y},0)`).append("text").attr("class", slots2?.text ?? "").attr("dy", "0.31em").attr("x", (d) => d.x < Math.PI ? 6 : -6).attr("text-anchor", (d) => d.x < Math.PI ? "start" : "end").attr("transform", (d) => d.x >= Math.PI ? "rotate(180)" : null).call((text) => text.text((d) => d.data.id.slice(0, 8)));
172
- const line = d3.lineRadial().curve(d3.curveBundle.beta(0.85)).radius((d) => d.y).angle((d) => d.x);
173
- const links = svg.append("g").selectAll().data(layout.leaves().flatMap((leaf) => leaf.outgoing)).join("path").style("mix-blend-mode", "multiply").attr("class", slots2?.path ?? "").attr("d", ([i, o]) => {
174
- return line(i.path(o));
175
- }).each(function(d) {
176
- d.path = this;
177
- });
178
- };
179
- var addLinks = (root) => {
180
- const nodes = new Map(root.descendants().map((d) => [
181
- d.data.id,
182
- d
183
- ]));
184
- const parents = root.descendants().reduce((map, d) => {
185
- if (d.children?.length) {
186
- map.set(d.data.id, d);
187
- }
188
- return map;
189
- }, /* @__PURE__ */ new Map());
190
- for (const d of root.leaves()) {
191
- const parent = parents.get(d.data.id);
192
- if (parent) {
193
- d.outgoing = parent.data.children?.slice(1).map((child) => {
194
- return [
195
- d,
196
- nodes.get(child.id)
197
- ];
198
- }) ?? [];
199
- } else {
200
- d.outgoing = [];
201
- }
202
- }
203
- return root;
204
- };
205
- var flatten = (node) => {
206
- const clone = {
207
- id: node.id
208
- };
209
- if (node.children?.length) {
210
- const children = node.children.map((child) => flatten(child));
211
- clone.children = [
212
- {
213
- id: node.id
214
- },
215
- ...children
216
- ];
217
- }
218
- return clone;
219
- };
220
- var HierarchicalEdgeBundling_default = HierarchicalEdgeBundling;
221
- var RadialTree = (s, data, options) => {
222
- const svg = d32.select(s);
223
- svg.selectAll("*").remove();
224
- const { label, radius = 400, r = 4, slots: slots2 } = options;
225
- const arc = 2 * Math.PI;
226
- const root = d32.hierarchy(data);
227
- const descendants = root.descendants();
228
- const getLabel = label === null ? null : descendants.map((d) => label(d.data));
229
- const layout = d32.tree().size([
230
- arc,
231
- radius
232
- ]).separation((a, b) => (a.parent === b.parent ? 1 : 2) / a.depth);
233
- layout(root);
234
- svg.append("g").selectAll("path").data(root.links()).join("path").attr("class", slots2?.path ?? "").attr("d", d32.linkRadial().angle((d) => d.x + Math.PI / 2).radius((d) => d.y));
235
- const node = svg.append("g").selectAll("a").data(root.descendants()).join("a").attr("transform", (d) => `rotate(${d.x * 180 / Math.PI}) translate(${d.y},0)`);
236
- node.append("circle").attr("class", slots2?.node ?? "").attr("r", r);
237
- if (getLabel) {
238
- node.append("text").attr("transform", (d) => `rotate(${d.x >= Math.PI ? 180 : 0})`).attr("dy", "0.32em").attr("x", (d) => d.x < Math.PI === !d.children ? 6 : -6).attr("text-anchor", (d) => d.x < Math.PI === !d.children ? "start" : "end").attr("class", slots2?.text ?? "").text((d, i) => getLabel[i]);
239
- }
240
- return svg.node();
241
- };
242
- var RadialTree_default = RadialTree;
243
- var TidyTree = (s, data, options) => {
244
- const svg = d33.select(s);
245
- svg.selectAll("*").remove();
246
- const { label, width, height, r = 4, padding = 4, margin = 60, slots: slots2 } = options;
247
- const root = d33.hierarchy(data);
248
- const descendants = root.descendants();
249
- const getLabel = label == null ? null : descendants.map((d) => label(d.data));
250
- const dx = 16;
251
- const dy = width / (root.height + padding);
252
- const layout = d33.tree().nodeSize([
253
- dx,
254
- dy
255
- ]);
256
- layout(root);
257
- let x0 = Infinity;
258
- let x1 = -x0;
259
- let y0 = Infinity;
260
- let y1 = -y0;
261
- root.each((d) => {
262
- if (d.x > x1) {
263
- x1 = d.x;
264
- }
265
- if (d.x < x0) {
266
- x0 = d.x;
267
- }
268
- if (d.y > y1) {
269
- y1 = d.y;
270
- }
271
- if (d.y < y0) {
272
- y0 = d.y;
273
- }
274
- });
275
- const sx = Math.min(2, Math.max(1, (height - margin * 2) / (x1 - x0)));
276
- const oy = -(width - (y1 - y0)) / 2;
277
- svg.append("g").selectAll("path").data(root.links()).join("path").attr("class", slots2?.path ?? "").attr("d", d33.link(d33.curveBumpX).x((d) => d.y + oy).y((d) => d.x * sx));
278
- const node = svg.append("g").selectAll("a").data(root.descendants()).join("a").attr("transform", (d) => `translate(${d.y + oy},${d.x * sx})`);
279
- node.append("circle").attr("class", slots2?.node ?? "").attr("r", r);
280
- if (getLabel) {
281
- node.append("text").attr("dy", "0.32em").attr("x", (d) => d.children ? -6 : 6).attr("text-anchor", (d) => d.children ? "end" : "start").attr("class", slots2?.text ?? "").text((d, i) => getLabel[i]);
282
- }
283
- };
284
- var TidyTree_default = TidyTree;
285
- var mapGraphToTreeData = (model, maxDepth = 8) => {
286
- const mapNode = (node, depth = 0) => {
287
- const treeNode = {
288
- id: model.idAccessor(node),
289
- label: model.idAccessor(node).slice(0, 8)
290
- };
291
- const links = model.graph.links.filter((link2) => link2.source === treeNode.id);
292
- if (depth < maxDepth) {
293
- treeNode.children = links.map((link2) => mapNode(model.graph.nodes.find((node2) => model.idAccessor(node2) === link2.target), depth + 1));
294
- }
295
- return treeNode;
296
- };
297
- let data;
298
- if (model.selected) {
299
- const node = model.graph.nodes.find((node2) => model.idAccessor(node2) === model.selected);
300
- if (node) {
301
- data = mapNode(node);
302
- }
303
- }
304
- return data;
305
- };
306
- var slots = {};
307
- var colors = [
308
- "[&>circle]:!fill-black-300 [&>circle]:!stroke-black-600",
309
- "[&>circle]:!fill-slate-300 [&>circle]:!stroke-slate-600",
310
- "[&>circle]:!fill-green-300 [&>circle]:!stroke-green-600",
311
- "[&>circle]:!fill-sky-300 [&>circle]:!stroke-sky-600",
312
- "[&>circle]:!fill-cyan-300 [&>circle]:!stroke-cyan-600",
313
- "[&>circle]:!fill-rose-300 [&>circle]:!stroke-rose-600",
314
- "[&>circle]:!fill-purple-300 [&>circle]:!stroke-purple-600",
315
- "[&>circle]:!fill-orange-300 [&>circle]:!stroke-orange-600",
316
- "[&>circle]:!fill-teal-300 [&>circle]:!stroke-teal-600",
317
- "[&>circle]:!fill-indigo-300 [&>circle]:!stroke-indigo-600"
318
- ];
319
- var Graph = ({ space, match, grid }) => {
320
- const model = (0, import_react2.useMemo)(() => space ? new SpaceGraphModel({
321
- schema: true
322
- }).open(space) : void 0, [
323
- space
324
- ]);
325
- const [selected, setSelected] = (0, import_react2.useState)();
326
- const { themeMode } = (0, import_react_ui.useThemeContext)();
327
- const context = (0, import_gem_core2.createSvgContext)();
328
- const projector = (0, import_react2.useMemo)(() => new import_gem_spore2.GraphForceProjector(context, {
329
- forces: {
330
- manyBody: {
331
- strength: -100
332
- },
333
- link: {
334
- distance: 120
335
- },
336
- radial: {
337
- radius: 150,
338
- strength: 0.05
339
- }
340
- },
341
- attributes: {
342
- radius: (node) => node.data?.type === "schema" ? 12 : 8
343
- }
344
- }), []);
345
- const filteredRef = (0, import_react2.useRef)();
346
- filteredRef.current = (0, import_plugin_search.filterObjectsSync)(model?.objects ?? [], match);
347
- (0, import_react2.useEffect)(() => {
348
- void projector.start();
349
- }, [
350
- match
351
- ]);
352
- const [colorMap] = (0, import_react2.useState)(/* @__PURE__ */ new Map());
353
- if (!model) {
354
- return null;
355
- }
356
- if (selected) {
357
- return /* @__PURE__ */ import_react2.default.createElement(Tree, {
358
- space,
359
- selected,
360
- variant: "tidy",
361
- onNodeClick: () => setSelected(void 0)
362
- });
363
- }
364
- return /* @__PURE__ */ import_react2.default.createElement(import_gem_core2.SVGRoot, {
365
- context
366
- }, /* @__PURE__ */ import_react2.default.createElement(import_gem_core2.SVG, {
367
- className: (0, import_react_ui_theme.mx)(import_gem_spore2.defaultStyles, slots?.root?.className)
368
- }, /* @__PURE__ */ import_react2.default.createElement(import_gem_spore2.Markers, {
369
- arrowSize: 6
370
- }), grid && /* @__PURE__ */ import_react2.default.createElement(import_gem_core2.Grid, {
371
- className: slots?.grid?.className ?? (0, import_gem_core2.defaultGridStyles)(themeMode)
372
- }), /* @__PURE__ */ import_react2.default.createElement(import_gem_core2.Zoom, {
373
- extent: [
374
- 1 / 2,
375
- 4
376
- ]
377
- }, /* @__PURE__ */ import_react2.default.createElement(import_gem_spore2.Graph, {
378
- model,
379
- projector,
380
- drag: true,
381
- arrows: true,
382
- onSelect: (node) => setSelected(node?.data?.id),
383
- labels: {
384
- text: (node) => {
385
- if (filteredRef.current?.length && !filteredRef.current.some((object) => object.id === node.data?.id)) {
386
- return void 0;
387
- }
388
- return node.data?.label ?? node.data?.title ?? node.data?.name ?? node.data?.id.slice(0, 8);
389
- }
390
- },
391
- attributes: {
392
- node: (node) => {
393
- let className;
394
- if (node.data) {
395
- const { object } = node.data;
396
- if (object) {
397
- const typename = (0, import_echo2.getTypename)(object);
398
- if (typename) {
399
- className = colorMap.get(typename);
400
- if (!className) {
401
- className = colors[colorMap.size % colors.length];
402
- colorMap.set(typename, className);
403
- }
404
- }
405
- }
406
- }
407
- const selected2 = filteredRef.current?.some((object) => object.id === node.data?.id);
408
- const blur = !selected2 && !!filteredRef.current?.length;
409
- return {
410
- class: (0, import_react_ui_theme.mx)(className, blur && "opacity-70")
411
- };
412
- },
413
- link: () => ({
414
- class: "[&>path]:!stroke-neutral-300 dark:[&>path]:!stroke-neutral-700"
415
- })
416
- }
417
- }))));
418
- };
419
- var defaultTreeLayoutSlots = {
420
- node: "fill-blue-600",
421
- path: "fill-none stroke-blue-400 stroke-[0.5px]",
422
- text: "stroke-[0.5px] stroke-neutral-700 text-xs"
423
- };
424
- var renderers = /* @__PURE__ */ new Map([
425
- [
426
- "tidy",
427
- TidyTree_default
428
- ],
429
- [
430
- "radial",
431
- RadialTree_default
432
- ],
433
- [
434
- "edge",
435
- HierarchicalEdgeBundling_default
436
- ]
437
- ]);
438
- var Tree = ({ space, selected, variant = "tidy", onNodeClick }) => {
439
- const model = (0, import_react.useMemo)(() => space ? new SpaceGraphModel().open(space, selected) : void 0, [
440
- space,
441
- selected
442
- ]);
443
- const [tree3, setTree] = (0, import_react.useState)();
444
- (0, import_react.useEffect)(() => {
445
- return model?.subscribe(() => {
446
- const tree4 = mapGraphToTreeData(model);
447
- setTree(tree4);
448
- }, true);
449
- }, [
450
- model
451
- ]);
452
- const context = (0, import_gem_core.createSvgContext)();
453
- const { ref, width = 0, height = 0 } = (0, import_react_resize_detector.useResizeDetector)();
454
- (0, import_react.useEffect)(() => {
455
- if (width && height) {
456
- const size = Math.min(width, height);
457
- const radius = size * 0.4;
458
- const options = {
459
- // TODO(burdon): Type.
460
- label: (d) => d.label ?? d.id,
461
- width,
462
- height,
463
- radius,
464
- marginLeft: (width - radius * 2) / 2,
465
- marginRight: (width - radius * 2) / 2,
466
- marginTop: (height - radius * 2) / 2,
467
- marginBottom: (height - radius * 2) / 2,
468
- slots: defaultTreeLayoutSlots
469
- };
470
- if (tree3) {
471
- const renderer = renderers.get(variant);
472
- renderer?.(context.ref.current, tree3, options);
473
- }
474
- }
475
- }, [
476
- tree3,
477
- width,
478
- height
479
- ]);
480
- return /* @__PURE__ */ import_react.default.createElement("div", {
481
- ref,
482
- className: "flex grow overflow-hidden",
483
- onClick: () => onNodeClick?.()
484
- }, /* @__PURE__ */ import_react.default.createElement(import_gem_core.SVGRoot, {
485
- context
486
- }, /* @__PURE__ */ import_react.default.createElement(import_gem_core.SVG, null)));
487
- };
488
- // Annotate the CommonJS export names for ESM import in node:
489
- 0 && (module.exports = {
490
- Graph,
491
- SpaceGraphModel,
492
- Tree,
493
- defaultTreeLayoutSlots
494
- });
495
- //# sourceMappingURL=chunk-QASZ24JS.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/Graph/graph-model.ts", "../../../src/components/Tree/Tree.tsx", "../../../src/components/Tree/layout/HierarchicalEdgeBundling.ts", "../../../src/components/Tree/layout/RadialTree.ts", "../../../src/components/Tree/layout/TidyTree.ts", "../../../src/components/Tree/types.ts", "../../../src/components/Graph/Graph.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { AST, EchoSchema, ReferenceAnnotationId, type S, SchemaValidator, StoredSchema } from '@dxos/echo-schema';\nimport { type GraphData, type GraphLink, GraphModel } from '@dxos/gem-spore';\nimport { log } from '@dxos/log';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { type ReactiveEchoObject, type Space, type Subscription, getSchema, getType } from '@dxos/react-client/echo';\n\nexport type SpaceGraphModelOptions = {\n schema?: boolean;\n};\n\ntype SchemaGraphNode = {\n id: string;\n type: 'schema';\n schema: S.Schema<any>;\n};\n\ntype ObjectGraphNode = {\n id: string;\n type: 'object';\n object: ReactiveEchoObject<any>;\n};\n\nexport type EchoGraphNode = SchemaGraphNode | ObjectGraphNode;\n\n/**\n * Converts ECHO objects to a graph.\n */\nexport class SpaceGraphModel extends GraphModel<EchoGraphNode> {\n private readonly _graph: GraphData<EchoGraphNode> = {\n nodes: [],\n links: [],\n };\n\n private _subscription?: Subscription;\n private _objects?: ReactiveEchoObject<any>[];\n\n constructor(private readonly _options: SpaceGraphModelOptions = {}) {\n super();\n }\n\n override get graph(): GraphData<EchoGraphNode> {\n return this._graph;\n }\n\n get objects(): ReactiveEchoObject<any>[] {\n return this._objects ?? [];\n }\n\n open(space: Space, objectId?: string) {\n if (!this._subscription) {\n // TODO(burdon): Filter.\n const query = space.db.query((object: ReactiveEchoObject<any>) => !(object instanceof CollectionType));\n\n this._subscription = query.subscribe(\n ({ objects }) => {\n this._objects = objects;\n\n // TODO(burdon): Normalize schema.\n this._graph.nodes = objects.map((object) => {\n if (object instanceof StoredSchema) {\n const effectSchema = space.db.schemaRegistry.getSchemaById(object.id)!;\n return { type: 'schema', id: object.id, schema: effectSchema.schema };\n }\n\n return { type: 'object', id: object.id, object };\n });\n\n this._graph.links = objects.reduce<GraphLink[]>((links, object) => {\n const objectSchema = getSchema(object);\n const typename = getType(object)?.objectId;\n if (objectSchema == null || typename == null) {\n log.info('no schema for object:', { id: object.id.slice(0, 8) });\n return links;\n }\n\n if (!(objectSchema instanceof EchoSchema)) {\n const idx = objects.findIndex((obj) => obj.id === typename);\n if (idx === -1) {\n this._graph.nodes.push({\n id: typename,\n type: 'schema',\n schema: objectSchema,\n });\n }\n }\n\n // Link to schema.\n if (this._options.schema) {\n links.push({\n id: `${object.id}-${typename}`,\n source: object.id,\n target: typename,\n });\n }\n\n // Parse schema to follow referenced objects.\n AST.getPropertySignatures(objectSchema.ast).forEach((prop) => {\n if (!SchemaValidator.hasTypeAnnotation(objectSchema, prop.name.toString(), ReferenceAnnotationId)) {\n return;\n }\n const value = object[String(prop.name)];\n if (value) {\n const refs = Array.isArray(value) ? value : [value];\n for (const ref of refs) {\n if (objects.findIndex((obj) => obj.id === ref.id) !== -1) {\n links.push({\n id: `${object.id}-${String(prop.name)}-${ref.id}`,\n source: object.id,\n target: ref.id,\n });\n }\n }\n }\n });\n\n return links;\n }, []);\n\n this.triggerUpdate();\n },\n { fire: true },\n );\n }\n\n this.setSelected(objectId);\n return this;\n }\n\n close() {\n if (this._subscription) {\n this._subscription();\n this._subscription = undefined;\n }\n\n return this;\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type Space } from '@dxos/client/echo';\nimport { createSvgContext, SVG, SVGRoot } from '@dxos/gem-core';\n\nimport { HierarchicalEdgeBundling, RadialTree, TidyTree } from './layout';\nimport { mapGraphToTreeData, type TreeNode } from './types';\nimport { SpaceGraphModel } from '../Graph';\n\n// TODO(burdon): Create dge bundling graph using d3.hierarchy.\n// https://observablehq.com/@d3/hierarchical-edge-bundling?intent=fork\n\ntype Renderer = (svg: SVGSVGElement, data: any, options: any) => void;\n\nexport type LayoutVariant = 'tidy' | 'radial' | 'edge';\n\n// TODO(burdon): Remove slots?\nexport type TreeLayoutSlots = {\n node?: string;\n path?: string;\n text?: string;\n};\n\nexport type TreeOptions = {\n label: (d: any) => string;\n\n slots?: TreeLayoutSlots;\n radius?: number;\n\n width: number;\n height: number;\n margin?: number;\n\n padding?: number;\n // Radius of nodes.\n r?: number;\n};\n\nexport const defaultTreeLayoutSlots: TreeLayoutSlots = {\n node: 'fill-blue-600',\n path: 'fill-none stroke-blue-400 stroke-[0.5px]',\n text: 'stroke-[0.5px] stroke-neutral-700 text-xs', // TODO(burdon): Create box instead of halo.\n};\n\nconst renderers = new Map<LayoutVariant, Renderer>([\n ['tidy', TidyTree],\n ['radial', RadialTree],\n ['edge', HierarchicalEdgeBundling],\n]);\n\nexport type TreeComponentProps<N = unknown> = {\n space: Space;\n selected?: string;\n variant?: LayoutVariant;\n onNodeClick?: (node?: N) => void;\n};\n\n// TODO(burdon): Label accessor.\nexport const Tree = <N,>({ space, selected, variant = 'tidy', onNodeClick }: TreeComponentProps<N>) => {\n const model = useMemo(() => (space ? new SpaceGraphModel().open(space, selected) : undefined), [space, selected]);\n const [tree, setTree] = useState<TreeNode>();\n useEffect(() => {\n return model?.subscribe(() => {\n const tree = mapGraphToTreeData(model);\n setTree(tree);\n }, true);\n }, [model]);\n\n const context = createSvgContext();\n const { ref, width = 0, height = 0 } = useResizeDetector();\n\n useEffect(() => {\n if (width && height) {\n const size = Math.min(width, height);\n const radius = size * 0.4;\n const options = {\n // TODO(burdon): Type.\n label: (d: any) => d.label ?? d.id,\n width,\n height,\n radius,\n marginLeft: (width - radius * 2) / 2,\n marginRight: (width - radius * 2) / 2,\n marginTop: (height - radius * 2) / 2,\n marginBottom: (height - radius * 2) / 2,\n slots: defaultTreeLayoutSlots,\n };\n\n if (tree) {\n const renderer = renderers.get(variant);\n renderer?.(context.ref.current!, tree, options);\n }\n }\n }, [tree, width, height]);\n\n // TODO(burdon): Provider should expand.\n return (\n <div ref={ref} className='flex grow overflow-hidden' onClick={() => onNodeClick?.()}>\n <SVGRoot context={context}>\n <SVG />\n </SVGRoot>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n// Copyright 2022 Observable, Inc.\n//\n\nimport * as d3 from 'd3';\nimport { type HierarchyNode } from 'd3-hierarchy';\n\nimport { type TreeOptions } from '../Tree';\nimport { type TreeNode } from '../types';\n\n// Create hierarchical ID.\n// eslint-disable-next-line unused-imports/no-unused-vars\nconst getId = (node: HierarchyNode<TreeNode>): string =>\n `${node.parent ? getId(node.parent) + '/' : ''}${node.data.id.slice(0, 4)}`;\n\n// https://github.com/d3/d3-hierarchy\n// https://observablehq.com/@d3/hierarchical-edge-bundling?intent=fork\nconst HierarchicalEdgeBundling = (s: SVGSVGElement, data: TreeNode, options: TreeOptions) => {\n const svg = d3.select(s);\n svg.selectAll('*').remove();\n\n const { radius = 600, padding = 100, slots } = options;\n\n // https://d3js.org/d3-hierarchy/hierarchy\n const root = d3.hierarchy(flatten(data));\n // .sort((a, b) => d3.ascending(a.height, b.height) || d3.ascending(getName(a.data), getName(b.data)));\n\n const tree = d3.cluster<TreeNode>().size([2 * Math.PI, radius - padding]);\n const layout = tree(addLinks(root));\n\n // eslint-disable-next-line unused-imports/no-unused-vars\n const node = svg\n .append('g')\n .selectAll()\n .data(layout.leaves())\n .join('g')\n .attr('transform', (d) => `rotate(${d.x * (180 / Math.PI) - 90}) translate(${d.y},0)`)\n .append('text')\n .attr('class', slots?.text ?? '')\n .attr('dy', '0.31em') // TODO(burdon): Based on font size.\n .attr('x', (d) => (d.x < Math.PI ? 6 : -6))\n .attr('text-anchor', (d) => (d.x < Math.PI ? 'start' : 'end'))\n .attr('transform', (d) => (d.x >= Math.PI ? 'rotate(180)' : null))\n // .text((d: any) => d.data.id)\n // .each(function (d: any) {\n // d.text = this;\n // })\n // .on('mouseover', overed)\n // .on('mouseout', outed)\n .call(\n (text) => text.text((d: any) => d.data.id.slice(0, 8)),\n // .text((d: any) => `${getId(d)} [${[(d as any).outgoing?.length ?? 0]}]`),\n );\n\n // https://d3js.org/d3-shape/radial-line\n const line = d3\n .lineRadial()\n .curve(d3.curveBundle.beta(0.85))\n .radius((d: any) => d.y)\n .angle((d: any) => d.x);\n\n // eslint-disable-next-line unused-imports/no-unused-vars\n const links = svg\n .append('g')\n .selectAll()\n .data(layout.leaves().flatMap((leaf: any) => leaf.outgoing))\n .join('path')\n .style('mix-blend-mode', 'multiply')\n .attr('class', slots?.path ?? '')\n .attr('d', ([i, o]) => {\n return line(i.path(o));\n })\n .each(function (d) {\n d.path = this;\n });\n\n // function overed(event: any, d: X) {\n // link.style('mix-blend-mode', null);\n // d3.select(this).attr('font-weight', 'bold');\n // d3.selectAll(d.incoming.map((d) => d.path))\n // .attr('stroke', color.in)\n // .raise();\n // d3.selectAll((d as any).incoming.map(([d]) => d.text))\n // .attr('fill', color.in)\n // .attr('font-weight', 'bold');\n // d3.selectAll(d.outgoing.map((d) => d.path))\n // .attr('stroke', color.out)\n // .raise();\n // d3.selectAll(d.outgoing.map(([, d]) => d.text))\n // .attr('fill', color.out)\n // .attr('font-weight', 'bold');\n // }\n\n // function outed(event: any, d: HierarchyNode<Datum>) {\n // // @ts-ignore\n // d3.select(this).attr('font-weight', null);\n // d3.selectAll(d.incoming.map((d) => d.path)).attr('stroke', null);\n // d3.selectAll(d.incoming.map(([d]) => d.text))\n // .attr('fill', null)\n // .attr('font-weight', null);\n // d3.selectAll(d.outgoing.map((d) => d.path)).attr('stroke', null);\n // d3.selectAll(d.outgoing.map(([, d]) => d.text))\n // .attr('fill', null)\n // .attr('font-weight', null);\n // }\n};\n\n// Monkey-patch with incoming/outgoing nodes.\nconst addLinks = (root: HierarchyNode<TreeNode>) => {\n // Map of nodes indexed by ID.\n const nodes = new Map(root.descendants().map((d) => [d.data.id, d]));\n const parents = root.descendants().reduce((map, d) => {\n if (d.children?.length) {\n map.set(d.data.id, d);\n }\n return map;\n }, new Map<string, HierarchyNode<TreeNode>>());\n\n for (const d of root.leaves()) {\n // (d as any).incoming = [];\n\n const parent = parents.get(d.data.id);\n if (parent) {\n // Skip the first node which is a placeholder created by flatten().\n (d as any).outgoing =\n parent.data.children?.slice(1).map((child) => {\n return [d, nodes.get(child.id)!];\n }) ?? [];\n } else {\n (d as any).outgoing = [];\n }\n }\n\n // for (const d of root.leaves()) {\n // for (const [_, o] of (d as any).outgoing) {\n // o.incoming.push(o);\n // }\n // }\n\n return root;\n};\n\n/**\n * We are using a hierarchy in order to group nodes by parent, but we want the parent\n * nodes to be positioned at the first level along with all descendents.\n * So we add a placeholder for all parents at the head of each group.\n * @param node\n */\nconst flatten = (node: TreeNode) => {\n const clone: TreeNode = {\n id: node.id,\n };\n\n // TODO(burdon): NOTE: Should exclude schema (since requires a tree).\n if (node.children?.length) {\n const children = node.children.map((child) => flatten(child));\n clone.children = [{ id: node.id }, ...children];\n }\n\n return clone;\n};\n\nexport default HierarchicalEdgeBundling;\n", "//\n// Copyright 2023 DXOS.org\n// Copyright 2022 Observable, Inc.\n//\n\nimport * as d3 from 'd3';\n\nimport { type TreeOptions } from '../Tree';\n\n// Released under the ISC license.\n// https://observablehq.com/@d3/radial-tree\n// https://observablehq.com/@d3/tree\nconst RadialTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {\n const svg = d3.select(s);\n svg.selectAll('*').remove();\n\n const {\n label, // given a node d, returns the display name\n radius = 400,\n r = 4, // radius of nodes\n slots,\n } = options;\n\n const arc = 2 * Math.PI;\n\n const root = d3.hierarchy(data);\n\n // Sort the nodes.\n // if (sort) {\n // root.sort(sort);\n // }\n\n // Compute labels and titles.\n const descendants = root.descendants();\n const getLabel = label === null ? null : descendants.map((d) => label(d.data));\n\n // Compute the layout.\n const layout = d3\n .tree()\n .size([arc, radius])\n .separation((a: any, b: any) => (a.parent === b.parent ? 1 : 2) / a.depth);\n layout(root);\n\n // Links.\n svg\n .append('g')\n .selectAll('path')\n .data(root.links())\n .join('path')\n .attr('class', slots?.path ?? '')\n .attr(\n 'd',\n d3\n .linkRadial()\n .angle((d: any) => d.x + Math.PI / 2)\n .radius((d: any) => d.y) as any,\n );\n\n // Nodes.\n const node = svg\n .append('g')\n .selectAll('a')\n .data(root.descendants())\n .join('a')\n // .attr('xlink:href', link == null ? null : (d) => link(d.data, d))\n // .attr('target', link == null ? null : linkTarget)\n .attr('transform', (d: any) => `rotate(${(d.x * 180) / Math.PI}) translate(${d.y},0)`);\n\n node\n .append('circle')\n .attr('class', slots?.node ?? '')\n .attr('r', r);\n\n // if (title != null) {\n // node.append('title').text((d) => title(d.data, d));\n // }\n\n // Text.\n if (getLabel) {\n node\n .append('text')\n .attr('transform', (d: any) => `rotate(${d.x >= Math.PI ? 180 : 0})`)\n .attr('dy', '0.32em')\n // eslint-disable-next-line no-mixed-operators\n .attr('x', (d: any) => (d.x < Math.PI === !d.children ? 6 : -6))\n // eslint-disable-next-line no-mixed-operators\n .attr('text-anchor', (d: any) => (d.x < Math.PI === !d.children ? 'start' : 'end'))\n // .attr('paint-order', 'stroke')\n .attr('class', slots?.text ?? '')\n .text((d, i) => getLabel[i]);\n }\n\n return svg.node();\n};\n\nexport default RadialTree;\n", "//\n// Copyright 2023 DXOS.org\n// Copyright 2021 Observable, Inc.\n//\n\nimport * as d3 from 'd3';\n\nimport { type TreeOptions } from '../Tree';\n\n// Released under the ISC license.\n// https://observablehq.com/@d3/tree\nconst TidyTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {\n const svg = d3.select(s);\n svg.selectAll('*').remove();\n\n const { label, width, height, r = 4, padding = 4, margin = 60, slots } = options;\n\n const root = d3.hierarchy(data);\n\n // Compute labels and titles.\n const descendants = root.descendants();\n const getLabel = label == null ? null : descendants.map((d) => label(d.data));\n\n // Compute the layout.\n const dx = 16;\n const dy = width / (root.height + padding);\n const layout = d3.tree().nodeSize([dx, dy]);\n layout(root);\n\n // Center the tree.\n let x0 = Infinity;\n let x1 = -x0;\n let y0 = Infinity;\n let y1 = -y0;\n root.each((d: any) => {\n if (d.x > x1) {\n x1 = d.x;\n }\n if (d.x < x0) {\n x0 = d.x;\n }\n if (d.y > y1) {\n y1 = d.y;\n }\n if (d.y < y0) {\n y0 = d.y;\n }\n });\n\n // TODO(burdon): Option to expand.\n // NOTE: x and y are flipped.\n const sx = Math.min(2, Math.max(1, (height - margin * 2) / (x1 - x0)));\n const oy = -(width - (y1 - y0)) / 2;\n\n // Links.\n svg\n .append('g')\n .selectAll('path')\n .data(root.links())\n .join('path')\n .attr('class', slots?.path ?? '')\n .attr(\n 'd',\n d3\n .link(d3.curveBumpX)\n .x((d: any) => d.y + oy)\n .y((d: any) => d.x * sx) as any,\n );\n\n // Nodes.\n const node = svg\n .append('g')\n .selectAll('a')\n .data(root.descendants())\n .join('a')\n // .attr('xlink:href', link == null ? null : (d) => link(d.data, d))\n // .attr('target', link == null ? null : linkTarget)\n .attr('transform', (d: any) => `translate(${d.y + oy},${d.x * sx})`);\n\n node\n .append('circle')\n .attr('class', slots?.node ?? '')\n .attr('r', r);\n\n // if (title != null) {\n // node.append('title').text((d) => title(d.data, d));\n // }\n\n if (getLabel) {\n node\n .append('text')\n\n .attr('dy', '0.32em')\n .attr('x', (d) => (d.children ? -6 : 6))\n .attr('text-anchor', (d) => (d.children ? 'end' : 'start'))\n // .attr('paint-order', 'stroke')\n .attr('class', slots?.text ?? '')\n .text((d, i) => getLabel[i]);\n }\n};\n\nexport default TidyTree;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { GraphModel } from '@dxos/gem-spore';\n\nexport type TreeNode = {\n id: string;\n label?: string;\n children?: TreeNode[];\n};\n\nexport const mapGraphToTreeData = <N>(model: GraphModel<N>, maxDepth = 8): TreeNode | undefined => {\n const mapNode = (node: N, depth = 0): TreeNode => {\n const treeNode: TreeNode = {\n id: model.idAccessor(node),\n label: model.idAccessor(node).slice(0, 8),\n };\n\n const links = model.graph.links.filter((link) => link.source === treeNode.id);\n if (depth < maxDepth) {\n treeNode.children = links.map((link) =>\n mapNode(model.graph.nodes.find((node) => model.idAccessor(node) === link.target)!, depth + 1),\n );\n }\n\n return treeNode;\n };\n\n let data: TreeNode | undefined;\n if (model.selected) {\n const node = model.graph.nodes.find((node) => model.idAccessor(node) === model.selected);\n if (node) {\n data = mapNode(node);\n }\n }\n\n return data;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { getTypename, type ReactiveEchoObject, type Space } from '@dxos/client/echo';\nimport { createSvgContext, defaultGridStyles, Grid, SVG, SVGRoot, Zoom } from '@dxos/gem-core';\nimport {\n defaultStyles,\n Graph as GraphComponent,\n GraphForceProjector,\n type GraphLayoutNode,\n Markers,\n} from '@dxos/gem-spore';\nimport { filterObjectsSync, type SearchResult } from '@dxos/plugin-search';\nimport { useThemeContext } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport '@dxos/gem-spore/styles';\n\nimport { type EchoGraphNode, SpaceGraphModel } from './graph-model';\nimport { Tree } from '../Tree';\n\ntype Slots = {\n root?: { className?: string };\n grid?: { className?: string };\n};\n\nconst slots: Slots = {};\n\nconst colors = [\n '[&>circle]:!fill-black-300 [&>circle]:!stroke-black-600',\n '[&>circle]:!fill-slate-300 [&>circle]:!stroke-slate-600',\n '[&>circle]:!fill-green-300 [&>circle]:!stroke-green-600',\n '[&>circle]:!fill-sky-300 [&>circle]:!stroke-sky-600',\n '[&>circle]:!fill-cyan-300 [&>circle]:!stroke-cyan-600',\n '[&>circle]:!fill-rose-300 [&>circle]:!stroke-rose-600',\n '[&>circle]:!fill-purple-300 [&>circle]:!stroke-purple-600',\n '[&>circle]:!fill-orange-300 [&>circle]:!stroke-orange-600',\n '[&>circle]:!fill-teal-300 [&>circle]:!stroke-teal-600',\n '[&>circle]:!fill-indigo-300 [&>circle]:!stroke-indigo-600',\n];\n\nexport type GraphProps = {\n space: Space;\n match?: RegExp;\n grid?: boolean;\n};\n\nexport const Graph: FC<GraphProps> = ({ space, match, grid }) => {\n const model = useMemo(() => (space ? new SpaceGraphModel({ schema: true }).open(space) : undefined), [space]);\n const [selected, setSelected] = useState<string>();\n const { themeMode } = useThemeContext();\n\n const context = createSvgContext();\n const projector = useMemo(\n () =>\n new GraphForceProjector<EchoGraphNode>(context, {\n forces: {\n manyBody: {\n strength: -100,\n },\n link: {\n distance: 120,\n },\n radial: {\n radius: 150,\n strength: 0.05,\n },\n },\n attributes: {\n radius: (node: GraphLayoutNode<EchoGraphNode>) => (node.data?.type === 'schema' ? 12 : 8),\n },\n }),\n [],\n );\n\n const filteredRef = useRef<SearchResult[]>();\n filteredRef.current = filterObjectsSync(model?.objects ?? [], match);\n useEffect(() => {\n void projector.start();\n }, [match]);\n\n const [colorMap] = useState(new Map<string, string>());\n\n if (!model) {\n return null;\n }\n\n if (selected) {\n return <Tree space={space} selected={selected} variant='tidy' onNodeClick={() => setSelected(undefined)} />;\n }\n\n return (\n <SVGRoot context={context}>\n <SVG className={mx(defaultStyles, slots?.root?.className)}>\n <Markers arrowSize={6} />\n {grid && <Grid className={slots?.grid?.className ?? defaultGridStyles(themeMode)} />}\n <Zoom extent={[1 / 2, 4]}>\n <GraphComponent\n model={model}\n projector={projector}\n drag\n arrows\n onSelect={(node) => setSelected(node?.data?.id)}\n labels={{\n text: (node: GraphLayoutNode<ReactiveEchoObject<any>>) => {\n if (filteredRef.current?.length && !filteredRef.current.some((object) => object.id === node.data?.id)) {\n return undefined;\n }\n\n // TODO(burdon): Use schema.\n return node.data?.label ?? node.data?.title ?? node.data?.name ?? node.data?.id.slice(0, 8);\n },\n }}\n attributes={{\n node: (node: GraphLayoutNode<ReactiveEchoObject<any>>) => {\n let className: string | undefined;\n if (node.data) {\n const { object } = node.data;\n if (object) {\n const typename = getTypename(object);\n if (typename) {\n className = colorMap.get(typename);\n if (!className) {\n className = colors[colorMap.size % colors.length];\n colorMap.set(typename, className);\n }\n }\n }\n }\n\n const selected = filteredRef.current?.some((object) => object.id === node.data?.id);\n const blur = !selected && !!filteredRef.current?.length;\n return {\n class: mx(className, blur && 'opacity-70'),\n };\n },\n link: () => ({\n class: '[&>path]:!stroke-neutral-300 dark:[&>path]:!stroke-neutral-700',\n }),\n }}\n />\n </Zoom>\n </SVG>\n </SVGRoot>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;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I,aAAahF,QAAQ1D,SAAS,KAAK;QACnC2I,cAAcjF,QAAQ1D,SAAS,KAAK;QACpC4I,YAAYjF,SAAS3D,SAAS,KAAK;QACnC6I,eAAelF,SAAS3D,SAAS,KAAK;QACtCE,OAAOoI;MACT;AAEA,UAAIhI,OAAM;AACR,cAAMwI,WAAWP,UAAU3F,IAAImE,OAAAA;AAC/B+B,mBAAWlD,QAAQ1G,IAAIsH,SAAUlG,OAAMX,OAAAA;MACzC;IACF;EACF,GAAG;IAACW;IAAMoD;IAAOC;GAAO;AAGxB,SACEkD,6BAAAA,QAAA,cAACkC,OAAAA;IAAI7J;IAAUiI,WAAU;IAA4B6B,SAAS,MAAMhC,cAAAA;KAClEH,6BAAAA,QAAA,cAACI,gBAAAA,SAAAA;IAAQrB;KACPiB,6BAAAA,QAAA,cAACK,gBAAAA,KAAAA,IAAAA,CAAAA,CAAAA;AAIT;",
6
- "names": ["import_react", "import_echo", "import_gem_core", "import_gem_spore", "SpaceGraphModel", "GraphModel", "constructor", "_options", "_graph", "nodes", "links", "graph", "objects", "_objects", "open", "space", "objectId", "_subscription", "query", "db", "object", "CollectionType", "subscribe", "map", "StoredSchema", "effectSchema", "schemaRegistry", "getSchemaById", "id", "type", "schema", "reduce", "objectSchema", "getSchema", "typename", "getType", "log", "info", "slice", "EchoSchema", "idx", "findIndex", "obj", "push", "source", "target", "AST", "getPropertySignatures", "ast", "forEach", "prop", "SchemaValidator", "hasTypeAnnotation", "name", "toString", "ReferenceAnnotationId", "value", "String", "refs", "Array", "isArray", "ref", "triggerUpdate", "fire", "setSelected", "close", "undefined", "HierarchicalEdgeBundling", "s", "data", "options", "svg", "select", "selectAll", "remove", "radius", "padding", "slots", "root", "hierarchy", "flatten", "tree", "cluster", "size", "Math", "PI", "layout", "addLinks", "node", "append", "leaves", "join", "attr", "d", "x", "y", "text", "call", "line", "lineRadial", "curve", "curveBundle", "beta", "angle", "flatMap", "leaf", "outgoing", "style", "path", "i", "o", "each", "Map", "descendants", "parents", "children", "length", "set", "parent", "get", "child", "clone", "RadialTree", "label", "r", "arc", "getLabel", "separation", "a", "b", "depth", "linkRadial", "TidyTree", "width", "height", "margin", "dx", "dy", "nodeSize", "x0", "Infinity", "x1", "y0", "y1", "sx", "min", "max", "oy", "link", "curveBumpX", "mapGraphToTreeData", "model", "maxDepth", "mapNode", "treeNode", "idAccessor", "filter", "find", "selected", "colors", "Graph", "match", "grid", "useMemo", "useState", "themeMode", "useThemeContext", "context", "createSvgContext", "projector", "GraphForceProjector", "forces", "manyBody", "strength", "distance", "radial", "attributes", "filteredRef", "useRef", "current", "filterObjectsSync", "useEffect", "start", "colorMap", "React", "Tree", "variant", "onNodeClick", "SVGRoot", "SVG", "className", "mx", "defaultStyles", "Markers", "arrowSize", "Grid", "defaultGridStyles", "Zoom", "extent", "GraphComponent", "drag", "arrows", "onSelect", "labels", "some", "title", "getTypename", "blur", "class", "defaultTreeLayoutSlots", "renderers", "setTree", "useResizeDetector", "marginLeft", "marginRight", "marginTop", "marginBottom", "renderer", "div", "onClick"]
7
- }