import { Axis, AxisDomain } from 'd3-axis'; import { ScaleLinear, ScaleTime } from 'd3-scale'; import { BaseType, Selection } from 'd3-selection'; import tinycolor from 'tinycolor2'; import { BarOptions, HistogramParams, Style } from '../HistogramParams.js'; export declare const NAN_COLOR = "#d8d8d8"; export declare const TICK_COLOR = "#fff"; export declare const TICK_WIDTH = 1.5; export declare const TICK_OPACITY = 1; export declare const FULLY_SELECTED_BARS = "histogram__chart--bar__fullyselected"; export declare const CURRENTLY_SELECTED_BARS = "histogram__chart--bar__currentselection"; export declare const UNSELECTED_BARS = "histogram__chart--bar"; export declare const PARTLY_SELECTED_BARS = "histogram__chart--bar__partlyselected"; export declare const UNSELECTED_BARS_ZONE = "unselected_bars_zone"; export declare const SELECTED_BARS_ZONE = "selected_bars_zone"; export interface MarginModel { top: number; right: number; bottom: number; left: number; } export interface BucketInterval { value: number; unit?: string; } export interface HistogramData { key: Date | number; value: number; chartId?: string; normalizeValue?: number; } export interface HistogramTooltip { title?: string; dataType?: string; xStartValue?: number | string | Date; xEndValue?: number | string | Date; xRange?: { value: number; unit?: string; }; y?: HistogramTooltipYValue[]; max?: number; min?: number; xUnit?: string; yUnit?: string; xLabel?: string; yLabel?: string; shown?: boolean; xPosition?: number; yPosition?: number; chartWidth?: number; } /** * Structure used to represent the y-value of a histogram tooltip */ export interface HistogramTooltipYValue { value: number | string; chartId?: string; color?: string; /** When normalizing per column, indicates the percentage that the value represents */ swimlaneBucketPercentage?: string; } export interface BrushCornerTooltips { leftCornerTooltip: BrushTooltip; rightCornerTooltip: BrushTooltip; verticalCssVisibility: string; horizontalCssVisibility: string; } export interface BrushTooltip { htmlContainer: HTMLElement; xPosition: number; yPosition: number; content: string; width?: number; cssVisibility?: string; } export interface SwimlaneParsedData { key: string; value: Array<{ key: number | Date; value: number; }>; } export interface SelectedOutputValues { startvalue: Date | number; endvalue: Date | number; } export interface SelectedInputValues { startvalue: Date | number; endvalue: Date | number; } export type HistogramSVG = Selection; export type HistogramSVGG = Selection; export type CircularSVG = Selection; export type HistogramSVGRect = Selection; export type HistogramSVGClipPath = Selection; export type HistogramSVGLine = Selection; export interface ChartDimensions { svg: HistogramSVG; margin: MarginModel; width: number; height: number; } export interface ChartAxes { xDomain: ScaleTime | ScaleLinear; yDomain: ScaleLinear; yDomainRight?: ScaleLinear; xTicksAxis: Axis; xLabelsAxis: Axis; yTicksAxis: Axis; yLabelsAxis: Axis; yTicksAxisRight?: Axis; yLabelsAxisRight?: Axis; stepWidth: number; xAxis: Axis; yAxis: Axis; yAxisRight?: Axis; } export interface SwimlaneAxes { xDomain: ScaleTime | ScaleLinear; xTicksAxis: Axis; xLabelsAxis: Axis; stepWidth: number; xAxis: Axis; } export declare function isChartAxes(axes: ChartAxes | SwimlaneAxes): axes is ChartAxes; export interface LaneStats { min?: number; max?: number; sum?: number; count?: number; } export interface SwimlaneStats { columnStats: Map; globalStats: LaneStats; nbLanes: number; minBorder?: number; maxBorder?: number; bucketLength?: number; } export interface SwimlaneOptions { /** Hex color attributted to buckets whose values are NaN */ nan_color?: string; /** Hex color attributted to buckets whose values are 0 */ zeros_color?: string; /** The tick plotted on each swimlane bucket that indicates how high/low the bucket value is. */ level_tick?: TickOptions; } export interface TickOptions { /** Hex color of the tick */ color?: string; /** Width of the tick in pixels */ width?: number; /** Opacity of the tick */ opacity?: number; } export interface SwimlaneData { stats: SwimlaneStats; lanes: Map>; } export interface Tooltip { isShown: boolean; isRightSide: boolean; xPosition: number; yPosition: number; xContent: string; yContent: string; yAdditonalInfo?: string; width?: number; chartId?: string; } export declare class HistogramUtils { static isSelectionBeyondDataDomain(selectedInputValues: SelectedInputValues, inputData: Array, intervalSelectedMap: Map): boolean; static isDataDomainWithinSelection(selectedInputValues: SelectedInputValues, inputData: Array, intervalSelectedMap: Map): boolean; static parseDataKey(inputData: Array, dataType: DataType): Array; static parseSelectedValues(selectedValues: SelectedInputValues, dataType: DataType): SelectedOutputValues; static parseSwimlaneDataKey(swimlanesInputData: Map>, dataType: DataType): Map>; private static parseDataKeyToDate; static getColor(zeroToOne: number, paletteColors: [number, number] | string): tinycolor.Instance; static roundValue(value: number, histogramParams: HistogramParams, dateInterval?: number): Date | number; static toString(value: Date | number, histogramParams: HistogramParams, dateInterval?: number): string; static isValueValid(bucket: HistogramData): boolean; static getFormatFromDateInterval(dateInterval: any): string; static generateUID(): string; static getIntervalGUID(start: Date | number, end: Date | number): string; static getRoundPrecision(dataInterval: number): number; static round(value: any, precision: any): number; static numberToShortValue(number: number, p?: number): string; static splitData(data: Array): [Array>, Array>]; } export declare function roundToNearestMultiple(i: any, multiple: any): number; export declare enum SwimlaneMode { variableHeight = "variableHeight", fixedHeight = "fixedHeight", circles = "circles" } export declare enum SwimlaneRepresentation { column = "column", global = "global" } export declare enum DataType { numeric = "numeric", time = "time" } export declare enum ChartType { area = "area", bars = "bars", oneDimension = "oneDimension", swimlane = "swimlane", curve = "curve" } export declare enum Position { top = "top", bottom = "bottom" } export declare function positionToNumber(position: Position): 0 | 1; export declare function formatNumber(x: any, formatChar?: string, roundPrecision?: number): string; export declare const NUMBER_FORMAT_CHAR = "NUMBER_FORMAT_CHAR"; export declare const tickNumberFormat: (d: any, formatChar: any) => string; export declare const SELECTED_STYLE: Style; export declare const UNSELECTED_STYLE: Style; export declare const HEAD_BAR: { SELECTED_STYLE: Style; UNSELECTED_STYLE: Style; HEIGHT: number; }; export declare const BAR_OPTIONS: { WEIGHT: number; BACKGROUND_COLOR: string; }; export declare function getBarOptions(barOptions: BarOptions): BarOptions;