diff --git a/.jshintrc b/.jshintrc index 59389cc..9255727 100644 --- a/.jshintrc +++ b/.jshintrc @@ -19,6 +19,7 @@ "jasmine": true, "globals": { - "d3": false + "d3": false, + "require": false } } diff --git a/src/core.js b/src/core.js index b432961..0a7b493 100644 --- a/src/core.js +++ b/src/core.js @@ -1,4 +1,3 @@ -import * as d3 from 'd3'; import Axis from './axis'; import CLASS from './class'; import { isValue, isFunction, isString, isUndefined, isDefined, ceil10, asHalfPixel, diffDomain, isEmpty, notEmpty, getOption, hasValue, sanitise, getPathBox } from './util'; @@ -49,7 +48,7 @@ function Chart(config) { function ChartInternal(api) { var $$ = this; - $$.d3 = d3; + $$.d3 = window.d3 ? window.d3 : typeof require !== 'undefined' ? require("d3") : undefined; $$.api = api; $$.config = $$.getDefaultConfig(); $$.data = {};