|
|
@ -1,4 +1,4 @@ |
|
|
|
import { BarSerie, BarOptions, ChartwerkBarPod as BarPod } from '@chartwerk/bar-pod'; |
|
|
|
import { BarSerie, BarOptions, ChartwerkBarPod } from '@chartwerk/bar-pod'; |
|
|
|
|
|
|
|
|
|
|
|
import { useEffect, useRef, useState } from 'react'; |
|
|
|
import { useEffect, useRef, useState } from 'react'; |
|
|
|
|
|
|
|
|
|
|
@ -12,9 +12,9 @@ export type ChartwerkBarPodProps = { |
|
|
|
className?: string; |
|
|
|
className?: string; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export function ChartwerkBarPod(props: ChartwerkBarPodProps) { |
|
|
|
export function ChartwerkReactBarPod(props: ChartwerkBarPodProps) { |
|
|
|
|
|
|
|
|
|
|
|
const [pod, setPod] = useState<BarPod | null>(null); |
|
|
|
const [pod, setPod] = useState<ChartwerkBarPod | null>(null); |
|
|
|
const [hack, setHack] = useState<number | null>(null); |
|
|
|
const [hack, setHack] = useState<number | null>(null); |
|
|
|
|
|
|
|
|
|
|
|
const chartRef = useRef(null); |
|
|
|
const chartRef = useRef(null); |
|
|
@ -32,7 +32,7 @@ export function ChartwerkBarPod(props: ChartwerkBarPodProps) { |
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if(chart === null) { return; } |
|
|
|
if(chart === null) { return; } |
|
|
|
if(pod === null) { |
|
|
|
if(pod === null) { |
|
|
|
const newPod = new BarPod( |
|
|
|
const newPod = new ChartwerkBarPod( |
|
|
|
// @ts-ignore
|
|
|
|
// @ts-ignore
|
|
|
|
chart, |
|
|
|
chart, |
|
|
|
props.series, |
|
|
|
props.series, |
|
|
@ -60,4 +60,4 @@ export function ChartwerkBarPod(props: ChartwerkBarPodProps) { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default ChartwerkBarPod; |
|
|
|
export default ChartwerkReactBarPod; |
|
|
|