Skip to content

Add style.connectors to draw dashed zoom lines - #9

Merged
iharhl merged 1 commit into
mainfrom
feature/dashed-zoom-lines
Nov 12, 2026
Merged

iharhl merged 1 commit into
mainfrom
feature/dashed-zoom-lines

Conversation

@iharhl

@iharhl iharhl commented Nov 12, 2026

Copy link
Copy Markdown
Owner

What

A figure-wide style.connectors option: solid (default) or dashed, for the fan lines that connect a zoomed block to its detail column.

  • memmap/schema.py: new Style.connectors: Literal["solid", "dashed"].
  • memmap/layout/primitives.py: Polyline gets an optional dash (SVG dash pattern, None = solid).
  • memmap/layout/connectors.py: connector_lines(..., dashed=...) sets a fixed DASH = "4 3" (px on, px off).
  • memmap/render/svg.py: writes stroke-dasharray only when a dash is set. PNG and PDF follow, as they are converted from the SVG.

Example

examples/ota_package_format.yaml now uses style: { palette: color, connectors: dashed }, and the README row mentions it.

Reviewer notes

  • Design rule: AGENTS.md said connectors have no keys because the look is fixed on purpose. This PR relaxes that to "connectors only choose solid or dashed". The dash pattern itself stays fixed, so there is no width, colour or pattern key. Worth a look if you would rather keep connectors entirely fixed.
  • Goldens: solid output is byte-identical, so only tests/golden/example_ota_package.svg changes: its two polylines gain stroke-dasharray="4 3". The real-firmware goldens were regenerated and are unchanged.
  • Tests: test_connector_style_sets_the_dash_of_every_fan_line covers both styles on the F303 example, including that the SVG has stroke-dasharray only when dashed. The new AGENTS.md recipe is checked in tests/test_cli.py.
  • uv run pytest (611 passed), uv run mypy and uv run ruff check pass locally.

🤖 Generated with Claude Code

A figure-wide style.connectors takes solid (the default) or dashed.
Dashed fan lines get a fixed 4 px on, 3 px off pattern through a new
dash field on Polyline. The SVG writer adds stroke-dasharray only when
a dash is set, so solid drawings stay byte-identical and no existing
golden changes. PNG and PDF follow, as they are converted from the SVG.

The OTA package example now uses dashed zoom lines; its golden is
regenerated. AGENTS.md says connectors only choose solid or dashed,
instead of having no keys, and gains a recipe. Add a test for both
styles and cover the recipe in test_cli.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iharhl
iharhl merged commit 42ca059 into main Nov 12, 2026
3 checks passed
@iharhl
iharhl deleted the feature/dashed-zoom-lines branch November 14, 2026 10:21
@iharhl iharhl mentioned this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant