Skip to content

Commit 8ea156c

Browse files
committed
Merge remote-tracking branch 'origin/master' into scattergl_glpixelratio
- and resolves conflicts in - src/traces/parcoords/parcoords.js - test/image/baselines/gl2d_parcoords_dark_background.png - test/image/mocks/gl2d_parcoords_dark_background.json
2 parents 4860893 + e6e2443 commit 8ea156c

File tree

435 files changed

+168
-7581
lines changed

Some content is hidden

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

435 files changed

+168
-7581
lines changed

.circleci/config.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ jobs:
170170
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.js
171171
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.min.js
172172
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plot-schema.json
173+
- run:
174+
name: Test validation using node.js and jsdom
175+
command: npm run test-plain-obj
176+
- run:
177+
name: Test plotly.min.js import using requirejs
178+
command: npm run test-requirejs
173179
- run:
174180
name: Test plotly bundles againt unexpected characters
175181
command: npm run no-bad-char
@@ -184,9 +190,6 @@ jobs:
184190
environment:
185191
NODE_OPTIONS: --max_old_space_size=4096
186192
command: npm run no-dup-keys
187-
- run:
188-
name: Test plotly.min.js import using requirejs
189-
command: npm run test-requirejs
190193

191194
workflows:
192195
version: 2

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules
2-
vendor
32
dist
43
build
54

devtools/test_dashboard/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</div>
2020
<div id="snapshot"></div>
2121

22-
<script src="../../vendor/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
22+
<script src="../../node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
2323
<script id="source" src="../../build/plotly.js" charset="utf-8"></script>
2424
<script src="../../build/test_dashboard-bundle.js" charset="utf-8"></script>
2525
</body>

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@
4343
"test-syntax": "node tasks/test_syntax.js && npm run find-strings -- --no-output",
4444
"test-bundle": "node tasks/test_bundle.js",
4545
"test-requirejs": "node tasks/test_requirejs.js",
46+
"test-plain-obj": "node tasks/test_plain_obj.js",
4647
"test": "npm run test-jasmine -- --nowatch && npm run test-bundle && npm run test-image && npm run test-export && npm run test-syntax && npm run lint",
4748
"start-test_dashboard": "node devtools/test_dashboard/server.js",
4849
"start-image_viewer": "node devtools/image_viewer/server.js",
4950
"start": "npm run start-test_dashboard",
5051
"baseline": "node tasks/baseline.js",
52+
"noci-baseline": "npm run cibuild && ./tasks/noci_test.sh image && git checkout dist && echo 'Please do not commit unless the change was expected!'",
5153
"preversion": "check-node-version --node 12 --npm 6.14 && npm-link-check && npm ls --prod",
5254
"version": "npm run build && npm run no-bad-char && git add -A dist build src/version.js",
5355
"postversion": "node -e \"console.log('Version bumped and committed. If ok, run: git push && git push --tags')\"",
@@ -163,6 +165,7 @@
163165
"karma-viewport": "^1.0.7",
164166
"lodash": "^4.17.20",
165167
"madge": "^3.12.0",
168+
"mathjax": "2.7.5",
166169
"minify-stream": "^2.1.0",
167170
"mkdirp": "^1.0.4",
168171
"node-sass": "^5.0.0",

src/lib/svg_text_utils.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,16 @@ function alignHTMLWith(_base, container, options) {
755755
};
756756
}
757757

758+
exports.makeTextShadow = function(offset, color) {
759+
var x = offset + 'px ';
760+
var y = offset + 'px ';
761+
var b = '1px ';
762+
return x + y + b + color + ', ' +
763+
'-' + x + '-' + y + b + color + ', ' +
764+
x + '-' + y + b + color + ', ' +
765+
'-' + x + y + b + color;
766+
};
767+
758768
/*
759769
* Editable title
760770
* @param {d3.selection} context: the element being edited. Normally text,

src/traces/parcats/parcats.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,7 @@ function performPlot(parcatsModels, graphDiv, layout, svg) {
238238
})
239239
.attr('alignment-baseline', 'middle')
240240

241-
.style('text-shadow',
242-
paperColor + ' -1px 1px 2px, ' +
243-
paperColor + ' 1px 1px 2px, ' +
244-
paperColor + ' 1px -1px 2px, ' +
245-
paperColor + ' -1px -1px 2px')
241+
.style('text-shadow', svgTextUtils.makeTextShadow(1, paperColor))
246242
.style('fill', 'rgb(0, 0, 0)')
247243
.attr('x',
248244
function(d) {

src/traces/parcoords/parcoords.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -652,12 +652,7 @@ module.exports = function parcoords(gd, cdModule, layout, callbacks) {
652652
.attr('stroke-width', '1px');
653653

654654
axis.selectAll('text')
655-
.style('text-shadow',
656-
paperColor + ' 1px 1px 1px #fff, ' +
657-
paperColor + ' -1px -1px 1px #fff, ' +
658-
paperColor + ' 1px -1px 1px #fff, ' +
659-
paperColor + ' -1px 1px 1px #fff'
660-
)
655+
.style('text-shadow', svgTextUtils.makeTextShadow(1, paperColor))
661656
.style('cursor', 'default');
662657

663658
var axisHeading = axisOverlays.selectAll('.' + c.cn.axisHeading)

src/traces/sankey/render.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var keyFun = gup.keyFun;
1515
var repeat = gup.repeat;
1616
var unwrap = gup.unwrap;
1717
var interpolateNumber = require('d3-interpolate').interpolateNumber;
18+
var svgTextUtils = require('../../lib/svg_text_utils');
1819

1920
var Registry = require('../../registry');
2021

@@ -1024,7 +1025,7 @@ module.exports = function(gd, svg, calcData, layout, callbacks) {
10241025

10251026
nodeLabel
10261027
.style('text-shadow', function(d) {
1027-
return d.horizontal ? '-1px 1px 1px #fff, 1px 1px 1px #fff, 1px -1px 1px #fff, -1px -1px 1px #fff' : 'none';
1028+
return d.horizontal ? svgTextUtils.makeTextShadow(1, '#fff') : 'none';
10281029
})
10291030
.each(function(d) {Drawing.font(nodeLabel, d.textFont);});
10301031

tasks/noci_test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,21 @@ test_jasmine () {
2626
# since the update to [email protected], we must use orca
2727
# as mapbox-gl versions >0.22.1 aren't supported on [email protected] used in the
2828
# 'old' image server
29+
#
30+
# due to mathjax upgrade to v2.7.5, we are unable to test mathjax mocks in the
31+
# 'old' image server and we use orca
32+
#
2933
test_image () {
3034
$root/../orca/bin/orca.js graph \
3135
$root/test/image/mocks/mapbox_* \
36+
$root/test/image/mocks/mathjax.json \
37+
$root/test/image/mocks/ternary-mathjax.json \
38+
$root/test/image/mocks/table_plain_birds.json \
39+
$root/test/image/mocks/table_wrapped_birds.json \
40+
$root/test/image/mocks/parcats_grid_subplots.json \
41+
$root/test/image/mocks/legend_mathjax_title_and_items.json \
42+
$root/test/image/mocks/table_latex_multitrace_scatter.json \
43+
--mathjax $root/node_modules/mathjax/MathJax.js \
3244
--plotly $root/build/plotly.js \
3345
--mapbox-access-token "pk.eyJ1IjoicGxvdGx5LWpzLXRlc3RzIiwiYSI6ImNrNG9meTJmOTAxa3UzZm10dWdteDQ2eWMifQ.2REjOFyIrleMqwS8H8y1-A" \
3446
--output-dir $root/test/image/baselines/ \

0 commit comments

Comments
 (0)