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

How can I make use of d3 functions when loading ember-c3? #95

Closed
scooterlord opened this issue Mar 6, 2019 · 5 comments
Closed

How can I make use of d3 functions when loading ember-c3? #95

scooterlord opened this issue Mar 6, 2019 · 5 comments

Comments

@scooterlord
Copy link

Hello and thank you for this plugin.

I am trying to make use of d3.js functionality inside a controller but can't do it and don't want to install ember-d3 to avoid duplications. WIth a previous version of ember-c3 (0.3.1) I could normally use d3 functions inside a controller but now I can't.

Any ideas how to do this?

@maxwondercorn
Copy link
Collaborator

I'm not sure how you were using d3 previously. The previous version was installing ember-d3 and also importing d3, so you could using directly or via ember-d3 imports.

The current version is using ember-auto-import for c3. I can't test at the moment but I believe C3 is exposed if you re-import it into your app.

// in your app
import c3 from "c3";

// use c3...

If that's the case, I should be able to import D3 in the addon and then you could import it to use directly.

@scooterlord
Copy link
Author

Thanks for the reply, however, I am talking about importing and using d3 functions and NOT c3 functions.

@maxwondercorn
Copy link
Collaborator

Sorry if I wasn’t clear.

Since c3 is available to the application, if I import d3 the same as c3, d3 would also be available to the application.

I think I can test this sometime today

@maxwondercorn
Copy link
Collaborator

I tested the d3 import today and it works. You will be able to import d3 from "d3" and then use d3 in your application

I'm updating the dummy application and readme. I should be able to push out a release sometime Friday

@scooterlord
Copy link
Author

A million thanks :)

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