forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumericFeaturesTable.tsx
More file actions
60 lines (55 loc) · 1.64 KB
/
Copy pathNumericFeaturesTable.tsx
File metadata and controls
60 lines (55 loc) · 1.64 KB
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
53
54
55
56
57
58
59
60
import { EuiBasicTable } from "@elastic/eui";
import React from "react";
import { NumericColumnSummaryStatisticType } from "../parsers/featureViewSummaryStatistics";
import SparklineHistogram from "./SparklineHistogram";
interface NumericFeaturesTableProps {
data: NumericColumnSummaryStatisticType[];
}
const NumericFeaturesTable = ({ data }: NumericFeaturesTableProps) => {
const columns = [
{ name: "Name", field: "name" },
{
name: "Value Type",
field: "valueType",
},
{
name: "Sample",
render: (statistics: NumericColumnSummaryStatisticType) => {
return (
<React.Fragment>
{statistics && statistics.sampleValues.join(",")}
</React.Fragment>
);
},
},
{
name: "Min/Max",
render: (statistics: NumericColumnSummaryStatisticType) => {
return statistics.min !== undefined && statistics.max !== undefined
? `${statistics.min}/${statistics.max}`
: undefined;
},
},
{ name: "zeros", field: "proportionOfZeros" },
{ name: "missing", field: "proportionMissing" },
{
name: "Sparklines",
render: (statistics: NumericColumnSummaryStatisticType) => {
if (statistics && statistics.histogram) {
return <SparklineHistogram data={statistics.histogram} />;
} else {
return "";
}
},
},
];
const getRowProps = (item: NumericColumnSummaryStatisticType) => {
return {
"data-test-subj": `row-${item.name}`,
};
};
return (
<EuiBasicTable columns={columns} items={data} rowProps={getRowProps} />
);
};
export default NumericFeaturesTable;