@@ -6,7 +6,7 @@ import { observer } from 'mobx-react';
6
6
import { action , computed , makeObservable , observable } from 'mobx' ;
7
7
import _ from 'lodash' ;
8
8
import MobxPromise from 'mobxpromise' ;
9
- import React from 'react' ;
9
+ import React , { CSSProperties } from 'react' ;
10
10
import styles from 'pages/studyView/table/tables.module.scss' ;
11
11
import {
12
12
toNumericValue ,
@@ -25,16 +25,26 @@ import {
25
25
import autobind from 'autobind-decorator' ;
26
26
import { SelectionOperatorEnum } from 'pages/studyView/TableUtils' ;
27
27
import { MultiSelectionTableRow } from 'pages/studyView/table/MultiSelectionTable' ;
28
- import { getFrequencyStr } from 'pages/studyView/StudyViewUtils' ;
28
+ import {
29
+ correctMargin ,
30
+ getFixedHeaderNumberCellMargin ,
31
+ getFrequencyStr ,
32
+ } from 'pages/studyView/StudyViewUtils' ;
29
33
30
34
export interface IClinicalEventTypeDataColumnCellProp {
31
35
data : string ;
36
+ style ?: CSSProperties ;
37
+ className ?: string ;
32
38
}
33
39
34
40
function ClinicalEventTypeColumnCell (
35
41
props : IClinicalEventTypeDataColumnCellProp
36
42
) {
37
- return < div > { props . data } </ div > ;
43
+ return (
44
+ < div className = { props . className } style = { props . style } >
45
+ { props . data }
46
+ </ div >
47
+ ) ;
38
48
}
39
49
40
50
export function filterClinicalEventTypeCountCell (
@@ -194,6 +204,8 @@ export default class ClinicalEventTypeCountTable extends React.Component<
194
204
) ,
195
205
render : ( data : ClinicalEventTypeCount ) => (
196
206
< ClinicalEventTypeColumnCell
207
+ className = { styles . pullRight }
208
+ style = { { marginLeft : cellMargin } }
197
209
data = { this . calculateClinicalEventTypeFreqString (
198
210
data ,
199
211
this . selectedPatientCount
@@ -241,7 +253,20 @@ export default class ClinicalEventTypeCountTable extends React.Component<
241
253
return {
242
254
[ ClinicalEventTypeCountColumnKey . CLINICAL_EVENT_TYPE ] : 0 ,
243
255
[ ClinicalEventTypeCountColumnKey . COUNT ] : 0 ,
244
- [ ClinicalEventTypeCountColumnKey . FREQ ] : 0 ,
256
+ [ ClinicalEventTypeCountColumnKey . FREQ ] : correctMargin (
257
+ getFixedHeaderNumberCellMargin (
258
+ this . columnsWidth [ ClinicalEventTypeCountColumnKey . FREQ ] ,
259
+ getFrequencyStr (
260
+ _ . max (
261
+ this . tableData . map (
262
+ item =>
263
+ ( item . count ! / this . selectedPatientCount ! ) *
264
+ 100
265
+ )
266
+ ) !
267
+ )
268
+ )
269
+ ) ,
245
270
} ;
246
271
}
247
272
0 commit comments