Last active
March 6, 2024 12:50
-
-
Save oscarmorrison/efa6f1213cc7bc5f410993d4139f0007 to your computer and use it in GitHub Desktop.
Modularly import only the D3.js modules you require
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { line, curve, curveCatmullRom } from "d3-shape"; | |
import { scaleTime, scaleLinear } from "d3-scale"; | |
import { axisBottom, axisLeft } from 'd3-axis'; | |
import { timeParse, isoFormat } from "d3-time-format"; | |
import { select } from "d3-selection"; | |
import { extent, max, min } from "d3-array"; | |
export default { | |
line: line, | |
scaleTime: scaleTime, | |
scaleLinear: scaleLinear, | |
axisBottom: axisBottom, | |
axisLeft: axisLeft, | |
timeParse: timeParse, | |
isoFormat: isoFormat, | |
select: select, | |
extent: extent, | |
min: min, | |
max: max, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import d3 from './d3Importer.js'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment