Skip to content

Added docs about building Plotly correctly with Angular #4182

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

Merged
merged 3 commits into from
Jun 5, 2020

Conversation

marcj
Copy link
Contributor

@marcj marcj commented Sep 10, 2019

Added correct howto to build plotly + angular. Removed old variants since ng eject is not possible anymore and not building with webGl is basically useless..

@etpinard
Copy link
Contributor

Thanks very much for the PR!

I've never used plotly.js with angular, so I'll ping @andrefarzat and @TomDemulierChevret who could maybe helps us review your patch.

@TomDemulierChevret
Copy link
Contributor

I don't have time to test this right now, but it seems pretty alright.

The only issue for me is that it should include an example with a partial bundle (and if possible a custom bundle) like the existing documentation.

@marcj
Copy link
Contributor Author

marcj commented Sep 11, 2019

What is a "partial bundle" and where is the custom bundle?

@TomDemulierChevret
Copy link
Contributor

TomDemulierChevret commented Sep 11, 2019

https://github.com/plotly/plotly.js/blob/master/dist/README.md#partial-bundles
https://github.com/plotly/plotly.js#modules

You don't want to bundle the whole plotly.js lib in your app if you only use a specific subset of charts.

The current version of the doc didn't cover custom bundle, but it had an exemple for partial bundle (in the "src/tsconfig.app.json" part).

@thatsmeta
Copy link

I found this PR very helpful when trying to build plotly with Angular.
As far as I understand, you can create a custom bundle in about the same way as described here: https://github.com/plotly/plotly.js#modules.

import Plotly from 'plotly.js/lib/core';
import scatter from 'plotly.js/lib/scatter';
import scattergl from 'plotly.js/lib/scattergl';

Plotly.register([
    scatter,
    scattergl
]);

export { Plotly };

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as Angular users have found this helpful, that's good enough for me! 💃

Co-authored-by: alexcjohnson <[email protected]>
@archmoj archmoj added this to the v1.54.2 milestone Jun 5, 2020
@archmoj archmoj merged commit 8e2771e into plotly:master Jun 5, 2020
@archmoj archmoj added the community community contribution label Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants