D3.js reference error in Jupyter Notebook from local copy - javascript

I have only gotten D3.js to load in a Jupyter Notebook once. That was when the path for my folder was "/lib/d3/d3.js". However, I downloaded both D3 v3.5 and v4.4, so I created different folders for both versions in my lib folder.
Ever since then, I haven't been able to get D3 to load in the notebook, and I have no idea why. I have even tried to load with CDN hosted versions, and have been unsuccessful. Is D3 picky about specifically having the "lib/d3/d3.js" path? This is what I've been doing:
Verify the path to the correct D3 file for the version I want to use
('python_data_analysis' is the root folderfolder structure
image
Load D3 into my Jupyter notebook (note: no errors on
load)referencing the path from step 1
Run my D3 code only to have Jupyter Notebook barf on the fact that
it doesn't know what d3 is:
"Javascript error adding output!
ReferenceError: d3 is not defined See your browser Javascript
console for more details."
Javascript console reveals that d3 is undefined.
What gives? At this point, I don't know what I'm doing wrong. It worked before, and the only thing different is the path. Are there some security settings at play that I'm not familiar with? Any help or suggestions would be greatly appreciated!

Related

three.js Basic Scene not Loading

I am trying to create the basic scene but nothing is loading on my HTML page. I don't know where to get the three.js file that I need to place inside my js folder before I can reference it as instructed on the docs page ().
Please can someone explain how I can import this file and add it into my js folder?
It would be helpful if you could share some code to judge if this is an internal problem.
First of all, if you make references to local files, you'll need to run things locally running a local server (for instance I run python -m http.server, then access my files in the browser from localhost:8000).
The other problem could be that your version of three.js or three.min.js is not the good one, you can actually get them from the github build folder, and place them in the same repo as your html file, to be able to import them (<script type="text/javascript" src="three.min.js"></script>).
Finally, you could also see what's going wrong in your console if you work on Firefox for instance, it might help you to solve your error.

Amcharts export: Loading error on libs

I am working on a project using amcharts, and I'm trying to use the Export features.
I linked to my project export.js and export.css according the userguide, in this way i can finally see the download button/export button in the top right of my charts so the libs are correctly loaded.
Unfortunately i can't get any image or xslx from that, opening a console it comes 4 errors related to loading error on the 4 libraries useful to work with export:
fabric.js
FileSaver.js
jszip.js
pdfmake.js
if I try to attach manually pdfmake library, I can solve the dependency issue, but if I try to do the same with the others, the console still reports problems about loading error libs.
How I could solve this?

Eclipse JSDT autocomplete not working

I've done research and see this is a recognized issue. I guess my question will be: Is there a solution in Eclipse Mars or in Neon? Another plugin for JavaScript Content Assist?
I'm running Eclipse Mars and have a project with Java and JavaScript (uses ScriptEngineManager). JavaDoc/AutoComplete is working in Java but not in JS files. It Was working but then just stopped. I've restarted, rebooted, refreshed, rebuilt. No joy. The error reported is :
An exception occurred while getting the JSDoc. See log for details.
(in the log: ) file.js [in [in ...Workspace\.metadata\.plugins\org.eclipse.wst.jsdt.core\libraries\system.js]] does not exist
I deleted and re-defined the workspace. No joy. Mouseover the keyword Array and it does show system.jsArray with ECMA info. But mouseover String and it shows src/docs/jsString. "src/docs" is a path in my project.
I'm thinking it's just looking in the wrong place for the docs but I don't know where to set that. I've read that there is a bug where auto complete only works within a file. This seems to be consistent where it's still looking within the current file for the definition of everything.
I can get String to refer back to system.jsString if I add an invalid function. But if I fix the function it goes back to looking in my src/docs. Go figure.
Maybe the project structure is wrong (this is FOSS I got from Github). In the root of the project there are src/foo folders with packages and .java source, a reference to the JRE System Library, a couple .jars, and another src folder with src/docs/java with .java files and src/docs/js with .js files. Do I need to change the folder type of src or do something else to it so that it's recognized as a code folder? Right now it's in the project explorer with a common "folder" icon, not like one of the package source folders.
Do I need Neon? Do I need another IDE?
This suggestion to update the .project didn't help.
I'm going to try the package "Eclipse IDE for JavaScript and Web Developers" but I dont know if that will help with this Java/JS hybrid project. I'm also going to try Atom.
Thanks.

How to run d3 Javascript

I am trying to run a simple example of d3 Javascript. I am following this tutorial for setting up d3:
https://github.com/mbostock/d3/wiki
This is also a link where I copied and pasted the code from:
http://bl.ocks.org/mbostock/4062045
The codes are basically for visualising a Force-Directed Graph. I created a Dynamic Web Project in Eclipse Juno. Inside the Web content, I have created an HTML file and pasted the codes. I also downloaded:
http://d3js.org/d3.v3.min.js
I normally run the file either with a web browser (Right-click -> Open with -> Web browser) or on the server:(Right-click -> Run -> Run on server - Tomcat 7). Unfortunately, I do not see the graph. I am using Firefox. It seems I have misunderstood something from this tutorial for setting up d3:
https://github.com/mbostock/d3/wiki
Could anyone please help me to solve the issue of setting up d3. Is there anything I need to configure that I have missed in order to get it run. Your assistance would be very much appreciated.

Webstorm doesn't see API

I am using JetBrain's WebStorm to do my JavaScript coding. Honestly, I have tried other programs and truly think this may be the best coding environment for JavaScript.
Unfortunately, for some reason it does not see the OpenLayers 3 class structure whatsoever. Usually, the IntelliSense in WebStorm doesn't have any trouble, but everything in this case is labelled error red because it cannot find the structure. This structure is located at: http://ol3js.org/en/master/build/ol.js.
I have copied the file locally and created the appropriate reference locally in the project. WebStorm had no problems with OpenLayers 2 API located at: https://github.com/openlayers/openlayers, but for some reason now it cannot see OpenLayers 3 object. It has nothing to do with it not being able to locate the namespace, because it finds the ol class and has no reference issues finding the file in the source directory.
I have also added the ol.js API library as an external JS library to the project in WebStorm, which does not solve the problem.

Categories