anyplotlib.Event#
- class anyplotlib.Event(event_type, source=None, time_stamp=<factory>, modifiers=<factory>, x=None, y=None, button=None, buttons=0, xdata=None, ydata=None, ray=None, line_id=None, dwell_ms=None, bar_index=None, value=None, x_label=None, group_index=None, dx=None, dy=None, key=None, last_widget_id=None, stop_propagation=False)[source]#
Bases:
objectA single interactive event with all payload fields as typed attributes.
- Universal fields (every event):
event_type, source, time_stamp, modifiers
- Pointer fields (pointer_* and double_click events):
x, y — canvas coordinates within the panel (float pixels) button — 0=left 1=middle 2=right; None on move/enter/leave/settled buttons — bitmask of currently held buttons xdata, ydata — data-space coordinates (None for Plot3D) ray — Plot3D only: {“origin”: […], “direction”: […]} line_id — Plot1D only: set when pointer is over a line dwell_ms — pointer_settled only: actual dwell time
- PlotBar extra fields (pointer_down only):
bar_index, value, x_label, group_index
- Wheel fields:
dx, dy — scroll deltas
- Key fields:
key — key name e.g. “q”, “Enter”, “ArrowLeft” last_widget_id — id of the last widget the user clicked, or None
- Propagation:
stop_propagation — set True inside a handler to halt remaining handlers
- Parameters:
event_type (str)
source (Any)
time_stamp (float)
x (float | None)
y (float | None)
button (int | None)
buttons (int)
xdata (float | None)
ydata (float | None)
ray (dict | None)
line_id (str | None)
dwell_ms (float | None)
bar_index (int | None)
value (float | None)
x_label (str | None)
group_index (int | None)
dx (float | None)
dy (float | None)
key (str | None)
last_widget_id (str | None)
stop_propagation (bool)