Commit b5478af
* feat(network): protocol edge-colour legend + curved parallel edges (#497)
The network graph colour-codes edges by protocol but never explained the
colours, and multi-protocol pairs drew every edge as an overlapping straight
line so only one colour was ever visible.
Legend: add an "Edges" section to the graph legend with a line swatch + label
per protocol, driven by PROTOCOL_COLORS / PROTOCOL_LABELS (buildProtocolLegend).
Only protocols present in the current graph are listed; protocols sharing a
colour collapse into one entry (HTTPS/TLS); an "Other" swatch appears when any
edge falls back to DEFAULT_EDGE_COLOR. Shown only in protocol colour mode.
Curves: register @sigma/edge-curve's EdgeCurvedArrowProgram and fan out edges
that share a node pair (applyParallelEdgeCurvature) so each protocol's colour is
visible; single edges between a pair stay straight. The PDF-capture overdraw
mirrors the curvature with a matching quadratic so exports don't collapse back
to overlapping lines.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(network): expand curated protocol palette + fold version variants (#497)
Only ~15 protocols had colours, so a capture's long tail (SSH, FTP, SMTP, SMB,
SIP, QUIC, NTP, SNMP, LDAP, RTP, …) all rendered identical grey and collapsed
into one "Other" legend entry. Expand PROTOCOL_COLORS with the common,
recognizable protocols, each a unique colour (the legend groups by colour).
Fold variants so they inherit the base colour instead of going grey:
normalizeProtocol() matches exact curated keys first, then a small
PROTOCOL_ALIASES map (SSL→TLS, SIP/SDP→SIP, …), then strips a trailing version
suffix (TLSv1.2→TLS, SSHv2→SSH, IGMPv3→IGMP) — so regular variants need no list.
getProtocolColor and buildProtocolLegend both route through it, keeping strokes
and legend in sync. Raw ethertypes / pure-numeric names stay grey by design.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(network): cap legend height and make it scroll when protocol list is long (#497)
The expanded protocol palette can list ~20 edge colours, which ran the legend the
full height of the canvas. On-screen the legend now caps to the canvas height and
scrolls (slim theme-aware scrollbar); this corner stops panning the graph, an
acceptable trade for a panel. The forceLight PDF-capture render keeps full height
so exports aren't clipped. The list stays present-only (unchanged).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix/guard-malformed-protocol-and-curvature-values
Address PR #553 review: harden against missing/malformed values so a single bad
edge can't crash the graph render.
- normalizeProtocol tolerates null/undefined/non-string (returns '' -> "Other")
- getCurvature rejects undefined/null/NaN maxIndex (not just <= 0)
- PDF-capture overdraw checks Number.isFinite(curvature) before quadraticCurveTo
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7951c8b commit b5478af
6 files changed
Lines changed: 423 additions & 5 deletions
File tree
- frontend
- src
- components/network/NetworkGraph
- features/network
- __tests__
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
Lines changed: 64 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
147 | 179 | | |
148 | 180 | | |
149 | 181 | | |
| |||
158 | 190 | | |
159 | 191 | | |
160 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
161 | 225 | | |
162 | 226 | | |
163 | 227 | | |
| |||
Lines changed: 115 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | | - | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
288 | 290 | | |
289 | 291 | | |
290 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
291 | 349 | | |
292 | 350 | | |
293 | 351 | | |
| |||
361 | 419 | | |
362 | 420 | | |
363 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
364 | 425 | | |
365 | 426 | | |
366 | 427 | | |
| |||
496 | 557 | | |
497 | 558 | | |
498 | 559 | | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
499 | 571 | | |
500 | 572 | | |
501 | 573 | | |
| |||
550 | 622 | | |
551 | 623 | | |
552 | 624 | | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
553 | 631 | | |
554 | 632 | | |
555 | 633 | | |
| |||
639 | 717 | | |
640 | 718 | | |
641 | 719 | | |
642 | | - | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
643 | 733 | | |
644 | 734 | | |
645 | 735 | | |
| |||
961 | 1051 | | |
962 | 1052 | | |
963 | 1053 | | |
964 | | - | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
965 | 1057 | | |
966 | 1058 | | |
967 | 1059 | | |
| |||
998 | 1090 | | |
999 | 1091 | | |
1000 | 1092 | | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1001 | 1113 | | |
1002 | 1114 | | |
1003 | 1115 | | |
| |||
0 commit comments