MCPcopy Create free account
hub / github.com/andylow92/file-system-like-github / nodeColor

Function nodeColor

apps/web/src/components/KnowledgeGraph.tsx:31–44  ·  view source on GitHub ↗
(node: GraphNode)

Source from the content-addressed store, hash-verified

29}
30
31function 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. */
47function edgePath(a: Point, b: Point): string {

Callers 1

KnowledgeGraphFunction · 0.85

Calls 2

getPageTypeFunction · 0.90
colorForTagFunction · 0.90

Tested by

no test coverage detected