I've been playing with Javascript in the Jupyter notebook following Brian 
Coffey's excellent D3 tutorial here:
https://github.com/stitchfix/d3-jupyter-tutorial

It appears, though, that more recent versions of D3 no longer work. 
Specifically, it seems that a problem developed at the switch from version 
3 of D3 to version 4 of D3. You can try the following, for example:

from IPython.core.display import HTML
#HTML('<script 
src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.js";></script>')
#HTML('<script 
src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.0.0/d3.js";></script>')

Of course, you need to uncomment the line that loads the verision of D3 you 
want to try. The first version, V3.5.17 of D3, works great. The second one, 
V4.0.0 of D3, doesn't work; more specifically, the `d3` object never makes 
it into the global namespace. Even more specifically, the Javascript 
console in Firefox indicates that there is a 
"Mismatched anonymous define() module: [object Object]
http://requirejs.org/docs/errors.html#mismatch";
Having a look at RequireJS, it looks like my version of the notebook is 
running Version 2.1.22 of RequireJS, which is a bit behind the times, I 
think. Perhaps that's related to the issue; I really don't know, but I 
don't think it's likely that D3 has been misusing Require since V4 came out.

I don't think this issue is specific to D3. In fact, I'd happily work with 
d3.v3. My real issue is with mathjs, which I can't get to work at all: 
http://mathjs.org/


I'm running Anaconda version 4.3.1 and ran 'conda update notebook' hoping 
that might help.


-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/cc82b41a-d81c-4231-85a0-6230c353747f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to