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

Skip to content

Commit 51a135d

Browse files
committed
Merge branch 'master' into etpinard/benchmarks
2 parents cca71fa + 38cd9e2 commit 51a135d

File tree

2,137 files changed

+1662166
-637622
lines changed

Some content is hidden

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

2,137 files changed

+1662166
-637622
lines changed

.circleci/config.yml

Lines changed: 103 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,14 @@ version: 2.0
1010
jobs:
1111
build:
1212
docker:
13-
- image: circleci/node:8.9.4
13+
- image: circleci/node:10.9.0
1414
working_directory: ~/plotly.js
1515
steps:
1616
- checkout
17-
- restore_cache:
18-
keys:
19-
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package-lock.json" }}
20-
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-master-{{ checksum "package-lock.json" }}
2117
- run:
2218
name: Install dependencies
2319
command: |
24-
npm install
20+
npm ci
2521
- run:
2622
name: List dependency versions
2723
command: |
@@ -33,59 +29,59 @@ jobs:
3329
command: |
3430
npm run pretest
3531
npm run cibuild
36-
- save_cache:
37-
paths:
38-
- node_modules
39-
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package.json" }}
32+
- run:
33+
command: rm -rf .git
4034
- persist_to_workspace:
41-
root: .
35+
root: /home/circleci
4236
paths:
43-
- node_modules
44-
- build
45-
- dist
37+
- plotly.js
4638

4739
test-jasmine:
4840
docker:
4941
# need '-browsers' version to test in real (xvfb-wrapped) browsers
50-
- image: circleci/node:8.9.4-browsers
42+
- image: circleci/node:10.9.0-browsers
43+
parallelism: 2
5144
working_directory: ~/plotly.js
5245
steps:
53-
- checkout
5446
- attach_workspace:
55-
at: ~/plotly.js
56-
- run:
57-
name: Set timezone to Alaska time (arbitrary timezone to test date logic)
58-
command: |
59-
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
47+
at: ~/
6048
- run:
6149
name: Run jasmine tests (batch 1)
6250
command: ./.circleci/test.sh jasmine
6351

6452
test-jasmine2:
6553
docker:
6654
# need '-browsers' version to test in real (xvfb-wrapped) browsers
67-
- image: circleci/node:8.9.4-browsers
55+
- image: circleci/node:10.9.0-browsers
56+
parallelism: 3
6857
working_directory: ~/plotly.js
6958
steps:
70-
- checkout
7159
- attach_workspace:
72-
at: ~/plotly.js
73-
- run:
74-
name: Set timezone to Alaska time (arbitrary timezone to test date logic)
75-
command: |
76-
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
60+
at: ~/
7761
- run:
7862
name: Run jasmine tests (batch 2)
7963
command: ./.circleci/test.sh jasmine2
8064

65+
test-jasmine3:
66+
docker:
67+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
68+
- image: circleci/node:10.9.0-browsers
69+
working_directory: ~/plotly.js
70+
steps:
71+
- attach_workspace:
72+
at: ~/
73+
- run:
74+
name: Run jasmine tests (batch 3)
75+
command: ./.circleci/test.sh jasmine3
76+
8177
test-image:
8278
docker:
8379
- image: plotly/testbed:latest
80+
parallelism: 4
8481
working_directory: /var/www/streambed/image_server/plotly.js/
8582
steps:
86-
- checkout
8783
- attach_workspace:
88-
at: /var/www/streambed/image_server/plotly.js/
84+
at: /var/www/streambed/image_server/
8985
- run:
9086
name: Run and setup container
9187
command: |
@@ -96,33 +92,107 @@ jobs:
9692
command: ./.circleci/test.sh image
9793
- store_artifacts:
9894
path: build
95+
destination: /
96+
97+
test-image2:
98+
docker:
99+
- image: plotly/testbed:latest
100+
working_directory: /var/www/streambed/image_server/plotly.js/
101+
steps:
102+
- attach_workspace:
103+
at: /var/www/streambed/image_server/
104+
- run:
105+
name: Run and setup container
106+
command: |
107+
supervisord &
108+
npm run docker -- setup
109+
- run:
110+
name: Run image tests
111+
command: ./.circleci/test.sh image2
112+
- store_artifacts:
113+
path: build
114+
destination: /
99115

100116
test-syntax:
101117
docker:
102-
- image: circleci/node:8.9.4
118+
- image: circleci/node:10.9.0
103119
working_directory: ~/plotly.js
104120
steps:
105-
- checkout
106121
- attach_workspace:
107-
at: ~/plotly.js
122+
at: ~/
108123
- run:
109124
name: Run syntax tests
110125
command: ./.circleci/test.sh syntax
111126

127+
test-bundle:
128+
docker:
129+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
130+
- image: circleci/node:10.9.0-browsers
131+
working_directory: ~/plotly.js
132+
steps:
133+
- attach_workspace:
134+
at: ~/
135+
- run:
136+
name: Run test-bundle
137+
command: ./.circleci/test.sh bundle
138+
139+
publish:
140+
docker:
141+
- image: circleci/node:10.9.0
142+
working_directory: ~/plotly.js
143+
steps:
144+
- attach_workspace:
145+
at: ~/
146+
- run:
147+
name: Build dist/
148+
command: npm run build
149+
- store_artifacts:
150+
path: dist
151+
destination: dist
152+
- run:
153+
name: Pack tarball
154+
command: |
155+
npm pack
156+
version=$(node -e "console.log(require('./package.json').version)")
157+
mv plotly.js-$version.tgz plotly.js.tgz
158+
- store_artifacts:
159+
path: plotly.js.tgz
160+
destination: /plotly.js.tgz
161+
- run:
162+
name: Show URLs to build files
163+
command: |
164+
PROJECT_NUM=45646037
165+
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/plotly.js.tgz
166+
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.js
167+
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.min.js
168+
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plot-schema.json
169+
112170
workflows:
113171
version: 2
114172
build-and-test:
115173
jobs:
116174
- build
175+
- test-bundle:
176+
requires:
177+
- build
117178
- test-jasmine:
118179
requires:
119180
- build
120181
- test-jasmine2:
121182
requires:
122183
- build
184+
- test-jasmine3:
185+
requires:
186+
- build
123187
- test-image:
124188
requires:
125189
- build
190+
- test-image2:
191+
requires:
192+
- build
126193
- test-syntax:
127194
requires:
128195
- build
196+
- publish:
197+
requires:
198+
- build

.circleci/test.sh

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,89 @@
44
set +e
55
set +o pipefail
66

7+
ROOT=$(dirname $0)/..
78
EXIT_STATE=0
89
MAX_AUTO_RETRY=5
910

11+
log () {
12+
echo -e "\n$1"
13+
}
14+
1015
# inspired by https://unix.stackexchange.com/a/82602
1116
retry () {
12-
local n=0
17+
local n=1
1318

1419
until [ $n -ge $MAX_AUTO_RETRY ]; do
15-
"$@" && break
20+
"$@" --failFast && break
21+
log "run $n of $MAX_AUTO_RETRY failed, trying again ..."
1622
n=$[$n+1]
17-
echo ''
18-
echo run $n of $MAX_AUTO_RETRY failed, trying again ...
19-
echo ''
20-
sleep 15
2123
done
2224

2325
if [ $n -eq $MAX_AUTO_RETRY ]; then
26+
log "one last time, w/o failing fast"
27+
"$@" && n=0
28+
fi
29+
30+
if [ $n -eq $MAX_AUTO_RETRY ]; then
31+
log "all $n runs failed, moving on."
2432
EXIT_STATE=1
2533
fi
2634
}
2735

36+
# set timezone to Alaska time (arbitrary timezone to test date logic)
37+
set_tz () {
38+
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
39+
export TZ='America/Anchorage'
40+
}
41+
2842
case $1 in
2943

3044
jasmine)
31-
npm run test-jasmine -- --skip-tags=gl,noCI,flaky || EXIT_STATE=$?
45+
set_tz
46+
47+
SUITE=$(circleci tests glob "$ROOT/test/jasmine/tests/*" | circleci tests split)
48+
npm run test-jasmine -- $SUITE --skip-tags=gl,noCI,flaky || EXIT_STATE=$?
49+
3250
exit $EXIT_STATE
3351
;;
3452

3553
jasmine2)
36-
npm run test-jasmine -- --tags=gl --skip-tags=noCI,flaky || EXIT_STATE=$?
37-
retry npm run test-jasmine -- --tags=flaky --skip-tags=noCI
38-
npm run test-bundle || EXIT_STATE=$?
54+
set_tz
55+
56+
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=5 --tag=gl | circleci tests split))
57+
for s in ${SHARDS[@]}; do
58+
retry npm run test-jasmine -- "$s" --tags=gl --skip-tags=noCI --doNotFailOnEmptyTestSuite
59+
done
60+
61+
exit $EXIT_STATE
62+
;;
63+
64+
jasmine3)
65+
set_tz
66+
67+
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=1 --tag=flaky | circleci tests split))
68+
69+
for s in ${SHARDS[@]}; do
70+
retry npm run test-jasmine -- "$s" --tags=flaky --skip-tags=noCI
71+
done
72+
3973
exit $EXIT_STATE
4074
;;
4175

4276
image)
43-
npm run test-image || EXIT_STATE=$?
77+
SUITE=$(find $ROOT/test/image/mocks/ -type f -printf "%f\n" | circleci tests split)
78+
npm run test-image -- $SUITE --filter || EXIT_STATE=$?
79+
exit $EXIT_STATE
80+
;;
81+
82+
image2)
4483
npm run test-export || EXIT_STATE=$?
45-
npm run test-image-gl2d || EXIT_STATE=$?
84+
exit $EXIT_STATE
85+
;;
86+
87+
bundle)
88+
set_tz
89+
npm run test-bundle || EXIT_STATE=$?
4690
exit $EXIT_STATE
4791
;;
4892

.eslintrc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"eslint:recommended"
55
],
66
"parserOptions": {
7-
"ecmaVersion": 5,
7+
"ecmaVersion": 5
88
},
99
"env": {
1010
"commonjs": true
@@ -17,6 +17,7 @@
1717
"Int16Array": true,
1818
"Int32Array": true,
1919
"ArrayBuffer": true,
20+
"DataView": true,
2021
"SVGElement": false
2122
},
2223
"rules": {
@@ -26,9 +27,9 @@
2627
"indent": [0],
2728
"indent-legacy": [2, 4, {"SwitchCase": 1}],
2829
"max-len": [0, 80],
29-
"brace-style": [0, "stroustrup", {"allowSingleLine": true}],
30+
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
3031
"curly": [2, "multi-line"],
31-
"camelcase": [0, {"properties": "never"}],
32+
"camelcase": [2, {"properties": "never"}],
3233
"comma-spacing": [2, {"before": false, "after": true}],
3334
"comma-style": [2, "last"],
3435
"semi": [2],
@@ -45,6 +46,7 @@
4546
"space-in-parens": [2, "never"],
4647
"space-before-function-paren": [2, "never"],
4748
"space-before-blocks": [2],
49+
"padded-blocks": [2, "never"],
4850
"spaced-comment": [2, "always"],
4951
"no-tabs": [2],
5052
"no-multi-spaces": [2, {"ignoreEOLComments": true}],
@@ -62,11 +64,14 @@
6264
"no-shadow": [0, {"builtinGlobals": true}],
6365
"block-scoped-var": [2],
6466
"no-unused-vars": [2],
67+
"one-var": [2, {"initialized": "never"}],
6568
"no-undef-init": [2],
6669
"no-use-before-define": [2, "nofunc"],
6770
"no-loop-func": [2],
6871
"no-console": [0],
6972
"no-unused-labels": [2],
70-
"no-useless-escape": [0]
73+
"no-useless-escape": [0],
74+
"func-name-matching": ["error", "always"],
75+
"no-prototype-builtins": [0]
7176
}
7277
}

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
custom: https://plot.ly/products/consulting-and-oem/

.github/ISSUE_TEMPLATE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ Thanks for your interest in plotly.js!
22

33
Before opening an issue, please search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/plotly/plotly.js/issues/new).
44

5-
Bug reports must be accompanied with a reproducible example. We recommend using [codepen](http://codepen.io/), [jsfiddle](https://jsfiddle.net/) or [jsbin](https://jsbin.com) to share your example.
5+
Bug reports **must** be accompanied with a reproducible example. We recommend using [codepen](http://codepen.io/), [jsfiddle](https://jsfiddle.net/) or [jsbin](https://jsbin.com) to share your example. Please use the [latest un-minified version](https://cdn.plot.ly/plotly-latest.js) of plotly.js in your report unless not applicable.
6+
7+
If you don't know JavaScript and still want to help us by reporting a bug, please attach the `"data"` and `"layout"` attributes that describe your graph and updates (if required to detect the bug). One way to retrieve your graph's data and layout attributes is by exporting your graph to [Plotly Cloud](http://plot.ly/). To do so, click on the _Edit in Chart Studio_ mode bar button (the 2nd one from the left by default) and follow these [instructions](https://help.plot.ly/save-share-and-export-in-plotly/), or watch this [screencast](https://community.plot.ly/t/mega-sharing-graphs-with-chart-studio/8869).
8+
9+
Issues found on the example pages from https://plot.ly/javascript/ should be filed in our [documentation repo](https://github.com/plotly/documentation/issues) with the exception of https://plot.ly/javascript/reference which should be filed here.
610

711
Note that GitHub issues are reserved for bug reports and feature requests only. Implementation questions should be asked on community.plot.ly (tagged [`plotly-js`](http://community.plot.ly/c/plotly-js)) or on Stack Overflow (tagged [`plotly`](https://stackoverflow.com/questions/tagged/plotly)).
812

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Thanks for your interest in plotly.js!
33
### Translations:
44

55
- Make a PR directly to the main repository
6-
- Label it `type: translation`
76
- Please @ mention a few other speakers of this language who can help review your translations.
87
- If you've omitted any keys from [dist/translation_keys.txt](https://github.com/plotly/plotly.js/blob/master/dist/translation-keys.txt) - which means they will fall back on the US English text - just make a short comment about why in the PR description: the English text works fine in your language, or you would like someone else to help translating those, or whatever the reason.
98
- You should only update files in `lib/locales/`, not those in `dist/`

0 commit comments

Comments
 (0)