8000 Branch for 1.31.2 by etpinard · Pull Request #2111 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Branch for 1.31.2 #2111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Oct 23, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ensuring special cases 0 rows or 0 columns work; noOpacity
  • Loading branch information
monfera authored and etpinard committed Oct 23, 2017
commit 3d56195d5f5eef1694ab735d32c8e8ca0b5359d4
5 changes: 3 additions & 2 deletions src/traces/table/data_preparation_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ module.exports = function calc(gd, trace) {
var headerValues = trace.header.values.map(function(c) {
return Array.isArray(c) ? c : [c];
});
var cellsValues = trace.cells.values;
var domain = trace.domain;
var groupWidth = Math.floor(gd._fullLayout._size.w * (domain.x[1] - domain.x[0]));
var groupHeight = Math.floor(gd._fullLayout._size.h * (domain.y[1] - domain.y[0]));
var headerRowHeights = headerValues[0].map(function() {return trace.header.height;});
var rowHeights = trace.cells.values[0].map(function() {return trace.cells.height;});
var headerRowHeights = headerValues.length ? headerValues[0].map(function() {return trace.header.height;}) : [];
var rowHeights = cellsValues.length ? cellsValues[0].map(function() {return trace.cells.height;}) : [];
var headerHeight = headerRowHeights.reduce(function(a, b) {return a + b;}, 0);
var scrollHeight = groupHeight - headerHeight;
var minimumFillHeight = scrollHeight + c.uplift;
Expand Down
41 changes: 18 additions & 23 deletions src/traces/table/defaults.js
1069F
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
var Lib = require('../../lib');
var attributes = require('./attributes');

function defaultColumnOrder(traceIn, coerce) {
var specifiedColumnOrder = traceIn.columnorder || [];
var commonLength = traceIn.header.values.length;
function defaultColumnOrder(traceOut, coerce) {
var specifiedColumnOrder = traceOut.columnorder || [];
var commonLength = traceOut.header.values.length;
var truncated = specifiedColumnOrder.slice(0, commonLength);
var sorted = truncated.slice().sort(function(a, b) {return a - b;});
var oneStepped = truncated.map(function(d) {return sorted.indexOf(d);});
Expand All @@ -28,28 +28,10 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
}

var fontDflt = {
family: layout.font.family,
size: layout.font.size,
color: layout.font.color
};

coerce('domain.x');
coerce('domain.y');

coerce('columnwidth');
defaultColumnOrder(traceIn, coerce);

coerce('cells.values');
coerce('cells.format');
coerce('cells.align');
coerce('cells.prefix');
coerce('cells.suffix');
coerce('cells.height');
coerce('cells.line.width');
coerce('cells.line.color');
coerce('cells.fill.color');
Lib.coerceFont(coerce, 'cells.font', fontDflt);

coerce('header.values');
coerce('header.format');
Expand All @@ -60,6 +42,19 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
coerce('header.height');
coerce('header.line.width');
coerce('header.line.color');
coerce('header.fill.color');
Lib.coerceFont(coerce, 'header.font', fontDflt);
coerce('header.fill.color', defaultColor);
Lib.coerceFont(coerce, 'header.font', Lib.extendFlat({}, layout.font));

defaultColumnOrder(traceOut, coerce);

coerce('cells.values');
coerce('cells.format');
coerce('cells.align');
coerce('cells.prefix');
coerce('cells.suffix');
coerce('cells.height');
coerce('cells.line.width');
coerce('cells.line.color');
coerce('cells.fill.color', defaultColor);
Lib.coerceFont(coerce, 'cells.font', Lib.extendFlat({}, layout.font));
};
2 changes: 1 addition & 1 deletion src/traces/table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Table.plot = require('./plot');
Table.moduleType = 'trace';
Table.name = 'table';
Table.basePlotModule = require('./base_plot');
Table.categories = [];
Table.categories = ['noOpacity'];
Table.meta = {
description: [
'Table view for detailed data viewing.',
Expand Down
0