-
Notifications
You must be signed in to change notification settings - Fork 10
Improve scatter ux #445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Improve scatter ux #445
Conversation
…ty/invisibility settings
The correcet place to trigger plot modifications is here, not in the functions that trigger the plot update.
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #445 +/- ##
==========================================
+ Coverage 88.13% 88.78% +0.65%
==========================================
Files 11 11
Lines 1079 1115 +36
==========================================
+ Hits 951 990 +39
+ Misses 128 125 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the scatter plot UX by adding manual point-size and frame-highlighting controls, refactors advanced-options visibility logic into relevant methods, and updates docs and tests to cover the new features.
- Added UI controls (
spinBox_point_size
,checkBox_frame_highlighting
) and corresponding properties/callbacks for scatter plots - Streamlined advanced-options visibility by removing a dedicated handler and integrating it into
_replot
,_on_plot_type_changed
, etc. - Updated tests to assert on new size/alpha behavior and refreshed documentation screenshots and descriptions
Reviewed Changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
src/napari_clusters_plotter/plotter_inputs.ui | Added scatter & histogram control group boxes and adjusted tab index |
src/napari_clusters_plotter/_new_plotter_widget.py | Introduced scatter_point_size /frame_highlighting_activated props, callbacks, and default factors |
src/napari_clusters_plotter/_tests/test_plotter.py | Extended tests for scatter advanced options |
docs/usage/plotter_widget.md | Updated screenshot reference and listed new controls |
Comments suppressed due to low confidence (1)
src/napari_clusters_plotter/plotter_inputs.ui:125
- There's a typo in the tooltip: 'enale' should be 'enable'.
<string><html><head/><body><p>Continuous colormap to display a feature as colors over plotted data.</p><p>Use the eye button in the plotter controls to hide/show the overlay colors.</p><p>To enale this, select a non-categorical feature in the <span style=" font-weight:600;">Hue</span> Combobox.</p></body></html></string>
docs/usage/plotter_widget.md
Outdated
Depending on which plot type is selected, some additional options are available: | ||
|
||
11. For `SCATTER` plot: | ||
- Enable the time-frame highlighting. This make give out-of-frame points a different alpha and size, making them appear slightly more transparent and smaller. This is useful to visualize the current time frame in a time-series dataset. To make use of this, enusre that the measurements in the layer's `layer.features` dataframe contain a `frame` column, which is used to determine the current time frame. |
Copilot
AI
Jul 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar typo: 'This make give out-of-frame' should be 'This will make out-of-frame' or 'Makes out-of-frame'.
- Enable the time-frame highlighting. This make give out-of-frame points a different alpha and size, making them appear slightly more transparent and smaller. This is useful to visualize the current time frame in a time-series dataset. To make use of this, enusre that the measurements in the layer's `layer.features` dataframe contain a `frame` column, which is used to determine the current time frame. | |
- Enable the time-frame highlighting. This will make out-of-frame points have a different alpha and size, making them appear slightly more transparent and smaller. This is useful to visualize the current time frame in a time-series dataset. To make use of this, ensure that the measurements in the layer's `layer.features` dataframe contain a `frame` column, which is used to determine the current time frame. |
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
THis PR depends on BiAPoL/biaplotter#64 and BiAPoL/biaplotter#66 to be released. |
Fixes #444
@zoccoler PR to fix what I noticed when I prepared the slides for the course. For a large number of points, the point sizes are waaaay too large to discern any clusters in the data. I added UI options to set the point size manually and to enable/disable the frame highlighting. In doing so, I also streamlined the handling of the advanced option's appearance/dissapearance a bit.
Future work may include some clever settings for points' edge width (the
linewidth
property) - it can happen, that for small point sizes, the face of a point is completely invisible due to the comparatively large border ^^"Copilot description
This pull request introduces several enhancements and refactors to the
napari_clusters_plotter
package, focusing on improving scatter plot functionality, adding advanced options for frame highlighting and point size adjustments, and restructuring the UI for better usability. Additionally, it includes updates to the test suite to ensure the new features are properly validated.Enhancements to Scatter Plot Functionality:
Added support for frame highlighting and point size adjustments in scatter plots, controlled via new UI elements (
checkBox_frame_highlighting
andspinBox_point_size
). These settings dynamically update the alpha and size of points based on the current frame and user-defined values. (src/napari_clusters_plotter/_new_plotter_widget.py
, [1] [2] [3]Introduced new properties (
scatter_point_size
andframe_highlighting_activated
) to encapsulate scatter plot settings, enabling easier access and modification. (src/napari_clusters_plotter/_new_plotter_widget.py
, src/napari_clusters_plotter/_new_plotter_widget.pyR381-R425)UI Improvements:
Restructured the UI to include dedicated containers for scatter and histogram settings (
scatter_settings_container
andbins_settings_container
), improving clarity and usability. (src/napari_clusters_plotter/plotter_inputs.ui
, [1] [2]Adjusted the default visibility and layout of UI elements to better reflect the active plot type, ensuring relevant controls are displayed contextually. (
src/napari_clusters_plotter/plotter_inputs.ui
, src/napari_clusters_plotter/plotter_inputs.uiL210-L261)Refactoring and Code Simplification:
_handle_advanced_options_widget_visibility
method, simplifying visibility control logic by integrating it directly into relevant methods such as_replot
and_on_plot_type_changed
. (src/napari_clusters_plotter/_new_plotter_widget.py
, [1] [2]Test Suite Updates:
Added tests for scatter plot advanced options, validating frame highlighting and point size functionality. (
src/napari_clusters_plotter/_tests/test_plotter.py
, src/napari_clusters_plotter/_tests/test_plotter.pyR558-R592)Updated existing tests to accommodate new scatter plot settings, ensuring proper handling of alpha and size adjustments. (
src/napari_clusters_plotter/_tests/test_plotter.py
, src/napari_clusters_plotter/_tests/test_plotter.pyL513-R516)