Home

Awesome

javafx-d3

Provides a Java API for using the JavaScript library d3.js with JavaFx Applications.

Many thanks to the authors of the projects gwt-d3 [1] and d3.js [2] !!!

Most of the source code of javafx-d3 originates from gwt-d3. If you use the original gwt-d3 project your result will be a web application that is written in JavaScript. If you use javafx-d3, your aim is to create a JavaFx desktop application that is written in Java.

alt tag

Current state

=> Please also feel free to jump in and directly contribute to the code of javafx-d3.

In terms of stability and performance javafx-d3 seems to work nicely for "smaller projects". If you want to transfer a lot of data between Java and JavaScript you might get into the limits of the JavaFx WebView. Hava a look at the scatterplot matrix example of the JavaFxD3DemoSuite and compare it to the original gwt demo to get an impression of the limitations of the WebView and javafx-d3:

https://gwtd3.github.io/demo/D3Demo.html

Please also see the following SO questions for more information:

http://stackoverflow.com/questions/41488110/java-api-for-manipulating-html-javascript-dom-elements

http://stackoverflow.com/questions/10762979/performance-of-webview-in-javafx

How it works:

Javafx-d3 uses the JavaFx WebView [3] to display an html page and to execute JavaScript. The JavaScript library d3.js is injected into the WebView. The communication between Java and JavaScript is based on
so called JSObjects [4].

With this straregy of javafx-d3 you are able to use the full power of d3.js for your Java desktop applications.

How to get started:

License

This project is licensed under BSD:

Javafx-d3 is based on third party code and you have to consider the corresponding licenses as well:


[1]: gwt-d3: https://github.com/gwtd3/gwt-d3<br> [2]: d3.js: http://d3js.org<br> [3]: JavaFx WebView: https://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm<br> [4]: Using JavaScript from Java: http://docstore.mik.ua/orelly/web/jscript/ch19_06.html<br> [5]: d3.js gallery: https://github.com/mbostock/d3/wiki/Gallery<br>