From d97b0e9b0c323e3a582b41e4f8c4293f07e60353 Mon Sep 17 00:00:00 2001 From: glitch4347 Date: Thu, 14 Dec 2023 12:32:54 +0100 Subject: [PATCH] markers++ --- react/ChartwerkLinePod.tsx | 12 ++++-------- src/index.ts | 1 - 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/react/ChartwerkLinePod.tsx b/react/ChartwerkLinePod.tsx index 1846cf0..0a82d8c 100644 --- a/react/ChartwerkLinePod.tsx +++ b/react/ChartwerkLinePod.tsx @@ -39,19 +39,14 @@ export function ChartwerkLinePod(props: ChartwerkLinePodProps) { useEffect(() => { // this function will be called on component unmount return () => { - if(pod === null) { - return; - } + if(pod === null) { return; } // @ts-ignore pod.removeEventListeners(); } }, []); useEffect(() => { - if(chart === null) { - return; - } - + if(chart === null) { return; } if(pod === null) { console.log('create chart'); console.log("markers"); @@ -63,11 +58,12 @@ export function ChartwerkLinePod(props: ChartwerkLinePodProps) { props.series, props.options, props.markers, - props.segments + // props.segments ); setPod(newPod); newPod.render(); } else { + console.log('update data'); pod.updateData(props.series, { ...props.options, }); diff --git a/src/index.ts b/src/index.ts index 91c91ed..21b6ef9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,7 +33,6 @@ class LinePod extends ChartwerkPod { ) { super(_el, _series, _options); this.series = new LineSeries(_series); - console.log('CREATE LINPOD NEW VERSION') } override renderMetrics(): void {