Skip to content

Customize the plotly.js bundle #5

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

Closed
liefra opened this issue May 19, 2018 · 5 comments
Closed

Customize the plotly.js bundle #5

liefra opened this issue May 19, 2018 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@liefra
Copy link

liefra commented May 19, 2018

Is there a way to customize the plotly.js bundle or load plotly.js via CDN?

Would be great to reduce the app size as a new Angular 6 app with angular-plotly.js is already 2.83 MB.

@arlowhite
Copy link

arlowhite commented May 22, 2018

I came-up with a solution in my angular-plotly-react library, which allows you to asynchronously load plotly.js.
PlotlyModule.forRoot() seems like the right place to configure this kind of thing.
See: PlotlyModule.forRoot
and PlotlyService

Feel free to copy this code if it's useful, it's MIT licensed.

The async loading does assume that scripts are loaded in <body>, which @angular/cli does. See http://www.jspatterns.com/the-ridiculous-case-of-adding-a-script-element/

@nicolaskruchten
Copy link
Contributor

@andrefarzat you should consider letting people pass in their own plotly like we do in React-land :)

@andrefarzat andrefarzat self-assigned this May 23, 2018
@andrefarzat andrefarzat added the enhancement New feature or request label May 23, 2018
@andrefarzat
Copy link
Collaborator

it arrived! Version 1.0.0 supports getting the Plotly object from window or loading via CDN. Please, check the doc](https://github.com/plotly/angular-plotly.js#customizing-the-plotlyjs-bundle) about 😸

@alwaysprep
Copy link

@andrefarzat PlotlyViaWindowModule example is a bit hard to understand for the people who are new to the angular community. Can you give a full example in the readme file?

@andrefarzat
Copy link
Collaborator

@alwaysprep I created an issue for it. Will work on it this weekend 😃

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

No branches or pull requests

5 participants