performance.tsx 966 B

123456789101112131415161718192021222324252627
  1. import {transformToLineSeries} from 'sentry/components/charts/lineChart';
  2. import getBreakpointChartOptionsFromData, {
  3. type EventBreakpointChartData,
  4. } from 'sentry/components/events/eventStatisticalDetector/breakpointChartOptions';
  5. import {lightTheme as theme} from 'sentry/utils/theme';
  6. import {slackChartDefaults, slackChartSize} from './slack';
  7. import type {RenderDescriptor} from './types';
  8. import {ChartType} from './types';
  9. export const performanceCharts: RenderDescriptor<ChartType>[] = [];
  10. performanceCharts.push({
  11. key: ChartType.SLACK_PERFORMANCE_ENDPOINT_REGRESSION,
  12. getOption: (data: EventBreakpointChartData) => {
  13. const {chartOptions, series} = getBreakpointChartOptionsFromData(data, theme);
  14. const transformedSeries = transformToLineSeries({series});
  15. return {
  16. ...chartOptions,
  17. backgroundColor: theme.background,
  18. series: transformedSeries,
  19. grid: slackChartDefaults.grid,
  20. };
  21. },
  22. ...slackChartSize,
  23. });