(node: GraphNode)
| 29 | } |
| 30 | |
| 31 | function nodeColor(node: GraphNode): string { |
| 32 | if (node.unresolved) { |
| 33 | return 'var(--color-danger)'; |
| 34 | } |
| 35 | // A canonical page type wins over tags: colour a note by *what it is* first. |
| 36 | const pageType = getPageType(node.type); |
| 37 | if (pageType) { |
| 38 | return pageType.color; |
| 39 | } |
| 40 | if (node.tags.length > 0) { |
| 41 | return colorForTag(node.tags[0]); |
| 42 | } |
| 43 | return 'var(--color-accent)'; |
| 44 | } |
| 45 | |
| 46 | /** A gentle quadratic arc between two points — softer than a straight line. */ |
| 47 | function edgePath(a: Point, b: Point): string { |
no test coverage detected