You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35Lines changed: 35 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,41 @@ A repo that demonstrates how to build plotly.js with Webpack can be found [here]
122
122
...
123
123
```
124
124
125
+
#### Building plotly.js with Angular CLI
126
+
127
+
Currently Angular CLI use Webpack under the hood to bundle and build your Angular application.
128
+
Sadly it doesn't allow to override its Webpack config, and therefore to use the plugin mentioned in [Building plotly.js with Webpack](#building-plotly.js-with-webpack).
129
+
Without this plugin your build will fail when it tries to build glslify for GLSL plots.
130
+
131
+
Currently 2 solutions exists to circumvent this issue :
132
+
1) If you need to use GLSL plots, you can create a Webpack config from your Angular CLI projet with [ng eject](https://github.com/angular/angular-cli/wiki/eject).
133
+
This will allow you to follow the instructions regarding Webpack.
134
+
2) If you don't need to use GLSL plots, you can make a custom build containing only the required modules for your plots.
135
+
The clean way to do it with Angular CLI is not the method described in [Modules](#modules) but the following :
136
+
```typescript
137
+
// in the Component you want to create a graph
138
+
import*asPlotlyfrom'plotly.js';
139
+
```
140
+
141
+
```json
142
+
// in src/tsconfig.app.json
143
+
...
144
+
"compilerOptions": {
145
+
...
146
+
"paths": {
147
+
"plotly.js": [
148
+
// List here the modules you want to import
149
+
// this exemple is enough for scatter plots
150
+
"../node_modules/plotly.js/lib/core.js",
151
+
"../node_modules/plotly.js/lib/scatter.js"
152
+
]
153
+
}
154
+
...
155
+
}
156
+
...
157
+
158
+
```
159
+
125
160
## Bugs and feature requests
126
161
127
162
Have a bug or a feature request? Please first read the [issues guidelines](https://github.com/plotly/plotly.js/blob/master/CONTRIBUTING.md#opening-issues).
0 commit comments