Skip to content

Commit

Permalink
[Table Visualization] remove repeated column from split tables
Browse files Browse the repository at this point in the history
Currently, when we split table by columns, the split column is shown
both in the table title and as a separate column. This is not needed.
In this PR, we remove the repeated column in split tables in col.

Partically resolved:
opensearch-project#2579 (comment)

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
  • Loading branch information
ananzh committed Oct 17, 2022
1 parent b919b99 commit 3c1fde0
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,12 @@ export const convertToFormattedData = (
table: Table,
visConfig: TableVisConfig
): FormattedDataProps => {
const { buckets, metrics, splitColumn } = visConfig;
const { buckets, metrics } = visConfig;
let formattedRows: OpenSearchDashboardsDatatableRow[] = table.rows;
let formattedColumns: FormattedColumn[] = table.columns
.map(function (col, i) {
const isBucket = buckets.find((bucket) => bucket.accessor === i);
const isSplitColumn = splitColumn
? splitColumn.find((splitCol) => splitCol.accessor === i)
: undefined;
const dimension =
isBucket || isSplitColumn || metrics.find((metric) => metric.accessor === i);
const dimension = isBucket || metrics.find((metric) => metric.accessor === i);

if (!dimension) return undefined;

Expand Down

0 comments on commit 3c1fde0

Please sign in to comment.