Skip to content

Commit 9939241

Browse files
committed
specify default sizes for parcoords fonts; screenshot fix
1 parent 505614d commit 9939241

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

src/traces/parcoords/attributes.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ module.exports = {
4949
}
5050
},
5151

52-
labelfont: extendFlat({}, fontAttrs, {description: 'Sets the font for the `dimension` labels.'}),
53-
tickfont: extendFlat({}, fontAttrs, {description: 'Sets the font for the `dimension` tick values.'}),
54-
rangefont: extendFlat({}, fontAttrs, {description: 'Sets the font for the `dimension` range values.'}),
52+
labelfont: extendFlat({}, fontAttrs, {dflt: {size: 10}, description: 'Sets the font for the `dimension` labels.'}),
53+
tickfont: extendFlat({}, fontAttrs, {dflt: {size: 10}, description: 'Sets the font for the `dimension` tick values.'}),
54+
rangefont: extendFlat({}, fontAttrs, {dflt: {size: 10}, description: 'Sets the font for the `dimension` range values.'}),
5555

5656
dimensions: {
5757
_isLinkedToArray: 'dimension',

src/traces/parcoords/defaults.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ function dimensionsDefaults(traceIn, traceOut) {
8181
return dimensionsOut;
8282
}
8383

84-
function coerceFont(fontAttr, coerce, defaultFont) {
84+
function coerceFont(fontAttr, coerce, layoutFont, defaultFont) {
8585
var fontSpec = Lib.coerceFont(coerce, fontAttr);
86-
Lib.coerceFont(coerce, fontAttr, Lib.extendFlat({}, defaultFont, fontSpec));
86+
Lib.coerceFont(coerce, fontAttr, Lib.extendFlat({}, layoutFont, defaultFont, fontSpec));
8787
}
8888

8989
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
@@ -102,7 +102,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
102102
traceOut.visible = false;
103103
}
104104

105-
coerceFont('labelfont', coerce, layout.font);
106-
coerceFont('tickfont', coerce, layout.font);
107-
coerceFont('rangefont', coerce, layout.font);
105+
coerceFont('labelfont', coerce, layout.font, attributes.labelfont.dflt || {});
106+
coerceFont('tickfont', coerce, layout.font, attributes.tickfont.dflt || {});
107+
coerceFont('rangefont', coerce, layout.font, attributes.rangefont.dflt || {});
108108
};

src/traces/parcoords/parcoords.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,6 @@ module.exports = function(root, svg, styledData, layout, callbacks) {
550550
var scale = d.domainScale;
551551
var sdom = scale.domain();
552552
var texts = d.ticktext;
553-
Drawing.font(axis, d.model.tickFont)
554553
d3.select(this)
555554
.call(d3.svg.axis()
556555
.orient('left')
@@ -562,20 +561,18 @@ module.exports = function(root, svg, styledData, layout, callbacks) {
562561
null)
563562
.tickFormat(d.ordinal ? function(d) {return d;} : null)
564563
.scale(scale));
564+
Drawing.font(axis.selectAll('text'), d.model.tickFont);
565565
});
566566

567567
axis
568-
.selectAll('.domain, .tick')
568+
.selectAll('.domain, .tick>line')
569569
.attr('fill', 'none')
570570
.attr('stroke', 'black')
571571
.attr('stroke-opacity', 0.25)
572572
.attr('stroke-width', '1px');
573573

574574
axis
575575
.selectAll('text')
576-
.style('fill', 'black')
577-
.style('fill-opacity', 1)
578-
.style('stroke', 'none')
579576
.style('text-shadow', '1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff')
580577
.style('cursor', 'default')
581578
.style('user-select', 'none');

0 commit comments

Comments
 (0)