HTML file saved with hv.save() includes unexpected CDN JS/CSS references

Greetings,

I am very interested in using inline mode because I should analyze data without Internet connection in my office.

I tested following code at the JupyterLab today,

import numpy as np

import holoviews as hv
hv.extension(‘bokeh’)

import panel as pn
pn.config.notifications = False
pn.config.inline = True
pn.io.resources.RESOURCE_MODE = ‘inline’

from bokeh.resources import INLINE

violin = hv.Violin(np.random.randn(100))
hv.save(violin, filename=‘test.html’, fig=‘html’, resources=INLINE)

and I found out that saved html file include following unexpected CDN JS/CSS references.
As result, the html file is loaded very slowly due to trial and failure for CDN at my office.

          <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.css" type="text/css" />
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" type="text/css" />
      <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.js"></script>

I guess notification area of panel added automatically by holoviews causes this trouble.

Could you suggest any solution or workaround?

Thank you very much for your attention and any advice.

1 Like

Hi @jackey

A work around would be to post-process the file by 1) reading it 2) replacing the unwanted content with the empty string 3) saving again.

1 Like

Thank you very much for your advice.

Actually, I found the below link several minutes ago.
Do not load notyf resources unless notifications are enabled #3958

Previously, I used the 0.13.0 version of panel package, but after I update it to the 0.14.1 version including above pull request, the problem was solved.

1 Like