Add color bar overlay - #7832
Conversation
|
Looking pretty spicy! |
Yeah, this is a pretty big limitation currently with canvas overlays. I've been thinking abotu this since I worked on the unified system using |
|
Even having a warning like: |
|
Great start! Love this so so so much! I keep seeing this feature request pop up in various places.
Anyways, this is super awesome! |
|
Yes to everything! |
|
I managed to get the tiling to work! Cool things that now work as expected:
A whole lot of refactoring went into this, so the diff is huge now; I will split out into smaller PRs if we like this approach :) |
|
Ok, I create #7835 and #7836 which respectively refactor the overlay code, and introduce tiling. The diffs are: main -> refactor: main...brisvag:napari:feature/tiling-overlays2 |
|
Last minute question: |
I prefer |
# References and relevant issues Part of the work in #7832. Depends on #7835. Diff relative to #7835: brisvag/napari@refactor/overlays...brisvag:napari:feature/tiling-overlays2 # Description Canvas overlays can be positioned on the canvas using a limited set of positions (`top_left`, `bottom_right` and so on). Currently, if two overlays end up in the same place, they simply overlap. This PR introduces tiling for canvas overlays by looping through all canvas overlays and assigning an (horizontal) offset equal to the space taken up by all previous overlays. ```py import napari v = napari.Viewer() v.add_points() v.scale_bar.visible = True v.text_overlay.visible = True v.text_overlay.text = 'Some interesting text' v.text_overlay.position = 'bottom_right' napari.run() ``` On main:  With this PR: <img width="283" height="104" alt="image" src="https://github.com/user-attachments/assets/6d295077-dc1e-4146-8770-b697532a2501" /> --------- Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> Co-authored-by: Tim Monko <timmonko@gmail.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
|
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: |






References and relevant issues
Description
Added a colormap/colorbar overlay.
Try with: