2

I often plot data that I do not want to leave my personal computer. I notice that when using mpld3 to generate plots in the jupyter notebook, https://mpld3.github.io is accessed. I think its just pulling plotting scripts, but is there any risk of any of my plotted data being sent off of my computer when using mpld3? Is there an "offline mode" I could use mpld3 with?

Caleb
  • 3,839
  • 7
  • 26
  • 35
  • how did you check that requests have been sent? – taras Apr 25 '17 at 18:13
  • 1
    Nothing very advanced. Chrome says "waiting for mpld3.github.io" when opening the notebook. I downloaded the jupyter notebook as html and looked at the source. I don't know javascript very well, but I believe `$.getScript("https://mpld3.github.io/js/mpld3.v0.3git.js", function(){ create_widget(); });` likely is the line that is accessing github. I imagine this loads the function into memory, and it unlikely that github would be processing any data for me. But, I need to be sure. – Caleb Apr 25 '17 at 18:36
  • exactly, that is what I was talking about. It downloads a mpld3 library (a mpld3.v0.3git.js file), so it does not matter whether you host it locally or download from the other site. Here is a `getScript` documentation: https://api.jquery.com/jquery.getscript/ and `create_widget` should create a DOM element in the browser. – taras Apr 25 '17 at 18:40

1 Answers1

3

Try to pass local=True either to mpld3.enable_notebook() or mpld3.display(). As FAQ claims:

Setting this to True will copy the mpld3 and d3 JavaScript libraries to the notebook directory, and will use the appropriate path within IPython (/files/*.js) to load the libraries

taras
  • 3,579
  • 3
  • 26
  • 27