diff --git a/projects/ngx-echarts/src/component/ngx-echarts.component.ts b/projects/ngx-echarts/src/component/ngx-echarts.component.ts index 15a65f3..71986f2 100644 --- a/projects/ngx-echarts/src/component/ngx-echarts.component.ts +++ b/projects/ngx-echarts/src/component/ngx-echarts.component.ts @@ -62,6 +62,35 @@ export class NgxEchartsComponent implements AfterViewInit, OnChanges, DoCheck, O @Output() onMouseOut = new EventEmitter(); @Output() onGlobalOut = new EventEmitter(); @Output() onContextMenu = new EventEmitter(); + // action events + @Output() onLegendSelectChanged = new EventEmitter(); + @Output() onLegendSelected = new EventEmitter(); + @Output() onLegendUnSelected = new EventEmitter(); + @Output() onLegendScroll = new EventEmitter(); + @Output() onDataZoom = new EventEmitter(); + @Output() onDataRangeSelected = new EventEmitter(); + @Output() onTimelineChanged = new EventEmitter(); + @Output() onTimelinePlayChanged = new EventEmitter(); + @Output() onRestore = new EventEmitter(); + @Output() onDataViewChanged = new EventEmitter(); + @Output() onMagicTypeChanged = new EventEmitter(); + @Output() onGeoSelectChanged = new EventEmitter(); + @Output() onGeoSelected = new EventEmitter(); + @Output() onGeoUnSelected = new EventEmitter(); + @Output() onPieSelectChanged = new EventEmitter(); + @Output() onPieSelected = new EventEmitter(); + @Output() onPieUnSelected = new EventEmitter(); + @Output() onMapSelectChanged = new EventEmitter(); + @Output() onMapSelected = new EventEmitter(); + @Output() onMapUnSelected = new EventEmitter(); + @Output() onAxisAreaSelected = new EventEmitter(); + @Output() onFocusNodeAdjacency = new EventEmitter(); + @Output() onUnfocusNodeAdjacency = new EventEmitter(); + @Output() onBrush = new EventEmitter(); + @Output() onBrushSelected = new EventEmitter(); + @Output() onGlobalCursorTaken = new EventEmitter(); + @Output() onRendered = new EventEmitter(); + @Output() onFinished = new EventEmitter(); private echartsInstance: ECharts; @@ -161,6 +190,7 @@ export class NgxEchartsComponent implements AfterViewInit, OnChanges, DoCheck, O } private buildEvent(): void { + // events this.echartsInstance.on('click', (event: any) => this.ngZone.run(() => this.onClick.emit(event))); this.echartsInstance.on('dblclick', (event: any) => this.ngZone.run(() => this.onDblClick.emit(event))); this.echartsInstance.on('mousedown', (event: any) => this.ngZone.run(() => this.onMouseDown.emit(event))); @@ -170,6 +200,35 @@ export class NgxEchartsComponent implements AfterViewInit, OnChanges, DoCheck, O this.echartsInstance.on('mouseout', (event: any) => this.ngZone.run(() => this.onMouseOut.emit(event))); this.echartsInstance.on('globalout', (event: any) => this.ngZone.run(() => this.onGlobalOut.emit(event))); this.echartsInstance.on('contextmenu', (event: any) => this.ngZone.run(() => this.onContextMenu.emit(event))); + // action events + this.echartsInstance.on('legendselectchanged', (event: any) => this.ngZone.run(() => this.onLegendSelectChanged.emit(event))); + this.echartsInstance.on('legendselected', (event: any) => this.ngZone.run(() => this.onLegendSelected.emit(event))); + this.echartsInstance.on('legendunselected', (event: any) => this.ngZone.run(() => this.onLegendUnSelected.emit(event))); + this.echartsInstance.on('legendscroll', (event: any) => this.ngZone.run(() => this.onLegendScroll.emit(event))); + this.echartsInstance.on('datazoom', (event: any) => this.ngZone.run(() => this.onDataZoom.emit(event))); + this.echartsInstance.on('datarangeselected', (event: any) => this.ngZone.run(() => this.onDataRangeSelected.emit(event))); + this.echartsInstance.on('timelinechanged', (event: any) => this.ngZone.run(() => this.onTimelineChanged.emit(event))); + this.echartsInstance.on('timelineplaychanged', (event: any) => this.ngZone.run(() => this.onTimelinePlayChanged.emit(event))); + this.echartsInstance.on('restore', (event: any) => this.ngZone.run(() => this.onRestore.emit(event))); + this.echartsInstance.on('dataviewchanged', (event: any) => this.ngZone.run(() => this.onDataViewChanged.emit(event))); + this.echartsInstance.on('magictypechanged', (event: any) => this.ngZone.run(() => this.onMagicTypeChanged.emit(event))); + this.echartsInstance.on('geoselectchanged', (event: any) => this.ngZone.run(() => this.onGeoSelectChanged.emit(event))); + this.echartsInstance.on('geoselected', (event: any) => this.ngZone.run(() => this.onGeoSelected.emit(event))); + this.echartsInstance.on('geounselected', (event: any) => this.ngZone.run(() => this.onGeoUnSelected.emit(event))); + this.echartsInstance.on('pieselectchanged', (event: any) => this.ngZone.run(() => this.onPieSelectChanged.emit(event))); + this.echartsInstance.on('pieselected', (event: any) => this.ngZone.run(() => this.onPieSelected.emit(event))); + this.echartsInstance.on('pieunselected', (event: any) => this.ngZone.run(() => this.onPieUnSelected.emit(event))); + this.echartsInstance.on('mapselectchanged', (event: any) => this.ngZone.run(() => this.onMapSelectChanged.emit(event))); + this.echartsInstance.on('mapselected', (event: any) => this.ngZone.run(() => this.onMapSelected.emit(event))); + this.echartsInstance.on('mapunselected', (event: any) => this.ngZone.run(() => this.onMapUnSelected.emit(event))); + this.echartsInstance.on('axisareaselected', (event: any) => this.ngZone.run(() => this.onAxisAreaSelected.emit(event))); + this.echartsInstance.on('focusNodeAdjacency', (event: any) => this.ngZone.run(() => this.onFocusNodeAdjacency.emit(event))); + this.echartsInstance.on('unfocusNodeAdjacency', (event: any) => this.ngZone.run(() => this.onUnfocusNodeAdjacency.emit(event))); + this.echartsInstance.on('brush', (event: any) => this.ngZone.run(() => this.onBrush.emit(event))); + this.echartsInstance.on('brushselected', (event: any) => this.ngZone.run(() => this.onBrushSelected.emit(event))); + this.echartsInstance.on('globalcursortaken', (event: any) => this.ngZone.run(() => this.onGlobalCursorTaken.emit(event))); + this.echartsInstance.on('rendered', (event: any) => this.ngZone.run(() => this.onRendered.emit(event))); + this.echartsInstance.on('finished', (event: any) => this.ngZone.run(() => this.onFinished.emit(event))); } private resize(): void {