-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfeature-info.js
52 lines (47 loc) · 1.33 KB
/
feature-info.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React from 'react';
import { Component } from 'react';
import { toFixed } from 'hetio-frontend-components';
import { InfoTable } from 'hetio-frontend-components';
import tooltipText from './tooltip-text.json';
export class FeatureInfo extends Component {
// display component
render() {
if (!this.props.feature)
return <></>;
const feature = this.props.feature;
const name = feature.metapath;
const info = this.props.featureInfo || {};
const bodyContents = [
['description', tooltipText['metapath_description'], info.description],
['metapath', tooltipText['metapath_full'], info.metapath_long],
['metric', tooltipText['metapath_metric'], info.metric],
[
'auroc',
tooltipText['metapath_auroc'],
toFixed(feature.auroc * 100) + '%',
feature.auroc
],
[
'stand coef',
tooltipText['metapath_coefficient'],
toFixed(feature.auroc, 2),
feature.standardized_coefficient
]
];
return (
<div
className='app_section'
style={{ display: this.props.visible ? 'block' : 'none' }}
>
<hr />
<p className='left'>
Info about{' '}
<b>
<i>{name}</i>
</b>
</p>
<InfoTable bodyContents={bodyContents} />
</div>
);
}
}