fix(graph): legend min-width on narrow diagrams; regenerate README topology image (v0.20.2)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
dtzp555-max
2026-07-07 13:31:45 +10:00
co-authored by Claude Fable 5
parent 972fe87798
commit dc43b3550d
5 changed files with 20 additions and 2 deletions
+12
View File
@@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
(pre-1.0: minor bumps may include breaking changes to the sim's behavior).
## [0.20.2] - 2026-07-07
### Fixed
- `aci-sim graph`: the single-row legend (role swatches + link-type samples)
clipped off the right edge on narrow diagrams (few nodes) — the SVG width
now accounts for the legend's minimum width.
### Docs
- README: regenerated the embedded topology diagram with the v0.20 renderer
(solid ISN uplinks, link-type legend, physical-links table with /31
point-to-point ISN addressing) + caption updated.
## [0.20.1] - 2026-07-07
### Docs
+2 -1
View File
@@ -36,7 +36,8 @@ from a single `topology.yaml`.
*A 2-site, 15-node fabric rendered by `aci-sim graph` — spines (blue),
leaves/border-leaves (green), controllers (amber), and the inter-site ISN
cloud (slate). See §5's `aci-sim graph` for how to generate your own.*
cloud (slate) — solid orange ISN uplinks, plus a physical-links table with
the /31 point-to-point ISN addressing. See §5's `aci-sim graph` for how to generate your own.*
### 60-second quickstart
+5
View File
@@ -368,6 +368,11 @@ def _svg_body(graph: Graph, topo: Topology) -> tuple[str, int, int]:
max_x = max_y = 0.0
width = int(max_x - min_x + 2 * MARGIN)
# A narrow diagram (few nodes) must still fit the single-row legend
# (role swatches at 150px pitch + three link-type samples at 130px) —
# otherwise the ISN-uplink/vPC legend entries clip off the right edge.
_roles_n = len([r for r in LEGEND_ORDER if any(n.role == r for n in graph.nodes)])
width = max(width, int(2 * MARGIN + _roles_n * 150 + 20 + 3 * 130))
height = int(max_y - min_y + 2 * MARGIN + TITLE_H + LEGEND_H)
# Shift everything so the drawing starts at (MARGIN, MARGIN + TITLE_H).
Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 151 KiB

+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "aci-sim"
version = "0.20.1"
version = "0.20.2"
description = "Faithful REST simulator of a 2-site Cisco ACI fabric (per-site APIC + ND/NDO)"
readme = "README.md"
license = "PolyForm-Noncommercial-1.0.0"