brainglobe / brainrender-napari

A napari plugin to render BrainGlobe atlases and associated data as layers.
BSD 3-Clause "New" or "Revised" License
19 stars 1 forks source link

Tooltip when hovering over atlas images #85

Closed alessandrofelder closed 1 year ago

alessandrofelder commented 1 year ago

Description

What is this PR

Why is this PR needed? Being able to display the region info when hovering over any atlas image in 2d is a sought-after feature.

What does this PR do? (This PR is a workaround until napari allows developers to provide custom tooltips for the selected layer. We can track this sort of thing in meta-issue #87)

An initial implementation of a layer tooltip.

References

Closes #26

How has this PR been tested?

Two additional tests added that cover added functionality Existing tests pass Manual testing looks reasonable

Is this a breaking change?

No

Does this PR require an update to the documentation?

Opened an issue in the docs https://github.com/brainglobe/website/issues/59

Checklist:

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.25% :tada:

Comparison is base (0e30dd4) 97.05% compared to head (55d9d4e) 97.30%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #85 +/- ## ========================================== + Coverage 97.05% 97.30% +0.25% ========================================== Files 7 7 Lines 339 371 +32 ========================================== + Hits 329 361 +32 Misses 10 10 ``` | [Files Changed](https://app.codecov.io/gh/brainglobe/brainrender-napari/pull/85?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=brainglobe) | Coverage Δ | | |---|---|---| | [brainrender\_napari/napari\_atlas\_representation.py](https://app.codecov.io/gh/brainglobe/brainrender-napari/pull/85?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=brainglobe#diff-YnJhaW5yZW5kZXJfbmFwYXJpL25hcGFyaV9hdGxhc19yZXByZXNlbnRhdGlvbi5weQ==) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

adamltyson commented 1 year ago

@alessandrofelder this works for me, but for some reason the brain region tooltip is displayed with an offset. The other tooltips in the widget work fine. Screenshot from 2023-08-31 12-19-09

alessandrofelder commented 1 year ago

the brain region tooltip is displayed with an offset. The other tooltips in the widget work fine.

Thanks, that offset shouldn't be as big! I'll try to fix!