Connect histogram optional features#390
Conversation
…ate _replot to display selected colormap with or without log norm
for more information, see https://pre-commit.ci
…lt colors and connect appropriate method to _on_show_plot_overlay depending on its state
… are 0 and hue_axis is categorical. In other cases, let layer colors be defined by color_indices and colormap (+ options like log)
|
Latest changes will only work after BiAPoL/biaplotter#49 |
…ettings as separated method
…e duplicated connections to _replot)
…les/disables manual bin spinbox and calls _replot, where bins are calculated and spinbox value (bin_number) is updated
…rs if nothing was selected (keep previous selections otherwise)
… in the Hue combobox
|
Hi @jo-mueller , This is ready for review. It needs the main development branch of the biaplotter (v0.3.0, not yet release but ready). Automated tests shall fail because of that. I connected all the options in the advanced tab, except the hide non-selected clusters checkbox. The functionality of painting the selected layer(s) with the colors drawn in the plotter and resetting the colors upon unselecting is working, at least for the Labels layers. Please give it a try. |
|
Hi @zoccoler I only could have a quick look at it on my smartphone so my insight is limited. One idea that came to me though is the following: From what I understand there are a bunch of widgets that turn visible/invisible depending on whether the HISTOGRAM2D is enabled. You could put all the widgets for the histogram in a separate container (I think there's something like a QFrame or QWidgetGroup) so you'd only have to turn one object visible and save yourself a bit of code. |
|
Hi @jo-mueller , Thanks for checking this up so quickly. That would save just a few lines of code because just 2 containers are histogram specific: bins and histogram overlay colormap. There are other conditions that do not related to hide/show, for example:
I would like to further simplify the logic, but at the moment, I focused on getting it working. One thing that I find confusing is that some widgets callbacks arw connected to the "plotter_needs_update" signal, which calls _replot, others are directly linked to specific callback functions that eventually call _replot. |
|
I noticed that changing some settings, especially those related to the color_overlay, would bring the overlay back on top (sometimes permanently) regardless of the This PR in the biaplotter repo should fix it, making the color overlay visibility fully determined by the Below is a small demonstration of the following behaviors:
The code and gif below were made on napari |
|
I just solved minor conflicts to get tests running, sorry...
I also added properties to set axes labels more easily in the release :) |
|
Oh, I will take a look into #395 |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…com/BiAPoL/napari-clusters-plotter into connect_histogram_optional_features
…com/BiAPoL/napari-clusters-plotter into connect_histogram_optional_features
for more information, see https://pre-commit.ci
|
@zoccoler The new bug you found in #395 I could also reproduce here. I think I found the issue, will fix it directly here on this branch. Follow-up: Upon inspecting it again, I realized that I had noticed it before and I'd say that it's a feature, not a bug. Adding the newly selected clusters on top of the previous selection would require knowing which indeces have been changed in the last draw stroke. We could try to compare but I think we'd have a hard time discriminating between zero-valued indeces that were intentional (i.e. by drawing zeros) or unintentional (i.e. by drawing on a reset plot). The correct way to continue drawing after a previous selection would be to first select the We could throw a little warning that informs the user that they are about to erase the previous selection when drawing on a non-categorical display? Anyway - I am going to merge this as this is not related to this PR. |

Hi,
I started connecting events for the Advanced tab. For that, I updated the .ui file a little bit.
This is still a draft PR (WIP), but I wanted to expose it more explicitly to share this starting point.
At this point, I connected the log checkbox and the overlay_colormap Combobox (the other widgets start hidden from the interface for now).
To Do:
layer.events.visibletohide_color_overlaymethod and vice-et-versa