Skip to content

Commit a5abb7f

Browse files
committed
Merge branch 'master' into slider-touch-support
2 parents 5fe96ec + 9c06996 commit a5abb7f

Some content is hidden

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

49 files changed

+1597
-17160
lines changed

.circleci/config.yml

+60-13
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,42 @@ jobs:
3131
paths:
3232
- plotly.js
3333

34+
timezone-jasmine:
35+
docker:
36+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
37+
- image: circleci/node:12.22.1-browsers
38+
working_directory: ~/plotly.js
39+
steps:
40+
- attach_workspace:
41+
at: ~/
42+
- run:
43+
name: Run hover_label test in UTC timezone
44+
environment:
45+
TZ: "UTC"
46+
command: date && npm run test-jasmine hover_label
47+
- run:
48+
name: Run hover_label test in Europe/Berlin timezone
49+
environment:
50+
TZ: "Europe/Berlin"
51+
command: date && npm run test-jasmine hover_label
52+
- run:
53+
name: Run hover_label test in Asia/Tokyo timezone
54+
environment:
55+
TZ: "Asia/Tokyo"
56+
command: date && npm run test-jasmine hover_label
57+
- run:
58+
name: Run hover_label test in America/Toronto timezone
59+
environment:
60+
TZ: "America/Toronto"
61+
command: date && npm run test-jasmine hover_label
62+
3463
no-gl-jasmine:
3564
docker:
3665
# need '-browsers' version to test in real (xvfb-wrapped) browsers
3766
- image: circleci/node:12.22.1-browsers
67+
environment:
68+
# Alaska time (arbitrary timezone to test date logic)
69+
TZ: "America/Anchorage"
3870
parallelism: 8
3971
working_directory: ~/plotly.js
4072
steps:
@@ -48,6 +80,9 @@ jobs:
4880
docker:
4981
# need '-browsers' version to test in real (xvfb-wrapped) browsers
5082
- image: circleci/node:12.22.1-browsers
83+
environment:
84+
# Alaska time (arbitrary timezone to test date logic)
85+
TZ: "America/Anchorage"
5186
parallelism: 8
5287
working_directory: ~/plotly.js
5388
steps:
@@ -61,6 +96,9 @@ jobs:
6196
docker:
6297
# need '-browsers' version to test in real (xvfb-wrapped) browsers
6398
- image: circleci/node:12.22.1-browsers
99+
environment:
100+
# Alaska time (arbitrary timezone to test date logic)
101+
TZ: "America/Anchorage"
64102
working_directory: ~/plotly.js
65103
steps:
66104
- attach_workspace:
@@ -69,6 +107,21 @@ jobs:
69107
name: Run jasmine tests (part C)
70108
command: .circleci/test.sh flaky-no-gl-jasmine
71109

110+
bundle-jasmine:
111+
docker:
112+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
113+
- image: circleci/node:12.22.1-browsers
114+
environment:
115+
# Alaska time (arbitrary timezone to test date logic)
116+
TZ: "America/Anchorage"
117+
working_directory: ~/plotly.js
118+
steps:
119+
- attach_workspace:
120+
at: ~/
121+
- run:
122+
name: Run jasmine tests (part D)
123+
command: .circleci/test.sh bundle-jasmine
124+
72125
make-baselines:
73126
parallelism: 4
74127
docker:
@@ -162,18 +215,6 @@ jobs:
162215
name: Run syntax tests on source files
163216
command: .circleci/test.sh source-syntax
164217

165-
jasmine-bundle:
166-
docker:
167-
# need '-browsers' version to test in real (xvfb-wrapped) browsers
168-
- image: circleci/node:12.22.1-browsers
169-
working_directory: ~/plotly.js
170-
steps:
171-
- attach_workspace:
172-
at: ~/
173-
- run:
174-
name: Run jasmine tests (part D)
175-
command: .circleci/test.sh jasmine-bundle
176-
177218
publish-dist:
178219
docker:
179220
- image: circleci/node:12.22.1
@@ -234,6 +275,9 @@ jobs:
234275
- run:
235276
name: Test plotly bundles againt unexpected characters
236277
command: npm run no-bad-char
278+
- run:
279+
name: Display function constructors in plotly.js bundle
280+
command: npm run log-new-func
237281
- run:
238282
name: Test certain bundles against function constructors
239283
command: npm run no-new-func
@@ -246,7 +290,10 @@ workflows:
246290
build-and-test:
247291
jobs:
248292
- install-and-cibuild
249-
- jasmine-bundle:
293+
- timezone-jasmine:
294+
requires:
295+
- install-and-cibuild
296+
- bundle-jasmine:
250297
requires:
251298
- install-and-cibuild
252299
- no-gl-jasmine:

.circleci/test.sh

+5-18
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,9 @@ retry () {
3333
fi
3434
}
3535

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-
4236
case $1 in
4337

4438
no-gl-jasmine)
45-
set_tz
46-
4739
SUITE=$(circleci tests glob "$ROOT/test/jasmine/tests/*" | circleci tests split)
4840
MAX_AUTO_RETRY=2
4941
retry npm run test-jasmine -- $SUITE --skip-tags=gl,noCI,flaky || EXIT_STATE=$?
@@ -52,8 +44,6 @@ case $1 in
5244
;;
5345

5446
webgl-jasmine)
55-
set_tz
56-
5747
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=5 --tag=gl | circleci tests split))
5848
for s in ${SHARDS[@]}; do
5949
MAX_AUTO_RETRY=2
@@ -64,8 +54,6 @@ case $1 in
6454
;;
6555

6656
flaky-no-gl-jasmine)
67-
set_tz
68-
6957
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=1 --tag=flaky | circleci tests split))
7058

7159
for s in ${SHARDS[@]}; do
@@ -76,6 +64,11 @@ case $1 in
7664
exit $EXIT_STATE
7765
;;
7866

67+
bundle-jasmine)
68+
npm run test-bundle || EXIT_STATE=$?
69+
exit $EXIT_STATE
70+
;;
71+
7972
make-baselines)
8073
SUITE=$(find $ROOT/test/image/mocks/ -type f -printf "%f\n" | sed 's/\.json$//1' | circleci tests split)
8174
python3 test/image/make_baseline.py $SUITE || EXIT_STATE=$?
@@ -87,12 +80,6 @@ case $1 in
8780
exit $EXIT_STATE
8881
;;
8982

90-
jasmine-bundle)
91-
set_tz
92-
npm run test-bundle || EXIT_STATE=$?
93-
exit $EXIT_STATE
94-
;;
95-
9683
source-syntax)
9784
npm run lint || EXIT_STATE=$?
9885
npm run test-syntax || EXIT_STATE=$?

CHANGELOG.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ 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.3.1] -- 2021-07-30
13+
14+
### Fixed
15+
- Fix period positioned hover to work in different time zones as well as on grouped bars [[#5864](https://github.com/plotly/plotly.js/pull/5864)]
16+
- Use ids from axes when making hover data keys [[#5852](https://github.com/plotly/plotly.js/pull/5852)]
17+
- Do not include regl based traces `parcoords`, `splom`, `scattergl` and `scatterpolargl` in the "strict" bundle so that it could be used with CSP without WebGL warning [[#5865](https://github.com/plotly/plotly.js/pull/5865)]
18+
19+
1220
## [2.3.0] -- 2021-07-23
1321

1422
### Added
@@ -28,7 +36,8 @@ where X.Y.Z is the semver of most recent plotly.js release.
2836
- Preview plot-schema changes between releases when building dist on master [[#5814](https://github.com/plotly/plotly.js/pull/5814)]
2937
- Display changes made to package.json between versions and add identical tags to draft bundles created by `publish-dist` job on CircleCI [[#5815](https://github.com/plotly/plotly.js/pull/5815)]
3038
- Simplify devtool by relying on `XMLHttpRequest` instead of `d3.json` [[#5832](https://github.com/plotly/plotly.js/pull/5832)]
31-
- Update CONTRIBUTING guidelines on how to submit pull requests and generate new baseline [[#5791](https://github.com/plotly/plotly.js/pull/5791), [[#5792](https://github.com/plotly/plotly.js/pull/5792)]]
39+
- Update CONTRIBUTING guidelines on how to submit pull requests and generate new baseline [[#5791](https://github.com/plotly/plotly.js/pull/5791), [#5792](https://github.com/plotly/plotly.js/pull/5792)]
40+
- More maintenance work listed under [the v2.3.0 milestone](https://github.com/plotly/plotly.js/milestone/63?closed=1)
3241

3342
### Fixed
3443
- Fix unknown filename when exporting charts using new versions of Safari [[#5609](https://github.com/plotly/plotly.js/pull/5609), [5838](https://github.com/plotly/plotly.js/pull/5838)],
@@ -68,6 +77,7 @@ where X.Y.Z is the semver of most recent plotly.js release.
6877
- 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)]
6978
- Bump turf bbox dependency to v6.4.0 [[#5747](https://github.com/plotly/plotly.js/pull/5747)]
7079
- Bump turf area dependency to v6.4.0 [[#5748](https://github.com/plotly/plotly.js/pull/5748)]
80+
- More maintenance work listed under [the v2.2.0 milestone](https://github.com/plotly/plotly.js/milestone/62?closed=1)
7181

7282
### Fixed
7383
- Cache values and patterns in set_convert for axes with `rangebreaks` to improve performance [[#5659](https://github.com/plotly/plotly.js/pull/5659)],
@@ -88,7 +98,7 @@ where X.Y.Z is the semver of most recent plotly.js release.
8898
### Changed
8999
- Replace deprecated [node-sass](https://www.npmjs.com/package/node-sass) modules with [Sass](https://www.npmjs.com/package/sass) and update plot CSS [[#5729](https://github.com/plotly/plotly.js/pull/5729)]
90100
- Bump `probe-image-size` to v7.2.1 [[#5739](https://github.com/plotly/plotly.js/pull/5739)]
91-
- More maintenance work listed under [the v2.1.0 milestone](https://github.com/plotly/plotly.js/milestone/61)
101+
- More maintenance work listed under [the v2.1.0 milestone](https://github.com/plotly/plotly.js/milestone/61?closed=1)
92102

93103
### Fixed
94104
- Fix setting the width of categorical bars & boxes to unit [[#5732](https://github.com/plotly/plotly.js/pull/5732)]
@@ -157,7 +167,7 @@ where X.Y.Z is the semver of most recent plotly.js release.
157167
dist files at build time [[#5436](https://github.com/plotly/plotly.js/pull/5436), [#5446](https://github.com/plotly/plotly.js/pull/5446)]
158168
- Guard against unexpected characters at build time [[#5424](https://github.com/plotly/plotly.js/pull/5424)]
159169
- Minimize indentation in plot-schema [[#5663](https://github.com/plotly/plotly.js/pull/5663)]
160-
- More maintenance work listed under [the 60th milestone](https://github.com/plotly/plotly.js/milestone/60)!
170+
- More maintenance work listed under [the 60th milestone](https://github.com/plotly/plotly.js/milestone/60?closed=1)!
161171

162172
### Fixed
163173
- Fix "toself" `fill` for `scattergl` traces to handle multiple polygons [[#5355](https://github.com/plotly/plotly.js/pull/5355)],

README.md

+3-3
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.3.0.min.js"></script>
58+
<script src="https://cdn.plot.ly/plotly-2.3.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.3.0.min.js"
75+
import "https://cdn.plot.ly/plotly-2.3.1.min.js"
7676
Plotly.newPlot("gd", [{ y: [1, 2, 3] }])
7777
</script>
7878
```
@@ -82,7 +82,7 @@ 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.3.0.js" charset="utf-8"></script>
85+
<script src="https://cdn.plot.ly/plotly-2.3.1.js" charset="utf-8"></script>
8686
```
8787

8888
> 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.
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Security-Policy" content="script-src 'self'; worker-src blob:; ">
5+
<title>Plotly.js "strict" Devtools</title>
6+
7+
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Droid+Sans|PT+Sans+Narrow|Gravitas+One|Droid+Sans+Mono|Droid+Serif|Raleway|Old+Standard+TT"/>
8+
<link rel="stylesheet" type="text/css" href="./style.css">
9+
</head>
10+
<body>
11+
<header>
12+
<img src="http://images.plot.ly/logo/[email protected]" onClick="Tabs.reload();" />
13+
<span id="reload-time"></span>
14+
15+
<input id="mocks-search" type="text" placeholder="mocks search" />
16+
</header>
17+
18+
<section id="mocks-list"></section>
19+
<div id="plots">
20+
<div id="graph"></div>
21+
</div>
22+
<div id="snapshot"></div>
23+
24+
<script src="../../node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
25+
<script charset="utf-8" id="source" src="../../build/plotly.js"></script>
26+
<script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script>
27+
</body>
28+
</html>

devtools/test_dashboard/server.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ var http = require('http');
44
var ecstatic = require('ecstatic');
55
var open = require('open');
66
var browserify = require('browserify');
7+
var minimist = require('minimist');
78

89
var constants = require('../../tasks/util/constants');
910
var makeWatchifiedBundle = require('../../tasks/util/watchified_bundle');
1011
var shortcutPaths = require('../../tasks/util/shortcut_paths');
1112

12-
var PORT = process.argv[2] || 3000;
13-
13+
var args = minimist(process.argv.slice(2), {});
14+
var PORT = args.port || 3000;
15+
var strict = args.strict;
1416

1517
// Create server
1618
var server = http.createServer(ecstatic({
@@ -21,9 +23,9 @@ var server = http.createServer(ecstatic({
2123
}));
2224

2325
// Make watchified bundle for plotly.js
24-
var bundlePlotly = makeWatchifiedBundle(function() {
26+
var bundlePlotly = makeWatchifiedBundle(strict, function() {
2527
// open up browser window on first bundle callback
26-
open('http://localhost:' + PORT + '/devtools/test_dashboard/index.html');
28+
open('http://localhost:' + PORT + '/devtools/test_dashboard/index' + (strict ? '-strict' : '') + '.html');
2729
});
2830

2931
// Bundle devtools code

0 commit comments

Comments
 (0)