Skip to content

Commit

Permalink
[Table Visualization][IMPROVE] remove repeated column from split tabl…
Browse files Browse the repository at this point in the history
…es (#2583)

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:
#2579 (comment)

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
  • Loading branch information
ananzh committed Oct 20, 2022
1 parent b919b99 commit c12b7c2
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 c12b7c2

Please sign in to comment.