UNPKG

@carbon/charts

Version:
91 lines (90 loc) 3.96 kB
import { ScaleTime, ScaleBand, ScaleLinear } from 'd3'; import { Service } from './service'; import { AxisPositions, CartesianOrientations, ScaleTypes } from '../interfaces/enums'; import { ThresholdOptions } from '../interfaces/components'; export type ScaleFunction = ScaleTime<number, number, never> | ScaleBand<string> | ScaleLinear<number, number, never>; export declare class CartesianScales extends Service { protected scaleTypes: { top: ScaleTypes; right: ScaleTypes; bottom: ScaleTypes; left: ScaleTypes; }; protected scales: { top: ScaleLinear<number, number, never>; right: ScaleLinear<number, number, never>; bottom: ScaleLinear<number, number, never>; left: ScaleLinear<number, number, never>; }; protected domainAxisPosition: AxisPositions; protected rangeAxisPosition: AxisPositions; protected secondaryDomainAxisPosition: AxisPositions; protected secondaryRangeAxisPosition: AxisPositions; protected dualAxes: boolean; protected orientation: CartesianOrientations; getDomainAxisPosition({ datum }?: { datum?: any; }): AxisPositions; getRangeAxisPosition({ datum, groups }?: { datum?: any; groups?: any; }): AxisPositions; getAxisOptions(position: AxisPositions): any; getDomainAxisOptions(): any; getRangeAxisOptions(): any; getScaleLabel(position: AxisPositions): string; getDomainLabel(): string; getRangeLabel(): string; update(): void; findDomainAndRangeAxes(): void; determineOrientation(): void; isDualAxes(): boolean; determineAxisDuality(): void; getCustomDomainValuesByposition(axisPosition: AxisPositions): any; getOrientation(): CartesianOrientations; getScaleByPosition(axisPosition: AxisPositions): ScaleLinear<number, number, never>; getScaleTypeByPosition(axisPosition: AxisPositions): ScaleTypes; getDomainAxisScaleType(): ScaleTypes; getRangeAxisScaleType(): ScaleTypes; getDomainScale(): ScaleLinear<number, number, never>; getRangeScale(): ScaleLinear<number, number, never>; getMainXAxisPosition(): AxisPositions; getMainYAxisPosition(): AxisPositions; getMainXScale(): ScaleLinear<number, number, never>; getMainYScale(): ScaleLinear<number, number, never>; getValueFromScale(scale: any, scaleType: ScaleTypes, axisPosition: AxisPositions, datum: any): number; getBoundedScaledValues(datum: any): number[]; getValueThroughAxisPosition(axisPosition: AxisPositions, datum: any): number; getDomainValue(d: string | object): number; getRangeValue(d: number | string | object): number; getMainXScaleType(): ScaleTypes; getMainYScaleType(): ScaleTypes; getDomainIdentifier(datum?: any): any; getRangeIdentifier(datum?: any): any; extendsDomain(axisPosition: AxisPositions, domain: any): number[] | Date[]; protected findVerticalAxesPositions(): { primary: AxisPositions; secondary: AxisPositions; }; protected findHorizontalAxesPositions(): { primary: AxisPositions; secondary: AxisPositions; }; protected findDomainAndRangeAxesPositions(verticalAxesPositions: any, horizontalAxesPositions: any): { primaryDomainAxisPosition: AxisPositions; secondaryDomainAxisPosition: AxisPositions; primaryRangeAxisPosition: AxisPositions; secondaryRangeAxisPosition: AxisPositions; }; getScaleDomain(axisPosition: AxisPositions): any; protected createScale(axisPosition: AxisPositions): ScaleFunction; getDomainLowerBound(position: any): number; getHighestDomainThreshold(): null | { threshold: ThresholdOptions; scaleValue: number; }; getHighestRangeThreshold(): null | { threshold: ThresholdOptions; scaleValue: number; }; }