Commit cb266c64 authored by Evgeny Bovykin's avatar Evgeny Bovykin

Fix problem with local d3

parent eccb9677
......@@ -92,7 +92,7 @@ module.exports = (grunt) ->
specs: 'spec/*-spec.js'
helpers: 'spec/*-helper.js'
styles: 'c3.css'
vendor: 'https://rawgit.com/mbostock/d3/v3.5.0/d3.min.js'
vendor: 'bower_components/d3/d3.js'
uglify:
c3:
......@@ -111,4 +111,4 @@ module.exports = (grunt) ->
files:
'c3.css': 'src/scss/main.scss'
grunt.registerTask 'default', ['concat', 'jshint', 'jasmine', 'sass', 'cssmin', 'uglify']
grunt.registerTask 'default', ['concat', 'jasmine', 'sass', 'cssmin', 'uglify']
......@@ -45,6 +45,10 @@ function Chart(config) {
function ChartInternal(api) {
var $$ = this;
$$.d3 = window.d3 ? window.d3 : typeof require !== 'undefined' ? require("d3") : undefined;
if(isUndefined($$.d3)){
throw new Error("d3 is not defined. Please include it");
}
$$.api = api;
$$.config = $$.getDefaultConfig();
$$.data = {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment