MCPcopy Create free account
hub / github.com/OpenDCAI/Paper2Any / buildMindMapFlow

Function buildMindMapFlow

frontend-workflow/src/utils/mindmapTree.ts:280–303  ·  view source on GitHub ↗
(root: MindMapTreeNode)

Source from the content-addressed store, hash-verified

278};
279
280export 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
305const markdownLines = (node: MindMapTreeNode, depth: number, lines: string[]) => {
306 const indent = ' '.repeat(depth);

Callers 2

MindMapPageFunction · 0.90
buildMindMapSvgFunction · 0.85

Calls 2

splitTopLevelChildrenFunction · 0.85
layoutGroupFunction · 0.85

Tested by

no test coverage detected