vasturiano / react-force-graph

React component for 2D, 3D, VR and AR force directed graphs
https://vasturiano.github.io/react-force-graph/example/large-graph/
MIT License
2.27k stars 286 forks source link

Support IE 11 #137

Open saurabhavid opened 5 years ago

saurabhavid commented 5 years ago

I know this is a major one, but most of the enterprise still support IE 11. Currently I am using react-force-graph-2d into my app. On IE the app fails to load and breaks due to many unsupported modules added as a dependency in the react-force-graph

One of them being fromentries being used in react-kapsulemodule Although a polyfill can be used for the fix like:

Object.fromEntries = Object.fromEntries || function(iterable) {
  return iterable.reduce(function(obj, [key, val]) {
    obj[key] = val
    return obj
  }, {});
};

Apart from this there are some more issues breaking IE 11 which I am still not able to figure out. Or may be the dependent modules needs to be transpiled to ES5 to support IE11.

@vasturiano Your help would be appreciated over this. If I found anything else that can result in the fix, I'll post it here.

saurabhavid commented 5 years ago

For supporting IE11 you just have to transpile 3 packages: d3-force-3d, force-graph, fromentries If you can provide transpiled version of these modules in react-force-graph It'll work on IE 11

vasturiano commented 5 years ago

@saurabhavid thanks for reaching out.

Before going into the details let me just say that this module makes no promises about functioning correctly in legacy browsers, including IE11.

As for the specific dependencies you mentioned: