Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 33e07dd

Browse files
author
Sebastian Wojtowicz
committed
[TASK] merge of new version
2 parents 97cef8c + 4ac68aa commit 33e07dd

File tree

1,961 files changed

+475556
-108054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,961 files changed

+475556
-108054
lines changed

.circleci/config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ version: 2.0
1010
jobs:
1111
build:
1212
docker:
13-
- image: circleci/node:10.9.0
13+
- image: circleci/node:12.13.0
1414
working_directory: ~/plotly.js
1515
steps:
1616
- checkout
@@ -39,7 +39,7 @@ jobs:
3939
test-jasmine:
4040
docker:
4141
# need '-browsers' version to test in real (xvfb-wrapped) browsers
42-
- image: circleci/node:10.9.0-browsers
42+
- image: circleci/node:12.13.0-browsers
4343
parallelism: 2
4444
working_directory: ~/plotly.js
4545
steps:
@@ -52,7 +52,7 @@ jobs:
5252
test-jasmine2:
5353
docker:
5454
# need '-browsers' version to test in real (xvfb-wrapped) browsers
55-
- image: circleci/node:10.9.0-browsers
55+
- image: circleci/node:12.13.0-browsers
5656
parallelism: 3
5757
working_directory: ~/plotly.js
5858
steps:
@@ -65,7 +65,7 @@ jobs:
6565
test-jasmine3:
6666
docker:
6767
# need '-browsers' version to test in real (xvfb-wrapped) browsers
68-
- image: circleci/node:10.9.0-browsers
68+
- image: circleci/node:12.13.0-browsers
6969
working_directory: ~/plotly.js
7070
steps:
7171
- attach_workspace:
@@ -115,7 +115,7 @@ jobs:
115115

116116
test-syntax:
117117
docker:
118-
- image: circleci/node:10.9.0
118+
- image: circleci/node:12.13.0
119119
working_directory: ~/plotly.js
120120
steps:
121121
- attach_workspace:
@@ -127,7 +127,7 @@ jobs:
127127
test-bundle:
128128
docker:
129129
# need '-browsers' version to test in real (xvfb-wrapped) browsers
130-
- image: circleci/node:10.9.0-browsers
130+
- image: circleci/node:12.13.0-browsers
131131
working_directory: ~/plotly.js
132132
steps:
133133
- attach_workspace:
@@ -138,7 +138,7 @@ jobs:
138138

139139
publish:
140140
docker:
141-
- image: circleci/node:10.9.0
141+
- image: circleci/node:12.13.0
142142
working_directory: ~/plotly.js
143143
steps:
144144
- attach_workspace:

.circleci/test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ case $1 in
7575

7676
image)
7777
SUITE=$(find $ROOT/test/image/mocks/ -type f -printf "%f\n" | circleci tests split)
78-
npm run test-image -- $SUITE --filter || EXIT_STATE=$?
78+
npm run test-image -- $SUITE --filter --skip-flaky || EXIT_STATE=$?
7979
exit $EXIT_STATE
8080
;;
8181

8282
image2)
83+
retry npm run test-image -- --just-flaky
8384
npm run test-export || EXIT_STATE=$?
8485
exit $EXIT_STATE
8586
;;

BUILDING.md

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,67 @@ var Plotly = require('plotly.js');
3535

3636
then simply run,
3737

38-
3938
```
4039
browserify index.js > bundle.js
4140
```
4241

4342
## Angular CLI
4443

45-
Currently Angular CLI uses Webpack under the hood to bundle and build your Angular application.
46-
Sadly it doesn't allow you to override its Webpack config in order to add the plugin mentioned in the [Webpack](#webpack) section.
47-
Without this plugin your build will fail when it tries to build glslify for WebGL plots.
48-
49-
Currently 2 solutions exists to circumvent this issue:
44+
Since Angular uses webpack under the hood and doesn't allow easily to change it's webpack configuration, there is some work needed using a `custom-webpack` builder to get things going.
5045

51-
1) If you need to use WebGL plots, you can create a Webpack config from your Angular CLI project with [ng eject](https://github.com/angular/angular-cli/wiki/eject). This will allow you to follow the instructions regarding Webpack.
52-
2) If you don't need to use WebGL plots, you can make a custom build containing only the required modules for your plots. The clean way to do it with Angular CLI is not the method described in the [Modules](https://github.com/plotly/plotly.js/blob/master/README.md#modules) section of the README but the following:
46+
1. Install [`@angular-builders/custom-webpack`](https://www.npmjs.com/package/@angular-builders/custom-webpack) and [[email protected]+](https://github.com/hughsk/ify-loader)
47+
2. Create a new `extra-webpack.config.js` beside `angular.json`.
5348

54-
```typescript
55-
// in the Component you want to create a graph
56-
import * as Plotly from 'plotly.js';
49+
> extra-webpack.config.json
50+
```javascript
51+
module.exports = {
52+
module: {
53+
rules: [
54+
{
55+
test: /\.js$/,
56+
include: [
57+
path.resolve(__dirname, "node_modules/plotly.js")
58+
],
59+
loader: 'ify-loader'
60+
}
61+
]
62+
},
63+
};
5764
```
5865

66+
3. Change the builder in `angular.json` to `"@angular-builders/custom-webpack:browser` and configure it correctly to use our new webpack config.
67+
68+
> angular.json
5969
```json
60-
// in src/tsconfig.app.json
61-
// List here the modules you want to import
62-
// this example is for scatter plots
6370
{
64-
"compilerOptions": {
65-
"paths": {
66-
"plotly.js": [
67-
"../node_modules/plotly.js/lib/core.js",
68-
"../node_modules/plotly.js/lib/scatter.js"
69-
]
71+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
72+
"version": 1,
73+
"newProjectRoot": "projects",
74+
"projects": {
75+
"MY_PROJECT_NAME": {
76+
"root": "",
77+
"sourceRoot": "src",
78+
"projectType": "application",
79+
"prefix": "app",
80+
"schematics": {
81+
"@schematics/angular:component": {
82+
"styleext": "scss"
7083
}
71-
}
72-
}
84+
},
85+
"architect": {
86+
"build": {
87+
"builder": "@angular-builders/custom-webpack:browser",
88+
"options": {
89+
....
90+
"customWebpackConfig": {
91+
"path": "./extra-webpack.config.js",
92+
"replaceDuplicatePlugins": true,
93+
"mergeStrategies": {"module.rules": "merge"}
94+
}
95+
}
96+
}
97+
...
7398
```
99+
100+
It's important to set `projects.x.architect.build.builder` and `projects.x.architect.build.options.customWebpackConfig`.
101+
If you have more projects in your `angular.json` make sure to adjust their settings accordingly.

0 commit comments

Comments
 (0)