Closed mk48 closed 6 years ago
I'm not that familiar with react. Basically you just need to make that D3 is loaded before loading dTree.
I will try to find a way, If I get any then I will post my answer here.
@mk48 I believe the library depends on d3
being available globally. so something like
// in your src/index.js
import d3 from 'd3';
...
window.d3 = d3;
should do the trick.
thanks @theoperatore , below code solved the issue
// in your src/index.js
import * as d3 from 'd3';
...
window.d3 = d3;
@mk48 I believe the library depends on
d3
being available globally. so something like// in your src/index.js import d3 from 'd3'; ... window.d3 = d3;
should do the trick.
I think this is not recommanded in react
(to assign a new variable to window
) !
Thanks for the excellent library.
I just tried to use with React Js and couldn't get through. Below is my approach. Could any please help me on this?
I am getting "d3 is not defined"