dagre-d3 icon indicating copy to clipboard operation
dagre-d3 copied to clipboard

Depend only on necessary d3 modules

Open TomerAberbach opened this issue 4 years ago • 2 comments

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).

TomerAberbach avatar Jul 28 '20 00:07 TomerAberbach

@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.

TomerAberbach avatar Jan 31 '21 04:01 TomerAberbach

I ported the project to es6 and I accept contributions! https://github.com/tbo47/dagre-es

tbo47 avatar Jan 06 '22 16:01 tbo47