mcaule / d3-timeseries

Time series charting library based on d3.js
143 stars 39 forks source link

How do you load this with requirejs? #3

Closed kevcal69 closed 7 years ago

mcaule commented 7 years ago

You can load it with requirejs, just be sure to use d3js with version 3.5.x And load the css separately.

requirejs.config({
  appDir: ".",
  baseUrl: "js",
  paths: {
    'd3': ['https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.12/d3'],
    'd3-tip': ['https://rawgit.com/Caged/d3-tip/v0.6.7/index'],
    'd3-timeseries': ['https://rawgit.com/mcaule/d3-timeseries/master/src/d3_timeseries']
  },
  shim: {
    /* Set dependencies*/
    'd3-tip': ['d3'],
    'd3-timeseries': ['d3', 'd3-tip']
  }
});

require(['d3-timeseries'], function(d3timeseries) {
  console.log("Loaded :)");
  var chart = d3timeseries()
  //...
})
kevcal69 commented 7 years ago

thanks for replying i already figured it out. do have the options to disable the mini-drawer?

mcaule commented 7 years ago

No, there is no options for that