holoviz / datashader

Quickly and accurately render even the largest data.
http://datashader.org
BSD 3-Clause "New" or "Revised" License
3.31k stars 366 forks source link

pixel value when I click on an image #557

Closed orkun closed 6 years ago

orkun commented 6 years ago

Is it possible to get pixel value when I click on an image? Is there any example? or how is it done? regards

jbednar commented 6 years ago

Yes and no. No, in that Bokeh does not yet support hover for 2D objects. We keep meaning to address that, but it keeps getting shunted aside for higher-priority work, because it's trickily bound up into other work that's already underway. Once it's done, you'll be able to hover over the image even in a pure HTML file (with no Python process running), but I can't promise when that will be ready.

Meanwhile, you can get the 2D coordinates of a mouse click as shown in the last cell of our Landsat example. That approach requires a live Python server (and thus won't work in the actual HTML file linked there), but once you get the coordinates you should be able to look up the value from the datashaded array manually.

jbednar commented 6 years ago

Bokeh now supports image hover, as of bokeh 0.12.16, and it's supported by HoloViews 1.10.4 and GeoViews 1.5, so you should be able to use those libraries to show hover information for any datashaded plot. See the "large data" sections of holoviews.org and geoviews.org.