diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ad89e3e6..6c6049f0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,71 @@ Fragment files in ``upcoming_changes/`` are assembled into this file by .. towncrier release notes start +0.5.0 (2026-07-26) +================== + +New Features +------------ + +- :meth:`Widget.set` takes ``_notify=False`` to move a widget without firing + ``pointer_move`` callbacks, so a handler that writes back to its own widget no + longer feeds into itself. Widgets also gained a + :meth:`~anyplotlib.widgets.Widget.remove` method. +- :meth:`~anyplotlib.Plot1D.add_range_widget` takes ``orientation="vertical"`` + for a band that selects a range of values, and ``snap_values`` to restrict a + drag to a set of allowed positions (matplotlib's + ``SpanSelector.snap_values``). ``snap_values`` is also available on the + vline, hline and point widgets. +- Added :meth:`~anyplotlib.Plot2D.set_scalebar_style` to recolour the automatic + scale bar, which was hardcoded white on a translucent dark pill and unreadable + over a light image. ``bgcolor="none"`` drops the pill entirely. +- Added ``linestyle="none"`` (also spelled ``"None"``) for a series drawn as + markers with no connecting line — matplotlib's scatter idiom, + ``ax.plot(y, linestyle="none", marker="o")``. An explicit ``linewidth=0`` + now means the same thing; it previously fell back to the 1.5 default in the + renderer. +- Added three 2-D overlay widget kinds: ``line`` + (:meth:`~anyplotlib.Plot2D.add_line_widget`), a bare two-endpoint segment for + line profiles and two-point measurements, and ``vline`` / ``hline``, full-height + and full-width rules grabbable anywhere along their length. +- Clicking a 1-D panel now emits a ``pointer_down`` event carrying the clicked + position as ``xdata``/``ydata``, matching 2-D panels; it previously fired only + when the click landed on a line. Clicks on a line still report ``line_id``, + so existing line-click handlers are unaffected. +- Panels expose their geometry through :meth:`~anyplotlib.Plot1D.plot_box`, + :meth:`~anyplotlib.Plot1D.data_to_display` and + :meth:`~anyplotlib.Plot1D.display_to_data`, so callers working in display space + no longer have to re-derive the renderer's layout constants and letterbox maths + themselves. +- Sized marker types take ``size_units="px"`` so their radii and widths stay + fixed in screen pixels through a zoom instead of scaling with the data — what + a marker standing in for a *point* wants, and what matplotlib does by sizing + scatter markers in display points. +- ``edgecolors`` and ``facecolors`` accept a sequence of colours parallel to the + markers — matplotlib's ``edgecolors=[...]`` / scatter ``c=[...]`` — for every + marker type on both 1-D and 2-D panels, where previously only ``points`` and + ``polygons`` on 1-D panels honoured it. A short sequence cycles. + + +Bug Fixes +--------- + +- A ``crosshair`` widget can now be grabbed anywhere along either of its rules + rather than only at the one-pixel centre hotspot; grabbing a rule constrains + the drag to that rule's own axis. +- The 1-D y-axis label is no longer drawn through the tick numbers; its position + was a fixed fraction of the left gutter and is now measured against the widest + tick string. +- The colorbar strip is no longer drawn flush against the image: there is now a + 6 px gap, taken out of the image width so the strip cannot be pushed off the + panel, and settable with :meth:`~anyplotlib.Plot2D.set_colorbar_pad`. This + shifts every colorbar plot by 4 px. +- ``save_html`` / ``to_html`` / ``figure_state`` now capture overlay widgets at + their current positions; widget moves reach JS as targeted events that never + rewrite the panel traits, so a snapshot used to show every widget where it was + created. + + 0.4.1 (2026-07-26) ================== diff --git a/docs/_root/index.html b/docs/_root/index.html index 7b4c42fc..288fe10c 100644 --- a/docs/_root/index.html +++ b/docs/_root/index.html @@ -4,12 +4,12 @@ anyplotlib – redirecting… - - + +

- Redirecting to v0.4.2 documentation… + Redirecting to v0.5.0 documentation

diff --git a/docs/_root/switcher.json b/docs/_root/switcher.json index ffe8ac3e..0aaf54ca 100644 --- a/docs/_root/switcher.json +++ b/docs/_root/switcher.json @@ -4,6 +4,11 @@ "version": "dev", "url": "https://cssfrancis.github.io/anyplotlib/dev/" }, + { + "name": "v0.5.0 (stable)", + "version": "v0.5.0", + "url": "https://cssfrancis.github.io/anyplotlib/v0.5.0/" + }, { "name": "v0.4.2 (stable)", "version": "v0.4.2", diff --git a/docs/conf.py b/docs/conf.py index aee90785..60eb43ed 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,7 +17,7 @@ project = "anyplotlib" copyright = "2026, anyplotlib contributors" author = "anyplotlib contributors" -release = "0.4.2" +release = "0.5.0" # When built in CI the workflow sets DOCS_VERSION to the tag name (e.g. # "v0.1.0") or "dev". Fall back to "dev" for local builds. diff --git a/pyproject.toml b/pyproject.toml index 504d9ad8..ec7bc498 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ exclude = [ [project] name = "anyplotlib" -version = "0.4.2" +version = "0.5.0" description = "A plotting library using python, javascript and anywidget for performant in browser plotting." readme = "README.md" license = { text = "MIT" } diff --git a/upcoming_changes/+colorbar-gap.bugfix.rst b/upcoming_changes/+colorbar-gap.bugfix.rst deleted file mode 100644 index 5315b874..00000000 --- a/upcoming_changes/+colorbar-gap.bugfix.rst +++ /dev/null @@ -1,4 +0,0 @@ -The colorbar strip is no longer drawn flush against the image: there is now a -6 px gap, taken out of the image width so the strip cannot be pushed off the -panel, and settable with :meth:`~anyplotlib.Plot2D.set_colorbar_pad`. This -shifts every colorbar plot by 4 px. diff --git a/upcoming_changes/+coord-api.new_feature.rst b/upcoming_changes/+coord-api.new_feature.rst deleted file mode 100644 index d7fab970..00000000 --- a/upcoming_changes/+coord-api.new_feature.rst +++ /dev/null @@ -1,5 +0,0 @@ -Panels expose their geometry through :meth:`~anyplotlib.Plot1D.plot_box`, -:meth:`~anyplotlib.Plot1D.data_to_display` and -:meth:`~anyplotlib.Plot1D.display_to_data`, so callers working in display space -no longer have to re-derive the renderer's layout constants and letterbox maths -themselves. diff --git a/upcoming_changes/+crosshair-grab.bugfix.rst b/upcoming_changes/+crosshair-grab.bugfix.rst deleted file mode 100644 index d157f0dc..00000000 --- a/upcoming_changes/+crosshair-grab.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -A ``crosshair`` widget can now be grabbed anywhere along either of its rules -rather than only at the one-pixel centre hotspot; grabbing a rule constrains -the drag to that rule's own axis. diff --git a/upcoming_changes/+export-widget-sync.bugfix.rst b/upcoming_changes/+export-widget-sync.bugfix.rst deleted file mode 100644 index 047500ee..00000000 --- a/upcoming_changes/+export-widget-sync.bugfix.rst +++ /dev/null @@ -1,4 +0,0 @@ -``save_html`` / ``to_html`` / ``figure_state`` now capture overlay widgets at -their current positions; widget moves reach JS as targeted events that never -rewrite the panel traits, so a snapshot used to show every widget where it was -created. diff --git a/upcoming_changes/+line-rule-widgets.new_feature.rst b/upcoming_changes/+line-rule-widgets.new_feature.rst deleted file mode 100644 index b5144937..00000000 --- a/upcoming_changes/+line-rule-widgets.new_feature.rst +++ /dev/null @@ -1,4 +0,0 @@ -Added three 2-D overlay widget kinds: ``line`` -(:meth:`~anyplotlib.Plot2D.add_line_widget`), a bare two-endpoint segment for -line profiles and two-point measurements, and ``vline`` / ``hline``, full-height -and full-width rules grabbable anywhere along their length. diff --git a/upcoming_changes/+linestyle-none.new_feature.rst b/upcoming_changes/+linestyle-none.new_feature.rst deleted file mode 100644 index 20f02f8b..00000000 --- a/upcoming_changes/+linestyle-none.new_feature.rst +++ /dev/null @@ -1,5 +0,0 @@ -Added ``linestyle="none"`` (also spelled ``"None"``) for a series drawn as -markers with no connecting line — matplotlib's scatter idiom, -``ax.plot(y, linestyle="none", marker="o")``. An explicit ``linewidth=0`` -now means the same thing; it previously fell back to the 1.5 default in the -renderer. diff --git a/upcoming_changes/+marker-size-units.new_feature.rst b/upcoming_changes/+marker-size-units.new_feature.rst deleted file mode 100644 index b9cfb1d4..00000000 --- a/upcoming_changes/+marker-size-units.new_feature.rst +++ /dev/null @@ -1,4 +0,0 @@ -Sized marker types take ``size_units="px"`` so their radii and widths stay -fixed in screen pixels through a zoom instead of scaling with the data — what -a marker standing in for a *point* wants, and what matplotlib does by sizing -scatter markers in display points. diff --git a/upcoming_changes/+per-marker-colors.new_feature.rst b/upcoming_changes/+per-marker-colors.new_feature.rst deleted file mode 100644 index 14db1043..00000000 --- a/upcoming_changes/+per-marker-colors.new_feature.rst +++ /dev/null @@ -1,4 +0,0 @@ -``edgecolors`` and ``facecolors`` accept a sequence of colours parallel to the -markers — matplotlib's ``edgecolors=[...]`` / scatter ``c=[...]`` — for every -marker type on both 1-D and 2-D panels, where previously only ``points`` and -``polygons`` on 1-D panels honoured it. A short sequence cycles. diff --git a/upcoming_changes/+pointer-down-1d.new_feature.rst b/upcoming_changes/+pointer-down-1d.new_feature.rst deleted file mode 100644 index a1d01b4b..00000000 --- a/upcoming_changes/+pointer-down-1d.new_feature.rst +++ /dev/null @@ -1,4 +0,0 @@ -Clicking a 1-D panel now emits a ``pointer_down`` event carrying the clicked -position as ``xdata``/``ydata``, matching 2-D panels; it previously fired only -when the click landed on a line. Clicks on a line still report ``line_id``, -so existing line-click handlers are unaffected. diff --git a/upcoming_changes/+range-orientation-snap.new_feature.rst b/upcoming_changes/+range-orientation-snap.new_feature.rst deleted file mode 100644 index 33e255a0..00000000 --- a/upcoming_changes/+range-orientation-snap.new_feature.rst +++ /dev/null @@ -1,5 +0,0 @@ -:meth:`~anyplotlib.Plot1D.add_range_widget` takes ``orientation="vertical"`` -for a band that selects a range of values, and ``snap_values`` to restrict a -drag to a set of allowed positions (matplotlib's -``SpanSelector.snap_values``). ``snap_values`` is also available on the -vline, hline and point widgets. diff --git a/upcoming_changes/+scalebar-style.new_feature.rst b/upcoming_changes/+scalebar-style.new_feature.rst deleted file mode 100644 index 36dcc41f..00000000 --- a/upcoming_changes/+scalebar-style.new_feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -Added :meth:`~anyplotlib.Plot2D.set_scalebar_style` to recolour the automatic -scale bar, which was hardcoded white on a translucent dark pill and unreadable -over a light image. ``bgcolor="none"`` drops the pill entirely. diff --git a/upcoming_changes/+widget-notify-remove.new_feature.rst b/upcoming_changes/+widget-notify-remove.new_feature.rst deleted file mode 100644 index 15677d2e..00000000 --- a/upcoming_changes/+widget-notify-remove.new_feature.rst +++ /dev/null @@ -1,4 +0,0 @@ -:meth:`Widget.set` takes ``_notify=False`` to move a widget without firing -``pointer_move`` callbacks, so a handler that writes back to its own widget no -longer feeds into itself. Widgets also gained a -:meth:`~anyplotlib.widgets.Widget.remove` method. diff --git a/upcoming_changes/+ylabel-clearance.bugfix.rst b/upcoming_changes/+ylabel-clearance.bugfix.rst deleted file mode 100644 index 13b58bfc..00000000 --- a/upcoming_changes/+ylabel-clearance.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -The 1-D y-axis label is no longer drawn through the tick numbers; its position -was a fixed fraction of the left gutter and is now measured against the widest -tick string.