1
0

GraphDiagram.astro 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ---
  2. // Flat technical node-link diagram for the hero. Hand-placed so it reads as a
  3. // deliberate blueprint, not a physics blob: thin ink lines, hollow nodes, mono
  4. // labels. Hovering a node inks it in. No glow, no gradients, no motion.
  5. ---
  6. <svg
  7. class="cg-graph"
  8. viewBox="0 0 780 600"
  9. role="img"
  10. aria-label="A code knowledge graph: index.ts links to auth.ts, router.ts and api/users.ts, which branch to middleware.ts, types/index.ts, createRouter and listUsers."
  11. >
  12. <g class="edges">
  13. <line x1="430" y1="64" x2="250" y2="210" />
  14. <line x1="430" y1="64" x2="450" y2="250" />
  15. <line x1="430" y1="64" x2="650" y2="200" />
  16. <line x1="250" y1="210" x2="180" y2="380" />
  17. <line x1="250" y1="210" x2="340" y2="380" />
  18. <line x1="450" y1="250" x2="560" y2="380" />
  19. <line x1="560" y1="380" x2="560" y2="500" />
  20. </g>
  21. <g class="nodes">
  22. <g class="node">
  23. <circle cx="430" cy="64" r="9" />
  24. <text x="448" y="69" text-anchor="start">index.ts</text>
  25. </g>
  26. <g class="node">
  27. <circle cx="250" cy="210" r="9" />
  28. <text x="232" y="215" text-anchor="end">auth.ts</text>
  29. </g>
  30. <g class="node">
  31. <circle cx="450" cy="250" r="9" />
  32. <text x="468" y="255" text-anchor="start">router.ts</text>
  33. </g>
  34. <g class="node">
  35. <circle cx="650" cy="200" r="9" />
  36. <text x="668" y="205" text-anchor="start">api/users.ts</text>
  37. </g>
  38. <g class="node">
  39. <circle cx="180" cy="380" r="9" />
  40. <text x="180" y="410" text-anchor="middle">middleware.ts</text>
  41. </g>
  42. <g class="node">
  43. <circle cx="340" cy="380" r="9" />
  44. <text x="340" y="410" text-anchor="middle">types/index.ts</text>
  45. </g>
  46. <g class="node">
  47. <circle cx="560" cy="380" r="9" />
  48. <text x="578" y="385" text-anchor="start">createRouter</text>
  49. </g>
  50. <g class="node">
  51. <circle cx="560" cy="500" r="9" />
  52. <text x="560" y="530" text-anchor="middle">listUsers</text>
  53. </g>
  54. </g>
  55. </svg>
  56. <style>
  57. .cg-graph {
  58. width: 100%;
  59. height: auto;
  60. max-width: 560px;
  61. min-width: 0; /* flex item: allow shrinking below intrinsic SVG width */
  62. display: block;
  63. }
  64. .cg-graph .edges line {
  65. stroke: var(--cg-ink);
  66. stroke-width: 1.25;
  67. }
  68. .cg-graph .node circle {
  69. fill: var(--cg-paper);
  70. stroke: var(--cg-ink);
  71. stroke-width: 1.5;
  72. transition: fill 0.12s ease;
  73. }
  74. .cg-graph .node text {
  75. font-family: var(--sl-font-mono);
  76. font-size: 15px;
  77. fill: var(--cg-ink);
  78. dominant-baseline: middle;
  79. }
  80. .cg-graph .node:hover circle {
  81. fill: var(--cg-ink);
  82. }
  83. </style>