rizer.spice.backend.services.results_plotting.builders#

Per-plot-kind data builders for the Results Explorer API.

Known simplification: purely decorative overlays with no comparison/tuning value are intentionally not translated into trace data here (the plasma-on axvspan shading in plot_elastic_inelastic_power_ratio). The underlying physical curves for every plot kind are all present.

Functions#

build_plot_data(→ dict)

Build JSON-serializable trace/axis/annotation data for one plot kind.

Module Contents#

rizer.spice.backend.services.results_plotting.builders.build_plot_data(plot_kind: str, run_ids: list[str], experiment_ids: list[str]) → dict#

Build JSON-serializable trace/axis/annotation data for one plot kind.

Parameters:
  • plot_kind (str) – A rizer.pipeline.plotting.plot_registry.PLOT_KINDS id.

  • run_ids (list of str) – Run identifiers (see rizer.spice.backend.services.results_discovery). May be empty only for plot kinds with requires_simulation=False.

  • experiment_ids (list of str) – Experiment-file identifiers to overlay, if plot_kind supports it.

Returns:

{“traces”: […], “axes”: {…}, “annotations”: […]}, matching rizer.spice.backend.models.results_schemas.PlotDataResponse. No server-side shift/filter is applied to traces for time_offsets_ns/ hidden_groups here – the frontend applies both at render time (see ResultsPlot.tsx); this only hands back the last-saved values.

Return type:

dict

Raises:
  • KeyError – If plot_kind is not a known plot kind.

  • ValueError – If run_ids is empty for a plot kind that requires a simulation.