Upgrade D3 library to v4
D3 version v4.x offers several advantages over our current version (v3.5.11) including the use of ES2015 module syntax which will allow us to take advantage of tree-shaking to significantly reduce the bundle size for the components which use it.
Imports should be altered from this:
import d3 from 'd3';
To look more like:
import { scaleLinear } from "d3-scale";
There is a migration guide in the v4.0.0 release notes:
https://github.com/d3/d3/blob/master/CHANGES.md
Here are all of the places where we currently use d3:
-
user contribution calendar -
project contribution charts -
project repository charts -
project pipelines charts -
project prometheus metrics
Edited by Mike Greiling