Skip to content

fix(plotting): lane-chart line breaks at lane boundaries (#121); docs: series length + derived variables - #127

Merged
cnicholas merged 2 commits into
mainfrom
fix/121-lane-connectors
Sep 15, 2026
Merged

cnicholas merged 2 commits into
mainfrom
fix/121-lane-connectors

Conversation

@cnicholas

Copy link
Copy Markdown
Owner

Summary

Contract / invariants

  • Defaults unchanged — single-series charts and faceted charts keep the original single lines+markers trace with no extra trace (pinned). validation/e2e_bishop_report.py exits 0.
  • Residuals unaffected — plotting only.
  • Row/index alignment preserved — the markers trace is the same points in the same order; the line trace repeats the boundary x for the gap entry so x arrays contain no nulls (the numeric-x axis test still holds).
  • Output schema compatible — the markers trace keeps its name, hovertemplate, customdata, legend and signal highlighting.
  • Pinned error strings unchanged.

Behaviour changes

  • Lane charts gain a lines trace named <chart> (lanes) (hoverinfo='skip', showlegend=False) and the markers trace's mode becomes markers. Visually: the same points, the same limits, and no segment crossing a lane boundary.

Methodology

  • No methodology change — rendering and documentation.
  • The series-length page's "position" section paraphrases Tom's 2026-09-10 email; he should read it once.

Tests

tests/test_lane_connectors.py:

  • one gap per boundary, at the lane-start positions; point counts unchanged

  • no drawn segment spans two lanes (lanes 100 apart, segments never jump)

  • markers keep hover; the line trace has none and no legend entry

  • single-series chart unchanged; faceted chart unchanged

  • pytest tests/ — 2426 passed, 10 skipped

  • ruff check . — clean

  • mypy processbehavior/plotting/renderers.py — clean

  • Golden masters untouched

Notes

  • The Docs workflow builds the two new pages on merge; the MyST CLI is not installed here, so they were reviewed in source. Links point at existing targets (weco-rules.md, sds-detection.md, the derived-variables tutorial).

🤖 Generated with Claude Code

https://claude.ai/code/session_01BKphCi1LC1hjGYteWEK9JV

…: series length + derived variables

## Summary
- **What:** on a lane chart the connecting line is now its own trace with a gap at each
  lane boundary, drawn under the markers. Two new user-guide pages.
- **Why:** #121 — the last point of one subgroup joined to the first of the next drew a
  steep "event" at every boundary that was only the sort order. The docs pages state the
  series-length position (from #114, with the reporter's table and credit) and the
  derived-variables contract (from #126), neither of which existed anywhere a user
  would look.
- **Scope:** plotting/renderers.py (main-trace block + two helpers);
  tests/test_lane_connectors.py; docs/user-guide/series-length.md,
  docs/user-guide/derived-variables.md, docs/myst.yml, key-concepts.md; CHANGELOG.

## Contract / Invariants (must remain true)
- Single-series charts and faceted charts: unchanged trace (lines+markers), no extra trace
  (pinned).
- Markers trace keeps name, hovertemplate, customdata, legend, signal highlighting.
- x arrays contain no nulls (gaps repeat the boundary x; only y carries None), so
  test_plotting_xaxis's numeric-x check still holds.
- No chart math; validator exit 0.

## Behavior Changes (explicit)
- Lane charts: fig.data gains a 'lines' trace named '<chart> (lanes)' (hoverinfo skip,
  showlegend False) and the markers trace's mode becomes 'markers'.

## Tests
- test_lane_connectors: one gap per boundary at the right positions; no drawn segment
  spans two lanes; markers keep hover, line has none; single-series unchanged; faceted
  unchanged.

## Manual Verification
- pytest tests/: 2426 passed; ruff clean; mypy renderers.py clean; validator exit 0
@cnicholas
cnicholas merged commit 53f3829 into main Sep 15, 2026
17 checks passed
@cnicholas
cnicholas deleted the fix/121-lane-connectors branch September 15, 2026 03:21
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