import { ComponentProps } from 'react' ; import { ChartType } from '../..' ; import { SpecType } from '../../../specs/constants' ; import { buildSFProps , SFProps , useSpecFactory } from '../../../state/spec_factory' ; import { stripUndefined } from '../../../utils/common' ; import { DEFAULT_ANNOTATION_LINE_STYLE } from '../../../utils/themes/merge_utils' ; import { LineAnnotationSpec , DEFAULT_GLOBAL_ID , AnnotationType } from '../utils/specs' ; const buildProps = buildSFProps < LineAnnotationSpec > ( ) ( { chartType : ChartType . XYAxis , specType : SpecType . Annotation , } , { groupId : DEFAULT_GLOBAL_ID , annotationType : AnnotationType . Line , style : DEFAULT_ANNOTATION_LINE_STYLE , hideLines : false , hideTooltips : false , hideLinesTooltips : true , zIndex : 1 , } ) ; public export const LineAnnotation = function < D = any > ( props ) { const { defaults , overrides } = buildProps ; useSpecFactory < LineAnnotationSpec < D > > ( { ... defaults , ... stripUndefined ( props ) , ... overrides } ) ; return null ; } ; public export type LineAnnotationProps = ComponentProps < typeof LineAnnotation > ;