- Home /
Using Js Library in Unity - (Intention to use d3.js or similar)
I would like to use the data visualisation library d3.js in Unity, so I can ultimately navigate through a 3d world with all the different visualisations (2d or 3d). Possible to integrate into Microsoft HoloLense.
I would like to know if any of the unity frameworks allows the use of js libraries.
I know that UnityScript it's not quite JS, would I be able to do it using webGL?
An alternative that I thought would be to use Unity Web Player and pass messages between the JS library and the player. Then draw the results in Unity. However, I am not sure how easy it would be (or versatile) it would be to draw the graphs in Unity. Unless I build each visualisation individually.
I also saw this: http://forum.unity3d.com/threads/unity3d-plugin-for-embedding-webpages-on-windows-is-ready.83071/
But, it looks pretty dead. Any maintained alternatives?
Thanks!
Answer by msabouri · Oct 22, 2018 at 05:37 AM
Web-view is not officially supported by Unity, and the plugins out there are insane, it's hard to make them work the way you want on all platforms you want!
Even if you make one of those plugins work for you, it's not worth it from performance point of view. There are two group of plugins. One group try to map each html element to similar Unity UI elements, they're generally limited to basics and js is completely out of the picture. The other group tried to run a browser simulator like chromium inside Unity, they're support web/css/js completely like a browser, but they're heavy, and they hugely drop your performance.
I worked with D3 and I know how exciting and easy it is to make crazy beautiful vfx. But I advice you to use Unity UI and instead of spending your time on web-view plugins try to make the same effect you want with coding!