(root: MindMapTreeNode)
| 278 | }; |
| 279 | |
| 280 | export const buildMindMapFlow = (root: MindMapTreeNode): { nodes: Node<MindMapNodeData>[]; edges: Edge[] } => { |
| 281 | const nodes: Node<MindMapNodeData>[] = [ |
| 282 | { |
| 283 | id: root.id, |
| 284 | type: 'mindMapNode', |
| 285 | position: { x: 0, y: -NODE_HEIGHT / 2 }, |
| 286 | draggable: false, |
| 287 | data: { |
| 288 | label: root.label, |
| 289 | summary: root.summary || '', |
| 290 | depth: 0, |
| 291 | branch: 'center', |
| 292 | isRoot: true, |
| 293 | }, |
| 294 | }, |
| 295 | ]; |
| 296 | const edges: Edge[] = []; |
| 297 | |
| 298 | const { left, right } = splitTopLevelChildren(root.children); |
| 299 | layoutGroup(right, 'right', root.id, 1, nodes, edges); |
| 300 | layoutGroup(left, 'left', root.id, 1, nodes, edges); |
| 301 | |
| 302 | return { nodes, edges }; |
| 303 | }; |
| 304 | |
| 305 | const markdownLines = (node: MindMapTreeNode, depth: number, lines: string[]) => { |
| 306 | const indent = ' '.repeat(depth); |
no test coverage detected