Skip to content

Commit 582fd0b

Browse files
committed
Merge remote-tracking branch 'origin/master' into clickable-legend-group-titles
2 parents e5c4dad + 03917c6 commit 582fd0b

File tree

217 files changed

+107816
-9263
lines changed

Some content is hidden

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

217 files changed

+107816
-9263
lines changed

.circleci/config.yml

Lines changed: 54 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,16 @@ jobs:
1515
steps:
1616
- checkout
1717
- run:
18-
name: set heap option before very first node.js call
19-
command: |
20-
export NODE_OPTIONS='--max-old-space-size=4096'
21-
- run:
22-
name: Install dependencies
23-
command: |
24-
npm ci
25-
- run:
26-
name: List dependency versions
27-
command: |
28-
echo "npm: $(npm --version)"
29-
echo "node: $(node --version)"
30-
npm ls || true
18+
name: Set up build environment
19+
command: .circleci/env_build.sh
3120
- run:
3221
name: Pretest
33-
command: |
34-
npm run pretest
35-
npm run cibuild
22+
command: npm run pretest
23+
- run:
24+
name: CI-Build
25+
command: npm run cibuild
3626
- run:
27+
name: Delete git
3728
command: rm -rf .git
3829
- persist_to_workspace:
3930
root: /home/circleci
@@ -51,7 +42,7 @@ jobs:
5142
at: ~/
5243
- run:
5344
name: Run jasmine tests (part A)
54-
command: ./.circleci/test.sh no-gl-jasmine
45+
command: .circleci/test.sh no-gl-jasmine
5546

5647
webgl-jasmine:
5748
docker:
@@ -64,9 +55,9 @@ jobs:
6455
at: ~/
6556
- run:
6657
name: Run jasmine tests (part B)
67-
command: ./.circleci/test.sh webgl-jasmine
58+
command: .circleci/test.sh webgl-jasmine
6859

69-
no-gl-flaky-jasmine:
60+
flaky-no-gl-jasmine:
7061
docker:
7162
# need '-browsers' version to test in real (xvfb-wrapped) browsers
7263
- image: circleci/node:12.22.1-browsers
@@ -76,7 +67,7 @@ jobs:
7667
at: ~/
7768
- run:
7869
name: Run jasmine tests (part C)
79-
command: ./.circleci/test.sh no-gl-flaky-jasmine
70+
command: .circleci/test.sh flaky-no-gl-jasmine
8071

8172
make-baselines:
8273
parallelism: 4
@@ -87,34 +78,11 @@ jobs:
8778
- attach_workspace:
8879
at: ~/
8980
- run:
90-
name: which pip3 version
91-
command: which pip3 && pip3 --version
81+
name: Install kaleido, plotly.io and required fonts
82+
command: .circleci/env_image.sh
9283
- run:
93-
name: install kaleido v0.2.1
94-
command: python3 -m pip install kaleido==0.2.1
95-
- run:
96-
name: install plotly.io v5.0.0
97-
command: python3 -m pip install plotly==5.0.0
98-
- run:
99-
name: install liberation2 fonts
100-
command: sudo apt-get install fonts-liberation2
101-
- run:
102-
name: install OpenSans fonts
103-
command: sudo apt-get install fonts-open-sans
104-
- run:
105-
name: install NotoSansCJK fonts
106-
command: sudo apt install fonts-noto-cjk
107-
- run:
108-
name: download google fonts e.g. Dosis, GravitasOne, NotoSansMono, NotoSans, NotoSerif, Old_Standard_TT, PT_Sans_Narrow, Raleway and Roboto
109-
command: python3 ./.circleci/download_google_fonts.py
110-
- run:
111-
name: install downloaded google fonts
112-
command: |
113-
sudo cp -r .circleci/fonts/ /usr/share/
114-
sudo fc-cache -f
115-
- run:
116-
name: create all png files
117-
command: ./.circleci/test.sh make-baselines
84+
name: Create all png files
85+
command: .circleci/test.sh make-baselines
11886
- persist_to_workspace:
11987
root: ~/
12088
paths:
@@ -128,8 +96,8 @@ jobs:
12896
- attach_workspace:
12997
at: ~/
13098
- run:
131-
name: compare pixels
132-
command: ./.circleci/test.sh test-image ; find build -maxdepth 1 -type f -delete
99+
name: Compare pixels
100+
command: .circleci/test.sh test-image ; find build -maxdepth 1 -type f -delete
133101
- store_artifacts:
134102
path: build
135103
destination: /
@@ -142,19 +110,13 @@ jobs:
142110
- attach_workspace:
143111
at: ~/
144112
- run:
145-
name: which pip3 version
146-
command: which pip3 && pip3 --version
147-
- run:
148-
name: install kaleido v0.2.1
149-
command: python3 -m pip install kaleido==0.2.1
113+
name: Install kaleido, plotly.io and required fonts
114+
command: .circleci/env_image.sh
150115
- run:
151-
name: install plotly.io v5.0.0
152-
command: python3 -m pip install plotly==5.0.0
153-
- run:
154-
name: install poppler-utils to have pdftops for exporting eps
116+
name: Install poppler-utils to have pdftops for exporting eps
155117
command: sudo apt-get install poppler-utils
156118
- run:
157-
name: create svg, jpg, jpeg, webp, pdf and eps files
119+
name: Create svg, jpg, jpeg, webp, pdf and eps files
158120
command: python3 test/image/make_exports.py
159121
- persist_to_workspace:
160122
root: ~/
@@ -169,7 +131,7 @@ jobs:
169131
- attach_workspace:
170132
at: ~/
171133
- run:
172-
name: test export sizes
134+
name: Test export sizes
173135
command: node test/image/export_test.js ; find build -maxdepth 1 -type f -delete
174136
- store_artifacts:
175137
path: build
@@ -198,7 +160,7 @@ jobs:
198160
at: ~/
199161
- run:
200162
name: Run syntax tests on source files
201-
command: ./.circleci/test.sh source-syntax
163+
command: .circleci/test.sh source-syntax
202164

203165
jasmine-bundle:
204166
docker:
@@ -210,26 +172,47 @@ jobs:
210172
at: ~/
211173
- run:
212174
name: Run jasmine tests (part D)
213-
command: ./.circleci/test.sh jasmine-bundle
175+
command: .circleci/test.sh jasmine-bundle
214176

215177
publish-dist:
216178
docker:
217179
- image: circleci/node:12.22.1
218180
working_directory: ~/plotly.js
219181
steps:
220-
- attach_workspace:
221-
at: ~/
182+
- checkout
183+
- run:
184+
name: Set up build environment
185+
command: .circleci/env_build.sh
186+
- run:
187+
name: Preview CHANGELOG for next release (only on master)
188+
command: |
189+
if [ $CIRCLE_BRANCH == "master" ]
190+
then npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true
191+
fi
192+
- run:
193+
name: Set draft version in package.json
194+
command: |
195+
node --eval "var fs = require('fs'); var inOut = './package.json'; var data = JSON.parse(fs.readFileSync(inOut)); var a = process.argv; data.version = a[a.length - 1].replace('v', ''); fs.writeFileSync(inOut, JSON.stringify(data, null, 2) + '\n');" `git describe`
196+
- run:
197+
name: View package.json diff between previous and next releases (including above draft version change)
198+
command: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true
222199
- run:
223200
name: Build dist/
224201
command: npm run build
225202
- store_artifacts:
226203
path: dist
227204
destination: dist
205+
- run:
206+
name: Preview plot-schema diff between previous and next releases (only on master)
207+
command: |
208+
if [ $CIRCLE_BRANCH == "master" ]
209+
then git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true
210+
fi
228211
- run:
229212
name: Pack tarball
230213
command: |
231214
npm pack
232-
version=$(node -e "console.log(require('./package.json').version)")
215+
version=$(node --eval "console.log(require('./package.json').version)")
233216
mv plotly.js-$version.tgz plotly.js.tgz
234217
- store_artifacts:
235218
path: plotly.js.tgz
@@ -242,18 +225,9 @@ jobs:
242225
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.js
243226
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.min.js
244227
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plot-schema.json
245-
- persist_to_workspace:
246-
root: ~/
247-
paths:
248-
- plotly.js
249-
250-
test-dist1:
251-
docker:
252-
- image: circleci/node:12.22.1
253-
working_directory: ~/plotly.js
254-
steps:
255-
- attach_workspace:
256-
at: ~/
228+
- run:
229+
name: Test plot-schema.json diff - If failed, after (npm start) you could run (npm run schema && git add test/plot-schema.json && git commit -m "update plot-schema diff")
230+
command: diff --unified --color dist/plot-schema.json test/plot-schema.json
257231
- run:
258232
name: Test plotly.min.js import using requirejs
259233
command: npm run test-requirejs
@@ -263,20 +237,9 @@ jobs:
263237
- run:
264238
name: Test certain bundles against function constructors
265239
command: npm run no-new-func
266-
267-
test-dist2:
268-
docker:
269-
- image: circleci/node:12.22.1
270-
working_directory: ~/plotly.js
271-
steps:
272-
- attach_workspace:
273-
at: ~/
274240
- run:
275241
name: Test plotly bundles against es6
276242
command: npm run no-es6-dist
277-
- run:
278-
name: Test plotly bundles againt duplicate keys
279-
command: npm run no-dup-keys
280243

281244
workflows:
282245
version: 2
@@ -292,7 +255,7 @@ workflows:
292255
- webgl-jasmine:
293256
requires:
294257
- install-and-cibuild
295-
- no-gl-flaky-jasmine:
258+
- flaky-no-gl-jasmine:
296259
requires:
297260
- install-and-cibuild
298261
- make-baselines:
@@ -313,12 +276,5 @@ workflows:
313276
- source-syntax:
314277
requires:
315278
- install-and-cibuild
316-
- publish-dist:
317-
requires:
318-
- install-and-cibuild
319-
- test-dist1:
320-
requires:
321-
- publish-dist
322-
- test-dist2:
323-
requires:
324-
- publish-dist
279+
280+
- publish-dist

.circleci/env_build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
export NODE_OPTIONS='--max-old-space-size=4096' && \
3+
echo "node version: $(node --version)" && \
4+
echo "npm version: $(npm --version)" && \
5+
npm ci && \
6+
npm ls || true

.circleci/env_image.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
# install required fonts
3+
sudo apt-get install fonts-liberation2 fonts-open-sans fonts-noto-cjk fonts-noto-color-emoji && \
4+
sudo python3 .circleci/download_google_fonts.py && \
5+
sudo cp -r .circleci/fonts/ /usr/share/ && \
6+
sudo fc-cache -f && \
7+
# install kaleido & plotly
8+
sudo python3 -m pip install kaleido==0.2.1 plotly==5.1.0 --progress-bar off

.circleci/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ case $1 in
6363
exit $EXIT_STATE
6464
;;
6565

66-
no-gl-flaky-jasmine)
66+
flaky-no-gl-jasmine)
6767
set_tz
6868

6969
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=1 --tag=flaky | circleci tests split))

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ Thanks for your interest in plotly.js!
99
### Features, Bug fixes, and others:
1010

1111
Before opening a pull request, developer should:
12+
1. make sure they are not on the `master` branch of their fork as using `master` for a pull request would make it difficult to fetch `upstream` changes.
13+
2. fetch latest changes from `upstream/master` into your fork i.e. `origin/master` then pull `origin/master` from you local `master`.
14+
3. then `git rebase master` their local dev branch off the latest `master` which should be sync with `upstream/master` at this time.
15+
4. make sure to **not** `git add` the `dist/` folder (the `dist/` is updated only on version bumps).
16+
5. make sure to commit changes to the `package-lock.json` file (if any new dependency required).
17+
6. provide a title and write an overview of what the PR attempts to do with a link to the issue they are trying to address.
18+
7. 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).
1219

13-
- `git rebase` their local branch off the latest `master`,
14-
- make sure to **not** `git add` the `dist/` folder (the `dist/` is updated only on version bumps),
15-
- make sure to commit changes to the `package-lock.json` file (if any new dependency required),
16-
- write an overview of what the PR attempts to do,
17-
- 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).
18-
19-
Note that it is forbidden to force push (i.e. `git push -f`) to remote branches associated with opened pull requests. Force pushes make it hard for maintainers to keep track of updates. Therefore, if required, please `git merge master` into your PR branch instead of `git rebase master`.
20+
After opening a pull request, developer:
21+
- should create a new small markdown log file using the PR number e.g. `1010_fix.md` or `1010_add.md` inside `draftlogs` folder as described in this [README](https://github.com/plotly/plotly.js/blob/master/draftlogs/README.md), commit it and push.
22+
- should **not** force push (i.e. `git push -f`) to remote branches associated with opened pull requests. Force pushes make it hard for maintainers to keep track of updates. Therefore, if required, please fetch `upstream/master` and "merge" with master instead of "rebase".

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,39 @@ To see all merged commits on the master branch that will be part of the next plo
99

1010
where X.Y.Z is the semver of most recent plotly.js release.
1111

12+
## [2.2.1] -- 2021-07-06
13+
14+
### Fixed
15+
- Fix to improve sanitizing href inputs for SVG and HTML text elements [[#5803](https://github.com/plotly/plotly.js/pull/5803)]
16+
17+
18+
## [1.58.5] -- 2021-07-06
19+
20+
### Fixed
21+
- Fix to improve sanitizing href inputs for SVG and HTML text elements [[#5803](https://github.com/plotly/plotly.js/pull/5803)]
22+
23+
24+
## [2.2.0] -- 2021-06-28
25+
26+
### Added
27+
- Legend group titles [[#5752](https://github.com/plotly/plotly.js/pull/5752)],
28+
this feature was anonymously sponsored: thank you to our sponsor!
29+
- Add half-year directive (%h) for formatting dates and improve descriptions to include extra date formatting options [[#5762](https://github.com/plotly/plotly.js/pull/5762)],
30+
this feature was anonymously sponsored: thank you to our sponsor!
31+
32+
### Changed
33+
- Modernize the process of creating baselines using [Kaleido](https://github.com/plotly/Kaleido) and improve image & other export test systems [[#5724](https://github.com/plotly/plotly.js/pull/5724)]
34+
- Centralize jsdom utility to return Plotly object in node.js test scripts and use it in generating plot-schema [[#5755](https://github.com/plotly/plotly.js/pull/5755)]
35+
- Bump turf bbox dependency to v6.4.0 [[#5747](https://github.com/plotly/plotly.js/pull/5747)]
36+
- Bump turf area dependency to v6.4.0 [[#5748](https://github.com/plotly/plotly.js/pull/5748)]
37+
38+
### Fixed
39+
- Cache values and patterns in set_convert for axes with `rangebreaks` to improve performance [[#5659](https://github.com/plotly/plotly.js/pull/5659)],
40+
with thanks to @spasovski for the contribution!
41+
- Fix fetching geojson when ES6 import is used to load the library [[#5763](https://github.com/plotly/plotly.js/pull/5763)]
42+
- Correct readme links [[#5746](https://github.com/plotly/plotly.js/pull/5746)]
43+
44+
1245
## [2.1.0] -- 2021-06-18
1346

1447
### Added

0 commit comments

Comments
 (0)