fix: derive overview node spacing from rem so branches never overlap (#27995)

This commit is contained in:
G30
2026-08-11 01:23:31 -04:00
committed by GitHub
parent 2207876ae7
commit fe62934be7
+5 -2
View File
@@ -65,8 +65,11 @@
const drawFlow = async (direction: LayoutDirection) => {
const nodeList: Node[] = [];
const edgeList: Edge[] = [];
const levelOffset = direction === 'vertical' ? 150 : 300;
const siblingOffset = direction === 'vertical' ? 250 : 150;
const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
const nodeWidth = 15 * rootFontSize;
const nodeHeight = 5 * rootFontSize;
const levelOffset = direction === 'vertical' ? nodeHeight + 70 : nodeWidth + 60;
const siblingOffset = direction === 'vertical' ? nodeWidth + 60 : nodeHeight + 70;
// Map to keep track of node positions at each level
let positionMap = new Map<string, PositionMapEntry>();