Skip to content
Snippets Groups Projects
Commit 77d82f69 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

automatically switch to scalar for 1x1 data and from scalar to table when...

automatically switch to scalar for 1x1 data and from scalar to table when scalar is no longer appropriate.
parent 17b972d1
No related branches found
No related tags found
No related merge requests found
......@@ -193,14 +193,20 @@ CardControllers.controller('CardDetail', [
queryResult = result;
isRunning = false;
// if this is our first run on a NEW card then try a little logic to pick a smart display for the data
if (firstRunNewCard &&
// try a little logic to pick a smart display for the data
if (card.display !== "scalar" &&
queryResult.data.rows &&
queryResult.data.rows.length === 1 &&
queryResult.data.columns.length === 1) {
// if we have a 1x1 data result then this should be viewed as a scalar
// if we have a 1x1 data result then this should always be viewed as a scalar
card.display = "scalar";
} else if (card.display === "scalar" &&
queryResult.data.rows &&
(queryResult.data.rows.length > 1 || queryResult.data.columns.length > 1)) {
// any time we were a scalar and now have more than 1x1 data switch to table view
card.display = "table";
} else if (dataset_query.type === "query" &&
dataset_query.query.aggregation &&
dataset_query.query.aggregation.length > 0 &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment