ENH: Implement TimeChange behaviour for evoked_topo and recursive option in link#13968
Open
Gnefil wants to merge 18 commits into
Open
ENH: Implement TimeChange behaviour for evoked_topo and recursive option in link#13968Gnefil wants to merge 18 commits into
Gnefil wants to merge 18 commits into
Conversation
…update time in subfigures synchronously
4 tasks
There was a problem hiding this comment.
Pull request overview
This PR adds TimeChange-based UI event interoperability to mne.viz.plot_evoked_topo (enabling time synchronization with other interactive figures) and extends mne.viz.ui_events.link() with a merge option to merge existing link-groups.
Changes:
- Add
TimeChangepublishing/subscribing to the magnified (single-channel) topo time series and track current time on the mainplot_evoked_topofigure. - Extend
mne.viz.ui_events.link()withmerge=to unify existing link-groups. - Add/adjust tests, a tutorial snippet, and a changelog entry covering the new behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
tutorials/evoked/20_visualize_evoked.py |
Adds an example linking an interactive topomap and plot_evoked_topo for synchronized time selection. |
mne/viz/ui_events.py |
Adds merge parameter to link() to merge figures’ existing link-groups. |
mne/viz/topo.py |
Implements TimeChange interactions for the magnified topo time series and subscribes the main topo figure to time-change events. |
mne/viz/tests/test_ui_events.py |
Adds a test covering merge=True link-group behavior. |
mne/viz/tests/test_topo.py |
Adds tests for time-change propagation/select-line behavior in plot_evoked_topo. |
doc/changes/dev/13968.newfeature.rst |
Adds a changelog entry describing the new TimeChange behavior and merge parameter. |
wmvanvliet
requested changes
Jun 25, 2026
wmvanvliet
left a comment
Contributor
There was a problem hiding this comment.
Can you also document the UI events that plot_evoked_joint now publishes/subscribes to?
Does plot_evoked_topo also changle the TimeChange event?
Notes
-----
The figure will publish and subscribe to the following UI events:
* :class:`~mne.viz.ui_events.TimeChange`
Co-authored-by: Marijn van Vliet <w.m.vanvliet@gmail.com>
Gnefil
commented
Jun 28, 2026
Gnefil
left a comment
Contributor
Author
There was a problem hiding this comment.
Updated according to second round of reviews.
wmvanvliet
reviewed
Jun 30, 2026
wmvanvliet
left a comment
Contributor
There was a problem hiding this comment.
Code looks good. Just two minor things
wmvanvliet
requested changes
Jul 1, 2026
Co-authored-by: Marijn van Vliet <w.m.vanvliet@gmail.com>
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.
Reference issue (if any)
Implements #13928.
What does this implement/fix?
It enables
plot_evoked_topofigures to interact with other figures sharingTimeChangeevent.The strategy is to implement
on_time_changefunction, link subfigures with the main figure, and mark the current time (set as a figure attribute) with a vertical line. Clicks on the subfigures publishTimeChangeevents, main figure subscribes to external events, and publish/subscribe transmit events/callbacks through thelinkfunction.Additional information
ui_events.link()function now has amergeparameter that allows mutually linking the link-groups that figs belong to separately.