mirror of
https://github.com/zoo-labs/zoo.git
synced 2026-11-10 22:32:34 +00:00
28 lines
583 B
TypeScript
28 lines
583 B
TypeScript
import AutoSizer from 'react-virtualized-auto-sizer'
|
|
import Curves from './Curves'
|
|
|
|
interface ScrollableGraphProps {
|
|
compact?: boolean
|
|
margin?: {
|
|
top: number
|
|
right: number
|
|
bottom: number
|
|
left: number
|
|
}
|
|
data: any
|
|
title?: string
|
|
labels?: string[]
|
|
note?: string
|
|
colors?: any[]
|
|
}
|
|
|
|
export default function ScrollableGraph(props: ScrollableGraphProps) {
|
|
return (
|
|
<>
|
|
{props.data && props.data[0]?.length !== 0 && (
|
|
<AutoSizer>{({ width, height }) => <Curves {...props} width={width} height={height} />}</AutoSizer>
|
|
)}
|
|
</>
|
|
)
|
|
}
|