Skip to content
Snippets Groups Projects
Commit cd213b20 authored by Bas Nijholt's avatar Bas Nijholt
Browse files

simplify holoviews js and css

parent 6fca822a
No related branches found
No related tags found
No related merge requests found
Pipeline #12839 passed
This commit is part of merge request !129. Comments created here will be created in the context of that merge request.
......@@ -128,35 +128,12 @@ intersphinx_mapping = {
}
# -- Add Holoviews js and css ------------------------------------------------
def setup(app):
from holoviews.plotting import Renderer
hv_js, hv_css = Renderer.html_assets(
extras=False, backends=[], script=True)
fname_css = 'holoviews.css'
fname_js = 'holoviews.js'
static_dir = 'source/_static'
os.makedirs(static_dir, exist_ok=True)
with open(f'{static_dir}/{fname_css}', 'w') as f:
hv_css = hv_css.split('<style>')[1].replace('</style>', '')
f.write(hv_css)
with open(f'{static_dir}/{fname_js}', 'w') as f:
f.write(hv_js)
app.add_stylesheet(fname_css)
app.add_javascript(fname_js)
dependencies = {**Renderer.core_dependencies, **Renderer.extra_dependencies}
for name, type_url in dependencies.items():
if name in ['bootstrap']:
continue
dependencies = {**Renderer.core_dependencies,
**Renderer.extra_dependencies}
for name in ['jQueryUI', 'jQuery', 'require']:
type_url = dependencies[name]
for url in type_url.get('js', []):
app.add_javascript(url)
for url in type_url.get('css', []):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment