NdOverlay legends: Style by dim transform association with each of NdOverlay's kdim
See original GitHub issueWhen doing e.g. an NdOverlay, the legend has an entry for each Element (see below). For 2 or more key dimensions, this quickly becomes a lot. It would be really nice if instead of listing every single Element, we could style the NdOverlay by setting different Cycle
options along the different key dimensions, e.g. along kdim1 we vary line width, along kdim2 the color, along kdim3 the opacity, … As far as styling the Element goes, this would mostly be a convenience, but it could make the associated legends much clearer.
E.g. this is what it currently looks like:
What the legend could instead look like is that there’s a thick line (no colour) for “measured”, a thin one for “representative”, a blue patch for “overturning”, an orange one for “perennial” (no variation in thickness), and so on.
Or is this too complicated to generalize?
Also, unsure if this is related: #1161
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
This is now possible by using style mappers, e.g.:
I’d like to add a cycle method on
dim
though so you don’t have to provide an explicit mapping.Just to clarify Philipp’s code snippet, it may look like you have to pass extra vdims to do the dim transform, but you can even use dim transforms on kdims of NdOverlays! https://nbviewer.jupyter.org/github/poplarShift/pyviz-recipes/blob/master/notebooks/styling_by_attribute.ipynb
Changing title to reflect that.