Cytoscape-dagre crashes with "Cannot set properties of undefined (setting 'order')" when an edge's source or target is not present in the cytoscape node set. Both backends can produce such edges in edge cases (ON_PAGE edges referencing a page_no absent from the pages list, DERIVED_FROM edges crossing document boundaries in Neo4j). When cytoscape-dagre adds these edges to its internal dagre/graphlib graph, graphlib auto-creates a skeleton node entry with undefined data; dagre's ordering phase then tries to set `.order` on that undefined object and throws. The fix builds a nodeIds Set from the returned nodes before constructing the elements array, then filters every edge so only those with a valid source AND target are forwarded to cytoscape. Dangling edges have no visual meaning anyway, so this is purely defensive. https://claude.ai/code/session_01PjZeeTBqERYDPs59RhXqCz |
||
|---|---|---|
| .. | ||
| public | ||
| src | ||
| .prettierignore | ||
| .prettierrc | ||
| Dockerfile | ||
| env.d.ts | ||
| eslint.config.js | ||
| index.html | ||
| nginx.conf.template | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||
| vite.config.js | ||