-
-
Notifications
You must be signed in to change notification settings - Fork 484
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
Support using an SVG for ToggleIcon #6127
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #6127 +/- ##
==========================================
+ Coverage 84.67% 84.68% +0.01%
==========================================
Files 296 296
Lines 44096 44151 +55
==========================================
+ Hits 37338 37389 +51
- Misses 6758 6762 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Are URLs also supported? |
No, I don't think so since I don't think Bokeh button icons support URLs either. Should this support URLs (if so, I think it can be in another PR)? |
If bokeh really doesn't then don't worry about it but I'd be surprised if that was the case. |
Also would prefer it to be in this PR if bokeh already allows it. |
I don't think it works, but maybe I'm using it wrong? import panel as pn
pn.extension()
cash_icon = "https://upload.wikimedia.org/wikipedia/commons/6/69/How_to_use_icon.svg"
pn.widgets.Button(icon=cash_icon, button_type='success', name='Checkout', icon_size='2em') ![]() No mention of URLs in https://docs.bokeh.org/en/3.0.2/_modules/bokeh/models/ui/icons.html#TablerIcon and this doesn't work from bokeh.models import Button
from bokeh.plotting import show
from bokeh.io import curdoc
from bokeh.models import CustomJS
from bokeh.models.ui.icons import SVGIcon, Icon
button = Button(label="Click me", icon=SVGIcon("https://upload.wikimedia.org/wikipedia/commons/6/69/How_to_use_icon.svg"))
show(button) |
Indeed, docstring says:
|
Support SVGs for ToggleIcon.
Screen.Recording.2023-12-26.at.1.38.16.PM.mov