Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Ch3ri0ur committed Jun 18, 2020
1 parent 321062c commit 920013e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Expand Up @@ -161,7 +161,7 @@ const App: React.FC = () => {
<Breadcrumb.Item>Bill</Breadcrumb.Item>
</Breadcrumb> */}
<div className="site-layout-background" style={{ padding: 24, minHeight: 360 }}>
{datar ? <UChart opts={opts} data={datar} /> : null}
{datar ? <UChart opts={opts} data={datar} /> : <p>Sorry no data found.</p>}
</div>
<CustomSlider value={pValue} setValue={setPValue} min={0} max={10} name="P-Value"></CustomSlider>
<CustomSlider value={iValue} setValue={setIValue} min={0} max={10} name="I-Value"></CustomSlider>
Expand Down
24 changes: 10 additions & 14 deletions src/components/Chart/Chart.tsx
Expand Up @@ -25,23 +25,19 @@ const UChart: React.FC<Prop> = (props: Prop) => {
refy.current?.destroy();
};
}, [props.opts]);
useEffect(() => {
if (canvasMain.current) {
if (props.data.length !== 0) {
refy.current?.setData(props.data);
}
}
// return (test) => {
// test.destroy();
// };
}, [props.data]);
// useEffect(() => {
// if (canvasMain.current) {
// if (props.data.length !== 0) {
// refy.current?.setData(props.data);
// }
// }
// // return (test) => {
// // test.destroy();
// // };
// }, [props.data]);

useEffect(() => {
refy?.current?.setData(props.data);
return () => {
// renderPlot = () => {};
// cancelAnimationFrame(id);
};
}, [props.data, refy]);

const canvasStyle = {
Expand Down

0 comments on commit 920013e

Please sign in to comment.