Skip to content

Commit 9328dff

Browse files
committed
calling setCellHeightAndPositionY in bulk
1 parent 7a4a21e commit 9328dff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/traces/table/plot.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,11 @@ function renderCellText(cellText, tableControlView, allColumnBlock, columnCell,
458458

459459
// finalize what's in the DOM
460460
Drawing.font(selection, d.font);
461-
setCellHeightAndPositionY(columnCell);
462461

463462
var renderCallback = d.wrappingNeeded ? wrapTextMaker : updateYPositionMaker;
464463
svgUtil.convertToTspans(selection, gd, renderCallback(allColumnBlock, element, tableControlView, d));
465-
});
464+
})
465+
columnCell.call(setCellHeightAndPositionY);
466466
}
467467

468468
function latexEh(content) {
@@ -768,6 +768,7 @@ function updateYPositionMaker(columnBlock, element, tableControlView, d) {
768768

769769
function setCellHeightAndPositionY(columnCell) {
770770
// fixme speed bottleneck 15%
771+
window.monfera++
771772
columnCell
772773
.attr('transform', function(d) {
773774
var headerHeight = d.rowBlocks[0].auxiliaryBlocks.reduce(function(p, n) {return p + rowsHeight(n, Infinity)}, 0);
@@ -776,7 +777,7 @@ function setCellHeightAndPositionY(columnCell) {
776777
var yOffset = rowAnchor + headerHeight;
777778
return 'translate(0 ' + yOffset + ')';
778779
})
779-
.select('.cellRect')
780+
.selectAll('.cellRect')
780781
.attr('height', function(d) {return getRow(getBlock(d), d.key).rowHeight;});
781782
}
782783

0 commit comments

Comments
 (0)