Skip to content

hv.Labels does not expose all style opts with Bokeh backend #6186

@TheoMathurin

Description

@TheoMathurin

ALL software version info

Holoviews 1.18.3
Bokeh 3.4.1

Description of expected behavior and the observed behavior

Since Bokeh 3, the Text glyph offers a string of customisation options that were not available in Bokeh 2 (see here and here to compare). However, these are not exposed in Holoviews.

The options involved are everything border_* and background_*.

I thought options were discovered dynamically to check whether they exist in the underlying Bokeh model but rather they are specified explicitly. In this case they have to be added to style_opts (and maybe _batched_style_opts) in LabelsPlot. They are a variety of ways to add them in the styles.py module but we need to avoid adding unexisting options to other elements.

Complete, minimal, self-contained example code that reproduces the issue

import holoviews as hv
import numpy as np

hv.extension('bokeh')

np.random.seed(9)
data = np.random.rand(10, 2)
labels = hv.Labels({('x', 'y'): data, 'text': [chr(65+i) for i in range(10)]}, ['x', 'y'], 'text').opts(background_fill_color='#FF46F7')
labels

Stack traceback and/or browser JavaScript console output

ValueError: Unexpected option 'background_fill_color' for Labels type across all extensions. No similar options found.
  • I may be interested in making a pull request to address this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions