Skip to content

Added docs about building Plotly correctly with Angular#4182

Merged
archmoj merged 3 commits into
plotly:masterfrom
marcj:patch-1
Jun 5, 2020
Merged

Added docs about building Plotly correctly with Angular#4182
archmoj merged 3 commits into
plotly:masterfrom
marcj:patch-1

Conversation

@marcj

@marcj marcj commented Sep 10, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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

marcj commented Sep 11, 2019

Copy link
Copy Markdown
Contributor Author

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

@TomDemulierChevret

TomDemulierChevret commented Sep 11, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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 };

Comment thread BUILDING.md Outdated

@alexcjohnson alexcjohnson left a comment

Copy link
Copy Markdown
Collaborator

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 <johnson.alex.c@gmail.com>
@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.

6 participants