UNPKG

5.8 kBTypeScriptView Raw
1import { AfterViewInit, ElementRef, EventEmitter, InjectionToken, NgZone, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2import type { EChartsOption, ECElementEvent } from 'echarts';
3import * as i0 from "@angular/core";
4export interface NgxEchartsConfig {
5 echarts: any | (() => Promise<any>);
6}
7export type ThemeOption = Record<string, any>;
8export declare const NGX_ECHARTS_CONFIG: InjectionToken<NgxEchartsConfig>;
9export declare class NgxEchartsDirective implements OnChanges, OnDestroy, OnInit, AfterViewInit {
10 private el;
11 private ngZone;
12 options: EChartsOption | null;
13 theme: string | ThemeOption | null;
14 initOpts: {
15 devicePixelRatio?: number;
16 renderer?: string;
17 width?: number | string;
18 height?: number | string;
19 locale?: string;
20 } | null;
21 merge: EChartsOption | null;
22 autoResize: boolean;
23 loading: boolean;
24 loadingType: string;
25 loadingOpts: object | null;
26 chartInit: EventEmitter<any>;
27 optionsError: EventEmitter<Error>;
28 chartClick: EventEmitter<ECElementEvent>;
29 chartDblClick: EventEmitter<ECElementEvent>;
30 chartMouseDown: EventEmitter<ECElementEvent>;
31 chartMouseMove: EventEmitter<ECElementEvent>;
32 chartMouseUp: EventEmitter<ECElementEvent>;
33 chartMouseOver: EventEmitter<ECElementEvent>;
34 chartMouseOut: EventEmitter<ECElementEvent>;
35 chartGlobalOut: EventEmitter<ECElementEvent>;
36 chartContextMenu: EventEmitter<ECElementEvent>;
37 chartHighlight: EventEmitter<any>;
38 chartDownplay: EventEmitter<any>;
39 chartSelectChanged: EventEmitter<any>;
40 chartLegendSelectChanged: EventEmitter<any>;
41 chartLegendSelected: EventEmitter<any>;
42 chartLegendUnselected: EventEmitter<any>;
43 chartLegendLegendSelectAll: EventEmitter<any>;
44 chartLegendLegendInverseSelect: EventEmitter<any>;
45 chartLegendScroll: EventEmitter<any>;
46 chartDataZoom: EventEmitter<any>;
47 chartDataRangeSelected: EventEmitter<any>;
48 chartGraphRoam: EventEmitter<any>;
49 chartGeoRoam: EventEmitter<any>;
50 chartTreeRoam: EventEmitter<any>;
51 chartTimelineChanged: EventEmitter<any>;
52 chartTimelinePlayChanged: EventEmitter<any>;
53 chartRestore: EventEmitter<any>;
54 chartDataViewChanged: EventEmitter<any>;
55 chartMagicTypeChanged: EventEmitter<any>;
56 chartGeoSelectChanged: EventEmitter<any>;
57 chartGeoSelected: EventEmitter<any>;
58 chartGeoUnselected: EventEmitter<any>;
59 chartAxisAreaSelected: EventEmitter<any>;
60 chartBrush: EventEmitter<any>;
61 chartBrushEnd: EventEmitter<any>;
62 chartBrushSelected: EventEmitter<any>;
63 chartGlobalCursorTaken: EventEmitter<any>;
64 chartRendered: EventEmitter<any>;
65 chartFinished: EventEmitter<any>;
66 animationFrameID: any;
67 private chart;
68 private chart$;
69 private echarts;
70 private resizeOb;
71 private resize$;
72 private resizeSub;
73 private initChartTimer?;
74 private changeFilter;
75 private loadingSub;
76 constructor(config: NgxEchartsConfig, el: ElementRef, ngZone: NgZone);
77 ngOnChanges(changes: SimpleChanges): void;
78 ngOnInit(): void;
79 ngOnDestroy(): void;
80 ngAfterViewInit(): void;
81 private dispose;
82 /**
83 * resize chart
84 */
85 resize(): void;
86 private toggleLoading;
87 private setOption;
88 /**
89 * dispose old chart and create a new one.
90 */
91 refreshChart(): Promise<void>;
92 private createChart;
93 private initChart;
94 private onOptionsChange;
95 private createLazyEvent;
96 static ɵfac: i0.ɵɵFactoryDeclaration<NgxEchartsDirective, never>;
97 static ɵdir: i0.ɵɵDirectiveDeclaration<NgxEchartsDirective, "echarts, [echarts]", ["echarts"], { "options": { "alias": "options"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "initOpts": { "alias": "initOpts"; "required": false; }; "merge": { "alias": "merge"; "required": false; }; "autoResize": { "alias": "autoResize"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingType": { "alias": "loadingType"; "required": false; }; "loadingOpts": { "alias": "loadingOpts"; "required": false; }; }, { "chartInit": "chartInit"; "optionsError": "optionsError"; "chartClick": "chartClick"; "chartDblClick": "chartDblClick"; "chartMouseDown": "chartMouseDown"; "chartMouseMove": "chartMouseMove"; "chartMouseUp": "chartMouseUp"; "chartMouseOver": "chartMouseOver"; "chartMouseOut": "chartMouseOut"; "chartGlobalOut": "chartGlobalOut"; "chartContextMenu": "chartContextMenu"; "chartHighlight": "chartHighlight"; "chartDownplay": "chartDownplay"; "chartSelectChanged": "chartSelectChanged"; "chartLegendSelectChanged": "chartLegendSelectChanged"; "chartLegendSelected": "chartLegendSelected"; "chartLegendUnselected": "chartLegendUnselected"; "chartLegendLegendSelectAll": "chartLegendLegendSelectAll"; "chartLegendLegendInverseSelect": "chartLegendLegendInverseSelect"; "chartLegendScroll": "chartLegendScroll"; "chartDataZoom": "chartDataZoom"; "chartDataRangeSelected": "chartDataRangeSelected"; "chartGraphRoam": "chartGraphRoam"; "chartGeoRoam": "chartGeoRoam"; "chartTreeRoam": "chartTreeRoam"; "chartTimelineChanged": "chartTimelineChanged"; "chartTimelinePlayChanged": "chartTimelinePlayChanged"; "chartRestore": "chartRestore"; "chartDataViewChanged": "chartDataViewChanged"; "chartMagicTypeChanged": "chartMagicTypeChanged"; "chartGeoSelectChanged": "chartGeoSelectChanged"; "chartGeoSelected": "chartGeoSelected"; "chartGeoUnselected": "chartGeoUnselected"; "chartAxisAreaSelected": "chartAxisAreaSelected"; "chartBrush": "chartBrush"; "chartBrushEnd": "chartBrushEnd"; "chartBrushSelected": "chartBrushSelected"; "chartGlobalCursorTaken": "chartGlobalCursorTaken"; "chartRendered": "chartRendered"; "chartFinished": "chartFinished"; }, never, never, true, never>;
98}
99
\No newline at end of file