@@ -14568,10 +14568,10 @@ var getAngleFromPosition = (x2, y2) => {
14568
14568
return Math.atan2(y2, x2) * 180 / Math.PI;
14569
14569
};
14570
14570
var keepCircleInsideCircle = (parentR, parentPosition, childR, childPosition) => {
14571
- const padding = 6;
14572
14571
const distance = Math.sqrt(Math.pow(parentPosition[0] - childPosition[0], 2) + Math.pow(parentPosition[1] - childPosition[1], 2));
14573
- if (distance > parentR + childR + padding) {
14574
- const angle = getAngleFromPosition(parentPosition[0] - childPosition[0], parentPosition[1] - childPosition[1]);
14572
+ const angle = getAngleFromPosition(childPosition[0] - parentPosition[0], childPosition[1] - parentPosition[1]);
14573
+ const padding = angle < -40 && angle > -150 ? 13 : 2;
14574
+ if (distance > parentR - childR - padding) {
14575
14575
const diff = getPositionFromAngleAndDistance(angle, parentR - childR - padding);
14576
14576
return [
14577
14577
parentPosition[0] + diff[0],
@@ -14593,15 +14593,18 @@ var fileColors = {
14593
14593
svg: "#EA4C85",
14594
14594
css: "#E97BF2",
14595
14595
svelte: "#D9D2C2",
14596
+ scss: "#9980FA",
14596
14597
html: "#ffb8b8",
14598
+ go: "#c7ecee",
14599
+ rb: "#eb4d4b",
14597
14600
m: "#0fb9b1",
14598
14601
py: "#9980FA",
14599
14602
sh: "#badc58"
14600
14603
};
14601
14604
var colorTheme = "file";
14602
14605
var looseFilesId = "__structure_loose_file__";
14603
- var width = 1400 ;
14604
- var height = 700 ;
14606
+ var width = 1e3 ;
14607
+ var height = 1e3 ;
14605
14608
var maxDepth = 9;
14606
14609
var Tree = ({ data, filesChanged = [] }) => {
14607
14610
const [selectedNodeId, setSelectedNodeId] = (0, import_react2.useState)(null);
@@ -14635,14 +14638,14 @@ var Tree = ({ data, filesChanged = [] }) => {
14635
14638
});
14636
14639
let packedTree = pack_default().size([width, height * 1.3]).padding((d) => {
14637
14640
if (d.depth <= 0)
14638
- return 6 ;
14641
+ return 0 ;
14639
14642
const hasChildWithNoChildren = d.children.filter((d2) => {
14640
14643
var _a;
14641
14644
return !((_a = d2.children) == null ? void 0 : _a.length);
14642
14645
}).length > 1;
14643
14646
if (hasChildWithNoChildren)
14644
- return 6 ;
14645
- return 30 ;
14647
+ return 9 ;
14648
+ return 15 ;
14646
14649
})(hierarchicalData);
14647
14650
packedTree.children = reflowSiblings(packedTree.children, cachedPositions.current);
14648
14651
const children2 = packedTree.descendants();
@@ -14786,7 +14789,7 @@ var Tree = ({ data, filesChanged = [] }) => {
14786
14789
style: {
14787
14790
pointerEvents: "none",
14788
14791
opacity: 0.8,
14789
- fontSize: "10px ",
14792
+ fontSize: "14px ",
14790
14793
fontWeight: 500,
14791
14794
transition: "all 0.5s ease-out"
14792
14795
},
@@ -14799,7 +14802,7 @@ var Tree = ({ data, filesChanged = [] }) => {
14799
14802
style: {
14800
14803
pointerEvents: "none",
14801
14804
opacity: 0.8,
14802
- fontSize: "10px ",
14805
+ fontSize: "14px ",
14803
14806
fontWeight: 500,
14804
14807
transition: "all 0.5s ease-out"
14805
14808
},
@@ -14810,7 +14813,7 @@ var Tree = ({ data, filesChanged = [] }) => {
14810
14813
style: {
14811
14814
pointerEvents: "none",
14812
14815
opacity: 0.8,
14813
- fontSize: "10px ",
14816
+ fontSize: "14px ",
14814
14817
fontWeight: 500,
14815
14818
mixBlendMode: "multiply",
14816
14819
transition: "all 0.5s ease-out"
@@ -14859,24 +14862,24 @@ var Tree = ({ data, filesChanged = [] }) => {
14859
14862
style: { pointerEvents: "none", transition: "all 0.5s ease-out" },
14860
14863
transform: `translate(${x2}, ${y2})`
14861
14864
}, /* @__PURE__ */ import_react2.default.createElement(CircleText, {
14862
- style: { fontSize: "10px ", transition: "all 0.5s ease-out" },
14863
- r: r + 6 ,
14865
+ style: { fontSize: "14px ", transition: "all 0.5s ease-out" },
14866
+ r: r - 3 ,
14864
14867
fill: "#374151",
14865
14868
stroke: "white",
14866
- strokeWidth: "4 ",
14869
+ strokeWidth: "6 ",
14867
14870
text: data2.label
14868
14871
}), /* @__PURE__ */ import_react2.default.createElement(CircleText, {
14869
- style: { fontSize: "10px ", transition: "all 0.5s ease-out" },
14872
+ style: { fontSize: "14px ", transition: "all 0.5s ease-out" },
14870
14873
fill: "#374151",
14871
- r: r + 6 ,
14874
+ r: r - 3 ,
14872
14875
text: data2.label
14873
14876
}));
14874
14877
}), !!selectedNode && (!selectedNode.children || selectedNode.depth === maxDepth) && /* @__PURE__ */ import_react2.default.createElement("g", {
14875
14878
transform: `translate(${selectedNode.x}, ${selectedNode.y})`
14876
14879
}, /* @__PURE__ */ import_react2.default.createElement("text", {
14877
14880
style: {
14878
14881
pointerEvents: "none",
14879
- fontSize: "10px ",
14882
+ fontSize: "14px ",
14880
14883
fontWeight: 500,
14881
14884
transition: "all 0.5s ease-out"
14882
14885
},
@@ -14887,7 +14890,7 @@ var Tree = ({ data, filesChanged = [] }) => {
14887
14890
}, selectedNode.data.label), /* @__PURE__ */ import_react2.default.createElement("text", {
14888
14891
style: {
14889
14892
pointerEvents: "none",
14890
- fontSize: "10px ",
14893
+ fontSize: "14px ",
14891
14894
fontWeight: 500,
14892
14895
transition: "all 0.5s ease-out"
14893
14896
},
@@ -14908,7 +14911,7 @@ var Legend = ({ fileTypes = [] }) => {
14908
14911
fill: fileColors[extension]
14909
14912
}), /* @__PURE__ */ import_react2.default.createElement("text", {
14910
14913
x: "10",
14911
- style: { fontSize: "10px ", fontWeight: 300 },
14914
+ style: { fontSize: "14px ", fontWeight: 300 },
14912
14915
dominantBaseline: "middle"
14913
14916
}, ".", extension))), /* @__PURE__ */ import_react2.default.createElement("div", {
14914
14917
className: "w-20 whitespace-nowrap text-sm text-gray-500 font-light italic"
@@ -14966,7 +14969,7 @@ var processChild = (child, getColor, cachedOrders, i = 0) => {
14966
14969
var reflowSiblings = (siblings, cachedPositions = {}, parentRadius, parentPosition) => {
14967
14970
if (!siblings)
14968
14971
return;
14969
- const items = [...siblings.map((d) => {
14972
+ let items = [...siblings.map((d) => {
14970
14973
var _a, _b;
14971
14974
return {
14972
14975
...d,
@@ -14982,23 +14985,23 @@ var reflowSiblings = (siblings, cachedPositions = {}, parentRadius, parentPositi
14982
14985
return ((_a = cachedPositions[d.data.path]) == null ? void 0 : _a[0]) || width / 2;
14983
14986
}).strength((d) => {
14984
14987
var _a;
14985
- return ((_a = cachedPositions[d.data.path]) == null ? void 0 : _a[1]) ? 0.5 : 0.1 ;
14988
+ return ((_a = cachedPositions[d.data.path]) == null ? void 0 : _a[1]) ? 0.5 : 0.2 ;
14986
14989
})).force("y", y_default2((d) => {
14987
14990
var _a;
14988
14991
return ((_a = cachedPositions[d.data.path]) == null ? void 0 : _a[1]) || height / 2;
14989
14992
}).strength((d) => {
14990
14993
var _a;
14991
- return ((_a = cachedPositions[d.data.path]) == null ? void 0 : _a[0]) ? 0.5 : 0.6 ;
14992
- })).force("collide", collide_default((d) => d.children ? d.r + paddingScale(d.depth) : d.r + 3).iterations(13 ).strength(1)).stop();
14993
- for (let i = 0; i < 130 ; i++) {
14994
+ return ((_a = cachedPositions[d.data.path]) == null ? void 0 : _a[0]) ? 0.5 : 0.1 ;
14995
+ })).force("collide", collide_default((d) => d.children ? d.r + paddingScale(d.depth) : d.r + 3).iterations(9 ).strength(1)).stop();
14996
+ for (let i = 0; i < 190 ; i++) {
14994
14997
simulation.tick();
14995
- items.map ((d) => {
14998
+ items.forEach ((d) => {
14996
14999
d.x = keepBetween(d.r, d.x, width - d.r);
14997
15000
d.y = keepBetween(d.r + 30, d.y, height - d.r);
14998
15001
if (parentPosition && parentRadius) {
14999
- const newPosition = keepCircleInsideCircle(parentRadius, parentPosition, d.r, [d.x, d.y]);
15000
- d.x = newPosition [0];
15001
- d.y = newPosition [1];
15002
+ const containedPosition = keepCircleInsideCircle(parentRadius, parentPosition, d.r, [d.x, d.y]);
15003
+ d.x = containedPosition [0];
15004
+ d.y = containedPosition [1];
15002
15005
}
15003
15006
});
15004
15007
}
@@ -15025,8 +15028,6 @@ var reflowSiblings = (siblings, cachedPositions = {}, parentRadius, parentPositi
15025
15028
];
15026
15029
item.children = item.children.map((child) => repositionChildren(child, itemReflowDiff[0], itemReflowDiff[1]));
15027
15030
if (item.children.length > 4) {
15028
- if (item.depth > 3)
15029
- return;
15030
15031
item.children.forEach((child) => {
15031
15032
const childCachedPosition = repositionedCachedPositions[child.data.path];
15032
15033
if (childCachedPosition) {
0 commit comments