Skip to content

Commit 8597490

Browse files
authored
Merge pull request #32 from CSSFrancis/release/v0.3.0b1
Release v0.3.0b1
2 parents 24df988 + 5c4b825 commit 8597490

8 files changed

Lines changed: 53 additions & 39 deletions

File tree

CHANGELOG.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,46 @@ Fragment files in ``upcoming_changes/`` are assembled into this file by
1010

1111
.. towncrier release notes start
1212
13+
0.3.0b1 (2026-07-13)
14+
====================
15+
16+
New Features
17+
------------
18+
19+
- Added :class:`~anyplotlib.widgets.ArrowWidget` (draggable arrow overlay, tail
20+
at ``(x, y)`` and head at ``(x + u, y + v)``) via ``Plot2D.add_arrow_widget`` /
21+
``add_widget("arrow")``, and a ``show_handles`` option (default ``True``) on
22+
every 2-D overlay widget to hide the grab-handle dots without affecting drag.
23+
- Added figure-level edit-mode chrome to :class:`~anyplotlib.Figure`: the
24+
``edit_chrome`` and ``selected_panel`` traits (per-panel hover / selection
25+
outlines), figure-background click events, and a figure-level annotation layer
26+
(``set_figure_markers`` / ``figure_markers``, positioned in figure fractions and
27+
always included in ``exportPNG``) with figure-level callbacks via
28+
``add_event_handler``.
29+
- Extended :class:`~anyplotlib.Figure` edit-mode interaction:
30+
31+
* Circle and rectangle overlay widgets are now **resizable via visible nodes** —
32+
a circle draws a centre (move) node and an east-point radius node; a rectangle
33+
draws all four corner nodes (opposite corner anchored on drag). Drawn only
34+
when ``show_handles`` is ``True``, with matching resize cursors.
35+
* :class:`~anyplotlib.widgets.ArrowWidget` **tail is now a reshape node**:
36+
dragging the tail moves it while the head stays anchored (dragging the shaft
37+
still moves the whole arrow; the head node still re-aims it).
38+
* The selected-panel and hover **outlines are fully inset** (``outline-offset:
39+
-2px``) so an edge/corner panel's ring is no longer clipped at the figure's
40+
right/bottom edge.
41+
* **Panel drag-swap** under ``edit_chrome``: each grid panel shows a move grip
42+
in its top-left corner; dragging it over a *different* panel emits a
43+
figure-level ``pointer_up`` event with ``panel_swap: true`` and
44+
``source_panel_id`` / ``target_panel_id`` (new :class:`~anyplotlib.Event`
45+
fields). anyplotlib performs no layout change itself — the host swaps and
46+
rebuilds. Releasing on the source panel or empty space cancels cleanly; the
47+
grip is inert when ``edit_chrome`` is off.
48+
* The JS ``mount()`` embedding entry point accepts an ``onResize({width,
49+
height})`` callback, fired (debounced) when the **root container resizes**, so
50+
an embedding host can relayout the figure to its new box.
51+
52+
1353
0.2.0 (2026-07-10)
1454
==================
1555

anyplotlib/axes/_inset_axes.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,12 @@ def indicate_region(self, parent_plot, region, *,
154154
panel in the SAME figure as this inset (typically the panel the
155155
inset overlays) — a plot registered on a different ``Figure``
156156
raises ``ValueError``.
157-
region : (x, y, w, h)
158-
The source rectangle in the parent image's data coordinates:
159-
top-left ``(x, y)`` plus width and height. The values follow the
160-
same convention as the parent's axes (pixel indices for an
161-
uncalibrated image; physical units when the axes are calibrated).
157+
region : tuple of float
158+
The source rectangle in the parent image's data coordinates, as
159+
``(x, y, w, h)``: top-left ``(x, y)`` plus width and height. The
160+
values follow the same convention as the parent's axes (pixel
161+
indices for an uncalibrated image; physical units when the axes
162+
are calibrated).
162163
All four must be finite; ``w`` and ``h`` must be strictly
163164
positive. The rectangle MAY extend outside the parent's data
164165
bounds (e.g. a region near an edge) — that is allowed by design

docs/_root/switcher.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"version": "dev",
55
"url": "https://cssfrancis.github.io/anyplotlib/dev/"
66
},
7+
{
8+
"name": "v0.3.0b1 (beta)",
9+
"version": "v0.3.0b1",
10+
"url": "https://cssfrancis.github.io/anyplotlib/v0.3.0b1/"
11+
},
712
{
813
"name": "v0.2.0 (stable)",
914
"version": "v0.2.0",

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
project = "anyplotlib"
1818
copyright = "2026, anyplotlib contributors"
1919
author = "anyplotlib contributors"
20-
release = "0.2.0"
20+
release = "0.3.0b1"
2121

2222
# When built in CI the workflow sets DOCS_VERSION to the tag name (e.g.
2323
# "v0.1.0") or "dev". Fall back to "dev" for local builds.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exclude = [
1313

1414
[project]
1515
name = "anyplotlib"
16-
version = "0.2.0"
16+
version = "0.3.0b1"
1717
description = "A plotting library using python, javascript and anywidget for performant in browser plotting."
1818
readme = "README.md"
1919
license = { text = "MIT" }

upcoming_changes/+arrow-widget-show-handles.new_feature.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

upcoming_changes/+edit-mode-resize-swap.new_feature.rst

Lines changed: 0 additions & 22 deletions
This file was deleted.

upcoming_changes/+figure-edit-chrome.new_feature.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)