Is it possible to style a HTMLLabel?

I would like to style the text and bounding box of a HTMLLabel beyond the attributes that are already present for label. Eg. add padding between text and border. Is that possible?

From the developer tools in Firefox I am able to drill down from class="bk-Figure" to the div class="bk-layer" where the annotation styling is. But if I create a style for bk-layer class nothing happens. How should I go about defining a style that updates bk-layer class for just the HTMLLabel?

Is it possible somehow to have HTMLLabel parse HTML code?

from bokeh.io import save, output_file
from bokeh.plotting import figure
from bokeh.models import HTMLLabel

output_file('htmllabel.html')

p = figure(
	width = 400,
	height = 400
)
p.circle(
	x = [0, 5],
	y = [3, 1],
	size = 14,
	fill_color = ['orange', 'blue'],
)

label = HTMLLabel(
    x = 50,
    y = 50,
    x_units = 'screen',
    y_units = 'screen',
    text = 'Hello\nthere',
    border_line_color = 'red',
    background_fill_color = 'yellow',
    text_line_height = 1.8,
    name = 'htmllabel'
)
p.add_layout(label)

save(p)

cc @mateusz

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.