Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
useEffect(() => {
// 第一次时初始化
chartRef.current || (chartRef.current = new Charts(domRef.current))
const mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {})
chartRef.current.setOption(getRingOption(mergedConfig), true)
let activeIndex = 0
function * loop() {
while (true) {
setState({ mergedConfig, activeIndex })
const option = getOption(mergedConfig, activeIndex)
chartRef.current.setOption(option, true)
const { activeTimeGap, data } = option.series[0]
useEffect(() => {
chartInstanceofRef.current ||
(chartInstanceofRef.current = new Chart(chartRef.current))
chartInstanceofRef.current.setOption(option || {}, true)
}, [option])