Skip to content

Commit be30fc9

Browse files
committed
Merge remote-tracking branch 'origin/master' into how-to-clone-your-fork
2 parents 0c3a0ae + ec01107 commit be30fc9

Some content is hidden

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

53 files changed

+69168
-293
lines changed

.circleci/config.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ jobs:
1515
steps:
1616
- checkout
1717
- run:
18-
name: set up build environment
18+
name: Set up build environment
1919
command: .circleci/env_build.sh
2020
- run:
2121
name: Pretest
22-
command: |
23-
npm run pretest
24-
npm run cibuild
22+
command: npm run pretest
23+
- run:
24+
name: CI-Build
25+
command: npm run cibuild
2526
- run:
27+
name: Delete git
2628
command: rm -rf .git
2729
- persist_to_workspace:
2830
root: /home/circleci
@@ -76,10 +78,10 @@ jobs:
7678
- attach_workspace:
7779
at: ~/
7880
- run:
79-
name: install kaleido, plotly.io and required fonts
81+
name: Install kaleido, plotly.io and required fonts
8082
command: .circleci/env_image.sh
8183
- run:
82-
name: create all png files
84+
name: Create all png files
8385
command: .circleci/test.sh make-baselines
8486
- persist_to_workspace:
8587
root: ~/
@@ -94,7 +96,7 @@ jobs:
9496
- attach_workspace:
9597
at: ~/
9698
- run:
97-
name: compare pixels
99+
name: Compare pixels
98100
command: .circleci/test.sh test-image ; find build -maxdepth 1 -type f -delete
99101
- store_artifacts:
100102
path: build
@@ -108,13 +110,13 @@ jobs:
108110
- attach_workspace:
109111
at: ~/
110112
- run:
111-
name: install kaleido, plotly.io and required fonts
113+
name: Install kaleido, plotly.io and required fonts
112114
command: .circleci/env_image.sh
113115
- run:
114-
name: install poppler-utils to have pdftops for exporting eps
116+
name: Install poppler-utils to have pdftops for exporting eps
115117
command: sudo apt-get install poppler-utils
116118
- run:
117-
name: create svg, jpg, jpeg, webp, pdf and eps files
119+
name: Create svg, jpg, jpeg, webp, pdf and eps files
118120
command: python3 test/image/make_exports.py
119121
- persist_to_workspace:
120122
root: ~/
@@ -129,7 +131,7 @@ jobs:
129131
- attach_workspace:
130132
at: ~/
131133
- run:
132-
name: test export sizes
134+
name: Test export sizes
133135
command: node test/image/export_test.js ; find build -maxdepth 1 -type f -delete
134136
- store_artifacts:
135137
path: build
@@ -179,8 +181,11 @@ jobs:
179181
steps:
180182
- checkout
181183
- run:
182-
name: set up build environment
184+
name: Set up build environment
183185
command: .circleci/env_build.sh
186+
- run:
187+
name: Preview CHANGELOG for next release (only on master)
188+
command: if [ $CIRCLE_BRANCH == "master" ]; then npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true; fi
184189
- run:
185190
name: Build dist/
186191
command: npm run build
@@ -204,6 +209,9 @@ jobs:
204209
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.js
205210
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.min.js
206211
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plot-schema.json
212+
- run:
213+
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")
214+
command: diff --unified --color dist/plot-schema.json test/plot-schema.json
207215
- run:
208216
name: Test plotly.min.js import using requirejs
209217
command: npm run test-requirejs

.circleci/env_image.sh

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

.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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ 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+
1224
## [2.2.0] -- 2021-06-28
1325

1426
### Added

CONTRIBUTING.md

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,19 @@ Three additional helpers exist that are refreshed every second:
138138
There is also a search bar in the top right of the dashboard. This fuzzy-searches
139139
image mocks based on their file name and trace type.
140140

141-
#### Alternative to test dashboard
141+
#### Step 5: Regenerate plot-schema in "test" folder then review & commit potential changes
142142

143-
Use the [`plotly-mock-viewer`](https://github.com/rreusser/plotly-mock-viewer)
144-
which has live-reloading and a bunch of other cool features.
145-
An online version of `plotly-mock-viewer` is available at <https://rreusser.github.io/plotly-mock-viewer/>
146-
which uses <https://cdn.plot.ly/plotly-latest.min.js>
143+
```bash
144+
npm run schema
145+
```
146+
147+
#### Step 6: Review & commit potential changes made to test/plot-schema.json
147148

148-
#### Other npm scripts
149+
> If you are editing attribute descriptions or implementing a new feature this file located in the test folder records the proposed changes to the API. Note that there is another plot-schema.json file located in the dist folder, which should only be updated by the maintainers at release time.
150+
151+
**IMPORTANT:** please do not change and commit any files in the "dist" folder
152+
153+
#### Other npm scripts that may be of interest in development
149154

150155
- `npm run preprocess`: pre-processes the css and svg source file in js. This
151156
script must be run manually when updating the css and svg source files.
@@ -207,17 +212,40 @@ npm run test-jasmine -- --help
207212
npm run test-jasmine -- --info
208213
```
209214

210-
### Draft new baseline
211-
Install fonts and tools
215+
### Draft new baselines
216+
#### With docker:
217+
> If you prefer using docker each time you need to
218+
```sh
219+
docker run -it -v "$(pwd)":/plotly.js circleci/python:3.8.9 bash
220+
# then inside the docker
221+
cd plotly.js
222+
sudo bash .circleci/env_image.sh
223+
```
224+
225+
#### Without docker:
226+
> Otherwise you may need to install `python 3.8`
227+
Then upgrade `pip` if needed
212228
```sh
213-
# install required fonts (if missing) on ubuntu
214-
sudo cp -r .circleci/fonts/ /usr/share/ && sudo fc-cache -f
215-
# upgrade pip (if needed)
216229
python3 -m pip install --upgrade pip
217-
# install kaleido
218-
python3 -m pip install kaleido
219-
# install plotly
220-
python3 -m pip install plotly
230+
```
231+
232+
To install required fonts and tools see this [shell script](https://github.com/plotly/plotly.js/blob/master/.circleci/env_image.sh).
233+
234+
#### Scripts to generate/update new baselines with/without docker:
235+
```sh
236+
python3 test/image/make_baseline.py = mock_1 mock_2
237+
```
238+
239+
> Alternatively using npm & node.js (which are not available in the python docker by default)
240+
241+
```sh
242+
npm run baseline mock_1 mock_2
243+
```
244+
245+
Or
246+
247+
```sh
248+
npm run baseline mock_*
221249
```
222250

223251
**IMPORTANT:** the `baseline`, `test-image` and `test-export` scripts do **not** bundle the source files before

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
5555
5656
```html
5757
<head>
58-
<script src="https://cdn.plot.ly/plotly-2.2.0.min.js"></script>
58+
<script src="https://cdn.plot.ly/plotly-2.2.1.min.js"></script>
5959
</head>
6060
<body>
6161
<div id="gd"></div>
@@ -72,7 +72,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
7272
Alternatively you may consider using [native ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) in the script tag.
7373
```html
7474
<script type="module">
75-
import "https://cdn.plot.ly/plotly-2.2.0.min.js"
75+
import "https://cdn.plot.ly/plotly-2.2.1.min.js"
7676
Plotly.newPlot("gd", [{ y: [1, 2, 3] }])
7777
</script>
7878
```
@@ -82,10 +82,10 @@ Fastly supports Plotly.js with free CDN service. Read more at <https://www.fastl
8282
### Un-minified versions are also available on CDN
8383
While non-minified source files may contain characters outside UTF-8, it is recommended that you specify the `charset` when loading those bundles.
8484
```html
85-
<script src="https://cdn.plot.ly/plotly-2.2.0.js" charset="utf-8"></script>
85+
<script src="https://cdn.plot.ly/plotly-2.2.1.js" charset="utf-8"></script>
8686
```
8787

88-
> Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.4. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.
88+
> Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.5. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.
8989
9090
To support MathJax, you need to load version two of MathJax e.g. `v2.7.5` files from CDN or npm.
9191
```html

dist/README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ The main plotly.js bundles weight in at:
4646
| 8 MB | 3.4 MB | 1019.6 kB | 8.3 MB |
4747

4848
#### CDN links
49-
> https://cdn.plot.ly/plotly-2.2.0.js
49+
> https://cdn.plot.ly/plotly-2.2.1.js
5050
51-
> https://cdn.plot.ly/plotly-2.2.0.min.js
51+
> https://cdn.plot.ly/plotly-2.2.1.min.js
5252
5353

5454
#### npm packages
@@ -94,9 +94,9 @@ The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`.
9494
| 2.7 MB | 1007.3 kB | 327.3 kB |
9595

9696
#### CDN links
97-
> https://cdn.plot.ly/plotly-basic-2.2.0.js
97+
> https://cdn.plot.ly/plotly-basic-2.2.1.js
9898
99-
> https://cdn.plot.ly/plotly-basic-2.2.0.min.js
99+
> https://cdn.plot.ly/plotly-basic-2.2.1.min.js
100100
101101

102102
#### npm packages
@@ -114,12 +114,12 @@ The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, `
114114

115115
| Raw size | Minified size | Minified + gzip size |
116116
|------|-----------------|------------------------|
117-
| 3.3 MB | 1.2 MB | 398.7 kB |
117+
| 3.3 MB | 1.2 MB | 398.8 kB |
118118

119119
#### CDN links
120-
> https://cdn.plot.ly/plotly-cartesian-2.2.0.js
120+
> https://cdn.plot.ly/plotly-cartesian-2.2.1.js
121121
122-
> https://cdn.plot.ly/plotly-cartesian-2.2.0.min.js
122+
> https://cdn.plot.ly/plotly-cartesian-2.2.1.min.js
123123
124124

125125
#### npm packages
@@ -137,12 +137,12 @@ The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `sca
137137

138138
| Raw size | Minified size | Minified + gzip size |
139139
|------|-----------------|------------------------|
140-
| 2.9 MB | 1 MB | 337.3 kB |
140+
| 2.9 MB | 1 MB | 337.4 kB |
141141

142142
#### CDN links
143-
> https://cdn.plot.ly/plotly-geo-2.2.0.js
143+
> https://cdn.plot.ly/plotly-geo-2.2.1.js
144144
145-
> https://cdn.plot.ly/plotly-geo-2.2.0.min.js
145+
> https://cdn.plot.ly/plotly-geo-2.2.1.min.js
146146
147147

148148
#### npm packages
@@ -163,9 +163,9 @@ The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`,
163163
| 3.8 MB | 1.5 MB | 482.7 kB |
164164

165165
#### CDN links
166-
> https://cdn.plot.ly/plotly-gl3d-2.2.0.js
166+
> https://cdn.plot.ly/plotly-gl3d-2.2.1.js
167167
168-
> https://cdn.plot.ly/plotly-gl3d-2.2.0.min.js
168+
> https://cdn.plot.ly/plotly-gl3d-2.2.1.min.js
169169
170170

171171
#### npm packages
@@ -183,12 +183,12 @@ The `gl2d` partial bundle contains trace modules `heatmapgl`, `parcoords`, `poin
183183

184184
| Raw size | Minified size | Minified + gzip size |
185185
|------|-----------------|------------------------|
186-
| 3.8 MB | 1.5 MB | 503.1 kB |
186+
| 3.8 MB | 1.5 MB | 503.2 kB |
187187

188188
#### CDN links
189-
> https://cdn.plot.ly/plotly-gl2d-2.2.0.js
189+
> https://cdn.plot.ly/plotly-gl2d-2.2.1.js
190190
191-
> https://cdn.plot.ly/plotly-gl2d-2.2.0.min.js
191+
> https://cdn.plot.ly/plotly-gl2d-2.2.1.min.js
192192
193193

194194
#### npm packages
@@ -209,9 +209,9 @@ The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitym
209209
| 4.4 MB | 1.8 MB | 525 kB |
210210

211211
#### CDN links
212-
> https://cdn.plot.ly/plotly-mapbox-2.2.0.js
212+
> https://cdn.plot.ly/plotly-mapbox-2.2.1.js
213213
214-
> https://cdn.plot.ly/plotly-mapbox-2.2.0.min.js
214+
> https://cdn.plot.ly/plotly-mapbox-2.2.1.min.js
215215
216216

217217
#### npm packages
@@ -229,12 +229,12 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne
229229

230230
| Raw size | Minified size | Minified + gzip size |
231231
|------|-----------------|------------------------|
232-
| 3 MB | 1.1 MB | 353.5 kB |
232+
| 3 MB | 1.1 MB | 353.6 kB |
233233

234234
#### CDN links
235-
> https://cdn.plot.ly/plotly-finance-2.2.0.js
235+
> https://cdn.plot.ly/plotly-finance-2.2.1.js
236236
237-
> https://cdn.plot.ly/plotly-finance-2.2.0.min.js
237+
> https://cdn.plot.ly/plotly-finance-2.2.1.min.js
238238
239239

240240
#### npm packages
@@ -252,12 +252,12 @@ The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `ca
252252

253253
| Raw size | Minified size | Minified + gzip size |
254254
|------|-----------------|------------------------|
255-
| 6.7 MB | 2.8 MB | 840.4 kB |
255+
| 6.7 MB | 2.8 MB | 840.5 kB |
256256

257257
#### CDN links
258-
> https://cdn.plot.ly/plotly-strict-2.2.0.js
258+
> https://cdn.plot.ly/plotly-strict-2.2.1.js
259259
260-
> https://cdn.plot.ly/plotly-strict-2.2.0.min.js
260+
> https://cdn.plot.ly/plotly-strict-2.2.1.min.js
261261
262262

263263
#### npm packages

0 commit comments

Comments
 (0)