Set options generically

Hi there,

Is there a way to “blindly” set an option that would target all element types supporting it ? I’m currently trying to apply some generic settings from generic code that could be given any holoviews object (both elements and layouts). The current workaround I found is a static list of types to apply the option to (e.g. [‘Scatter’, ‘Points’, ‘Curve’]) but I’m sure I missed a lot of them and it’s not future proof.

This would include things like setting color cycles, and sometimes dimensions (only if the user asked for it, since it could wreck complex layouts).

Ideally there would be a way to set an option with a user-given predicate, so we can:

  • check if the specific class supports that option
  • exclude/include some classes, or some specific groups or labels
  • check if the option has already been set on that object by the user, to avoid overwriting it

The general goal I’m converging to is some sort of “programmatic stylesheet” that can apply various options based on criteria more complex than just the type, as well as even adding extra data to the plots (e.g. an overlaid scatter plot muted by default to show timeseries update points).

I’m not aware of one, but that sounds like a useful utility to have.