UNPKG

realchart

Version:

Wooritech charting library

491 lines (484 loc) 15.9 kB
import * as RealChart from 'realchart'; import { CircularGauge, CircleGaugeOptions, ChartItemOptions, GaugeRangeBand, ICircularGaugeExtents, CircleGaugeRimOptions, CircleGaugeValueRimOptions, GaugeItem, CircleGaugeHandOptions, CircleGaugePinOptions, GaugeScale, CircleGaugeScaleOptions, CircleGaugeRimBaseOptions, ValueRange, LinearGaugeOptions, LinearValueBarOptions, LinearGaugeBaseOptions, ValueGauge, LinearGaugeLabelOptions, IMinMax, IChart, SVGStyleOrClass, LinearGaugeScaleOptions, GaugeLabel, LinearGaugeGroupBaseOptions, GaugeGroup, ChartItem, LinearGaugeChildLabelOptions, LinearGaugeGroupLabelOptions, BulletGaugeOptions, BulletGaugeBandOptions, BulletTargetBarOptions, BulletValueBarOptions, BulletGaugeGroupOptions, Gauge, ClockGaugeOptions, ClockGaugeRimOptions, ClockGaugeHandOptions, ClockGaugeSecondHandOptions, ClockGaugeTickOptions, ClockGaugeTickLabelOptions, ClockGaugePinOptions, ChartText, ClockGaugeLabelOptions } from 'realchart'; /** * 원형게이지 테두리(rim) 모델 기반 클래스<br/> * {@page options} 모델은 {@page op.CircleGaugeRimBaseOptions}이다. */ declare abstract class CircleGaugeRimBase<OP extends CircleGaugeRimBaseOptions = CircleGaugeRimBaseOptions> extends GaugeItem<OP> { static defaults: CircleGaugeRimBaseOptions; private _ranges; private _runRanges; getRange(bounds: { minValue?: number; maxValue?: number; }, value: number): ValueRange | undefined; protected _doApply(options: CircleGaugeRimBaseOptions): void; private $_internalRanges; } /** * 원형게이지 테두리(rim) 모델.<br/> * {@page options} 모델은 {@page op.CircleGaugeRimOptions}이다. */ declare class CircleGaugeRim extends CircleGaugeRimBase<CircleGaugeRimOptions> { static defaults: CircleGaugeRimOptions; private _segmentThicknessDim; getSegmentThickness(domain: number): number; protected _doApply(options: CircleGaugeRimOptions): void; } /** * 값을 표시하는 테두리(rim) 모델.<br/> * {@page options} 모델은 {@page op.CircleGaugeValueRimOptions}이다. */ declare class CircleGaugeValueRim extends CircleGaugeRimBase<CircleGaugeValueRimOptions> { static defaults: CircleGaugeValueRimOptions; private _thicknessDim; getThickness(domain: number): number; protected _doApply(options: CircleGaugeValueRimOptions): void; } /** * 원형게이지 침(hand) 모델.<br/> * {@page options} 모델은 {@page op.CircleGaugeHandOptions}이다. */ declare class CircleGaugeHand extends GaugeItem<CircleGaugeHandOptions> { static defaults: CircleGaugeHandOptions; private _radiusDim; private _lengthDim; private _offsetDim; getExtents(domain: number): { radius: number; length: number; offset: number; }; protected _doApply(options: CircleGaugeHandOptions): void; } /** * 원형게이지 핀 모델.<br/> * {@page options} 모델은 {@page op.CircleGaugePinOptions}이다. */ declare class CircleGaugePin extends GaugeItem<CircleGaugePinOptions> { static defaults: CircleGaugePinOptions; private _radiusDim; getRadius(domain: number): number; protected _doApply(options: CircleGaugePinOptions): void; } /** * 원형게이지 자(scale) 모델.<br/> * {@page options} 모델은 {@page op.CircleGaugeScaleOptions}이다. */ declare class CircleGaugeScale extends GaugeScale<CircleGaugeScaleOptions> { static defaults: CircleGaugeScaleOptions; protected _getStepMultiples(step: number): number[]; } /** * 원형 게이지 모델.<br/> * {@page op.GaugeOptions#type}은 **'circle'** 이고, * {@page options 설정} 모델은 {@page op.CircleGaugeOptions}이다. * * @modules gauge */ declare class CircleGauge extends CircularGauge<CircleGaugeOptions> { static readonly type: string; private _band; private _scale; private _rim; private _valueRim; private _hand; private _pin; protected _doInitChildren(op: { [child: string]: ChartItemOptions; }): void; /** * 게이지 본체 주변이나 내부에 값 영역들을 구분해서 표시하는 band의 모델. */ get band(): GaugeRangeBand; /** * 스케일 모델. */ get scale(): CircleGaugeScale; /** * 게이지 배경 원호 테두리 설정 모델. */ get rim(): CircleGaugeRim; /** * 게이지의 값 원호 테두리 설정 모델. */ get valueRim(): CircleGaugeValueRim; /** * 게이지 바늘 설정 모델. */ get hand(): CircleGaugeHand; /** * 게이지 중앙에 표시되는 핀 설정 모델. */ get pin(): CircleGaugePin; getExtents(gaugeSize: number): ICircularGaugeExtents; } /** * {@page LinearGauge} 스케일 모델.<br/> * {@page options} 모델은 {@page op.LinearGaugeScaleOptions}이다.<br/> */ declare class LinearGaugeScale extends GaugeScale<LinearGaugeScaleOptions> { _vertical: boolean; _reversed: boolean; } /** * 선형게이지 라벨 모델.<br/> * {@page options} 모델은 {@page op.LinearGaugeLabelOptions}이다. */ declare class LinearGaugeLabel<OP extends LinearGaugeLabelOptions = LinearGaugeLabelOptions> extends GaugeLabel<OP> { static defaults: LinearGaugeLabelOptions; private _widthDim; private _heightDim; private _maxWidthDim; private _maxHeightDim; private _gapDim; _runPos: 'left' | 'right' | 'top' | 'bottom'; _runGap: number; _runVert: boolean; getWidth(domain: number): number; getHeight(domain: number): number; getMaxWidth(domain: number): number; getMaxHeight(domain: number): number; getGap(domain: number): number; protected _doApply(options: LinearGaugeLabelOptions): void; } /** * 선형 게이지 모델들의 기반 클래스.<br/> * {@page options} 모델은 {@page op.LinearGaugeBaseOptions}이다. */ declare abstract class LinearGaugeBase<OP extends LinearGaugeBaseOptions = LinearGaugeBaseOptions> extends ValueGauge<OP> { static defaults: LinearGaugeBaseOptions; private _label; private _scale; protected _doInitChildren(op: { [child: string]: ChartItemOptions; }): void; /** * label 설정 모델. * * @config */ get label(): LinearGaugeLabel<LinearGaugeLabelOptions>; /** * scale. * * @config */ get scale(): LinearGaugeScale; isVertical(): boolean; scaleVisible(): boolean; calcedMinMax(): IMinMax; protected _doPrepareRender(chart: IChart): void; } /** * linear 게이지의 값을 표시하는 영역에 대한 설정 모델.<br/> * {@page options} 모델은 {@page op.LinearValueBarOptions}이다. */ declare class LinearValueBar<OP extends LinearValueBarOptions = LinearValueBarOptions> extends GaugeItem<OP> { private _args; getStyle(gauge: LinearGaugeBase, value: number): SVGStyleOrClass; } /** * 선형 게이지 모델.<br/> * {@page op.GaugeOptions#type}은 **'linear'** 이고, * {@page options 설정} 모델은 {@page op.LinearGaugeOptions}이다. * * @modules gauge */ declare class LinearGauge extends LinearGaugeBase<LinearGaugeOptions> { static readonly type = "linear"; private _valueBar; private _band; protected _doInitChildren(op: { [child: string]: ChartItemOptions; }): void; /** * 게이지 값을 표시하는 bar 모델. */ get valueBar(): LinearValueBar<LinearValueBarOptions>; /** * 게이지 본체 주변이나 내부에 값 영역들을 구분해서 표시하는 band의 모델. * * @config */ get band(): GaugeRangeBand; } /** * 선형 그룹게이지의 자식 라벨 모델.<br/> * {@page options} 모델은 {@page op.LinearGaugeChildLabelOptions}이다. */ declare class LinearGaugeChildLabel extends ChartItem<LinearGaugeChildLabelOptions> { static defaults: LinearGaugeChildLabelOptions; } /** * 선형 그룹게이지의 그룹 라벨 모델.<br/> * {@page options} 모델은 {@page op.LinearGaugeGroupLabelOptions}이다. */ declare class LinearGaugeGroupLabel extends LinearGaugeLabel<LinearGaugeGroupLabelOptions> { static defaults: LinearGaugeGroupLabelOptions; } /** * 선형 그룹게이지 모델들의 기반 클래스.<br/> * {@page options} 모델은 {@page op.LinearGaugeGroupBaseOptions}이다. */ declare abstract class LinearGaugeGroupBase<T extends LinearGaugeBase = LinearGaugeBase, OP extends LinearGaugeGroupBaseOptions<LinearGaugeBaseOptions> = LinearGaugeGroupBaseOptions<LinearGaugeBaseOptions>> extends GaugeGroup<T, OP> { static defaults: LinearGaugeGroupBaseOptions<LinearGaugeBaseOptions>; private _label; private _itemLabel; private _scale; _labelWidth: number; _labelHeight: number; protected _doInitChildren(op: { [child: string]: ChartItemOptions; }): void; /** * label 설정 모델. * * @config */ get label(): LinearGaugeGroupLabel; /** * 자식 게이지들의 label 표시 관련 속성 모델. * * @config */ get itemLabel(): LinearGaugeChildLabel; /** * scale. * * @config */ get scale(): LinearGaugeScale; calcedMinMax(): IMinMax; } /** * Bullet 게이지 밴드 모델.<br/> * {@page options} 모델은 {@page op.BulletGaugeBandOptions}이다. */ declare class BulletGaugeBand extends ChartItem<BulletGaugeBandOptions> { gauge: BulletGauge | BulletGaugeGroup; static defaults: BulletGaugeBandOptions; private _ranges; private _runRanges; constructor(gauge: BulletGauge | BulletGaugeGroup); /** * 값 범위 목록을 리턴한다.<br/> * 범위별로 다른 스타일을 적용할 수 있다. * * @config */ getRanges(): ValueRange[]; protected _doApply(options: BulletGaugeBandOptions): void; private $_internalRanges; } /** * Bullet 게이지 목표 bar 모델.<br/> * {@page options} 모델은 {@page op.BulletTargetBarOptions}이다. */ declare class BulletTargetBar extends GaugeItem<BulletTargetBarOptions> { static defaults: BulletTargetBarOptions; } /** * Bullet 게이지 값 bar 모델.<br/> * {@page options} 모델은 {@page op.BulletValueBarOptions}이다. */ declare class BulletValueBar extends LinearValueBar<BulletValueBarOptions> { } /** * Bullet 게이지 모델.<br/> * {@page op.GaugeOptions#type}은 {@page config.gauge.bullet 'bullet'}이고, * {@page options 설정} 모델은 {@page op.BulletGaugeOptions}이다. * * @modules gauge */ declare class BulletGauge extends LinearGaugeBase<BulletGaugeOptions> { static readonly type = "bullet"; static defaults: BulletGaugeOptions; private _band; private _targetBar; private _valueBar; protected _doInitChildren(op: { [child: string]: ChartItemOptions; }): void; /** * 밴드. * * @config */ get band(): BulletGaugeBand; /** * target bar. * * @config */ get targetBar(): BulletTargetBar; /** * value bar. * * @config */ get valueBar(): BulletValueBar; getRanges(min: number, max: number, inclusive: boolean): ValueRange[]; } /** * Bullet 게이지그룹 모델.<br/> * {@page op.GaugeOptions#type}은 {@page config.gauge.bulletgroup 'bulletgroup'}이고, * {@page options} 모델은 {@page op.BulletGaugeGroupOptions}이다. * * @modules gauge */ declare class BulletGaugeGroup extends LinearGaugeGroupBase<BulletGauge, BulletGaugeGroupOptions> { static readonly type: string; static readonly gaugeType = "bullet"; static defaults: BulletGaugeGroupOptions; getRanges(min: number, max: number, inclusive: boolean): ValueRange[]; _gaugesType(): string; } /** * Clock 게이지 테두리(rim) 설정 모델.<br/> * {@page options} 모델은 {@page op.ClockGaugeRimOptions}이다. */ declare class ClockGaugeRim extends GaugeItem<ClockGaugeRimOptions> { static defaults: ClockGaugeRimOptions; private _thicknessDim; getThickness(domain: number): number; protected _doApply(options: ClockGaugeRimOptions): void; } /** * Clock 게이지 시/분침(hand) 설정 모델.<br/> * {@page options} 모델은 {@page op.ClockGaugeHandOptions}이다. */ declare class ClockGaugeHand<OP extends ClockGaugeHandOptions = ClockGaugeHandOptions> extends GaugeItem<OP> { static defaults: ClockGaugeHandOptions; private _lengthDim; getLength(domain: number): number; protected _doApply(options: ClockGaugeHandOptions): void; } /** * Clock 게이지 분침 모델.<br/> * {@page options} 모델은 {@page op.ClockGaugeHandOptions}이다. */ declare class ClockGaugeMinuteHand extends ClockGaugeHand<ClockGaugeHandOptions> { static defaults: ClockGaugeHandOptions; } /** * Clock 게이지 초침(hand) 설정 모델.<br/> * {@page options} 모델은 {@page op.ClockGaugeSecondHandOptions}이다. */ declare class ClockGaugeSecondHand extends ClockGaugeHand<ClockGaugeSecondHandOptions> { static defaults: ClockGaugeSecondHandOptions; } /** * Clock 게이지 tick 설정 모델.<br/> * {@page options} 모델은 {@page op.ClockGaugeTickOptions}이다. */ declare class ClockGaugeTick extends GaugeItem<ClockGaugeTickOptions> { length: number; constructor(gauge: ClockGauge, length: number); } /** * Clock 게이지 tick 라벨 설정 모델.<br/> * {@page options} 모델은 {@page op.ClockGaugeTickLabelOptions}이다. */ declare class ClockGaugeTickLabel extends GaugeItem<ClockGaugeTickLabelOptions> { static defaults: ClockGaugeTickLabelOptions; } /** * Clock 게이지 중심 pin 설정 모델.<br/> * {@page options} 모델은 {@page op.ClockGaugePinOptions}이다. */ declare class ClockGaugePin extends GaugeItem<ClockGaugePinOptions> { raidus: number; constructor(gauge: ClockGauge, raidus: number); } /** * Clock 게이지 내부에 표시되는 라벨 설정 모델.<br/> * {@page options} 모델은 {@page op.ClockGaugeLabelOptions}이다. */ declare class ClockGaugeLabel extends ChartText<ClockGaugeLabelOptions> { static defaults: ClockGaugeLabelOptions; constructor(gauge: ClockGauge); } /** * 시계 게이지 모델.<br/> * {@page op.GaugeOptions#type}은 **'clock'** 이고, * {@page options 설정} 모델은 {@page op.ClockGaugeOptions}이다. * * @modules gauge */ declare class ClockGauge extends Gauge<ClockGaugeOptions> { static readonly type = "clock"; static defaults: ClockGaugeOptions; private _centerX; private _centerY; private _radius; private _centerXDim; private _centerYDim; private _radiusDim; protected _doInitChildren(op: { [child: string]: ChartItemOptions; }): void; /** * rim 설정 모델. * * @config */ rim: ClockGaugeRim; /** * 시침 설정 모델. * * @config */ hourHand: ClockGaugeHand; /** * 분침 설정 모델. * * @config */ minuteHand: ClockGaugeMinuteHand; /** * 초침 설정 모델. * * @config */ secondHand: ClockGaugeSecondHand; /** * main tick. * * @config */ tick: ClockGaugeTick; /** * minor tick * * @config */ minorTick: ClockGaugeTick; /** * tick label * * @config */ tickLabel: ClockGaugeTickLabel; /** * pin * * @config */ pin: ClockGaugePin; /** * label * * @config */ label: ClockGaugeLabel; getTime(): Date; getExtents(gaugeWidth: number, gaugeHeight: number): { cx: number; cy: number; rd: number; }; protected _doApply(options: ClockGaugeOptions): void; } declare function registerGauge(chart: typeof RealChart): void; export { BulletGauge, CircleGauge, ClockGauge, LinearGauge, registerGauge as default };