@dxos/plugin-explorer 0.7.2 → 0.7.3-staging.971cd8d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{ExplorerArticle-4OBHGIGW.mjs → ExplorerArticle-KSRCIPOE.mjs} +2 -2
- package/dist/lib/browser/{ExplorerMain-32VT4YBN.mjs → ExplorerMain-GZAQIZZN.mjs} +2 -2
- package/dist/lib/browser/{chunk-5VUTPEHW.mjs → chunk-EAKI45DO.mjs} +1 -1
- package/dist/lib/browser/{chunk-5VUTPEHW.mjs.map → chunk-EAKI45DO.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-ENP6U4EA.mjs → chunk-HIJQV4QE.mjs} +4 -3
- package/dist/lib/browser/chunk-HIJQV4QE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -4
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{ExplorerArticle-27ZL2ETR.cjs → ExplorerArticle-LQ454R2T.cjs} +6 -6
- package/dist/lib/node/{ExplorerMain-RTTGKG6Y.cjs → ExplorerMain-AVJLNOT4.cjs} +6 -6
- package/dist/lib/node/{chunk-IRNSEMMX.cjs → chunk-IVCQS2Z3.cjs} +10 -9
- package/dist/lib/node/chunk-IVCQS2Z3.cjs.map +7 -0
- package/dist/lib/node/{chunk-CAOILACU.cjs → chunk-VEJSCGZU.cjs} +4 -4
- package/dist/lib/node/{chunk-CAOILACU.cjs.map → chunk-VEJSCGZU.cjs.map} +1 -1
- package/dist/lib/node/index.cjs +17 -16
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +3 -3
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{ExplorerArticle-VETOT2T2.mjs → ExplorerArticle-IOA2RNC5.mjs} +2 -2
- package/dist/lib/node-esm/{ExplorerMain-U5T6IBTJ.mjs → ExplorerMain-ECYATOPW.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-GIFMBGAX.mjs → chunk-2KCTAIJN.mjs} +4 -3
- package/dist/lib/node-esm/chunk-2KCTAIJN.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7CJWNBLU.mjs → chunk-ATSNCSBK.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-7CJWNBLU.mjs.map → chunk-ATSNCSBK.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +5 -4
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
- package/dist/types/src/components/Graph/graph-model.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +23 -21
- package/src/ExplorerPlugin.tsx +1 -0
- package/src/components/Graph/Graph.stories.tsx +1 -1
- package/src/components/Graph/graph-model.ts +2 -11
- package/src/components/Tree/Tree.stories.tsx +3 -3
- package/src/types/types.ts +1 -1
- package/dist/lib/browser/chunk-ENP6U4EA.mjs.map +0 -7
- package/dist/lib/node/chunk-IRNSEMMX.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-GIFMBGAX.mjs.map +0 -7
- /package/dist/lib/browser/{ExplorerArticle-4OBHGIGW.mjs.map → ExplorerArticle-KSRCIPOE.mjs.map} +0 -0
- /package/dist/lib/browser/{ExplorerMain-32VT4YBN.mjs.map → ExplorerMain-GZAQIZZN.mjs.map} +0 -0
- /package/dist/lib/node/{ExplorerArticle-27ZL2ETR.cjs.map → ExplorerArticle-LQ454R2T.cjs.map} +0 -0
- /package/dist/lib/node/{ExplorerMain-RTTGKG6Y.cjs.map → ExplorerMain-AVJLNOT4.cjs.map} +0 -0
- /package/dist/lib/node-esm/{ExplorerArticle-VETOT2T2.mjs.map → ExplorerArticle-IOA2RNC5.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ExplorerMain-U5T6IBTJ.mjs.map → ExplorerMain-ECYATOPW.mjs.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Graph
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HIJQV4QE.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-
|
|
27
|
+
//# sourceMappingURL=ExplorerArticle-KSRCIPOE.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Graph
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HIJQV4QE.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-
|
|
33
|
+
//# sourceMappingURL=ExplorerMain-GZAQIZZN.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/view.ts", "../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Standardize views?\nexport class ViewType extends TypedObject({ typename: 'dxos.org/type/View', version: '0.1.0' })({\n name: S.optional(S.String),\n type: S.String,\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SurfaceProvides,\n TranslationsProvides,\n} from '@dxos/app-framework';\nimport { type SchemaProvides } from '@dxos/plugin-
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Standardize views?\nexport class ViewType extends TypedObject({ typename: 'dxos.org/type/View', version: '0.1.0' })({\n name: S.optional(S.String),\n type: S.String,\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SurfaceProvides,\n TranslationsProvides,\n} from '@dxos/app-framework';\nimport { type SchemaProvides } from '@dxos/plugin-space';\n\nimport { EXPLORER_PLUGIN } from '../meta';\n\nconst EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;\n\nexport enum ExplorerAction {\n CREATE = `${EXPLORER_ACTION}/create`,\n}\n\nexport type ExplorerPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n MetadataRecordsProvides &\n TranslationsProvides &\n SchemaProvides;\n"],
|
|
5
5
|
"mappings": ";;;;;AAIA,SAASA,GAAGC,mBAAmB;AAGxB,IAAMC,WAAN,cAAuBC,YAAY;EAAEC,UAAU;EAAsBC,SAAS;AAAQ,CAAA,EAAG;EAC9FC,MAAMC,EAAEC,SAASD,EAAEE,MAAM;EACzBC,MAAMH,EAAEE;AACV,CAAA,EAAA;AAAI;;;ACKJ,IAAME,kBAAkB,GAAGC,eAAAA;;UAEfC,iBAAAA;8CACD,GAAGF,eAAAA,SAAwB,IAAA;GAD1BE,mBAAAA,iBAAAA,CAAAA,EAAAA;",
|
|
6
6
|
"names": ["S", "TypedObject", "ViewType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "type", "EXPLORER_ACTION", "EXPLORER_PLUGIN", "ExplorerAction"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// packages/plugins/experimental/plugin-explorer/src/components/Graph/graph-model.ts
|
|
2
|
-
import { AST,
|
|
2
|
+
import { AST, MutableSchema, ReferenceAnnotationId, SchemaValidator, StoredSchema } from "@dxos/echo-schema";
|
|
3
3
|
import { GraphModel } from "@dxos/gem-spore";
|
|
4
4
|
import { log } from "@dxos/log";
|
|
5
5
|
import { CollectionType } from "@dxos/plugin-space/types";
|
|
6
|
+
import { getSchema, getType } from "@dxos/react-client/echo";
|
|
6
7
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-explorer/src/components/Graph/graph-model.ts";
|
|
7
8
|
var SpaceGraphModel = class extends GraphModel {
|
|
8
9
|
constructor(_options = {}) {
|
|
@@ -47,7 +48,7 @@ var SpaceGraphModel = class extends GraphModel {
|
|
|
47
48
|
id: object.id.slice(0, 8)
|
|
48
49
|
}, {
|
|
49
50
|
F: __dxlog_file,
|
|
50
|
-
L:
|
|
51
|
+
L: 72,
|
|
51
52
|
S: this,
|
|
52
53
|
C: (f, a) => f(...a)
|
|
53
54
|
});
|
|
@@ -471,4 +472,4 @@ export {
|
|
|
471
472
|
Tree,
|
|
472
473
|
Graph
|
|
473
474
|
};
|
|
474
|
-
//# sourceMappingURL=chunk-
|
|
475
|
+
//# sourceMappingURL=chunk-HIJQV4QE.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 { AST, MutableSchema, 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\nexport type EchoGraphNode = SchemaGraphNode | EchoObjectGraphNode;\n\ntype EchoObjectGraphNode = {\n id: string;\n type: 'echo-object';\n object: ReactiveEchoObject<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?: 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 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 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 MutableSchema)) {\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 ReactiveEchoObject, type Space, getType } 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};\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<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 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,SAASA,KAAKC,eAAeC,uBAA+BC,iBAAiBC,oBAAoB;AACjG,SAAyCC,k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AG;IAAChB;IAAMS;IAAOC;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", "MutableSchema", "ReferenceAnnotationId", "SchemaValidator", "StoredSchema", "GraphModel", "log", "CollectionType", "getSchema", "getType", "SpaceGraphModel", "constructor", "_options", "_graph", "nodes", "links", "graph", "objects", "_objects", "open", "space", "objectId", "_subscription", "query", "db", "object", "subscribe", "map", "effectSchema", "schemaRegistry", "getSchemaById", "id", "type", "schema", "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
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ExplorerAction,
|
|
3
3
|
ViewType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EAKI45DO.mjs";
|
|
5
5
|
import {
|
|
6
6
|
EXPLORER_PLUGIN,
|
|
7
7
|
meta_default
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
SpaceGraphModel,
|
|
12
12
|
Tree,
|
|
13
13
|
defaultTreeLayoutSlots
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HIJQV4QE.mjs";
|
|
15
15
|
|
|
16
16
|
// packages/plugins/experimental/plugin-explorer/src/ExplorerPlugin.tsx
|
|
17
17
|
import React3 from "react";
|
|
@@ -10847,8 +10847,8 @@ var Globe = ({ items = [], accessor, projection = "orthographic", options = defa
|
|
|
10847
10847
|
};
|
|
10848
10848
|
|
|
10849
10849
|
// packages/plugins/experimental/plugin-explorer/src/components/index.ts
|
|
10850
|
-
var ExplorerMain = lazy(() => import("./ExplorerMain-
|
|
10851
|
-
var ExplorerArticle = lazy(() => import("./ExplorerArticle-
|
|
10850
|
+
var ExplorerMain = lazy(() => import("./ExplorerMain-GZAQIZZN.mjs"));
|
|
10851
|
+
var ExplorerArticle = lazy(() => import("./ExplorerArticle-KSRCIPOE.mjs"));
|
|
10852
10852
|
|
|
10853
10853
|
// packages/plugins/experimental/plugin-explorer/src/translations.ts
|
|
10854
10854
|
var translations_default = [
|
|
@@ -10872,6 +10872,7 @@ var ExplorerPlugin = () => {
|
|
|
10872
10872
|
metadata: {
|
|
10873
10873
|
records: {
|
|
10874
10874
|
[ViewType.typename]: {
|
|
10875
|
+
createObject: ExplorerAction.CREATE,
|
|
10875
10876
|
placeholder: [
|
|
10876
10877
|
"object title placeholder",
|
|
10877
10878
|
{
|