see the original thread here
Currently its hard to integrate certain plotting libraries in one single zeppelin notebook efficiently. efficiently here means in the sense of how often library code needs to be embedded into a single notebook. while few plotting libraries provide APIs to properly enable lazy loading of their JS library (e.g. bokeh), others do not (e.g. plotly), which results in large overhead in notebooks with couple of plots, where each plot embeds the library code again and again. attempts to only embed library code in the first paragraph is not feasible, as its not guaranteed, that this paragraph will be loaded at first by the browser. Any attempt to load libraries via paragraph code will end up in such synchronization issues when the library does not support synchronization on its own.
A general solution for that problem is to enable the loading of 3rd party JS libraries within the root HTML.
Hence this issue will introduce a new optional zeppelin configuration that allows administrators to add global addons to the zeppelin root HTML, so analysts can rely on that the JS library is already loaded for every paragraph.
As there exist two places in HTML where initial loading may be placed, the issue will introduce the following two configuration properties:
- zeppelin.server.html.head.addon > addon html code to be placed at the end of the html->head section
- zeppelin.server.html.body.addon > addon html code to be placed at the end of the html->body section
Each property may contain any valid HTML code, e.g.
<script defer src="https://url/to/my/lib.min.js" /><script defer src="https://url/to/other/lib.min.js" />