Skip to content

Commit 2ef6df0

Browse files
committed
Enhance documentation: improve event class docstring and update chart section headers for clarity
1 parent 51bd457 commit 2ef6df0

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

Examples/Benchmarks/plot_benchmark_comparison.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,14 @@ def _results_to_array(results, sizes):
434434
])
435435
return np.array(rows, dtype=float)
436436

437+
# sphinx_gallery_end_ignore
437438

439+
#%%
438440
# ---------------------------------------------------------------------------
439-
# Chart 1 — 2-D image update (Python pre-render, all four libraries)
441+
# 2-D image update (Python pre-render, all four libraries)
440442
# ---------------------------------------------------------------------------
441443

444+
# sphinx_gallery_start_ignore
442445
_size_labels_2d = [f"{s}²" for s in _SIZES_2D]
443446
_heights_2d = _results_to_array(results_2d, _SIZES_2D)
444447

@@ -458,8 +461,9 @@ def _results_to_array(results, sizes):
458461
# sphinx_gallery_end_ignore
459462

460463
# %%
461-
# 1-D line update comparison (Python pre-render)
462-
# ------------------------------------------------
464+
# ---------------------------------------------------------------------------
465+
# 1-D line update (Python pre-render, all four libraries)
466+
# ---------------------------------------------------------------------------
463467

464468
# sphinx_gallery_start_ignore
465469

@@ -501,6 +505,9 @@ def _results_to_array(results, sizes):
501505
# a ``UserWarning`` is emitted at import time. Install Playwright
502506
# (``pip install playwright && playwright install chromium``) to populate
503507
# the JS timing columns.
508+
#
509+
# 2D Image Plotting Costs
510+
# -----------------------
504511

505512
# sphinx_gallery_start_ignore
506513

@@ -525,6 +532,8 @@ def _results_to_array(results, sizes):
525532
# sphinx_gallery_end_ignore
526533

527534
#%%
535+
# Scatter Plotting Costs
536+
# -------------------------
528537

529538
# sphinx_gallery_start_ignore
530539
_apl_py_1d = np.array([results_1d["anyplotlib"].get(n, 0.0) or 0.0

anyplotlib/callbacks.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ def on_settle(event):
4545
@dataclass
4646
class Event:
4747
"""A single interactive event.
48-
event_type: one of on_click / on_changed / on_release / on_key /
49-
on_line_hover / on_line_click
50-
source: the originating Python object (Widget, Plot, or None)
51-
data: full state dict; all keys also accessible as event.x
48+
49+
:event_type: one of ``on_click`` / ``on_changed`` / ``on_release`` /
50+
``on_key`` / ``on_line_hover`` / ``on_line_click``
51+
:source: the originating Python object (Widget, Plot, or None)
52+
:data: full state dict; all keys also accessible as ``event.x``
53+
5254
5355
For ``on_line_hover`` and ``on_line_click`` events the data dict
5456
contains:

0 commit comments

Comments
 (0)