Open rsignell-usgs opened 1 year ago
I have noticed this and this is part of the work I am actively working on right now - hoping to get this fixed soon.
Is there a workaround? I'd love to give a live demo tomorrow during my final presentation here at NATO CMRE in Italy, 11:00 Italy time.
I'll have a look this evening.
This legend is already generated with a workaround so I don't expect it will be hard to hide (or simply filter out) those annoying numbers (which is probably the correct thing to do tbh as the vessel types are supposed to be grouped into the named categories)
Here is the simple fix I've found so far:
tiles * labels * points.opts(show_legend=False) * legend.opts(xaxis='bare',yaxis='bare', title='')
Looks like points
now gets an automatic legend which merges with the custom one.
@rsignell-usgs I've updated the deployment to fix the legend and which also includes some new hover functionality (WIP): https://ship-traffic.pyviz.demo.anaconda.com/ship_traffic
I just had to discover a similar fix for the Census example. Seems like the automatic legend (which I totally don't remember us implementing!) needs a way to pass a mapping from category value (12) to category name (Tug). legend_mapping={12:"Tug", ...}
?
@jlstevens , awesome! Just in time for my live demo!!!!
I think that a mapping option would make sense!
When using categorical datashader operations in holoviews, I would hope we don't need the mapping as we would set the names explicitly.
@Hoxbro @jbednar I think the legend_mapping
suggestion makes sense as an override.
I'm guessing something changed with one of the packages, because when I run the interactive ship traffic cell, I get two legends. The first one is coming from the
points
datashader object but I can't figure out how to turn it off! Help @jlstevens !