@dxos/plugin-explorer 0.6.9-staging.8e43e2a → 0.6.10-main.bbdfaa4

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 (38) hide show
  1. package/dist/lib/browser/{ExplorerArticle-IPAJQMAX.mjs → ExplorerArticle-2LF7QANN.mjs} +2 -2
  2. package/dist/lib/browser/{ExplorerMain-3KFXOEYO.mjs → ExplorerMain-K6Z6UVZR.mjs} +2 -2
  3. package/dist/lib/browser/{chunk-7YEM64IQ.mjs → chunk-XKITKIPQ.mjs} +9 -8
  4. package/dist/lib/browser/chunk-XKITKIPQ.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +5 -37862
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/node/{ExplorerArticle-PYOGBY3Z.cjs → ExplorerArticle-PQEEN244.cjs} +6 -6
  9. package/dist/lib/node/{ExplorerMain-HGCLO5O4.cjs → ExplorerMain-IGUMYIAN.cjs} +6 -6
  10. package/dist/lib/node/{chunk-2GOPBQBC.cjs → chunk-K4PB5A4K.cjs} +9 -8
  11. package/dist/lib/node/chunk-K4PB5A4K.cjs.map +7 -0
  12. package/dist/lib/node/index.cjs +9 -37862
  13. package/dist/lib/node/index.cjs.map +4 -4
  14. package/dist/lib/node/meta.json +1 -1
  15. package/dist/types/src/components/Chart/Chart.stories.d.ts +1 -1
  16. package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
  17. package/dist/types/src/components/Globe/Globe.stories.d.ts +1 -1
  18. package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
  19. package/dist/types/src/components/Graph/Graph.d.ts +1 -0
  20. package/dist/types/src/components/Graph/Graph.d.ts.map +1 -1
  21. package/dist/types/src/components/Graph/Graph.stories.d.ts +1 -1
  22. package/dist/types/src/components/Graph/Graph.stories.d.ts.map +1 -1
  23. package/dist/types/src/components/Tree/Tree.stories.d.ts +1 -1
  24. package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
  25. package/package.json +28 -23
  26. package/src/components/Chart/Chart.stories.tsx +9 -15
  27. package/src/components/Globe/Globe.stories.tsx +14 -38
  28. package/src/components/Globe/Globe.tsx +3 -3
  29. package/src/components/Graph/Graph.stories.tsx +1 -1
  30. package/src/components/Graph/Graph.tsx +13 -13
  31. package/src/components/Tree/Tree.stories.tsx +1 -1
  32. package/src/components/Tree/Tree.tsx +3 -3
  33. package/dist/lib/browser/chunk-7YEM64IQ.mjs.map +0 -7
  34. package/dist/lib/node/chunk-2GOPBQBC.cjs.map +0 -7
  35. /package/dist/lib/browser/{ExplorerArticle-IPAJQMAX.mjs.map → ExplorerArticle-2LF7QANN.mjs.map} +0 -0
  36. /package/dist/lib/browser/{ExplorerMain-3KFXOEYO.mjs.map → ExplorerMain-K6Z6UVZR.mjs.map} +0 -0
  37. /package/dist/lib/node/{ExplorerArticle-PYOGBY3Z.cjs.map → ExplorerArticle-PQEEN244.cjs.map} +0 -0
  38. /package/dist/lib/node/{ExplorerMain-HGCLO5O4.cjs.map → ExplorerMain-IGUMYIAN.cjs.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Graph
3
- } from "./chunk-7YEM64IQ.mjs";
3
+ } from "./chunk-XKITKIPQ.mjs";
4
4
 
5
5
  // packages/plugins/experimental/plugin-explorer/src/components/ExplorerArticle.tsx
6
6
  import React from "react";
@@ -24,4 +24,4 @@ var ExplorerArticle_default = ExplorerArticle;
24
24
  export {
25
25
  ExplorerArticle_default as default
26
26
  };
27
- //# sourceMappingURL=ExplorerArticle-IPAJQMAX.mjs.map
27
+ //# sourceMappingURL=ExplorerArticle-2LF7QANN.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Graph
3
- } from "./chunk-7YEM64IQ.mjs";
3
+ } from "./chunk-XKITKIPQ.mjs";
4
4
 
5
5
  // packages/plugins/experimental/plugin-explorer/src/components/ExplorerMain.tsx
6
6
  import React from "react";
@@ -30,4 +30,4 @@ var ExplorerMain_default = ExplorerMain;
30
30
  export {
31
31
  ExplorerMain_default as default
32
32
  };
33
- //# sourceMappingURL=ExplorerMain-3KFXOEYO.mjs.map
33
+ //# sourceMappingURL=ExplorerMain-K6Z6UVZR.mjs.map
@@ -112,7 +112,7 @@ var SpaceGraphModel = class extends GraphModel {
112
112
  // packages/plugins/experimental/plugin-explorer/src/components/Tree/Tree.tsx
113
113
  import React2, { useEffect as useEffect2, useMemo as useMemo2, useState as useState2 } from "react";
114
114
  import { useResizeDetector } from "react-resize-detector";
115
- import { createSvgContext as createSvgContext2, SVG as SVG2, SVGContextProvider as SVGContextProvider2 } from "@dxos/gem-core";
115
+ import { createSvgContext as createSvgContext2, SVG as SVG2, SVGRoot as SVGRoot2 } from "@dxos/gem-core";
116
116
 
117
117
  // packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/HierarchicalEdgeBundling.ts
118
118
  import * as d3 from "d3";
@@ -273,11 +273,12 @@ var mapGraphToTreeData = (model, maxDepth = 8) => {
273
273
  // packages/plugins/experimental/plugin-explorer/src/components/Graph/Graph.tsx
274
274
  import React, { useEffect, useMemo, useRef, useState } from "react";
275
275
  import { getType as getType2 } from "@dxos/echo-schema";
276
- import { createSvgContext, darkGridStyles, defaultGridStyles, Grid, SVG, SVGContextProvider, Zoom } from "@dxos/gem-core";
277
- import { Graph as GraphComponent, GraphForceProjector, Markers } from "@dxos/gem-spore";
276
+ import { createSvgContext, defaultGridStyles, Grid, SVG, SVGRoot, Zoom } from "@dxos/gem-core";
277
+ import { defaultStyles, Graph as GraphComponent, GraphForceProjector, Markers } from "@dxos/gem-spore";
278
278
  import { filterObjectsSync } from "@dxos/plugin-search";
279
279
  import { useThemeContext } from "@dxos/react-ui";
280
280
  import { mx } from "@dxos/react-ui-theme";
281
+ import "@dxos/gem-spore/styles";
281
282
  var slots = {};
282
283
  var colors = [
283
284
  "[&>circle]:!fill-black-300 [&>circle]:!stroke-black-600",
@@ -336,14 +337,14 @@ var Graph = ({ space, match }) => {
336
337
  onNodeClick: () => setSelected(void 0)
337
338
  });
338
339
  }
339
- return /* @__PURE__ */ React.createElement(SVGContextProvider, {
340
+ return /* @__PURE__ */ React.createElement(SVGRoot, {
340
341
  context
341
342
  }, /* @__PURE__ */ React.createElement(SVG, {
342
- className: slots?.root?.className
343
+ className: mx(defaultStyles, slots?.root?.className)
343
344
  }, /* @__PURE__ */ React.createElement(Markers, {
344
345
  arrowSize: 6
345
346
  }), /* @__PURE__ */ React.createElement(Grid, {
346
- className: slots?.grid?.className ?? themeMode === "dark" ? darkGridStyles : defaultGridStyles
347
+ className: slots?.grid?.className ?? defaultGridStyles(themeMode)
347
348
  }), /* @__PURE__ */ React.createElement(Zoom, {
348
349
  extent: [
349
350
  1 / 2,
@@ -459,7 +460,7 @@ var Tree = ({ space, selected, variant = "tidy", onNodeClick }) => {
459
460
  ref,
460
461
  className: "flex grow overflow-hidden",
461
462
  onClick: () => onNodeClick?.()
462
- }, /* @__PURE__ */ React2.createElement(SVGContextProvider2, {
463
+ }, /* @__PURE__ */ React2.createElement(SVGRoot2, {
463
464
  context
464
465
  }, /* @__PURE__ */ React2.createElement(SVG2, null)));
465
466
  };
@@ -470,4 +471,4 @@ export {
470
471
  Tree,
471
472
  Graph
472
473
  };
473
- //# sourceMappingURL=chunk-7YEM64IQ.mjs.map
474
+ //# sourceMappingURL=chunk-XKITKIPQ.mjs.map
@@ -0,0 +1,7 @@
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 {\n AST,\n DynamicSchema,\n getSchema,\n getType,\n ReferenceAnnotationId,\n type S,\n SchemaValidator,\n StoredSchema,\n} 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 EchoReactiveObject, type Space, type Subscription } from '@dxos/react-client/echo';\n\nexport type SpaceGraphModelOptions = {\n schema?: boolean;\n};\n\nexport type EchoGraphNode = SchemaGraphNode | EchoObjectGraphNode;\n\ntype EchoObjectGraphNode = {\n id: string;\n type: 'echo-object';\n object: EchoReactiveObject<any>;\n};\n\ntype SchemaGraphNode = {\n id: string;\n type: 'schema';\n schema: S.Schema<any>;\n};\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?: EchoReactiveObject<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(): EchoReactiveObject<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: EchoReactiveObject<any>) => !(object instanceof CollectionType));\n\n this._subscription = query.subscribe(\n ({ objects }) => {\n this._objects = objects;\n this._graph.nodes = objects.map((object) => {\n if (object instanceof StoredSchema) {\n const effectSchema = space.db.schema.getSchemaById(object.id)!;\n return { type: 'schema', id: object.id, schema: effectSchema.schema };\n }\n return { type: 'echo-object', id: object.id, object };\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 DynamicSchema)) {\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 { type Space } from '@dxos/client/echo';\nimport { type EchoReactiveObject, getType } from '@dxos/echo-schema';\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};\n\nexport const Graph: FC<GraphProps> = ({ space, match }) => {\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: 180,\n },\n radial: {\n radius: 200,\n strength: 0.05,\n },\n },\n attributes: {\n radius: (node: GraphLayoutNode<EchoGraphNode>) => (node.data?.type === 'schema' ? 24 : 12),\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 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<EchoReactiveObject<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<EchoReactiveObject<any>>) => {\n let className: string | undefined;\n if (node.data) {\n const typename = getType(node.data)?.objectId;\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 const selected = filteredRef.current?.some((object) => object.id === node.data?.id);\n return {\n class: mx(\n filteredRef.current?.length\n ? selected\n ? [className]\n : '[&>text]:!fill-neutral-300'\n : ['[&>text]:!fill-neutral-700', className],\n ),\n };\n },\n link: () => ({\n class: '[&>path]:!stroke-neutral-300',\n }),\n }}\n />\n </Zoom>\n </SVG>\n </SVGRoot>\n );\n};\n"],
5
+ "mappings": ";AAIA,SACEA,KACAC,eACAC,WACAC,SACAC,uBAEAC,iBACAC,oBACK;AACP,SA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;GAAO;AAGxB,SACE,gBAAAkB,OAAA,cAACC,OAAAA;IAAIrB;IAAUsB,WAAU;IAA4BC,SAAS,MAAMrC,cAAAA;KAClE,gBAAAkC,OAAA,cAACI,UAAAA;IAAQ1B;KACP,gBAAAsB,OAAA,cAACK,MAAAA,IAAAA,CAAAA,CAAAA;AAIT;",
6
+ "names": ["AST", "DynamicSchema", "getSchema", "getType", "ReferenceAnnotationId", "SchemaValidator", "StoredSchema", "GraphModel", "log", "CollectionType", "SpaceGraphModel", "constructor", "_options", "_graph", "nodes", "links", "graph", "objects", "_objects", "open", "space", "objectId", "_subscription", "query", "db", "object", "subscribe", "map", "effectSchema", "schema", "getSchemaById", "id", "type", "reduce", "objectSchema", "typename", "info", "slice", "idx", "findIndex", "obj", "push", "source", "target", "getPropertySignatures", "ast", "forEach", "prop", "hasTypeAnnotation", "name", "toString", "value", "String", "refs", "Array", "isArray", "ref", "triggerUpdate", "fire", "setSelected", "close", "undefined", "React", "useEffect", "useMemo", "useState", "useResizeDetector", "createSvgContext", "SVG", "SVGRoot", "d3", "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", "id", "slice", "line", "lineRadial", "curve", "curveBundle", "beta", "angle", "links", "flatMap", "leaf", "outgoing", "style", "path", "i", "o", "each", "nodes", "Map", "descendants", "map", "parents", "reduce", "children", "length", "set", "parent", "get", "child", "clone", "d3", "RadialTree", "s", "data", "options", "svg", "select", "selectAll", "remove", "label", "radius", "r", "slots", "arc", "Math", "PI", "root", "hierarchy", "descendants", "getLabel", "map", "d", "layout", "tree", "size", "separation", "a", "b", "parent", "depth", "append", "links", "join", "attr", "path", "linkRadial", "angle", "x", "y", "node", "children", "text", "i", "d3", "TidyTree", "s", "data", "options", "svg", "select", "selectAll", "remove", "label", "width", "height", "r", "padding", "margin", "slots", "root", "hierarchy", "descendants", "getLabel", "map", "d", "dx", "dy", "layout", "tree", "nodeSize", "x0", "Infinity", "x1", "y0", "y1", "each", "x", "y", "sx", "Math", "min", "max", "oy", "append", "links", "join", "attr", "path", "link", "curveBumpX", "node", "children", "text", "i", "mapGraphToTreeData", "model", "maxDepth", "mapNode", "node", "depth", "treeNode", "id", "idAccessor", "label", "slice", "links", "graph", "filter", "link", "source", "children", "map", "nodes", "find", "target", "data", "selected", "React", "useEffect", "useMemo", "useRef", "useState", "getType", "createSvgContext", "defaultGridStyles", "Grid", "SVG", "SVGRoot", "Zoom", "defaultStyles", "Graph", "GraphComponent", "GraphForceProjector", "Markers", "filterObjectsSync", "useThemeContext", "mx", "slots", "colors", "Graph", "space", "match", "model", "useMemo", "SpaceGraphModel", "schema", "open", "undefined", "selected", "setSelected", "useState", "themeMode", "useThemeContext", "context", "createSvgContext", "projector", "GraphForceProjector", "forces", "manyBody", "strength", "link", "distance", "radial", "radius", "attributes", "node", "data", "type", "filteredRef", "useRef", "current", "filterObjectsSync", "objects", "useEffect", "start", "colorMap", "Map", "Tree", "variant", "onNodeClick", "SVGRoot", "SVG", "className", "mx", "defaultStyles", "root", "Markers", "arrowSize", "Grid", "grid", "defaultGridStyles", "Zoom", "extent", "GraphComponent", "drag", "arrows", "onSelect", "id", "labels", "text", "length", "some", "object", "label", "title", "name", "slice", "typename", "getType", "objectId", "get", "size", "set", "class", "defaultTreeLayoutSlots", "node", "path", "text", "renderers", "Map", "TidyTree", "RadialTree", "HierarchicalEdgeBundling", "Tree", "space", "selected", "variant", "onNodeClick", "model", "useMemo", "SpaceGraphModel", "open", "undefined", "tree", "setTree", "useState", "useEffect", "subscribe", "mapGraphToTreeData", "context", "createSvgContext", "ref", "width", "height", "useResizeDetector", "size", "Math", "min", "radius", "options", "label", "d", "id", "marginLeft", "marginRight", "marginTop", "marginBottom", "slots", "renderer", "get", "current", "React", "div", "className", "onClick", "SVGRoot", "SVG"]
7
+ }