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.
Related
I am currently building a demo for a simple cordapp, and am trying to implement a simple webpage to show an example of interacting with the node. I am launching my nodes using the node driver, and have created custom API's as well as some custom HTML and JS. I am having issues getting changes made to my JS and HTML files to propagate through to being shown on the webserver - and while I know these files are stored with the node I can figure out the correct method to go about getting the node to update these files.
I have tried removing the build folder, rebuilding the project and then running my node driver script, with no luck. I have also tried simply copying the files into build/resources, but I this also doesnt seem to work and I am not sure if this is where nodes run using the node driver actually pull their web resources from. Is there anything I am missing here? Could anyone potentially point me in the direction of a better process to develop and test this? (rather than having to re run my node driver everytime I make a change to either my HTML or JS files)
Turns out the issue had nothing to do with the Corda side of things, but rather developing in chrome. Due to chromes caching for some reason old JS file were being used. Resolved by flushing the cache using Ctrl+Shift+R (See Disabling Chrome cache for website development)
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!
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.
I'm trying to create an SVG that works much like the Travis CI build status icon.
Looking at the url:
https://travis-ci.org/ddavison/sublime-tabs.svg?branch=master
The URL points to an SVG, but the SVG seems to be able to pull information from another source, hence the "passing" or "failing" message.. How can I replicate this?
I've tried faking the browser by making it a <script>, and just generating an SVG, but that doesn't seem to work. It just renders XML on the page. Is it possible that Travis has a rule that parses .svg as some other script file?
How can I execute JavaScript before i actually render the SVG to the user?
I've figured it out. Per #DJDavid98 's comment, I ended up generating the image server side.
Here's an example:
I ended up using Ruby to generate it as JavaScript actually is not allowed on a GitHub Readme!
Try it yourself! Generate some buttons for people to star/fork your repo on github:
http://githubbadges.com
I'm trying out examples of Amchart from their website. When I open the html file on the browser(without running it on a server) the chart is getting displayed properly. But then when I run the same code on localhost(tomcat server) the chart is not getting displayed. I'm not sure if somethings wrong. Can you please let me know if you have encountered any similar issues or am I missing something.
Thanks a lot for your help.
Arun S.
I faced the same problem.
Made a mistake in referencing the js and css file.
The webapp folder structure was different for jetty and tomcat (which i used for testing and production)
This should help you understand