import React from 'react'; import { Intergalactic } from 'intergalactic/core'; import { Flex } from 'intergalactic/flex-box'; import { ScaleBand, ScaleLinear, ScaleTime } from 'd3-scale'; import { BaseChartProps } from './AbstractChart.type'; import { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type'; type TrendItem = { x: number; y: number; }; type BarKey = string; export type BarChartData = Array>; export type BarChartProps = BaseChartProps & { groupKey: string; xScale?: ScaleBand | ScaleTime; yScale?: ScaleLinear; type?: 'stack' | 'group'; trend?: Record; /** Handle click by `HoverRect`. `index` is an index of the data array. */ onClickHoverRect?: (index: number, e: React.SyntheticEvent) => void; /** Handle click by Bar. */ onClickBar?: (barItem: number, barKey: BarKey, e: React.SyntheticEvent) => void; }; export type BarChartType = Intergalactic.Component; export {};