import React from 'react'; import { NoContent } from 'UI'; import { Styles, AvgLabel } from '../../common'; import { withRequest } from 'HOCs' import { AreaChart, Area, CartesianGrid, Tooltip, ResponsiveContainer, XAxis, YAxis } from 'recharts'; import { toUnderscore } from 'App/utils'; import { NO_METRIC_DATA } from 'App/constants/messages' const WIDGET_KEY = 'timeToRender'; interface Props { data: any optionsLoading: any fetchOptions: any options: any metric?: any } function TimeToRender(props: Props) { const { data, optionsLoading, metric } = props; const gradientDef = Styles.gradientDef(); const onSelect = (params) => { // const _params = { density: 70 } // TODO reload the data with new params; // this.props.fetchWidget(WIDGET_KEY, dashbaordStore.period, props.platform, { ..._params, url: params.value }) } return ( <>
{/* */}
{gradientDef} Styles.tickFormatter(val)} label={{ ...Styles.axisLabelLeft, value: "Time to Render (ms)" }} />
); } export default withRequest({ dataName: "options", initialData: [], dataWrapper: data => data, loadingName: 'optionsLoading', requestName: "fetchOptions", endpoint: '/dashboard/' + toUnderscore(WIDGET_KEY) + '/search', method: 'GET' })(TimeToRender)