import type React from 'react'; import type { VizAppearance } from '@splunk/visualizations-shared/themeUtils'; export interface SparkLineProps { /** UDF-selected visualization appearance. */ appearance?: VizAppearance; /** If true, data can contain `null` as a value and is treated as `0`. If false, this throws error when data contains `null`. */ acceptNull?: boolean; /** Array of numbers. These data numbers are converted to points and show on sparkline. */ data?: (number | null)[]; /** A React ref which is set to the DOM element when the component mounts and `null` when it unmounts. */ elementRef?: React.Ref; /** Sets the number of end dots to display. When showEndDot is set to `true`, endDotCount is at least 1. If set to a positive value, this overrides showEndDot. */ endDotCount?: number; /** Fills color to the end dot. */ endDotFillColor?: string; /** Sets end dot radius. End dot radius must be less than or equal to the margin. By default, its value equals the margin. */ endDotRadius?: number; /** Sets end dot circle stroke color. */ endDotStroke?: string; /** Sets end dot circle stroke width in pixels. */ endDotStrokeWidth?: number; /** Fills color to area. */ fillColor?: string; /** Default fill opacity used when fillOpacity is not provided. */ defaultFillOpacity?: string; /** Fills opacity to area. Value must be in 0 ~ 1. */ fillOpacity?: string; /** Applies a vertical gradient to the area fill using the fill color and a transparent endpoint. */ fillGradient?: { startOffset: string; endOffset: string; }; /** Sets cursor stroke color. */ cursorStroke?: string; /** Sets cursor stroke width in pixels. */ cursorStrokeWidth?: number; /** Sets cursor line cap style. */ cursorStrokeLinecap?: 'butt' | 'round' | 'square'; /** Sets cursor dash array style. */ cursorStrokeDasharray?: string; /** Container height. If this value is specified, sparkline calculates the size using this height. */ height: number; /** When set to `true`, sparkline shows as area. */ isArea?: boolean; /** The sparkline line color. */ lineColor?: string; /** Allows user to draw only the last data points for the line. */ lineLength?: number; /** The sparkline line stroke width in pixels. */ lineStrokeWidth?: number; /** Enable to show end dot. */ showEndDot?: boolean; /** Enable to show tooltip. */ showTooltip?: boolean; /** Sets the data value range and maximum value shown on sparkline. */ yMax?: number; /** Sets the data value range and minimum value shown on sparkline. */ yMin?: number; /** The width of the container. */ width: number; /** Sets the a11y title text on sparkline. */ title?: string; [key: string]: unknown; } export type FillGradient = NonNullable; export type SparkLinePoint = [number, number]; export type SparkLineGeometry = { dotsToShow: number; lineIsolatedPoints: SparkLinePoint[]; lineSegments: SparkLinePoint[][]; points: SparkLinePoint[]; areaSegments: SparkLinePoint[][]; xMargin: number; xUnit: number; }; export type SparkLineAppearance = { isSplunk1cd: boolean; resolvedFillColor: string; resolvedFillGradient?: FillGradient; resolvedFillOpacity: string; resolvedGradientEndColor: string; resolvedHoverFillGradient?: FillGradient; resolvedHoverFillOpacity?: string; resolvedLineStrokeWidth: number; }; export type SparkLineIds = { areaGradientId: string; hoverAreaGradientId: string; pointMarkerFilterId: string; pointMarkerFocusFilterId: string; titleId: string; }; export type SparkLineInteractiveProps = { onBlur: React.FocusEventHandler; onFocus: React.FocusEventHandler; onKeyDown: React.KeyboardEventHandler; onMouseLeave: React.MouseEventHandler; onMouseOver: React.MouseEventHandler; }; export type SparkLineInteractionState = { activeIndex: number; componentIsFocused: boolean; currentPointX: number | null; currentPointY: number | null; handlePointAnchorMount: (element: SVGCircleElement | null) => void; handlePointClick: React.MouseEventHandler; handlePointMouseDown: React.MouseEventHandler; hoveredIndex: number | null; interactiveProps: Partial; pointAnchor: SVGCircleElement | null; pointMarkerIsPinned: boolean; pointRefs: React.MutableRefObject<(SVGRectElement | null)[]>; showCursorAndTooltip: boolean; tooltipIndex: number | null; tooltipValue: number | null; }; //# sourceMappingURL=types.d.ts.map