diff --git a/src/components/ActiveChart/index.js b/src/components/ActiveChart/index.js index c14c061e8b3c43b6e7d469a89923efc9eef68dbc..a7bf0bfc783da2102f5b307f59d25ade869937f7 100644 --- a/src/components/ActiveChart/index.js +++ b/src/components/ActiveChart/index.js @@ -33,18 +33,16 @@ export default class ActiveChart extends Component { } loopData = () => { - this.requestRef = requestAnimationFrame(() => { - this.timer = setTimeout(() => { - this.setState( - { - activeData: getActiveData(), - }, - () => { - this.loopData(); - } - ); - }, 1000); - }); + this.timer = setTimeout(() => { + this.setState( + { + activeData: getActiveData(), + }, + () => { + this.loopData(); + } + ); + }, 500); }; render() { diff --git a/src/components/Charts/AsyncLoadBizCharts.js b/src/components/Charts/AsyncLoadBizCharts.js index 274bea5664541040c7759abf8a77d42efb41f425..8d9a2cd059b692da7a7848f71c269610a9d534c1 100644 --- a/src/components/Charts/AsyncLoadBizCharts.js +++ b/src/components/Charts/AsyncLoadBizCharts.js @@ -24,8 +24,10 @@ class AsyncLoadBizCharts extends React.Component { async componentDidMount() { await loadBizCharts(); - this.setState({ - loading: false, + requestAnimationFrame(() => { + this.setState({ + loading: false, + }); }); } diff --git a/src/components/Charts/index.js b/src/components/Charts/index.js index 081663b38f0d632db9d359496e18442416e1ff3d..56a1c565f4a162f4ef0cee14b39116596ed9a9f0 100644 --- a/src/components/Charts/index.js +++ b/src/components/Charts/index.js @@ -1,11 +1,12 @@ import React, { Suspense } from 'react'; import numeral from 'numeral'; import ChartCard from './ChartCard'; +import Field from './Field'; const getComponent = Component => { return props => { return ( - + ); @@ -19,7 +20,6 @@ const Gauge = getComponent(React.lazy(() => import('./Gauge'))); const MiniArea = getComponent(React.lazy(() => import('./MiniArea'))); const MiniBar = getComponent(React.lazy(() => import('./MiniBar'))); const MiniProgress = getComponent(React.lazy(() => import('./MiniProgress'))); -const Field = getComponent(React.lazy(() => import('./Field'))); const WaterWave = getComponent(React.lazy(() => import('./WaterWave'))); const TagCloud = getComponent(React.lazy(() => import('./TagCloud'))); const TimelineChart = getComponent(React.lazy(() => import('./TimelineChart'))); diff --git a/src/pages/Dashboard/Analysis.js b/src/pages/Dashboard/Analysis.js index 11fa66adc1b25ca11dbbcac46c6dfa357b2c9d5b..cceab9bdcdf5ba8356f6f59462aea6529a78e2fa 100644 --- a/src/pages/Dashboard/Analysis.js +++ b/src/pages/Dashboard/Analysis.js @@ -25,7 +25,6 @@ class Analysis extends Component { }; componentDidMount() { - console.log('run'); const { dispatch } = this.props; this.reqRef = requestAnimationFrame(() => { dispatch({