chart.tsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. import type React from 'react';
  2. import {Component} from 'react';
  3. import type {Theme} from '@emotion/react';
  4. import {withTheme} from '@emotion/react';
  5. import styled from '@emotion/styled';
  6. import type {DataZoomComponentOption, LegendComponentOption} from 'echarts';
  7. import type {Location} from 'history';
  8. import isEqual from 'lodash/isEqual';
  9. import omit from 'lodash/omit';
  10. import {AreaChart} from 'sentry/components/charts/areaChart';
  11. import {BarChart} from 'sentry/components/charts/barChart';
  12. import ChartZoom from 'sentry/components/charts/chartZoom';
  13. import ErrorPanel from 'sentry/components/charts/errorPanel';
  14. import {LineChart} from 'sentry/components/charts/lineChart';
  15. import ReleaseSeries from 'sentry/components/charts/releaseSeries';
  16. import SimpleTableChart from 'sentry/components/charts/simpleTableChart';
  17. import TransitionChart from 'sentry/components/charts/transitionChart';
  18. import TransparentLoadingMask from 'sentry/components/charts/transparentLoadingMask';
  19. import {getSeriesSelection, isChartHovered} from 'sentry/components/charts/utils';
  20. import LoadingIndicator from 'sentry/components/loadingIndicator';
  21. import type {PlaceholderProps} from 'sentry/components/placeholder';
  22. import Placeholder from 'sentry/components/placeholder';
  23. import {IconWarning} from 'sentry/icons';
  24. import {space} from 'sentry/styles/space';
  25. import type {PageFilters} from 'sentry/types/core';
  26. import type {
  27. EChartDataZoomHandler,
  28. EChartEventHandler,
  29. ReactEchartsRef,
  30. } from 'sentry/types/echarts';
  31. import type {Organization} from 'sentry/types/organization';
  32. import {defined} from 'sentry/utils';
  33. import {
  34. axisLabelFormatter,
  35. axisLabelFormatterUsingAggregateOutputType,
  36. getDurationUnit,
  37. tooltipFormatter,
  38. } from 'sentry/utils/discover/charts';
  39. import type {EventsMetaType} from 'sentry/utils/discover/eventView';
  40. import type {AggregationOutputType} from 'sentry/utils/discover/fields';
  41. import {
  42. aggregateOutputType,
  43. getAggregateArg,
  44. getEquation,
  45. getMeasurementSlug,
  46. isEquation,
  47. maybeEquationAlias,
  48. stripDerivedMetricsPrefix,
  49. stripEquationPrefix,
  50. } from 'sentry/utils/discover/fields';
  51. import getDynamicText from 'sentry/utils/getDynamicText';
  52. import {eventViewFromWidget} from 'sentry/views/dashboards/utils';
  53. import {getBucketSize} from 'sentry/views/dashboards/widgetCard/utils';
  54. import WidgetLegendNameEncoderDecoder from 'sentry/views/dashboards/widgetLegendNameEncoderDecoder';
  55. import {getFormatter} from '../../../components/charts/components/tooltip';
  56. import {getDatasetConfig} from '../datasetConfig/base';
  57. import type {Widget} from '../types';
  58. import {DisplayType} from '../types';
  59. import type WidgetLegendSelectionState from '../widgetLegendSelectionState';
  60. import {BigNumberWidgetVisualization} from '../widgets/bigNumberWidget/bigNumberWidgetVisualization';
  61. import type {GenericWidgetQueriesChildrenProps} from './genericWidgetQueries';
  62. const OTHER = 'Other';
  63. const PERCENTAGE_DECIMAL_POINTS = 3;
  64. export const SLIDER_HEIGHT = 60;
  65. export type AugmentedEChartDataZoomHandler = (
  66. params: Parameters<EChartDataZoomHandler>[0] & {
  67. seriesEnd: string | number;
  68. seriesStart: string | number;
  69. },
  70. instance: Parameters<EChartDataZoomHandler>[1]
  71. ) => void;
  72. type TableResultProps = Pick<
  73. GenericWidgetQueriesChildrenProps,
  74. 'errorMessage' | 'loading' | 'tableResults'
  75. >;
  76. type WidgetCardChartProps = Pick<
  77. GenericWidgetQueriesChildrenProps,
  78. 'timeseriesResults' | 'tableResults' | 'errorMessage' | 'loading'
  79. > & {
  80. location: Location;
  81. organization: Organization;
  82. selection: PageFilters;
  83. theme: Theme;
  84. widget: Widget;
  85. widgetLegendState: WidgetLegendSelectionState;
  86. chartGroup?: string;
  87. chartZoomOptions?: DataZoomComponentOption;
  88. expandNumbers?: boolean;
  89. isMobile?: boolean;
  90. legendOptions?: LegendComponentOption;
  91. noPadding?: boolean;
  92. onLegendSelectChanged?: EChartEventHandler<{
  93. name: string;
  94. selected: Record<string, boolean>;
  95. type: 'legendselectchanged';
  96. }>;
  97. onZoom?: AugmentedEChartDataZoomHandler;
  98. shouldResize?: boolean;
  99. showSlider?: boolean;
  100. timeseriesResultsTypes?: Record<string, AggregationOutputType>;
  101. windowWidth?: number;
  102. };
  103. class WidgetCardChart extends Component<WidgetCardChartProps> {
  104. shouldComponentUpdate(nextProps: WidgetCardChartProps): boolean {
  105. if (
  106. this.props.widget.displayType === DisplayType.BIG_NUMBER &&
  107. nextProps.widget.displayType === DisplayType.BIG_NUMBER &&
  108. (this.props.windowWidth !== nextProps.windowWidth ||
  109. !isEqual(this.props.widget?.layout, nextProps.widget?.layout))
  110. ) {
  111. return true;
  112. }
  113. // Widget title changes should not update the WidgetCardChart component tree
  114. const currentProps = {
  115. ...omit(this.props, ['windowWidth']),
  116. widget: {
  117. ...this.props.widget,
  118. title: '',
  119. },
  120. };
  121. nextProps = {
  122. ...omit(nextProps, ['windowWidth']),
  123. widget: {
  124. ...nextProps.widget,
  125. title: '',
  126. },
  127. };
  128. return !isEqual(currentProps, nextProps);
  129. }
  130. tableResultComponent({
  131. loading,
  132. errorMessage,
  133. tableResults,
  134. }: TableResultProps): React.ReactNode {
  135. const {location, widget, selection} = this.props;
  136. if (errorMessage) {
  137. return (
  138. <StyledErrorPanel>
  139. <IconWarning color="gray500" size="lg" />
  140. </StyledErrorPanel>
  141. );
  142. }
  143. if (typeof tableResults === 'undefined') {
  144. // Align height to other charts.
  145. return <LoadingPlaceholder />;
  146. }
  147. const datasetConfig = getDatasetConfig(widget.widgetType);
  148. return tableResults.map((result, i) => {
  149. const fields = widget.queries[i]?.fields?.map(stripDerivedMetricsPrefix) ?? [];
  150. const fieldAliases = widget.queries[i]?.fieldAliases ?? [];
  151. const eventView = eventViewFromWidget(widget.title, widget.queries[0], selection);
  152. return (
  153. <TableWrapper key={`table:${result.title}`}>
  154. <StyledSimpleTableChart
  155. eventView={eventView}
  156. fieldAliases={fieldAliases}
  157. location={location}
  158. fields={fields}
  159. title={tableResults.length > 1 ? result.title : ''}
  160. loading={loading}
  161. loader={<LoadingPlaceholder />}
  162. metadata={result.meta}
  163. data={result.data}
  164. stickyHeaders
  165. fieldHeaderMap={datasetConfig.getFieldHeaderMap?.(widget.queries[i])}
  166. getCustomFieldRenderer={datasetConfig.getCustomFieldRenderer}
  167. />
  168. </TableWrapper>
  169. );
  170. });
  171. }
  172. bigNumberComponent({
  173. loading,
  174. errorMessage,
  175. tableResults,
  176. }: TableResultProps): React.ReactNode {
  177. if (errorMessage) {
  178. return (
  179. <StyledErrorPanel>
  180. <IconWarning color="gray500" size="lg" />
  181. </StyledErrorPanel>
  182. );
  183. }
  184. if (typeof tableResults === 'undefined' || loading) {
  185. return <BigNumber>{'\u2014'}</BigNumber>;
  186. }
  187. const {widget} = this.props;
  188. return tableResults.map((result, i) => {
  189. const tableMeta = {...result.meta};
  190. const fields = Object.keys(tableMeta?.fields ?? {});
  191. let field = fields[0];
  192. let selectedField = field;
  193. if (defined(widget.queries[0].selectedAggregate)) {
  194. const index = widget.queries[0].selectedAggregate;
  195. selectedField = widget.queries[0].aggregates[index];
  196. if (fields.includes(selectedField)) {
  197. field = selectedField;
  198. }
  199. }
  200. const data = result?.data;
  201. const meta = result?.meta as EventsMetaType;
  202. const value = data?.[0]?.[selectedField];
  203. if (
  204. !field ||
  205. !result.data?.length ||
  206. selectedField === 'equation|' ||
  207. selectedField === '' ||
  208. !defined(value) ||
  209. !Number.isFinite(value) ||
  210. Number.isNaN(value)
  211. ) {
  212. return <BigNumber key={`big_number:${result.title}`}>{'\u2014'}</BigNumber>;
  213. }
  214. return (
  215. <BigNumberWidgetVisualization
  216. key={i}
  217. field={field}
  218. value={value}
  219. meta={meta}
  220. thresholds={widget.thresholds ?? undefined}
  221. preferredPolarity="-"
  222. />
  223. );
  224. });
  225. }
  226. chartRef: ReactEchartsRef | null = null;
  227. handleRef = (chartRef: ReactEchartsRef): void => {
  228. if (chartRef && !this.chartRef) {
  229. this.chartRef = chartRef;
  230. // add chart to the group so that it has synced cursors
  231. const instance = chartRef.getEchartsInstance?.();
  232. if (instance && !instance.group && this.props.chartGroup) {
  233. instance.group = this.props.chartGroup;
  234. }
  235. }
  236. if (!chartRef) {
  237. this.chartRef = null;
  238. }
  239. };
  240. chartComponent(chartProps): React.ReactNode {
  241. const {widget} = this.props;
  242. const stacked = widget.queries[0]?.columns.length > 0;
  243. switch (widget.displayType) {
  244. case 'bar':
  245. return <BarChart {...chartProps} stacked={stacked} />;
  246. case 'area':
  247. case 'top_n':
  248. return <AreaChart stacked {...chartProps} />;
  249. case 'line':
  250. default:
  251. return <LineChart {...chartProps} />;
  252. }
  253. }
  254. render() {
  255. const {
  256. theme,
  257. tableResults,
  258. timeseriesResults,
  259. errorMessage,
  260. loading,
  261. widget,
  262. onZoom,
  263. legendOptions,
  264. showSlider,
  265. noPadding,
  266. chartZoomOptions,
  267. timeseriesResultsTypes,
  268. shouldResize,
  269. } = this.props;
  270. if (widget.displayType === 'table') {
  271. return getDynamicText({
  272. value: (
  273. <TransitionChart loading={loading} reloading={loading}>
  274. <LoadingScreen loading={loading} />
  275. {this.tableResultComponent({tableResults, loading, errorMessage})}
  276. </TransitionChart>
  277. ),
  278. fixed: <Placeholder height="200px" testId="skeleton-ui" />,
  279. });
  280. }
  281. if (widget.displayType === 'big_number') {
  282. return (
  283. <TransitionChart loading={loading} reloading={loading}>
  284. <LoadingScreen loading={loading} />
  285. <BigNumberResizeWrapper>
  286. {this.bigNumberComponent({tableResults, loading, errorMessage})}
  287. </BigNumberResizeWrapper>
  288. </TransitionChart>
  289. );
  290. }
  291. if (errorMessage) {
  292. return (
  293. <StyledErrorPanel>
  294. <IconWarning color="gray500" size="lg" />
  295. </StyledErrorPanel>
  296. );
  297. }
  298. const {location, selection, onLegendSelectChanged, widgetLegendState} = this.props;
  299. const {start, end, period, utc} = selection.datetime;
  300. const {projects, environments} = selection;
  301. const legend = {
  302. left: 0,
  303. top: 0,
  304. selected: getSeriesSelection(location),
  305. formatter: (seriesName: string) => {
  306. seriesName = WidgetLegendNameEncoderDecoder.decodeSeriesNameForLegend(seriesName);
  307. const arg = getAggregateArg(seriesName);
  308. if (arg !== null) {
  309. const slug = getMeasurementSlug(arg);
  310. if (slug !== null) {
  311. seriesName = slug.toUpperCase();
  312. }
  313. }
  314. if (maybeEquationAlias(seriesName)) {
  315. seriesName = stripEquationPrefix(seriesName);
  316. }
  317. return seriesName;
  318. },
  319. ...legendOptions,
  320. };
  321. const axisField = widget.queries[0]?.aggregates?.[0] ?? 'count()';
  322. const axisLabel = isEquation(axisField) ? getEquation(axisField) : axisField;
  323. // Check to see if all series output types are the same. If not, then default to number.
  324. const outputType =
  325. timeseriesResultsTypes && new Set(Object.values(timeseriesResultsTypes)).size === 1
  326. ? timeseriesResultsTypes[axisLabel]
  327. : 'number';
  328. const isDurationChart = outputType === 'duration';
  329. const durationUnit = isDurationChart
  330. ? timeseriesResults && getDurationUnit(timeseriesResults, legendOptions)
  331. : undefined;
  332. const bucketSize = getBucketSize(timeseriesResults);
  333. const valueFormatter = (value: number, seriesName?: string) => {
  334. const decodedSeriesName = seriesName
  335. ? WidgetLegendNameEncoderDecoder.decodeSeriesNameForLegend(seriesName)
  336. : seriesName;
  337. const aggregateName = decodedSeriesName?.split(':').pop()?.trim();
  338. if (aggregateName) {
  339. return timeseriesResultsTypes
  340. ? tooltipFormatter(value, timeseriesResultsTypes[aggregateName])
  341. : tooltipFormatter(value, aggregateOutputType(aggregateName));
  342. }
  343. return tooltipFormatter(value, 'number');
  344. };
  345. const nameFormatter = (name: string) => {
  346. return WidgetLegendNameEncoderDecoder.decodeSeriesNameForLegend(name);
  347. };
  348. const chartOptions = {
  349. autoHeightResize: shouldResize ?? true,
  350. grid: {
  351. left: 0,
  352. right: 4,
  353. top: '40px',
  354. bottom: showSlider ? SLIDER_HEIGHT : 0,
  355. },
  356. seriesOptions: {
  357. showSymbol: false,
  358. },
  359. tooltip: {
  360. trigger: 'axis',
  361. axisPointer: {
  362. type: 'cross',
  363. },
  364. formatter: (params, asyncTicket) => {
  365. const {chartGroup} = this.props;
  366. const isInGroup =
  367. chartGroup && chartGroup === this.chartRef?.getEchartsInstance().group;
  368. // tooltip is triggered whenever any chart in the group is hovered,
  369. // so we need to check if the mouse is actually over this chart
  370. if (isInGroup && !isChartHovered(this.chartRef)) {
  371. return '';
  372. }
  373. return getFormatter({
  374. valueFormatter,
  375. nameFormatter,
  376. isGroupedByDate: true,
  377. bucketSize,
  378. addSecondsToTimeFormat: false,
  379. showTimeInTooltip: true,
  380. })(params, asyncTicket);
  381. },
  382. },
  383. yAxis: {
  384. axisLabel: {
  385. color: theme.chartLabel,
  386. formatter: (value: number) => {
  387. if (timeseriesResultsTypes) {
  388. return axisLabelFormatterUsingAggregateOutputType(
  389. value,
  390. outputType,
  391. true,
  392. durationUnit,
  393. undefined,
  394. PERCENTAGE_DECIMAL_POINTS
  395. );
  396. }
  397. return axisLabelFormatter(
  398. value,
  399. aggregateOutputType(axisLabel),
  400. true,
  401. undefined,
  402. undefined,
  403. PERCENTAGE_DECIMAL_POINTS
  404. );
  405. },
  406. },
  407. axisPointer: {
  408. type: 'line',
  409. snap: false,
  410. lineStyle: {
  411. type: 'solid',
  412. width: 0.5,
  413. },
  414. label: {
  415. show: false,
  416. },
  417. },
  418. minInterval: durationUnit ?? 0,
  419. },
  420. xAxis: {
  421. axisPointer: {
  422. snap: true,
  423. },
  424. },
  425. };
  426. return (
  427. <ChartZoom
  428. period={period}
  429. start={start}
  430. end={end}
  431. utc={utc}
  432. showSlider={showSlider}
  433. chartZoomOptions={chartZoomOptions}
  434. >
  435. {zoomRenderProps => {
  436. if (errorMessage) {
  437. return (
  438. <StyledErrorPanel>
  439. <IconWarning color="gray500" size="lg" />
  440. </StyledErrorPanel>
  441. );
  442. }
  443. const otherRegex = new RegExp(`(?:.* : ${OTHER}$)|^${OTHER}$`);
  444. const shouldColorOther = timeseriesResults?.some(({seriesName}) =>
  445. seriesName?.match(otherRegex)
  446. );
  447. const colors = timeseriesResults
  448. ? theme.charts.getColorPalette(
  449. timeseriesResults.length - (shouldColorOther ? 3 : 2)
  450. )
  451. : [];
  452. // TODO(wmak): Need to change this when updating dashboards to support variable topEvents
  453. if (shouldColorOther) {
  454. colors[colors.length] = theme.chartOther;
  455. }
  456. // Create a list of series based on the order of the fields,
  457. const series = timeseriesResults
  458. ? timeseriesResults
  459. .map((values, i: number) => {
  460. let seriesName = '';
  461. if (values.seriesName !== undefined) {
  462. seriesName = isEquation(values.seriesName)
  463. ? getEquation(values.seriesName)
  464. : values.seriesName;
  465. }
  466. return {
  467. ...values,
  468. seriesName,
  469. color: colors[i],
  470. };
  471. })
  472. .filter(Boolean) // NOTE: `timeseriesResults` is a sparse array! We have to filter out the empty slots after the colors are assigned, since the colors are assigned based on sparse array index
  473. : [];
  474. const seriesStart = series[0]?.data[0]?.name;
  475. const seriesEnd = series[0]?.data[series[0].data.length - 1]?.name;
  476. const forwardedRef = this.props.chartGroup ? this.handleRef : undefined;
  477. return widgetLegendState.widgetRequiresLegendUnselection(widget) ? (
  478. <ReleaseSeries
  479. end={end}
  480. start={start}
  481. period={period}
  482. environments={environments}
  483. projects={projects}
  484. memoized
  485. >
  486. {({releaseSeries}) => {
  487. // make series name into seriesName:widgetId form for individual widget legend control
  488. // NOTE: e-charts legends control all charts that have the same series name so attaching
  489. // widget id will differentiate the charts allowing them to be controlled individually
  490. const modifiedReleaseSeriesResults =
  491. WidgetLegendNameEncoderDecoder.modifyTimeseriesNames(
  492. widget,
  493. releaseSeries
  494. );
  495. return (
  496. <TransitionChart loading={loading} reloading={loading}>
  497. <LoadingScreen loading={loading} />
  498. <ChartWrapper
  499. autoHeightResize={shouldResize ?? true}
  500. noPadding={noPadding}
  501. >
  502. {getDynamicText({
  503. value: this.chartComponent({
  504. ...zoomRenderProps,
  505. ...chartOptions,
  506. // Override default datazoom behaviour for updating Global Selection Header
  507. ...(onZoom
  508. ? {
  509. onDataZoom: (evt, chartProps) =>
  510. // Need to pass seriesStart and seriesEnd to onZoom since slider zooms
  511. // callback with percentage instead of datetime values. Passing seriesStart
  512. // and seriesEnd allows calculating datetime values with percentage.
  513. onZoom({...evt, seriesStart, seriesEnd}, chartProps),
  514. }
  515. : {}),
  516. legend,
  517. series: [...series, ...(modifiedReleaseSeriesResults ?? [])],
  518. onLegendSelectChanged,
  519. forwardedRef,
  520. }),
  521. fixed: <Placeholder height="200px" testId="skeleton-ui" />,
  522. })}
  523. </ChartWrapper>
  524. </TransitionChart>
  525. );
  526. }}
  527. </ReleaseSeries>
  528. ) : (
  529. <TransitionChart loading={loading} reloading={loading}>
  530. <LoadingScreen loading={loading} />
  531. <ChartWrapper autoHeightResize={shouldResize ?? true} noPadding={noPadding}>
  532. {getDynamicText({
  533. value: this.chartComponent({
  534. ...zoomRenderProps,
  535. ...chartOptions,
  536. // Override default datazoom behaviour for updating Global Selection Header
  537. ...(onZoom
  538. ? {
  539. onDataZoom: (evt, chartProps) =>
  540. // Need to pass seriesStart and seriesEnd to onZoom since slider zooms
  541. // callback with percentage instead of datetime values. Passing seriesStart
  542. // and seriesEnd allows calculating datetime values with percentage.
  543. onZoom({...evt, seriesStart, seriesEnd}, chartProps),
  544. }
  545. : {}),
  546. legend,
  547. series,
  548. onLegendSelectChanged,
  549. forwardedRef,
  550. }),
  551. fixed: <Placeholder height="200px" testId="skeleton-ui" />,
  552. })}
  553. </ChartWrapper>
  554. </TransitionChart>
  555. );
  556. }}
  557. </ChartZoom>
  558. );
  559. }
  560. }
  561. export default withTheme(WidgetCardChart);
  562. const StyledTransparentLoadingMask = styled(props => (
  563. <TransparentLoadingMask {...props} maskBackgroundColor="transparent" />
  564. ))`
  565. display: flex;
  566. justify-content: center;
  567. align-items: center;
  568. `;
  569. function LoadingScreen({loading}: {loading: boolean}) {
  570. if (!loading) {
  571. return null;
  572. }
  573. return (
  574. <StyledTransparentLoadingMask visible={loading}>
  575. <LoadingIndicator mini />
  576. </StyledTransparentLoadingMask>
  577. );
  578. }
  579. const LoadingPlaceholder = styled(({className}: PlaceholderProps) => (
  580. <Placeholder height="200px" className={className} />
  581. ))`
  582. background-color: ${p => p.theme.surface300};
  583. `;
  584. const BigNumberResizeWrapper = styled('div')`
  585. flex-grow: 1;
  586. overflow: hidden;
  587. position: relative;
  588. `;
  589. const BigNumber = styled('div')`
  590. line-height: 1;
  591. display: inline-flex;
  592. flex: 1;
  593. width: 100%;
  594. min-height: 0;
  595. font-size: 32px;
  596. color: ${p => p.theme.headingColor};
  597. padding: ${space(1)} ${space(3)} ${space(3)} ${space(3)};
  598. * {
  599. text-align: left !important;
  600. }
  601. `;
  602. const ChartWrapper = styled('div')<{autoHeightResize: boolean; noPadding?: boolean}>`
  603. ${p => p.autoHeightResize && 'height: 100%;'}
  604. width: 100%;
  605. padding: ${p => (p.noPadding ? `0` : `0 ${space(2)} ${space(2)}`)};
  606. `;
  607. const TableWrapper = styled('div')`
  608. margin-top: ${space(1.5)};
  609. min-height: 0;
  610. border-bottom-left-radius: ${p => p.theme.borderRadius};
  611. border-bottom-right-radius: ${p => p.theme.borderRadius};
  612. `;
  613. const StyledSimpleTableChart = styled(SimpleTableChart)`
  614. overflow: auto;
  615. height: 100%;
  616. `;
  617. const StyledErrorPanel = styled(ErrorPanel)`
  618. padding: ${space(2)};
  619. `;