@dxos/plugin-explorer 0.8.2-main.12df754 → 0.8.2-main.36232bc
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/{chunk-B2DMPSP5.mjs → chunk-RRXH3JYB.mjs} +16 -16
- package/dist/lib/browser/{chunk-B2DMPSP5.mjs.map → chunk-RRXH3JYB.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-N7TC6BMF.mjs → react-surface-TPR4VUPE.mjs} +2 -2
- package/dist/lib/node/{chunk-HCDBN6NN.cjs → chunk-4QUNUHKB.cjs} +19 -19
- package/dist/lib/node/{chunk-HCDBN6NN.cjs.map → chunk-4QUNUHKB.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +7 -7
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-WD4G2NRS.cjs → react-surface-OLIOGYOK.cjs} +6 -6
- package/dist/lib/node-esm/{chunk-PZOORWFE.mjs → chunk-VNMYGDGZ.mjs} +16 -16
- package/dist/lib/node-esm/{chunk-PZOORWFE.mjs.map → chunk-VNMYGDGZ.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-J5SW7VF2.mjs → react-surface-QLB55AWT.mjs} +2 -2
- package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/RadialTree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/TidyTree.d.ts.map +1 -1
- package/package.json +24 -24
- package/src/components/Globe/Globe.stories.tsx +13 -13
- package/src/components/Tree/layout/HierarchicalEdgeBundling.ts +17 -19
- package/src/components/Tree/layout/RadialTree.ts +5 -7
- package/src/components/Tree/layout/TidyTree.ts +5 -6
- /package/dist/lib/browser/{react-surface-N7TC6BMF.mjs.map → react-surface-TPR4VUPE.mjs.map} +0 -0
- /package/dist/lib/node/{react-surface-WD4G2NRS.cjs.map → react-surface-OLIOGYOK.cjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-J5SW7VF2.mjs.map → react-surface-QLB55AWT.mjs.map} +0 -0
|
@@ -10831,19 +10831,19 @@ import { createSvgContext, SVG, SVGRoot } from "@dxos/gem-core";
|
|
|
10831
10831
|
import { useAsyncState } from "@dxos/react-ui";
|
|
10832
10832
|
|
|
10833
10833
|
// packages/plugins/plugin-explorer/src/components/Tree/layout/HierarchicalEdgeBundling.ts
|
|
10834
|
-
import
|
|
10834
|
+
import { cluster, curveBundle, hierarchy, lineRadial, select } from "d3";
|
|
10835
10835
|
var HierarchicalEdgeBundling = (s, data, options) => {
|
|
10836
|
-
const svg =
|
|
10836
|
+
const svg = select(s);
|
|
10837
10837
|
svg.selectAll("*").remove();
|
|
10838
10838
|
const { radius = 600, padding = 100, slots } = options;
|
|
10839
|
-
const root =
|
|
10840
|
-
const tree3 =
|
|
10839
|
+
const root = hierarchy(flatten(data));
|
|
10840
|
+
const tree3 = cluster().size([
|
|
10841
10841
|
2 * Math.PI,
|
|
10842
10842
|
radius - padding
|
|
10843
10843
|
]);
|
|
10844
10844
|
const layout = tree3(addLinks(root));
|
|
10845
10845
|
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", slots?.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)));
|
|
10846
|
-
const line =
|
|
10846
|
+
const line = lineRadial().curve(curveBundle.beta(0.85)).radius((d) => d.y).angle((d) => d.x);
|
|
10847
10847
|
const links = svg.append("g").selectAll().data(layout.leaves().flatMap((leaf) => leaf.outgoing)).join("path").style("mix-blend-mode", "multiply").attr("class", slots?.path ?? "").attr("d", ([i, o]) => {
|
|
10848
10848
|
return line(i.path(o));
|
|
10849
10849
|
}).each(function(d) {
|
|
@@ -10894,21 +10894,21 @@ var flatten = (node) => {
|
|
|
10894
10894
|
var HierarchicalEdgeBundling_default = HierarchicalEdgeBundling;
|
|
10895
10895
|
|
|
10896
10896
|
// packages/plugins/plugin-explorer/src/components/Tree/layout/RadialTree.ts
|
|
10897
|
-
import
|
|
10897
|
+
import { hierarchy as hierarchy2, linkRadial, select as select2, tree } from "d3";
|
|
10898
10898
|
var RadialTree = (s, data, options) => {
|
|
10899
|
-
const svg =
|
|
10899
|
+
const svg = select2(s);
|
|
10900
10900
|
svg.selectAll("*").remove();
|
|
10901
10901
|
const { label, radius = 400, r = 4, slots } = options;
|
|
10902
10902
|
const arc = 2 * Math.PI;
|
|
10903
|
-
const root =
|
|
10903
|
+
const root = hierarchy2(data);
|
|
10904
10904
|
const descendants = root.descendants();
|
|
10905
10905
|
const getLabel = label === null ? null : descendants.map((d) => label(d.data));
|
|
10906
|
-
const layout =
|
|
10906
|
+
const layout = tree().size([
|
|
10907
10907
|
arc,
|
|
10908
10908
|
radius
|
|
10909
10909
|
]).separation((a, b) => (a.parent === b.parent ? 1 : 2) / a.depth);
|
|
10910
10910
|
layout(root);
|
|
10911
|
-
svg.append("g").selectAll("path").data(root.links()).join("path").attr("class", slots?.path ?? "").attr("d",
|
|
10911
|
+
svg.append("g").selectAll("path").data(root.links()).join("path").attr("class", slots?.path ?? "").attr("d", linkRadial().angle((d) => d.x + Math.PI / 2).radius((d) => d.y));
|
|
10912
10912
|
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)`);
|
|
10913
10913
|
node.append("circle").attr("class", slots?.node ?? "").attr("r", r);
|
|
10914
10914
|
if (getLabel) {
|
|
@@ -10919,17 +10919,17 @@ var RadialTree = (s, data, options) => {
|
|
|
10919
10919
|
var RadialTree_default = RadialTree;
|
|
10920
10920
|
|
|
10921
10921
|
// packages/plugins/plugin-explorer/src/components/Tree/layout/TidyTree.ts
|
|
10922
|
-
import
|
|
10922
|
+
import { curveBumpX, hierarchy as hierarchy3, link, select as select3, tree as tree2 } from "d3";
|
|
10923
10923
|
var TidyTree = (s, data, options) => {
|
|
10924
|
-
const svg =
|
|
10924
|
+
const svg = select3(s);
|
|
10925
10925
|
svg.selectAll("*").remove();
|
|
10926
10926
|
const { label, width, height, r = 4, padding = 4, margin = 60, slots } = options;
|
|
10927
|
-
const root =
|
|
10927
|
+
const root = hierarchy3(data);
|
|
10928
10928
|
const descendants = root.descendants();
|
|
10929
10929
|
const getLabel = label == null ? null : descendants.map((d) => label(d.data));
|
|
10930
10930
|
const dx = 16;
|
|
10931
10931
|
const dy = width / (root.height + padding);
|
|
10932
|
-
const layout =
|
|
10932
|
+
const layout = tree2().nodeSize([
|
|
10933
10933
|
dx,
|
|
10934
10934
|
dy
|
|
10935
10935
|
]);
|
|
@@ -10954,7 +10954,7 @@ var TidyTree = (s, data, options) => {
|
|
|
10954
10954
|
});
|
|
10955
10955
|
const sx = Math.min(2, Math.max(1, (height - margin * 2) / (x1 - x0)));
|
|
10956
10956
|
const oy = -(width - (y1 - y0)) / 2;
|
|
10957
|
-
svg.append("g").selectAll("path").data(root.links()).join("path").attr("class", slots?.path ?? "").attr("d",
|
|
10957
|
+
svg.append("g").selectAll("path").data(root.links()).join("path").attr("class", slots?.path ?? "").attr("d", link(curveBumpX).x((d) => d.y + oy).y((d) => d.x * sx));
|
|
10958
10958
|
const node = svg.append("g").selectAll("a").data(root.descendants()).join("a").attr("transform", (d) => `translate(${d.y + oy},${d.x * sx})`);
|
|
10959
10959
|
node.append("circle").attr("class", slots?.node ?? "").attr("r", r);
|
|
10960
10960
|
if (getLabel) {
|
|
@@ -11068,4 +11068,4 @@ export {
|
|
|
11068
11068
|
Tree,
|
|
11069
11069
|
ExplorerContainer
|
|
11070
11070
|
};
|
|
11071
|
-
//# sourceMappingURL=chunk-
|
|
11071
|
+
//# sourceMappingURL=chunk-RRXH3JYB.mjs.map
|