dc-js / dc.leaflet.js

DC charts using Leaflet maps
Apache License 2.0
52 stars 24 forks source link

Issue while importing module #28

Closed doshisunny closed 7 years ago

doshisunny commented 7 years ago

I am having issue with importing dc.leaflet while importing it.
const dcLeaflet = require('dc.leaflet'); gives me error unable to resolve path module
Currently I am able to resolve it by adding index.js in dc.leaflet inside node_module directory with following.

dc = require("dc");
leaflet = require('leaflet');
leaflet.markercluster = require('leaflet.markercluster');
crossfilter = require("crossfilter2");
module.exports = require("./dc.leaflet");

This is something we can not do with application deployment. Do you have any alternative or better suggestion to so?

gordonwoodhull commented 7 years ago

Hi @doshisunny, thanks for the report. I'd be glad to add module support to dc.graph.js but I just haven't migrated to ES6 myself so I don't know what goes in the file.

Would you care to open a pull request? I could merge and do a new npm release fairly quickly.

doshisunny commented 7 years ago

@gordonwoodhull Thank you so much. I created pull request.

gordonwoodhull commented 7 years ago

Thanks @doshisunny! Merged in 0.3.2 0.3.3 and published to npm.