Skip to content

Commit

Permalink
deferring the cell height change for now
Browse files Browse the repository at this point in the history
  • Loading branch information
monfera committed Oct 19, 2017
1 parent 103e793 commit 7a5b02c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/traces/table/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ module.exports = overrideAll({

height: {
valType: 'number',
dflt: 28,
dflt: 20,
role: 'style',
description: 'The height of cells.'
},
Expand Down
4 changes: 2 additions & 2 deletions src/traces/table/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
coerce('header.height');
coerce('header.line.width');
coerce('header.line.color');
coerce('header.fill.color', defaultColor);
coerce('header.fill.color');
Lib.coerceFont(coerce, 'header.font', Lib.extendFlat({}, layout.font));

defaultColumnOrder(traceOut, coerce);
Expand All @@ -55,6 +55,6 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
coerce('cells.height');
coerce('cells.line.width');
coerce('cells.line.color');
coerce('cells.fill.color', defaultColor);
coerce('cells.fill.color');
Lib.coerceFont(coerce, 'cells.font', Lib.extendFlat({}, layout.font));
};
11 changes: 6 additions & 5 deletions test/jasmine/tests/table_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var Plotly = require('@lib/index');
var Lib = require('@src/lib');
var Plots = require('@src/plots/plots');
var Table = require('@src/traces/table');
var attributes = require('@src/traces/table/attributes');
var cn = require('@src/traces/table/constants').cn;

var createGraphDiv = require('../assets/create_graph_div');
Expand Down Expand Up @@ -76,8 +77,8 @@ describe('table initialization tests', function() {

it('\'line\' specification should yield a default color', function() {
var fullTrace = _supply({});
expect(fullTrace.header.fill.color).toEqual('#777');
expect(fullTrace.cells.fill.color).toEqual('#777');
expect(fullTrace.header.fill.color).toEqual(attributes.header.fill.color.dflt);
expect(fullTrace.cells.fill.color).toEqual(attributes.cells.fill.color.dflt);
});

it('\'domain\' specification should have a default', function() {
Expand Down Expand Up @@ -108,17 +109,17 @@ describe('table initialization tests', function() {
align: 'center',
height: 28,
line: { width: 1, color: 'grey' },
fill: { color: '#777' },
fill: { color: attributes.header.fill.color.dflt },
font: {family: '"Open Sans", verdana, arial, sans-serif', size: 12, color: '#444'}
});

expect(fullTrace.cells).toEqual({
values: [1, 2],
format: [],
align: 'center',
height: 28,
height: 20,
line: { width: 1, color: 'grey' },
fill: { color: '#777' },
fill: { color: attributes.cells.fill.color.dflt },
font: {family: '"Open Sans", verdana, arial, sans-serif', size: 12, color: '#444'}
});
});
Expand Down

0 comments on commit 7a5b02c

Please sign in to comment.