import * as React from "react"; import { GenericChartComponent } from "@react-financial-charts/core"; export interface AnnotateProps { readonly className?: string; readonly with: React.ElementType; readonly when: (value: any, index: number, array: any[]) => boolean; readonly usingProps?: any; } export class Annotate extends React.Component { public static defaultProps = { className: "react-financial-charts-enable-interaction react-financial-charts-annotate react-financial-charts-default-cursor", }; public render() { return ; } private readonly renderSVG = (moreProps: any) => { const { xAccessor, xScale, chartConfig: { yScale }, plotData, } = moreProps; const { className, usingProps, with: Annotation, when } = this.props; const data = (plotData as unknown[]).filter(when); return ( {data.map((d, idx) => { return ( ); })} ); }; }