import type { CSSProperties } from 'react'; import { useChartData } from '../../context/ChartContext.js'; import { formatNumber } from '../../utility/formatNumber.js'; interface IntegralIndicatorProps { value: number | undefined; format: string; width: number; opacity?: number; } const styles: Record<'text' | 'path', CSSProperties> = { text: { fontSize: '11px', fill: 'black', }, path: { fill: 'none', strokeWidth: '1px', shapeRendering: 'crispEdges', stroke: 'black', }, }; export function IntegralIndicator(props: IntegralIndicatorProps) { const { value, width, format, opacity = 1 } = props; const { height, margin } = useChartData(); const bottom = height - margin.bottom; return ( {value ? formatNumber(value, format) : ''} ); }