UNPKG

@graphique/geom-hline

Version:

For drawing horizontal lines (usually used as markers)

37 lines (34 loc) 1.6 kB
import React, { SVGAttributes } from 'react'; import { Aes } from '@graphique/graphique'; type GeomAes<Datum> = Omit<Aes<Datum>, 'x' | 'fill' | 'size'>; interface GeomProps<Datum> { /** * **data used by this Geom** * * This will overwrite top-level `data` passed to `GG` as it relates to mappings defined in `aes`. */ data?: Datum[]; /** * **functional mapping applied to `data` for this Geom** * * This extends the top-level `aes` passed to `GG`. Any repeated mappings defined here will take precedence within the Geom. */ aes?: GeomAes<Datum>; /** attributes passed to the underlying SVG elements */ attr?: SVGAttributes<SVGLineElement>; /** should this Geom have a tooltip associated with it (_default_: `true`) */ showTooltip?: boolean; /** callback called for mousemove events on the drawing area when focusing data */ onDatumFocus?: (data: Datum[], index: number[]) => void; /** callback called for click events on the drawing area when selecting focused data */ onDatumSelection?: (data: Datum[], index: number[]) => void; /** callback called for mouseleave events on the drawing area */ onExit?: () => void; /** should elements enter/update/exit with animated transitions (_default_: `true`) */ isAnimated?: boolean; } declare const GeomHLine: { <Datum>({ data: localData, aes: localAes, attr, onDatumFocus, onDatumSelection, onExit, showTooltip, isAnimated, }: GeomProps<Datum>): React.JSX.Element; displayName: string; }; export { type GeomAes, GeomHLine, type GeomProps };