Skip to content

Commit 03be8ff

Browse files
committed
Merge branch 'master' into compress-attr-transform-by-default
2 parents 3485c0e + 178feb5 commit 03be8ff

File tree

1,849 files changed

+1216015
-516488
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,849 files changed

+1216015
-516488
lines changed

.circleci/config.yml

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
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:10.9.0
14+
working_directory: ~/plotly.js
15+
steps:
16+
- 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" }}
21+
- run:
22+
name: Install dependencies
23+
command: |
24+
npm install
25+
- run:
26+
name: List dependency versions
27+
command: |
28+
echo "npm: $(npm --version)"
29+
echo "node: $(node --version)"
30+
npm ls || true
31+
- run:
32+
name: Pretest
33+
command: |
34+
npm run pretest
35+
npm run cibuild
36+
- save_cache:
37+
paths:
38+
- node_modules
39+
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package.json" }}
40+
- persist_to_workspace:
41+
root: .
42+
paths:
43+
- node_modules
44+
- build
45+
- dist
46+
47+
test-jasmine:
48+
docker:
49+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
50+
- image: circleci/node:10.9.0-browsers
51+
working_directory: ~/plotly.js
52+
steps:
53+
- checkout
54+
- attach_workspace:
55+
at: ~/plotly.js
56+
- run:
57+
name: Run jasmine tests (batch 1)
58+
command: ./.circleci/test.sh jasmine
59+
60+
test-jasmine2:
61+
docker:
62+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
63+
- image: circleci/node:10.9.0-browsers
64+
working_directory: ~/plotly.js
65+
steps:
66+
- checkout
67+
- attach_workspace:
68+
at: ~/plotly.js
69+
- run:
70+
name: Run jasmine tests (batch 2)
71+
command: ./.circleci/test.sh jasmine2
72+
73+
test-image:
74+
docker:
75+
- image: plotly/testbed:latest
76+
working_directory: /var/www/streambed/image_server/plotly.js/
77+
steps:
78+
- checkout
79+
- attach_workspace:
80+
at: /var/www/streambed/image_server/plotly.js/
81+
- run:
82+
name: Run and setup container
83+
command: |
84+
supervisord &
85+
npm run docker -- setup
86+
- run:
87+
name: Run image tests
88+
command: ./.circleci/test.sh image
89+
- store_artifacts:
90+
path: build
91+
92+
test-image2:
93+
docker:
94+
- image: plotly/testbed:latest
95+
working_directory: /var/www/streambed/image_server/plotly.js/
96+
steps:
97+
- checkout
98+
- attach_workspace:
99+
at: /var/www/streambed/image_server/plotly.js/
100+
- run:
101+
name: Run and setup container
102+
command: |
103+
supervisord &
104+
npm run docker -- setup
105+
- run:
106+
name: Run image tests
107+
command: ./.circleci/test.sh image2
108+
- store_artifacts:
109+
path: build
110+
111+
test-syntax:
112+
docker:
113+
- image: circleci/node:10.9.0
114+
working_directory: ~/plotly.js
115+
steps:
116+
- checkout
117+
- attach_workspace:
118+
at: ~/plotly.js
119+
- run:
120+
name: Run syntax tests
121+
command: ./.circleci/test.sh syntax
122+
123+
workflows:
124+
version: 2
125+
build-and-test:
126+
jobs:
127+
- build
128+
- test-jasmine:
129+
requires:
130+
- build
131+
- test-jasmine2:
132+
requires:
133+
- build
134+
- test-image:
135+
requires:
136+
- build
137+
- test-image2:
138+
requires:
139+
- build
140+
- test-syntax:
141+
requires:
142+
- build

.circleci/test.sh

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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+
npm run test-jasmine -- --skip-tags=gl,noCI,flaky || EXIT_STATE=$?
48+
retry npm run test-jasmine -- --tags=flaky --skip-tags=noCI
49+
npm run test-bundle || EXIT_STATE=$?
50+
51+
exit $EXIT_STATE
52+
;;
53+
54+
jasmine2)
55+
set_tz
56+
57+
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --tag=gl))
58+
59+
for s in ${SHARDS[@]}; do
60+
retry npm run test-jasmine -- "$s" --tags=gl --skip-tags=noCI
61+
done
62+
63+
exit $EXIT_STATE
64+
;;
65+
66+
image)
67+
npm run test-image || EXIT_STATE=$?
68+
exit $EXIT_STATE
69+
;;
70+
71+
image2)
72+
npm run test-export || EXIT_STATE=$?
73+
npm run test-image-gl2d || EXIT_STATE=$?
74+
exit $EXIT_STATE
75+
;;
76+
77+
syntax)
78+
npm run lint || EXIT_STATE=$?
79+
npm run test-syntax || EXIT_STATE=$?
80+
exit $EXIT_STATE
81+
;;
82+
83+
esac

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ dist
33
build
44

55
test/jasmine/assets/jquery-1.8.3.min.js
6-
src/plots/polar/micropolar.js
6+
src/plots/polar/legacy/micropolar.js

.eslintrc

+8-4
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@
1616
"Uint8Array": true,
1717
"Int16Array": true,
1818
"Int32Array": true,
19-
"ArrayBuffer": true
19+
"ArrayBuffer": true,
20+
"DataView": true,
21+
"SVGElement": false
2022
},
2123
"rules": {
2224
"no-trailing-spaces": [2],
2325
"no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 0}],
2426
"eol-last": [2],
25-
"indent": [2, 4, {"SwitchCase": 1}],
27+
"indent": [0],
28+
"indent-legacy": [2, 4, {"SwitchCase": 1}],
2629
"max-len": [0, 80],
2730
"brace-style": [0, "stroustrup", {"allowSingleLine": true}],
2831
"curly": [2, "multi-line"],
@@ -45,7 +48,7 @@
4548
"space-before-blocks": [2],
4649
"spaced-comment": [2, "always"],
4750
"no-tabs": [2],
48-
"no-multi-spaces": [2],
51+
"no-multi-spaces": [2, {"ignoreEOLComments": true}],
4952
"no-whitespace-before-property": [2],
5053
"no-unexpected-multiline": [2],
5154
"no-floating-decimal": [2],
@@ -64,6 +67,7 @@
6467
"no-use-before-define": [2, "nofunc"],
6568
"no-loop-func": [2],
6669
"no-console": [0],
67-
"no-unused-labels": [2]
70+
"no-unused-labels": [2],
71+
"no-useless-escape": [0]
6872
}
6973
}

.github/ISSUE_TEMPLATE.md

+5-1
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

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
Thanks for your interest in plotly.js!
22

3+
### Translations:
4+
5+
- Make a PR directly to the main repository
6+
- Please @ mention a few other speakers of this language who can help review your translations.
7+
- 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.
8+
- You should only update files in `lib/locales/`, not those in `dist/`
9+
10+
### Features, Bug fixes, and others:
11+
312
Developers are strongly encouraged to first make a PR to their own plotly.js fork and ask one of the maintainers to review the modifications there. Once the pull request is deemed satisfactory, the developer will be asked to make a pull request to the main plotly.js repo and may be asked to squash some commits before doing so.
413

514
Before opening a pull request, developer should:
615

716
- `git rebase` their local branch off the latest `master`,
8-
- 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),
919
- write an overview of what the PR attempts to do,
1020
- 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).
1121

.github/SUPPORT.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Implementation help may be found on community.plot.ly (tagged
2+
[`plotly-js`](http://community.plot.ly/c/plotly-js)) or on Stack Overflow
3+
(tagged [`plotly`](https://stackoverflow.com/questions/tagged/plotly)).
4+
5+
Direct developer email support can be purchased through a [Plotly Support
6+
Plan](https://support.plot.ly/libraries/javascript).

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ npm-debug.log*
99
*.sublime*
1010

1111
.*
12+
!.circleci
1213
!.gitignore
1314
!.npmignore
1415
!.eslintrc

0 commit comments

Comments
 (0)