Skip to content

Commit 51de82b

Browse files
committed
refactor - use variables for font options
1 parent 6e1560b commit 51de82b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/traces/heatmap/plot.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,12 @@ module.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) {
442442
}
443443

444444
var font = trace.textfont;
445+
var fontFamily = font.family;
446+
var fontSize = font.size;
445447
var xFn = function(d) { return d.x; };
446448
var yFn = function(d) {
447449
var nlines = d.t.split('<br>').length;
448-
return d.y - font.size * ((nlines * LINE_SPACING) / 2 - 1);
450+
return d.y - fontSize * ((nlines * LINE_SPACING) / 2 - 1);
449451
};
450452

451453
var labels = selectLabels(plotGroup).data(textData);
@@ -471,7 +473,7 @@ module.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) {
471473
thisLabel
472474
.attr('data-notex', 1)
473475
.call(svgTextUtils.positionText, xFn(d), yFn(d))
474-
.call(Drawing.font, font.family, font.size, fontColor)
476+
.call(Drawing.font, fontFamily, fontSize, fontColor)
475477
.text(d.t)
476478
.call(svgTextUtils.convertToTspans, gd);
477479
});

0 commit comments

Comments
 (0)