ResidentMario / py_d3

D3 block magic for Jupyter notebook.
MIT License
451 stars 40 forks source link

Version loading doesn't seem to work at all #6

Closed kotoroshinoto closed 7 years ago

kotoroshinoto commented 7 years ago

when I ask the code to print d3.version, I ALWAYS get 3.5.17

nothing I do with the %%d3 magic line in terms of including version numbers changes this for me.

kotoroshinoto commented 7 years ago

it seems i had to tell pip to install from this repository as the new version hasn't been uploaded to pypi or any of the other standard locations

ResidentMario commented 7 years ago

Getting the right version to load is tricky because of the way the Jupyter/web interface works.

Try opening a new notebook and then doing:

%load_ext py_d3

And then:

%%d3 4.7.2

Then printing the version. In my experience, this gets the correct version loaded.

ResidentMario commented 7 years ago

Hmm, I'll take a look at what's going on pip.

ResidentMario commented 7 years ago

The versions on pip were desynced because I had a 0.2.5 tarball and a 0.2.4 distribution. No idea how that happened. I've updated the PyPI py_d3 listing to 0.2.6, so you should be able to just pip install -U py_d3 to get the most recent version now.

With regards to your other concern, here's the two things you need to keep in mind:

  1. You may only have one copy of D3 loaded per notebook. Whichever version you load first is the one every plot will use.
  2. D3 is cached, so to use a different version of D3 don't reload the kernel: purge the page cache instead (Ctrl + Shift + R on Chrome/Firefox).

I've added notes on this issue to the README. I'm closing this now, but let me know if you have any further issues!

ResidentMario commented 7 years ago

xref #4