dagre-d3
dagre-d3 copied to clipboard
Depend only on necessary d3 modules
Currently, dagre-d3
depends on the entire d3
library, but it only directly uses exports from the d3-selection
and d3-shape
libraries. You can verify this by searching for "d3" in this repository and scoping to JavaScript files. The code uses d3.select
, which belongs to the d3-selection
library, and d3.curveLinear
, which belongs to the d3-shape
library.
This PR replaces dagre-d3
's d3
dependency with the d3-selection
and d3-shape
dependencies, and as a result nearly halves the size of dagre-d3.min.js
(from 708kB to 367kB).
@lutzroeder, so apparently I deleted the fork I originally made this PR from. As a result I don't think I can resolve the conflicts.
However, I think you should have write access to this PR so if you're still interested in merging, then you could make the necessary changes for merging.
I ported the project to es6 and I accept contributions! https://github.com/tbo47/dagre-es