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

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