Skip to content

Commit 9871117

Browse files
committed
Standardize to 1px blur and equal x/y offsets
1 parent a480991 commit 9871117

16 files changed

+11
-12
lines changed

src/lib/svg_text_utils.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -755,15 +755,14 @@ function alignHTMLWith(_base, container, options) {
755755
};
756756
}
757757

758-
exports.makeTextShadow = function(offsetX, offsetY, blurRadius, color) {
759-
var x = offsetX + 'px ';
760-
var y = offsetY + 'px ';
761-
var b = blurRadius + 'px ';
762-
var clr = color + ' ';
763-
return x + y + b + clr + ', ' +
764-
'-' + x + '-' + y + b + clr + ', ' +
765-
x + '-' + y + b + clr + ', ' +
766-
'-' + x + y + b + clr;
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;
767766
};
768767

769768
/*

src/traces/parcats/parcats.js

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

241-
.style('text-shadow', svgTextUtils.makeTextShadow(1, 1, 2, paperColor))
241+
.style('text-shadow', svgTextUtils.makeTextShadow(1, paperColor))
242242
.style('fill', 'rgb(0, 0, 0)')
243243
.attr('x',
244244
function(d) {

src/traces/parcoords/parcoords.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ module.exports = function parcoords(gd, cdModule, layout, callbacks) {
649649
.attr('stroke-width', '1px');
650650

651651
axis.selectAll('text')
652-
.style('text-shadow', svgTextUtils.makeTextShadow(1, 1, 1, paperColor))
652+
.style('text-shadow', svgTextUtils.makeTextShadow(1, paperColor))
653653
.style('cursor', 'default');
654654

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

src/traces/sankey/render.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ module.exports = function(gd, svg, calcData, layout, callbacks) {
10251025

10261026
nodeLabel
10271027
.style('text-shadow', function(d) {
1028-
return d.horizontal ? svgTextUtils.makeTextShadow(1, 1, 1, '#fff') : 'none';
1028+
return d.horizontal ? svgTextUtils.makeTextShadow(1, '#fff') : 'none';
10291029
})
10301030
.each(function(d) {Drawing.font(nodeLabel, d.textFont);});
10311031

-219 Bytes
Loading
-227 Bytes
Loading
-227 Bytes
Loading
9 Bytes
Loading
Loading
-198 Bytes
Loading

test/image/baselines/parcats_dark.png

-126 Bytes
Loading
-428 Bytes
Loading
-93 Bytes
Loading
-173 Bytes
Loading
-59 Bytes
Loading
-93 Bytes
Loading

0 commit comments

Comments
 (0)