Skip to content

Enable histogram#387

Merged
jo-mueller merged 12 commits intov0.9.0from
enable-histogram
Apr 24, 2025
Merged

Enable histogram#387
jo-mueller merged 12 commits intov0.9.0from
enable-histogram

Conversation

@jo-mueller
Copy link
Collaborator

Fixes #383

This re-enables the histogram functionality from the old clusters-plotter for the upcoming 0.9.0.

Long description

This pull request introduces enhancements to the napari_clusters_plotter plugin, focusing on adding support for 2D histograms, improving colormap handling, and refining the overall plotting functionality. It also includes updates to dependencies and new tests to ensure the robustness of the changes.

Feature Enhancements:

  • Added support for 2D histograms by introducing a new plotting type HISTOGRAM2D and updating the PlottingType enum and related UI elements (_setup_ui, _on_plot_type_changed). [1] [2] [3]
  • Introduced a colormap_reference dictionary to centralize colormap selection logic based on plot type and data categorization, simplifying the _replot method. [1] [2]

Dependency Updates:

  • Updated the biaplotter dependency version from >=0.1.0 to >=0.2.0 in pyproject.toml.

Code Simplifications:

  • Simplified colormap and color index handling in _color_layer_by_value by replacing multiple calls with a single color_indices_to_rgba method.
  • Removed unused imports (ArtistType) and refactored active artist initialization to use string identifiers instead of enum members. [1] [2]

Testing Improvements:

  • Added a new parameterized test test_histogram_support to validate the functionality of the new HISTOGRAM2D plot type with various layer types.

UI Updates:

  • Enabled the plot_type_box dropdown in the UI to allow users to switch between plot types dynamically.

@jo-mueller jo-mueller added this to the v0.9.0 milestone Apr 24, 2025
@jo-mueller jo-mueller added the enhancement New feature or request label Apr 24, 2025
@jo-mueller jo-mueller merged commit db85cf0 into v0.9.0 Apr 24, 2025
18 of 33 checks passed
@jo-mueller jo-mueller deleted the enable-histogram branch April 24, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant