@graphique/geom-vline
Version:
For drawing vertical lines (usually used as markers)
39 lines (36 loc) • 1.65 kB
TypeScript
import React, { SVGAttributes } from 'react';
import { Aes, DataValue } from '@graphique/graphique';
type GeomAes<Datum> = Omit<Aes<Datum>, 'x' | 'y' | 'fill' | 'size'> & {
x?: DataValue<Datum>;
};
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 GeomVLine: {
<Datum>({ data: localData, aes: localAes, attr, showTooltip, onDatumFocus, onDatumSelection, onExit, isAnimated, }: GeomProps<Datum>): React.JSX.Element;
displayName: string;
};
export { type GeomAes, type GeomProps, GeomVLine };