Skip to content

Commit c2f251f

Browse files
committed
fixing server image gen issue - thanks Étienne - and removing the post-hoc LaTeX styling workaround
1 parent 2be591f commit c2f251f

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/traces/table/attributes.js

+2
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ module.exports = {
138138
valType: 'color',
139139
editType: 'calc',
140140
arrayOk: true,
141+
dflt: 'white',
141142
role: 'style',
142143
description: [
143144
'Sets the cell fill color. It accepts either a specific color',
@@ -257,6 +258,7 @@ module.exports = {
257258
editType: 'calc',
258259
arrayOk: true,
259260
role: 'style',
261+
dflt: 'white',
260262
description: [
261263
'Sets the cell fill color. It accepts either a specific color',
262264
' or an array of colors.'

src/traces/table/plot.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ function renderColumnCellTree(gd, tableControlView, columnBlock, allColumnBlock)
357357

358358
var columnCell = renderColumnCell(columnCells);
359359

360-
setFont(columnCell);
360+
supplyStylingValues(columnCell);
361361

362362
var cellRect = renderCellRect(columnCell);
363363

@@ -367,6 +367,7 @@ function renderColumnCellTree(gd, tableControlView, columnBlock, allColumnBlock)
367367

368368
var cellText = renderCellText(cellTextHolder);
369369

370+
setFont(cellText);
370371
populateCellText(cellText, tableControlView, allColumnBlock, gd);
371372

372373
// doing this at the end when text, and text stlying are set
@@ -440,7 +441,7 @@ function renderCellTextHolder(columnCell) {
440441
return cellTextHolder;
441442
}
442443

443-
function setFont(columnCell) {
444+
function supplyStylingValues(columnCell) {
444445
columnCell
445446
.each(function(d, i) {
446447
var spec = d.calcdata.cells.font;
@@ -450,15 +451,20 @@ function setFont(columnCell) {
450451
color: gridPick(spec.color, col, i),
451452
family: gridPick(spec.family, col, i)
452453
};
453-
Drawing.font(d3.select(this), font);
454-
455454
d.rowNumber = d.key;
456455
d.align = gridPick(d.calcdata.cells.align, col, i);
457456
d.cellBorderWidth = gridPick(d.calcdata.cells.line.width, col, i);
458457
d.font = font;
459458
});
460459
}
461460

461+
function setFont(cellText) {
462+
cellText
463+
.each(function(d) {
464+
Drawing.font(d3.select(this), d.font);
465+
});
466+
}
467+
462468
function sizeAndStyleRect(cellRect) {
463469
cellRect
464470
.attr('width', function(d) {return d.column.columnWidth;})
@@ -781,11 +787,6 @@ function updateYPositionMaker(columnBlock, element, tableControlView, gd, d) {
781787
return 'translate(' + xPosition(d, d3.select(element.parentNode).select('.cellTextHolder').node().getBoundingClientRect().width) + ' ' + yPosition + ')';
782788
});
783789

784-
// MathJax styling has to be killed for HTML DOM color specifications to seep through
785-
cellTextHolder.selectAll('svg').selectAll('*')
786-
.attr('fill', null)
787-
.attr('stroke', null);
788-
789790
d.settledY = true;
790791
};
791792
}

0 commit comments

Comments
 (0)