visualdynamics.plot.bands¶
bands
¶
The bands of a specification, dragged on the plot.
A specification's warning and abort bands are read off the plot as
shaded zones (plot._shade_limit_zones); while its sheet is open they
are also set there. Each edge of each band — warning below and
above, abort below and above — carries one handle per run of segments
sharing a band, for the channel drawn; dragging a handle moves that
edge by the decibels dragged, and lands when the drag ends (Brandon,
2026-09-06: the only place the bands are shown is the plot, the edit
applies to every selected channel in that frequency range, and it
lands when the drag stops). The handle knows nothing of channels or
constraints: it reports (kind, side, segments, decibels) — the level
the edge was let go at — and whoever opened the sheet lands it
through the draft's with_band_edge, which puts every channel there
under its own symmetric and uniform rules.
Functions:
| Name | Description |
|---|---|
snap_db |
The decibels a drag of |
band_edges |
The four band edges of one channel in display units, one piece |
add_band_handles |
One draggable handle per run of segments sharing a band, per |
Functions:¶
snap_db
¶
The decibels a drag of dy decades from value_db reaches, on
the STEP grid: ten decibels to the decade, rounded to the step.
Source code in src/visualdynamics/plot/bands.py
band_edges
¶
band_edges(draft: Any, channel: int, unit_system: Any) -> dict[tuple[str, str], list[tuple[list[int], ndarray, ndarray]]]
The four band edges of one channel in display units, one piece
per run of segments sharing a band: (kind, side) -> [(segments,
frequencies, levels)]. Each piece is its own band over its own
span, corner to corner — so where the band steps at a breakpoint
two pieces meet at one frequency at two levels, exactly as the
shading does. Taken at the breakpoints instead, a corner belongs
to the section on its right and the left section's line slanted
to its neighbor's level (Brandon, 2026-09-06).
Source code in src/visualdynamics/plot/bands.py
add_band_handles
¶
add_band_handles(plot: Any, draft: Any, channel: int, unit_system: Any, colors: Any, on_release: Callable[[str, str, list[int], float], None], on_menu: Callable[[Any], None] | None = None) -> list[Any]
One draggable handle per run of segments sharing a band, per edge, for the drawn channel. Returns the handles added.