Merged
Conversation
Owner
Author
|
I just added an event where "f" fits the data using scipy. |
There was a problem hiding this comment.
Pull request overview
Adds a new interactive 1‑D Gaussian fitting example and extends the widget/line interaction system to support richer interactions (widget visibility, new widget styles, and improved line hover/click behavior).
Changes:
- Add
Widget.show()/hide()+visiblestate, and make JS rendering/hit-testing respect hidden widgets. - Extend 1‑D widgets:
RangeWidget(style='band'|'fwhm', y=...)andPointWidget(show_crosshair=...); addLine1D.set_data()for live overlay updates. - Add a new interactive fitting example and a large set of tests covering line click routing and widget visibility/fitting flows.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_widgets.py |
Adds new line-click tests and extensive new widget visibility + interactive fitting scenario tests. |
pyproject.toml |
Adds SciPy to optional dependencies (docs extra). |
Examples/Interactive/plot_interactive_fitting.py |
New end-to-end interactive Gaussian fitting example using widgets + SciPy fitting. |
anyplotlib/widgets.py |
Implements widget visibility API and extends RangeWidget/PointWidget initialization options. |
anyplotlib/figure_plots.py |
Adds Line1D.set_data() and extends widget-creation APIs with new parameters and optional batching. |
anyplotlib/figure_esm.js |
Implements visibility filtering, new widget rendering modes, improved line hover highlighting, and adjusted click/drag logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ample usage to include "help"
…nd add visibility setter for widgets
Owner
Author
|
I also added in the ability to add a ? help tool tip. This is something I've always wanted in HyperSpy. So often I think the interactive features are hidden and a little help section would be so nice. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kind of a fun one. But I added in an example of fitting using mutiple components.
Screen.Recording.2026-04-05.at.10.12.52.PM.mov
@ericpre you might like this.