UNPKG

4.42 kBTypeScriptView Raw
1import { EventEmitter, TemplateRef } from '@angular/core';
2import { BaseChartComponent } from '../common/base-chart.component';
3import { ColorHelper } from '../common/color.helper';
4import { BoxChartMultiSeries, BoxChartSeries, IBoxModel, StringOrNumberOrDate } from '../models/chart-data.model';
5import { ScaleLinear, ScaleBand } from 'd3-scale';
6import { ViewDimensions } from '../common/types/view-dimension.interface';
7import { LegendPosition, LegendOptions } from '../common/types/legend.model';
8import * as i0 from "@angular/core";
9export declare class BoxChartComponent extends BaseChartComponent {
10 /** Show or hide the legend. */
11 legend: boolean;
12 legendPosition: LegendPosition;
13 legendTitle: string;
14 /** I think it is better to handle legend options as single Input object of type ILegendOptions */
15 legendOptionsConfig: LegendOptions;
16 showGridLines: boolean;
17 xAxis: boolean;
18 yAxis: boolean;
19 showXAxisLabel: boolean;
20 showYAxisLabel: boolean;
21 roundDomains: boolean;
22 xAxisLabel: string;
23 yAxisLabel: string;
24 roundEdges: boolean;
25 strokeColor: string;
26 strokeWidth: number;
27 tooltipDisabled: boolean;
28 gradient: boolean;
29 wrapTicks: boolean;
30 select: EventEmitter<IBoxModel>;
31 activate: EventEmitter<IBoxModel>;
32 deactivate: EventEmitter<IBoxModel>;
33 tooltipTemplate: TemplateRef<any>;
34 /** Input Data, this came from Base Chart Component. */
35 results: BoxChartMultiSeries;
36 /** Chart Dimensions, this came from Base Chart Component. */
37 dims: ViewDimensions;
38 /** Color data. */
39 colors: ColorHelper;
40 /** Transform string css attribute for the chart container */
41 transform: string;
42 /** Chart Margins (For each side, counterclock wise). */
43 margin: [number, number, number, number];
44 /** Legend Options object to handle positioning, title, colors and domain. */
45 legendOptions: LegendOptions;
46 xScale: ScaleBand<string>;
47 yScale: ScaleLinear<number, number>;
48 xDomain: StringOrNumberOrDate[];
49 yDomain: number[];
50 seriesDomain: string[];
51 /** Chart X axis dimension. */
52 xAxisHeight: number;
53 /** Chart Y axis dimension. */
54 yAxisWidth: number;
55 trackBy(index: number, item: BoxChartSeries): StringOrNumberOrDate;
56 update(): void;
57 setColors(): void;
58 setScales(): void;
59 getXScale(domain: Array<string | number | Date>, width: number): ScaleBand<string>;
60 getYScale(domain: number[], height: number): ScaleLinear<number, number>;
61 getUniqueBoxChartXDomainValues(results: BoxChartMultiSeries): (string | number | Date)[];
62 getXDomain(): Array<string | number | Date>;
63 getYDomain(): number[];
64 getSeriesDomain(): string[];
65 updateYAxisWidth({ width }: {
66 width: any;
67 }): void;
68 updateXAxisHeight({ height }: {
69 height: any;
70 }): void;
71 onClick(data: IBoxModel): void;
72 onActivate(data: IBoxModel): void;
73 onDeactivate(data: IBoxModel): void;
74 private getLegendOptions;
75 static ɵfac: i0.ɵɵFactoryDeclaration<BoxChartComponent, never>;
76 static ɵcmp: i0.ɵɵComponentDeclaration<BoxChartComponent, "ngx-charts-box-chart", never, { "legend": { "alias": "legend"; "required": false; }; "legendPosition": { "alias": "legendPosition"; "required": false; }; "legendTitle": { "alias": "legendTitle"; "required": false; }; "legendOptionsConfig": { "alias": "legendOptionsConfig"; "required": false; }; "showGridLines": { "alias": "showGridLines"; "required": false; }; "xAxis": { "alias": "xAxis"; "required": false; }; "yAxis": { "alias": "yAxis"; "required": false; }; "showXAxisLabel": { "alias": "showXAxisLabel"; "required": false; }; "showYAxisLabel": { "alias": "showYAxisLabel"; "required": false; }; "roundDomains": { "alias": "roundDomains"; "required": false; }; "xAxisLabel": { "alias": "xAxisLabel"; "required": false; }; "yAxisLabel": { "alias": "yAxisLabel"; "required": false; }; "roundEdges": { "alias": "roundEdges"; "required": false; }; "strokeColor": { "alias": "strokeColor"; "required": false; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; }; "tooltipDisabled": { "alias": "tooltipDisabled"; "required": false; }; "gradient": { "alias": "gradient"; "required": false; }; "wrapTicks": { "alias": "wrapTicks"; "required": false; }; }, { "select": "select"; "activate": "activate"; "deactivate": "deactivate"; }, ["tooltipTemplate"], never, false, never>;
77}