Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d3-slider with Require.js #45

Open
gabalmat-csg opened this issue Jun 2, 2016 · 1 comment
Open

d3-slider with Require.js #45

gabalmat-csg opened this issue Jun 2, 2016 · 1 comment

Comments

@gabalmat-csg
Copy link

gabalmat-csg commented Jun 2, 2016

Has anyone successfully loaded this module with require()? I'm assuming a shim is needed, but I can't figure out what it should look like. Right now I have:

require.config({ paths: { "d3": "https://d3js.org/d3.v3.min", "d3.slider": "lib/d3.slider" }, shim: { "d3.slider": { "deps": ["d3"], "exports": "d3" } } }); console.log(d3.version); d3.select("#time_slider").call(d3.slider());

This logs:
3.5.17
TypeError: d3.slider is not a function

@Joe-Withey
Copy link

Joe-Withey commented Jul 29, 2016

I'm using webpack to import and it appears to work well like this.

d3.slider = require('d3.slider');

Don't forget the css file!

require('!style!css!d3.slider/d3.slider.css');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants