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

Skip to content

Commit 6134cf4

Browse files
committed
Merges updates from upstream
2 parents 5ab9b79 + cef9304 commit 6134cf4

File tree

2,594 files changed

+2397775
-39395
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,594 files changed

+2397775
-39395
lines changed

.circleci/config.yml

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
version: 2.0
2+
3+
# Inspired by:
4+
# https://github.com/CircleCI-Public/circleci-demo-workflows/blob/workspace-forwarding/.circleci/config.yml
5+
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
6+
#
7+
# For list of official CircleCI node.js images, go to:
8+
# https://hub.docker.com/r/circleci/node/tags/
9+
10+
jobs:
11+
build:
12+
docker:
13+
- image: circleci/node:12.13.0
14+
working_directory: ~/plotly.js
15+
steps:
16+
- checkout
17+
- run:
18+
name: Install dependencies
19+
command: |
20+
npm ci
21+
- run:
22+
name: List dependency versions
23+
command: |
24+
echo "npm: $(npm --version)"
25+
echo "node: $(node --version)"
26+
npm ls || true
27+
- run:
28+
name: Pretest
29+
command: |
30+
npm run pretest
31+
npm run cibuild
32+
- run:
33+
command: rm -rf .git
34+
- persist_to_workspace:
35+
root: /home/circleci
36+
paths:
37+
- plotly.js
38+
39+
test-jasmine:
40+
docker:
41+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
42+
- image: circleci/node:12.13.0-browsers
43+
parallelism: 2
44+
working_directory: ~/plotly.js
45+
steps:
46+
- attach_workspace:
47+
at: ~/
48+
- run:
49+
name: Run jasmine tests (batch 1)
50+
command: ./.circleci/test.sh jasmine
51+
52+
test-jasmine2:
53+
docker:
54+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
55+
- image: circleci/node:12.13.0-browsers
56+
parallelism: 3
57+
working_directory: ~/plotly.js
58+
steps:
59+
- attach_workspace:
60+
at: ~/
61+
- run:
62+
name: Run jasmine tests (batch 2)
63+
command: ./.circleci/test.sh jasmine2
64+
65+
test-jasmine3:
66+
docker:
67+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
68+
- image: circleci/node:12.13.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+
77+
test-image:
78+
docker:
79+
- image: plotly/testbed:latest
80+
parallelism: 4
81+
working_directory: /var/www/streambed/image_server/plotly.js/
82+
steps:
83+
- attach_workspace:
84+
at: /var/www/streambed/image_server/
85+
- run:
86+
name: Run and setup container
87+
command: |
88+
supervisord &
89+
npm run docker -- setup
90+
- run:
91+
name: Run image tests
92+
command: ./.circleci/test.sh image
93+
- store_artifacts:
94+
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: /
115+
116+
test-syntax:
117+
docker:
118+
- image: circleci/node:12.13.0
119+
working_directory: ~/plotly.js
120+
steps:
121+
- attach_workspace:
122+
at: ~/
123+
- run:
124+
name: Run syntax tests
125+
command: ./.circleci/test.sh syntax
126+
127+
test-bundle:
128+
docker:
129+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
130+
- image: circleci/node:12.13.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:12.13.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+
170+
workflows:
171+
version: 2
172+
build-and-test:
173+
jobs:
174+
- build
175+
- test-bundle:
176+
requires:
177+
- build
178+
- test-jasmine:
179+
requires:
180+
- build
181+
- test-jasmine2:
182+
requires:
183+
- build
184+
- test-jasmine3:
185+
requires:
186+
- build
187+
- test-image:
188+
requires:
189+
- build
190+
- test-image2:
191+
requires:
192+
- build
193+
- test-syntax:
194+
requires:
195+
- build
196+
- publish:
197+
requires:
198+
- build

.circleci/test.sh

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/bin/bash
2+
3+
# override CircleCi's default run settings
4+
set +e
5+
set +o pipefail
6+
7+
ROOT=$(dirname $0)/..
8+
EXIT_STATE=0
9+
MAX_AUTO_RETRY=5
10+
11+
log () {
12+
echo -e "\n$1"
13+
}
14+
15+
# inspired by https://unix.stackexchange.com/a/82602
16+
retry () {
17+
local n=1
18+
19+
until [ $n -ge $MAX_AUTO_RETRY ]; do
20+
"$@" --failFast && break
21+
log "run $n of $MAX_AUTO_RETRY failed, trying again ..."
22+
n=$[$n+1]
23+
done
24+
25+
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."
32+
EXIT_STATE=1
33+
fi
34+
}
35+
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+
42+
case $1 in
43+
44+
jasmine)
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+
50+
exit $EXIT_STATE
51+
;;
52+
53+
jasmine2)
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+
73+
exit $EXIT_STATE
74+
;;
75+
76+
image)
77+
SUITE=$(find $ROOT/test/image/mocks/ -type f -printf "%f\n" | circleci tests split)
78+
npm run test-image -- $SUITE --filter --skip-flaky || EXIT_STATE=$?
79+
exit $EXIT_STATE
80+
;;
81+
82+
image2)
83+
retry npm run test-image -- --just-flaky
84+
npm run test-export || EXIT_STATE=$?
85+
exit $EXIT_STATE
86+
;;
87+
88+
bundle)
89+
set_tz
90+
npm run test-bundle || EXIT_STATE=$?
91+
exit $EXIT_STATE
92+
;;
93+
94+
syntax)
95+
npm run lint || EXIT_STATE=$?
96+
npm run test-syntax || EXIT_STATE=$?
97+
exit $EXIT_STATE
98+
;;
99+
100+
esac

.eslintrc

Lines changed: 13 additions & 6 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,17 +17,19 @@
1717
"Int16Array": true,
1818
"Int32Array": true,
1919
"ArrayBuffer": true,
20+
"DataView": true,
2021
"SVGElement": false
2122
},
2223
"rules": {
2324
"no-trailing-spaces": [2],
2425
"no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 0}],
2526
"eol-last": [2],
26-
"indent": [2, 4, {"SwitchCase": 1}],
27+
"indent": [0],
28+
"indent-legacy": [2, 4, {"SwitchCase": 1}],
2729
"max-len": [0, 80],
28-
"brace-style": [0, "stroustrup", {"allowSingleLine": true}],
30+
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
2931
"curly": [2, "multi-line"],
30-
"camelcase": [0, {"properties": "never"}],
32+
"camelcase": [2, {"properties": "never"}],
3133
"comma-spacing": [2, {"before": false, "after": true}],
3234
"comma-style": [2, "last"],
3335
"semi": [2],
@@ -44,9 +46,10 @@
4446
"space-in-parens": [2, "never"],
4547
"space-before-function-paren": [2, "never"],
4648
"space-before-blocks": [2],
49+
"padded-blocks": [2, "never"],
4750
"spaced-comment": [2, "always"],
4851
"no-tabs": [2],
49-
"no-multi-spaces": [2],
52+
"no-multi-spaces": [2, {"ignoreEOLComments": true}],
5053
"no-whitespace-before-property": [2],
5154
"no-unexpected-multiline": [2],
5255
"no-floating-decimal": [2],
@@ -61,10 +64,14 @@
6164
"no-shadow": [0, {"builtinGlobals": true}],
6265
"block-scoped-var": [2],
6366
"no-unused-vars": [2],
67+
"one-var": [2, {"initialized": "never"}],
6468
"no-undef-init": [2],
6569
"no-use-before-define": [2, "nofunc"],
6670
"no-loop-func": [2],
6771
"no-console": [0],
68-
"no-unused-labels": [2]
72+
"no-unused-labels": [2],
73+
"no-useless-escape": [0],
74+
"func-name-matching": ["error", "always"],
75+
"no-prototype-builtins": [0]
6976
}
7077
}

.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: 2 additions & 2 deletions
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/`
@@ -15,7 +14,8 @@ Developers are strongly encouraged to first make a PR to their own plotly.js for
1514
Before opening a pull request, developer should:
1615

1716
- `git rebase` their local branch off the latest `master`,
18-
- make sure to **not** `git add` the `dist/` folder (the `dist/` is updated only on verion bumps),
17+
- make sure to **not** `git add` the `dist/` folder (the `dist/` is updated only on version bumps),
18+
- make sure to commit changes to the `package-lock.json` file (if any),
1919
- write an overview of what the PR attempts to do,
2020
- select the _Allow edits from maintainers_ option (see this [article](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) for more details).
2121

0 commit comments

Comments
 (0)