import { FunctionComponent } from 'react'; import _ from 'lodash'; import * as React from 'react'; type SummaryStatisticsTableProps = { data: any[]; labels: string[] }; export const SummaryStatisticsTable: FunctionComponent = ( props: SummaryStatisticsTableProps ) => { const headers = props.labels.length === 1 ? ( {props.labels[0]} ) : ( [, props.labels.map(label => {label})] ); return ( {headers} {props.data.map(d => ( ))} {props.data.map(d => ( ))} {props.data.map(d => ( ))} {props.data.map(d => ( ))} {props.data.map(d => ( ))}
Maximum{_.round(d.max, 2)}
75% (q3){_.round(d.q3, 2)}
Median{_.round(d.median, 2)}
25% (q1){_.round(d.q1, 2)}
Minimum{_.round(d.min, 2)}
); };