You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
For our use-case we need to be able to generate png files with io.export_png that look exactly like the interactive html. Currently this means that we can not make use of the very nice and extremely powerful 'template' functionality that io.save provides.
Describe the solution you'd like
It would be fantastic if the 'template' functionality could also be added to io.export_png
The text was updated successfully, but these errors were encountered:
fstalm
changed the title
[FEATURE] add "template" to io.export_png
[FEATURE] add "template" to io.export_png label:Triage
Jul 15, 2020
fstalm
changed the title
[FEATURE] add "template" to io.export_png label:Triage
[FEATURE] add "template" to io.export_png
Jul 15, 2020
Tentatively marking as feature. Offhand it seems like it should not be too difficult, but some actual investigation will be needed. @fstalm Certainly if you are able to conduct some experiments on your own that may help speed up things.
@bryevdv Attached is a new export.py (sorry, I am not allowed to create a pull request it seems: "Permission to bokeh/bokeh.git denied"). This file essentially only declares 'template' as optional argument to export_png and then hands it down the chain to get_screenshot_as_png and then to get_layout_html.
The optional template is added to template string that get_layout_html is creating: + str(template or ''). This latter bit probably will have to be modified so that it also handles jinja2 templates and not only strings. Maybe somebody with such expertise could have a look.
Passing for example template="{% block postamble %} <style>.bk-root .bk-tabs-header .bk-tab { padding-top: 12px; padding-bottom: 12px; padding-left: 24px; padding-right: 24px; } </style> {% endblock %}"
as template to export_png now will draw larger Tabs and produce a png file that is a copy of the html file created with save(...,template=template).
Is your feature request related to a problem? Please describe.
For our use-case we need to be able to generate png files with io.export_png that look exactly like the interactive html. Currently this means that we can not make use of the very nice and extremely powerful 'template' functionality that io.save provides.
Describe the solution you'd like
It would be fantastic if the 'template' functionality could also be added to io.export_png
The text was updated successfully, but these errors were encountered: