Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] HTMLLabel to support stylesheets and css_classes #13652

Closed
carve11 opened this issue Jan 21, 2024 · 3 comments · Fixed by #13828
Closed

[FEATURE] HTMLLabel to support stylesheets and css_classes #13652

carve11 opened this issue Jan 21, 2024 · 3 comments · Fixed by #13828

Comments

@carve11
Copy link

carve11 commented Jan 21, 2024

Problem description

The HTMLLabel or Label annotations are very useful renderers for text since they accept screen units. One issue for me is the lack of css style options beyond the current text, border and background arguments. I often find that I would like to style something but not able to. Eg it could be padding, use the font-family defined in html body css, font-weight. I have previously asked about this on discourse.

Based on the following versions:
Python version : 3.11.7 (main, Jan 1 2024, 01:39:59) [Clang 14.0.0 (clang-1400.0.29.202)]
IPython version : (not installed)
Tornado version : 6.4
Bokeh version : 3.3.3

Feature description

Other widgets support the arguments css_classes and stylesheets and, if I have understood correctly, HTMLLabel is a div element.

Potential alternatives

Have not considered any alternatives.

Additional information

No response

@carve11 carve11 added the TRIAGE label Jan 21, 2024
@mattpap
Copy link
Contributor

mattpap commented Jan 22, 2024

HTMLLabel was designed to be an HTML equivalent to canvas Label annotation, thus it strives to keep the same API, behavior and appearance. In fact, HTMLLabel used to be implemented as Label(render_mode="css"). However, the utility of HTMLLabel defined like this is questionable. We are currently in the process of adding "floating" UI elements to bokeh (PR #13538), so it will be possible to add HTML panels to plots/canvas and any renderers (e.g. attach HTML to a box annotation) in screen, data and symbolic coordinates. These HTML panels support css_classes, stylesheets and more.

@mattpap mattpap added this to the 3.4 milestone Jan 22, 2024
@carve11
Copy link
Author

carve11 commented Jan 22, 2024

@mattpap Cool, thanks for the update. Looking forward to the floating UI elements.

@mattpap
Copy link
Contributor

mattpap commented Apr 21, 2024

PR #13828 adds support for all styling properties of UIElement to all DOM based renderers on the canvas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants