Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPython notebook: Uncaught TypeError: X.watchTransition is not a function #115

Open
Hubbitus opened this issue Mar 13, 2016 · 0 comments
Open

Comments

@Hubbitus
Copy link

I'm new in python-nvd3 (nvd3 too) and try evaluate example from https://gist.github.com/jdavidheiser/9552624#file-nvd3-ipython-notebook-demo

Thats example works, but from time to time. Run cell work properly 1 from 10 attempts. Some race condition happened and in browser I see JavaScript error:

Uncaught TypeError: X.watchTransition is not a function

Brief googling I found similar complain http://stackoverflow.com/questions/29899013/ipython-notebook-can-not-show-multiple-charts-with-d3js-or-nvd3 and possible found underneath bugreport on nvd3: novus/nvd3#1219

What I also discover strange

import nvd3
nvd3.ipynb.initialize_javascript(use_remote=True)

Mostly useless, because just draw first chart emit message what it will be loaded automatically.
But what much more interesting, according to browser console it loads:

  • nv.d3.min.js?_=1457861845889
  • d3.min.js?_=1457861845890
  • d3.min.js?_=1457861845891
  • nv.d3.min.js?_=1457861845892
  • nv.d3.min.js?_=1457861845893

For all initiator jquery.min.js?v=20160311105719:6.
nv.d3.min.js loaded 3 times, and d3.min.js twice!

Then I run first example from notebook:

type = 'stackedAreaChart'
chart = nvd3.stackedAreaChart(name=type,height=450,width=800,use_interactive_guideline=True)
nb_element = 50
xdata = range(nb_element)
ydata = [i * random.randint(1, 10) for i in range(nb_element)]
ydata2 = [x * 2 for x in ydata]
ydata3 = [x * 5 for x in ydata]
chart.add_serie(name="serie 1", y=ydata, x=xdata)
chart.add_serie(name="serie 2", y=ydata2, x=xdata)
chart.add_serie(name="serie 3", y=ydata3, x=xdata)
chart

It load nv.d3.min.css, d3.min.js, nv.d3.min.js.
If I rerun it just after few seconds it shows empty cell result.
In console bunch of errors:

d3.min.js?_=1457861845891:1: Uncaught TypeError: Cannot read property 'sourceEvent' of null
nv.d3.min.js?_=1457861845896:6: Uncaught TypeError: X.watchTransition is not a function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant