Skip to content
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

Displaying custom data on hover for RGBA image #8668

Closed
paulaceccon opened this Issue Feb 18, 2019 · 6 comments

Comments

Projects
None yet
4 participants
@paulaceccon
Copy link

paulaceccon commented Feb 18, 2019

It would be nice to be possible to show some sort of information on RGBA images using Bokeh (https://stackoverflow.com/questions/54753032/hover-image-rgba-bokeh/54753614#54753614).
For instance, I'm working on a project in which we provide an RGBA image where the alpha represents some sort of confidence. We would like, when hovering an image pixel, to be able to show this confidence (in this case, the rgba[:,:,3] value).

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented Feb 18, 2019

cc @jlstevens I don't recall what the obstacles to this were, offhand.

@jbednar

This comment has been minimized.

Copy link
Contributor

jbednar commented Feb 18, 2019

For my purposes, I'd like to be able to see the full RGBA tuple, or any particular channel, or (ideally) any other column of data sharing the same shape. E.g. if I had data that was turned into RGBA by datashader, it would be nice to hover over and see the original data value. Currently I can do that by overlaying an invisible (alpha=0) copy of the Image, but that's awkward.

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented Feb 18, 2019

Some random thought:

  • Probably good to add some new special fields: $red, $green, $blue $alpha Obviously these would only be useful or apply to hovers of ImageRGBA (or possibly also Image)

  • I think linking to data shader or other data is possible in the same way as with Image? I.e. if you have another column foo with some other data (per-pixel) then the hover tool would drill down and display @foo gives you the same per-pixel hover that Image does. Or are you asking for something else?

  • Another possible usage: coupled with CustomJSHover a per-pixel extra data column that had some external id, etc. could use that to query some other API to get lots of additional information per-pixel without having to dump everything in the CDS (useful obviously only if there is an API available)

@jbednar

This comment has been minimized.

Copy link
Contributor

jbednar commented Feb 18, 2019

  • The new special fields sound reasonable to me. Seems like @Alpha could apply to any glyph?

  • The datashader support is maybe something we could do in HoloViews; we transform the dataset (which is not in the browser) into an array and then to an RGBA (which is always passed to the browser); we could maybe make the array available (optionally) as a column so that it would be available for hover. That's related to things @jlstevens is already working on, so I'll leave that up to him.

  • Yes, being easily able to query (after a delay, presumably) to find out what to display in the hover would be very useful.

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented Mar 12, 2019

@jlstevens any interest/availability to make a quick stab at this?

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Mar 12, 2019

I'm currently working on more advanced colormapping models but I am happy to come back to this when I get a chance...

@bryevdv bryevdv referenced this issue Mar 21, 2019

Merged

compute image bounds correctly #8773

2 of 2 tasks complete

@bryevdv bryevdv modified the milestones: short-term, 1.1 Mar 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.