- You are using plotting Plotly interactive charts through (Cufflinks)[https://github.com/santosjorge/cufflinks] in a Jupyter notebook.
- Your charts have a link in the bottom right corner - "Export to plotly"
- You want to remove this from your exported html
-
Add a raw code cell
-
Paste the following
<script>
$( document ).ready(function(){
setTimeout(function(){$("a.link--impt").attr("display","none");}, 500);
});
</script>
- Export your notebook as html and load it in the browser. The link should not be displayed.
- The raw code cell allows you to add javascript in the notebook which will run in the browser when the notebook is exported as html.
- <script> denotes javascript
- $ refers to the Jquery library
- The "Export to plotly" link is < a > element inside an SVG (the interactive chart) and needs .attr("display","none") to make it not display. Instead, if you wanted to remove a normal html tag you'd use .hide() - $("div.someClass").hide().
- The SVG charts take some time to render even after the document is ready, setTimeout calls the code to hide the < a > 500ms after the document is ready. You may need to increase this value if your charts take longer to load.
I need to remove in Jupiter notebook itself is there any other way?