Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Porting D3.js to other languages

I am looking to use D3.js in a c++ application, where using js isn't feasible for a variety of reasons.

What elements of js/svg/css are being relied on in the code that would not be easily substituted with svg/vector type drawing functions from a c++ library.

Where am I likely to run into difficulty?

like image 522
eigen_enthused Avatar asked Jul 17 '12 19:07

eigen_enthused


People also ask

Can I use D3 JS in python?

Turn D3 into PythonThe step to Pythonize the D3 scripts is by changing the static values into variables. We can do this for the final HTML file and for the properties in the force-directed javascript file. The idea is as follows: Import/read the final HTML and/or javascript file using Python.

Is D3 js still relevant?

The JavaScript ecosystem has completely changed during this time, in terms of libraries, best practices and even language features. Nevertheless, D3 is still here. And it's more popular than ever.

Is D3 a coding language?

js (also known as D3, short for Data-Driven Documents) is a JavaScript library for producing dynamic, interactive data visualizations in web browsers. It makes use of Scalable Vector Graphics (SVG), HTML5, and Cascading Style Sheets (CSS) standards.

How do I import D3 into JavaScript?

Install D3 by running npm install d3 --save . Import D3 to App. js by adding import * as d3 from d3 . You need to use import * (“import everything”) since D3 has no default exported module.


1 Answers

As some people have commented, beyond D3 relying on some of the features of Javascript (not just syntactically, but even more so with respect to the nature of the language itself) - it also depends on the DOM and some means of interpreting SVG markup -- all of which is included in a browser environment.

Have you considered the R programming language? I've always been under the impression that one of the voids D3 fills is providing some of the same data-driven approach to visualization that is supported in R, but just in a browser environment.

Now - that's not to say that R can do everything that D3 can do or vice versa - but there is a lot of overlap as far as visualization is concerned and depending on the nature of your needs - R might be just what you're looking for. And if that's the case, there is a great library called RInside and another called rcpp that aim to provide integration of C++ in R and R in C++.

like image 159
mbeasley Avatar answered Sep 28 '22 08:09

mbeasley