Skip to content

Instantly share code, notes, and snippets.

@waleedshkt
Forked from oscarmorrison/d3Importer.js
Created April 26, 2020 19:17
Show Gist options
  • Save waleedshkt/98723a7e9580ad655814555ba3c2b98f to your computer and use it in GitHub Desktop.
Save waleedshkt/98723a7e9580ad655814555ba3c2b98f to your computer and use it in GitHub Desktop.
Modularly import only the D3.js modules you require
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,
};
import d3 from './d3Importer.js';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment