chore: dark config

This commit is contained in:
jialin
2025-04-28 10:05:06 +08:00
parent d4d7148f16
commit ce9c31f368
35 changed files with 678 additions and 399 deletions
+11 -19
View File
@@ -1,5 +1,5 @@
import { throttle } from 'lodash';
import {
import React, {
forwardRef,
useCallback,
useEffect,
@@ -36,13 +36,16 @@ const Chart: React.FC<{
chart.current?.resize();
}, []);
const setOption = useCallback((options: ECOption) => {
chart.current?.clear();
chart.current?.setOption(options, {
notMerge: true,
lazyUpdate: true
});
}, []);
const setOption = useCallback(
(options: ECOption) => {
chart.current?.clear();
chart.current?.setOption(options, {
notMerge: true,
lazyUpdate: true
});
},
[options]
);
useEffect(() => {
if (container.current) {
@@ -79,17 +82,6 @@ const Chart: React.FC<{
};
}, []);
// resize on window resize
// useEffect(() => {
// const handleResize = throttle(() => {
// chart.current?.resize();
// }, 100);
// window.addEventListener('resize', handleResize);
// return () => {
// window.removeEventListener('resize', handleResize);
// };
// }, []);
return (
<div className="chart-wrapper" style={{ width: width, height }}>
<div ref={container} style={{ width: width, height }}></div>