-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5dbb668
commit bf725b5
Showing
8 changed files
with
132 additions
and
161 deletions.
There are no files selected for viewing
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
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
31 changes: 19 additions & 12 deletions
31
src/features/Results/CaseResult/CaseResultView/CaseResultView.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
19 changes: 2 additions & 17 deletions
19
...ectCaseResult/ObjectCaseResult.styled.tsx → ...tCaseResult/ChannelResultTable.styled.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
65 changes: 65 additions & 0 deletions
65
src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ChannelResultTable.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,65 @@ | ||
/* eslint-disable max-lines-per-function */ | ||
import { Table } from '@equinor/eds-core-react'; | ||
import { CaseCardComponent } from '../../../../../components/CaseCardComponent/CaseCardComponent'; | ||
|
||
import { ComputeCaseDto, GetResultDto } from '../../../../../api/generated'; | ||
import * as Styled from './ChannelResultTable.styled'; | ||
|
||
export const ChannelResultTable = ({ | ||
data, | ||
computeCase, | ||
}: { | ||
data: GetResultDto; | ||
computeCase?: ComputeCaseDto[]; | ||
}) => { | ||
const filterValues = (name: string) => { | ||
return data.resultValues.filter((d) => d.name === name); | ||
}; | ||
|
||
let modelArea = ''; | ||
if (computeCase && computeCase[0].modelArea !== null) | ||
modelArea = computeCase && computeCase[0].modelArea.name; | ||
|
||
if (modelArea === '') modelArea = 'Whole model'; | ||
|
||
const channelHeightCount = filterValues('channel-height_count'); | ||
const channelHeightMean = filterValues('channel-height_mean'); | ||
const channelHeightSD = filterValues('channel-height_sd'); | ||
|
||
const channelWidthCount = filterValues('channel-width_count'); | ||
const channelWidthMean = filterValues('channel-width_mean'); | ||
const channelWidthSD = filterValues('channel-width_sd'); | ||
|
||
return ( | ||
<CaseCardComponent | ||
title={data.resultType + ' Case'} | ||
subTitle={modelArea} | ||
resultCard={true} | ||
> | ||
<Table> | ||
<Table.Head> | ||
<Table.Row> | ||
<Styled.DataCell></Styled.DataCell> | ||
<Styled.DataCell>Mean</Styled.DataCell> | ||
<Styled.DataCell>Standard deviation (SD)</Styled.DataCell> | ||
<Styled.DataCell>Count</Styled.DataCell> | ||
</Table.Row> | ||
</Table.Head> | ||
<Table.Body key={data.computeCaseId}> | ||
<Table.Row> | ||
<Styled.ColumnCell>Channel width</Styled.ColumnCell> | ||
<Styled.DataCell>{channelWidthMean[0].value}</Styled.DataCell> | ||
<Styled.DataCell>{channelWidthSD[0].value}</Styled.DataCell> | ||
<Styled.DataCell>{channelWidthCount[0].value}</Styled.DataCell> | ||
</Table.Row> | ||
<Table.Row> | ||
<Styled.ColumnCell>Channel height</Styled.ColumnCell> | ||
<Styled.DataCell>{channelHeightMean[0].value}</Styled.DataCell> | ||
<Styled.DataCell>{channelHeightSD[0].value}</Styled.DataCell> | ||
<Styled.DataCell>{channelHeightCount[0].value}</Styled.DataCell> | ||
</Table.Row> | ||
</Table.Body> | ||
</Table> | ||
</CaseCardComponent> | ||
); | ||
}; |
41 changes: 0 additions & 41 deletions
41
src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ObjectCaseResult.tsx
This file was deleted.
Oops, something went wrong.
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