Skip to content

Commit 0682a88

Browse files
committed
add a shorter default header when there's no header specified
1 parent c3f0908 commit 0682a88

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/traces/table/constants.js

+14-13
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,27 @@
99
'use strict';
1010

1111
module.exports = {
12-
maxDimensionCount: 60,
13-
overdrag: 45,
1412
cellPad: 8,
13+
columnExtentOffset: 10,
14+
columnTitleOffset: 28,
15+
emptyHeaderHeight: 16,
1516
latexCheck: /^\$.*\$$/,
16-
wrapSplitCharacter: ' ',
17-
wrapSpacer: ' ',
18-
lineBreaker: '<br>',
19-
uplift: 5,
2017
goldenRatio: 1.618,
21-
columnTitleOffset: 28,
22-
columnExtentOffset: 10,
23-
transitionEase: 'cubic-out',
24-
transitionDuration: 100,
25-
releaseTransitionEase: 'cubic-out',
18+
lineBreaker: '<br>',
19+
maxDimensionCount: 60,
20+
overdrag: 45,
2621
releaseTransitionDuration: 120,
27-
scrollbarWidth: 8,
22+
releaseTransitionEase: 'cubic-out',
2823
scrollbarCaptureWidth: 18,
29-
scrollbarOffset: 5,
3024
scrollbarHideDelay: 1000,
3125
scrollbarHideDuration: 1000,
26+
scrollbarOffset: 5,
27+
scrollbarWidth: 8,
28+
transitionDuration: 100,
29+
transitionEase: 'cubic-out',
30+
uplift: 5,
31+
wrapSpacer: ' ',
32+
wrapSplitCharacter: ' ',
3233
cn: {
3334
// general class names
3435
table: 'table',

src/traces/table/data_preparation_helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function calc(gd, trace) {
2424
var domain = trace.domain;
2525
var groupWidth = Math.floor(gd._fullLayout._size.w * (domain.x[1] - domain.x[0]));
2626
var groupHeight = Math.floor(gd._fullLayout._size.h * (domain.y[1] - domain.y[0]));
27-
var headerRowHeights = headerValues.length ? headerValues[0].map(function() {return trace.header.height;}) : [];
27+
var headerRowHeights = trace.header.values.length ? headerValues[0].map(function() {return trace.header.height;}) : [c.emptyHeaderHeight];
2828
var rowHeights = cellsValues.length ? cellsValues[0].map(function() {return trace.cells.height;}) : [];
2929
var headerHeight = headerRowHeights.reduce(function(a, b) {return a + b;}, 0);
3030
var scrollHeight = groupHeight - headerHeight;

0 commit comments

Comments
 (0)