|
@@ -1,4 +1,4 @@
|
|
|
-import * as React from 'react';
|
|
|
+import {Component, isValidElement} from 'react';
|
|
|
import {InjectedRouter} from 'react-router';
|
|
|
import {Theme, withTheme} from '@emotion/react';
|
|
|
import type {
|
|
@@ -105,7 +105,7 @@ type State = {
|
|
|
seriesSelection: Record<string, boolean>;
|
|
|
};
|
|
|
|
|
|
-class Chart extends React.Component<ChartProps, State> {
|
|
|
+class Chart extends Component<ChartProps, State> {
|
|
|
state: State = {
|
|
|
seriesSelection: {},
|
|
|
forceUpdate: false,
|
|
@@ -210,9 +210,9 @@ class Chart extends React.Component<ChartProps, State> {
|
|
|
} = this.props;
|
|
|
const {seriesSelection} = this.state;
|
|
|
|
|
|
- let Component = this.getChartComponent();
|
|
|
+ let ChartComponent = this.getChartComponent();
|
|
|
|
|
|
- if (Component === WorldMapChart) {
|
|
|
+ if (ChartComponent === WorldMapChart) {
|
|
|
const {data, title} = processTableResults(tableData);
|
|
|
const tableSeries = [
|
|
|
{
|
|
@@ -223,7 +223,7 @@ class Chart extends React.Component<ChartProps, State> {
|
|
|
return <WorldMapChart series={tableSeries} fromDiscover={fromDiscover} />;
|
|
|
}
|
|
|
|
|
|
- Component = Component as Exclude<
|
|
|
+ ChartComponent = ChartComponent as Exclude<
|
|
|
ChartComponent,
|
|
|
React.ComponentType<WorldMapChartProps>
|
|
|
>;
|
|
@@ -341,11 +341,11 @@ class Chart extends React.Component<ChartProps, State> {
|
|
|
},
|
|
|
},
|
|
|
...(chartOptionsProp ?? {}),
|
|
|
- animation: typeof Component === typeof BarChart ? false : undefined,
|
|
|
+ animation: typeof ChartComponent === typeof BarChart ? false : undefined,
|
|
|
};
|
|
|
|
|
|
return (
|
|
|
- <Component
|
|
|
+ <ChartComponent
|
|
|
{...props}
|
|
|
{...zoomRenderProps}
|
|
|
{...chartOptions}
|
|
@@ -501,7 +501,7 @@ type ChartDataProps = {
|
|
|
topEvents?: number;
|
|
|
};
|
|
|
|
|
|
-class EventsChart extends React.Component<EventsChartProps> {
|
|
|
+class EventsChart extends Component<EventsChartProps> {
|
|
|
isStacked() {
|
|
|
const {topEvents, yAxis} = this.props;
|
|
|
return (
|
|
@@ -606,7 +606,7 @@ class EventsChart extends React.Component<EventsChartProps> {
|
|
|
>
|
|
|
<TransparentLoadingMask visible={reloading || !!reloadingAdditionalSeries} />
|
|
|
|
|
|
- {React.isValidElement(chartHeader) && chartHeader}
|
|
|
+ {isValidElement(chartHeader) && chartHeader}
|
|
|
|
|
|
<ThemedChart
|
|
|
zoomRenderProps={zoomRenderProps}
|