Making the sort order for metrics pull from fd for time table viz (#3661)

This commit is contained in:
michellethomas 2017-10-12 17:51:26 -07:00 committed by Maxime Beauchemin
parent 52a9f2742b
commit f87163413b
1 changed files with 8 additions and 2 deletions

View File

@ -44,8 +44,14 @@ function viz(slice, payload) {
metricMap[m.metric_name] = m;
});
const metrics = payload.data.columns;
const defaultSort = { column: fd.column_collection[0].key, direction: 'desc' };
let metrics;
let defaultSort = null;
if (payload.data.is_group_by) {
metrics = payload.data.columns;
defaultSort = { column: fd.column_collection[0].key, direction: 'desc' };
} else {
metrics = fd.metrics;
}
const tableData = metrics.map((metric) => {
let leftCell;
const context = Object.assign({}, fd, { metric });