-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Table Visualization] split table in rows and columns (#2578)
This PR implement a group component TableVisGroupComponent utilizing TableVisComponent as sub component. It also adds a title to TableVisComponent. Partically resolved: #2379 Signed-off-by: Anan Zhuang <[email protected]>
- Loading branch information
Showing
5 changed files
with
110 additions
and
36 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/plugins/vis_type_table/public/components/table_vis_app.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.visTable { | ||
flex-direction: column; | ||
flex-grow: 1 0 0; | ||
} | ||
|
||
.visTable__group { | ||
padding: $euiSizeS; | ||
margin-bottom: $euiSizeL; | ||
|
||
> h3 { | ||
text-align: center; | ||
} | ||
} | ||
|
||
.visTable__groupInColumns { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: flex-start; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/plugins/vis_type_table/public/components/table_vis_component_group.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React, { memo } from 'react'; | ||
|
||
import { IInterpreterRenderHandlers } from 'src/plugins/expressions'; | ||
import { TableGroup } from '../table_vis_response_handler'; | ||
import { TableVisConfig } from '../types'; | ||
import { TableVisComponent } from './table_vis_component'; | ||
|
||
interface TableVisGroupComponentProps { | ||
tableGroups: TableGroup[]; | ||
visConfig: TableVisConfig; | ||
handlers: IInterpreterRenderHandlers; | ||
} | ||
|
||
export const TableVisComponentGroup = memo( | ||
({ tableGroups, visConfig, handlers }: TableVisGroupComponentProps) => { | ||
return ( | ||
<> | ||
{tableGroups.map(({ tables, title }) => ( | ||
<div key={title} className="visTable__group"> | ||
<TableVisComponent | ||
title={title} | ||
table={tables[0]} | ||
visConfig={visConfig} | ||
handlers={handlers} | ||
/> | ||
</div> | ||
))} | ||
</> | ||
); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters