2.2. ImPlot playwright — ImPlot-aware test layer over imgui_playwright (PlotSession + plot_* / drag_* readers and wait_for_* polls)

The ImPlot-aware test layer over dasImgui’s imgui_playwright. implot_open(app, plot_path) waits for a plot to render and returns a PlotSession — just the (app, plot_path) pair, since ImPlot is stateless (there is no editor handle to capture, unlike the node-editor’s EditorSession).

The readers pull the plot’s serialized per-frame state out of the snapshot payload: plot_axis_limitsAxisLimits, plot_visible / plot_hovered, plot_mouse_pos (data coords), plot_bbox / plot_center (screen, for synthetic-move targets). For drag tools, handle_path(s, id) resolves a handle’s snapshot path and drag_point_value / drag_line_value / drag_rect_value / drag_held read its bound value. The wait_for_* polls gate an assertion on a state change actually landing: wait_for_axis_limits (axis convergence after a SetupAxisLimits / zoom / fit), wait_for_hovered (a synthetic move onto the plot), wait_for_point_moved (a synthetic drag moving a point off its baseline).

2.2.1. Structures

PlotSession

struct PlotSession

AxisLimits

struct AxisLimits

DragRectValue

struct DragRectValue

LegendEntryView

struct LegendEntryView

2.2.2. Session

implot_open(app: ImguiApp; plot_path: string; timeout_sec: float = 15f ): PlotSession

def implot_open (app: ImguiApp; plot_path: string; timeout_sec: float = 15f) : PlotSession

Arguments:
  • app : ImguiApp

  • plot_path : string

  • timeout_sec : float

2.2.3. Reads

implot_snapshot(s: PlotSession ): JsonValue?

def implot_snapshot (s: PlotSession) : JsonValue?

Arguments:
plot_axis_limit(snap: JsonValue?; s: PlotSession; field: string ): double

def plot_axis_limit (var snap: JsonValue?; s: PlotSession; field: string) : double

Arguments:
plot_axis_limits(snap: JsonValue?; s: PlotSession ): AxisLimits

def plot_axis_limits (var snap: JsonValue?; s: PlotSession) : AxisLimits

Arguments:
plot_bbox(snap: JsonValue?; s: PlotSession ): float4

def plot_bbox (var snap: JsonValue?; s: PlotSession) : float4

Arguments:
plot_center(snap: JsonValue?; s: PlotSession ): tuple<float;float>

def plot_center (var snap: JsonValue?; s: PlotSession) : tuple<float;float>

Arguments:
plot_hovered(snap: JsonValue?; s: PlotSession ): bool

def plot_hovered (var snap: JsonValue?; s: PlotSession) : bool

Arguments:
plot_mouse_pos(snap: JsonValue?; s: PlotSession ): tuple<double;double>

def plot_mouse_pos (var snap: JsonValue?; s: PlotSession) : tuple<double;double>

Arguments:
plot_payload(snap: JsonValue?; s: PlotSession ): JsonValue?

def plot_payload (var snap: JsonValue?; s: PlotSession) : JsonValue?

Arguments:
plot_visible(snap: JsonValue?; s: PlotSession ): bool

def plot_visible (var snap: JsonValue?; s: PlotSession) : bool

Arguments:

2.2.4. Axis drag

drag_axis(s: PlotSession; axis: ImAxis; delta_px: float )

def drag_axis (s: PlotSession; axis: ImAxis; delta_px: float)

Arguments:

2.2.5. Drag-tool handles

drag_held(snap: JsonValue?; path: string ): bool

def drag_held (var snap: JsonValue?; path: string) : bool

Arguments:
drag_line_value(snap: JsonValue?; path: string ): double

def drag_line_value (var snap: JsonValue?; path: string) : double

Arguments:
drag_point_value(snap: JsonValue?; path: string ): tuple<double;double>

def drag_point_value (var snap: JsonValue?; path: string) : tuple<double;double>

Arguments:
drag_rect_value(snap: JsonValue?; path: string ): DragRectValue

def drag_rect_value (var snap: JsonValue?; path: string) : DragRectValue

Arguments:
handle_path(s: PlotSession; id: string ): string

def handle_path (s: PlotSession; id: string) : string

Arguments:

2.2.6. Legend

legend_entry(snap: JsonValue?; s: PlotSession; series: string ): LegendEntryView

def legend_entry (var snap: JsonValue?; s: PlotSession; series: string) : LegendEntryView

Arguments:
legend_entry_center(snap: JsonValue?; s: PlotSession; series: string ): tuple<float;float>

def legend_entry_center (var snap: JsonValue?; s: PlotSession; series: string) : tuple<float;float>

Arguments:
legend_toggle(s: PlotSession; series: string )

def legend_toggle (s: PlotSession; series: string)

Arguments:
series_shown(snap: JsonValue?; s: PlotSession; series: string ): bool

def series_shown (var snap: JsonValue?; s: PlotSession; series: string) : bool

Arguments:
wait_for_legend_hover(s: PlotSession; series: string; expected: bool = true; max_frames: int = 300 ): JsonValue?

def wait_for_legend_hover (s: PlotSession; series: string; expected: bool = true; max_frames: int = 300) : JsonValue?

Arguments:
  • s : PlotSession

  • series : string

  • expected : bool

  • max_frames : int

wait_for_series_shown(s: PlotSession; series: string; expected: bool; max_frames: int = 300 ): JsonValue?

def wait_for_series_shown (s: PlotSession; series: string; expected: bool; max_frames: int = 300) : JsonValue?

Arguments:
  • s : PlotSession

  • series : string

  • expected : bool

  • max_frames : int

2.2.7. Polling / await

implot_wait_visible(s: PlotSession; timeout_sec: float = 6f ): JsonValue?

def implot_wait_visible (s: PlotSession; timeout_sec: float = 6f) : JsonValue?

Arguments:
wait_for_axis_limit_changed(s: PlotSession; field: string; before: double; tol: double = 1e-06lf; max_frames: int = 300 ): JsonValue?

def wait_for_axis_limit_changed (s: PlotSession; field: string; before: double; tol: double = 1e-06lf; max_frames: int = 300) : JsonValue?

Arguments:
  • s : PlotSession

  • field : string

  • before : double

  • tol : double

  • max_frames : int

wait_for_axis_limits(s: PlotSession; x_min: double; x_max: double; y_min: double; y_max: double; tol: double = 0.001lf; max_frames: int = 300 ): JsonValue?

def wait_for_axis_limits (s: PlotSession; x_min: double; x_max: double; y_min: double; y_max: double; tol: double = 0.001lf; max_frames: int = 300) : JsonValue?

Arguments:
  • s : PlotSession

  • x_min : double

  • x_max : double

  • y_min : double

  • y_max : double

  • tol : double

  • max_frames : int

wait_for_hovered(s: PlotSession; expected: bool = true; max_frames: int = 300 ): JsonValue?

def wait_for_hovered (s: PlotSession; expected: bool = true; max_frames: int = 300) : JsonValue?

Arguments:
wait_for_point_moved(s: PlotSession; id: string; from: tuple<double;double>; tol: double = 1e-06lf; max_frames: int = 300 ): JsonValue?

def wait_for_point_moved (s: PlotSession; id: string; from: tuple<double;double>; tol: double = 1e-06lf; max_frames: int = 300) : JsonValue?

Arguments:
  • s : PlotSession

  • id : string

  • from : tuple<double;double>

  • tol : double

  • max_frames : int