Conversation
…n the python side
…value for single bounds with bin edges
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new "combined" slider mode to the slicer plot that allows users to toggle between a range slider (two handles) and a single-handle slider within the same widget. It also replaces the read-only label readouts with editable text fields, enabling users to type exact coordinate values directly. The combined mode is enabled by default.
Changes:
- Replaces
slice.pywithslicing.py, introducingCombinedSliceWidget,BoundedText,BoundedBinEdgeText, and related bounded-text readout widgets - Extends
Slicerandslicer()to supportmode('single','range','combined') andoperationparameters; adds_maybe_reduce_dimfor reducing sliced dims; the figure now usesreduce_nodesinstead ofslice_nodes - Expands the test suite with parametrized tests for all three modes, including datetime and bin-edge coordinate cases
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/plopp/widgets/slicing.py |
New widget file implementing bounded text readouts and combined slider |
src/plopp/widgets/__init__.pyi |
Exports CombinedSliceWidget from the new module |
src/plopp/plotting/slicer.py |
Adds mode/operation params, _maybe_reduce_dim, switches figure to reduce_nodes |
src/plopp/plotting/superplot.py |
Explicitly sets mode='single' for superplot |
tests/widgets/slice_test.py |
Updated/extended tests for new bounded text readouts |
tests/plotting/slicer_test.py |
New parametrized tests for all three slider modes |
docs/plotting/slicer-plot.ipynb |
Updated example notebook to use new combined default and mode='single' for player |
docs/getting-started/numpy-pandas-xarray.ipynb |
Minor datetime formatting note added |
docs/_static/plotting/slicer-plot.png |
Updated screenshot |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
YooSunYoung
approved these changes
Mar 5, 2026
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.
This adds a new slider for the
slicerplot which combines a range slider (two handles) and a single slider (one handle) where the mode can be toggled with a button click.It also adds text fields instead of a read-only text as readouts, which enables the user to enter the values they want.
If the requested value is outside the range, it will clamp to the bounds of the axes.
If the requested value does not match an exact coordinate value it will snap to the closest value available.
The combined slider is now enabled by default in the slicer plot.
Example:
The text boxes also properly handle bin edges and datetime coords (this is why the changes here got quite complicated).