Skip to content

Tracking: candidate plot types #96

Description

@AlexisJanin

Standing list of plot types we might add, so ideas have somewhere to live between "someone mentioned it" and "we are building it". Not a task — nothing here is scheduled, and no PR should close this issue.

When a candidate is actually adopted it graduates into its own issue (as #71 for spectrogram and #73 for psd did), and gets ticked off here with a link.

Current roster

time_series (the substrate), spectrogram, psd, loop — see plot_types/registry.py.

Cost of a new one, for calibration: a package (definition.py + plot.py) plus two lines in registry.py. It gets more expensive only if the type needs a user display setting (a UserOptions class + a DisplayFallbacks field) or an axis payload of its own (a field on Data).

Two existing shapes most candidates can be built on:

  • psd shape — N signal refs → one shared subplot, non-time x axis.
  • loop shape — exactly 2 refs → square grid, per-point timestamps (so the time slider and point annotations work).

Adopted

  • Histogram / distribution — value on x, count or density on y, several signals overlaid on one subplot.
    • Why: time-in-target-range questions — how much of the stay was SpO₂ below 90, how driving pressure was distributed.
    • Shape: psd's, with the FFT swapped for a binning step. Flags TIME_AXIS=False, UNIFIED_HOVER=False, RESAMPLED=False; no colorbar, no point timestamps.
    • Cost: no new Data field, no new user setting. Config entry is a list of refs plus an optional value range, so validate_entry is close to PsdDefinition's.

Raised, not adopted

Recorded for the record. Each is a candidate, not a plan — several are here mainly so we do not re-derive the reasoning next time they come up.

  • Bland–Altman / agreement plot — two signals; x = their mean, y = their difference, with bias and ±1.96 SD lines. Loop's shape and flags unchanged, including per-point timestamps, so the time slider shows when two sources diverged. Fits the multi-source premise (Philips vs Mindray SpO₂, fluxmed vs servo_u tidal volume).
  • Cross-spectral pair (coherence / transfer function) — two signals, frequency on x. Psd's flags exactly, and check_freq_range already exists. Driving use case is cerebral autoregulation (ABP↔ICP, ABP↔NIRS).
  • EIT ventilation map — 2-D spatial heatmap with a time slider. The EIT loader already parses dynamic_image_matrix and tidal_image_matrix and discards them. Blocked on a real decision, not on plotting: ADR-0010 makes _load's output the parquet cache, and a per-frame matrix is not a tidy column — flattened pixel columns or a companion cache would have to be argued first.
  • Breath-cycle ensemble — overlay every ventilator cycle on a shared 0→T axis with a mean cycle in bold; x is elapsed time within a cycle, so TIME_AXIS=False and POINT_TIMESTAMPS=False (an averaged point has no single instant). Needs cycle segmentation from flow.
  • Event-triggered average — the same, aligned on annotations instead of a detected cycle. Crosses a seam: annotations live in dash_api/annotations/, builders run in the wrapper pipeline.
  • Value-density heatmap — time on x, value bins on y, count as colour; makes a multi-day recording legible where a line is a smear. Keeps TIME_AXIS=True, so all three annotation types still work. Costs a new Data axis field, since spectrogram_freq_axis is named for frequency.
  • Correlation matrix — N signals, pairwise correlation as a colorbar heatmap. Exploration tool rather than a clinical artifact.
  • Poincaré plot — signal[n] vs signal[n+lag]. Cheap, but narrow; park unless HRV work actually lands.

Ruled out — not plot types

Kept here so they stop being proposed as ones:

  • Scatter rendering of a time series → trace_options.
  • Stacked-area regional EIT percentages → a fill option on a grouping.
  • A second y-axis → a grouping concern.

Related and larger than any single entry: several requests of the form "can you plot X" are really derived signals (smooth, differentiate, resample, arithmetic between two signals), which the library has no concept of. One such mechanism would feed all four existing plot types instead of adding a fifth — worth its own issue if it comes up again.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions