import type {InjectedRouter} from 'react-router'; import type {Theme} from '@emotion/react'; import type {Query} from 'history'; import ChartZoom from 'sentry/components/charts/chartZoom'; import ErrorPanel from 'sentry/components/charts/errorPanel'; import type {LineChartProps} from 'sentry/components/charts/lineChart'; import {LineChart} from 'sentry/components/charts/lineChart'; import ReleaseSeries from 'sentry/components/charts/releaseSeries'; import TransitionChart from 'sentry/components/charts/transitionChart'; import TransparentLoadingMask from 'sentry/components/charts/transparentLoadingMask'; import Placeholder from 'sentry/components/placeholder'; import {IconWarning} from 'sentry/icons'; import {t} from 'sentry/locale'; import type {Series} from 'sentry/types/echarts'; import { axisLabelFormatter, getDurationUnit, tooltipFormatter, } from 'sentry/utils/discover/charts'; import getDynamicText from 'sentry/utils/getDynamicText'; import type {NormalizedTrendsTransaction} from 'sentry/views/performance/trends/types'; import {getIntervalLine} from 'sentry/views/performance/utils/getIntervalLine'; import {transformEventStatsSmoothed} from '../../../trends/utils'; type Props = { errored: boolean; loading: boolean; queryExtra: Query; reloading: boolean; router: InjectedRouter; theme: Theme; series?: Series[]; timeFrame?: { end: number; start: number; }; transaction?: NormalizedTrendsTransaction; withBreakpoint?: boolean; } & Omit, 'children' | 'queryExtra'> & Pick; function Content({ errored, theme, series: data, timeFrame, start, end, period, projects, environments, loading, reloading, legend, utc, queryExtra, router, withBreakpoint, transaction, onLegendSelectChanged, }: Props) { if (errored) { return ( ); } const series = data ? data .map(values => { return { ...values, color: theme.purple300, lineStyle: { opacity: 0.75, width: 1, }, }; }) .reverse() : []; const needsLabel = false; const breakpointSeries = withBreakpoint ? getIntervalLine(theme, data || [], 0.5, needsLabel, transaction) : []; const durationUnit = getDurationUnit(series, legend); const chartOptions: Omit = { grid: { left: '10px', right: '10px', top: '40px', bottom: '0px', }, seriesOptions: { showSymbol: false, }, tooltip: { valueFormatter: (value: number | null) => tooltipFormatter(value, 'duration'), }, xAxis: timeFrame ? { min: timeFrame.start, max: timeFrame.end, } : undefined, yAxis: { min: 0, minInterval: durationUnit, axisLabel: { color: theme.chartLabel, formatter: (value: number) => axisLabelFormatter(value, 'duration', undefined, durationUnit), }, }, }; const {smoothedResults} = transformEventStatsSmoothed(data, t('Smoothed')); const smoothedSeries = smoothedResults ? smoothedResults.map(values => { return { ...values, color: theme.purple300, lineStyle: { opacity: 1, }, }; }) : []; return ( {zoomRenderProps => ( {({releaseSeries}) => ( {getDynamicText({ value: ( ), fixed: , })} )} )} ); } export default Content;