ngx-echarts
Version:
<!-- Badges section here. --> [][npm-badge-url] [][npm-badge-url] [][ci
173 lines (172 loc) • 5.43 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
import { Injectable } from '@angular/core';
import * as i0 from "@angular/core";
/**
* Provide an wrapper for global echarts
* ```typescript
* export class AppComponent implements onInit {
* constructor(private nes: NgxEchartsService) {}
*
* ngOnInit() {
* // const points = ...;
* // const rect = ...;
*
* // Get native global echarts object, then call native function
* const echarts = this.nes.echarts;
* const points = echarts.graphic.clipPointsByRect(points, rect);
*
* // Or call wrapper function directly:
* const points = this.nes.graphic.clipPointsByRect(points, rect);
* }
* }
* ```
*/
var NgxEchartsService = /** @class */ (function () {
function NgxEchartsService() {
}
Object.defineProperty(NgxEchartsService.prototype, "echarts", {
/**
* Get global echarts object
* @return {?}
*/
get: function () {
return echarts;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgxEchartsService.prototype, "graphic", {
/**
* Wrapper for echarts.graphic
* @return {?}
*/
get: function () {
return this._checkEcharts() ? echarts.graphic : undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgxEchartsService.prototype, "init", {
/**
* Wrapper for echarts.init
* @return {?}
*/
get: function () {
return this._checkEcharts() ? echarts.init : undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgxEchartsService.prototype, "connect", {
/**
* Wrapper for echarts.connect
* @return {?}
*/
get: function () {
return this._checkEcharts() ? echarts.connect : undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgxEchartsService.prototype, "disconnect", {
/**
* Wrapper for echarts.disconnect
* @return {?}
*/
get: function () {
return this._checkEcharts() ? echarts.disconnect : undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgxEchartsService.prototype, "dispose", {
/**
* Wrapper for echarts.dispose
* @return {?}
*/
get: function () {
return this._checkEcharts() ? echarts.dispose : undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgxEchartsService.prototype, "getInstanceByDom", {
/**
* Wrapper for echarts.getInstanceByDom
* @return {?}
*/
get: function () {
return this._checkEcharts() ? echarts.getInstanceByDom : undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgxEchartsService.prototype, "registerMap", {
/**
* Wrapper for echarts.registerMap
* @return {?}
*/
get: function () {
return this._checkEcharts() ? echarts.registerMap : undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgxEchartsService.prototype, "getMap", {
/**
* Wrapper for echarts.getMap
* @return {?}
*/
get: function () {
return this._checkEcharts() ? echarts.getMap : undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgxEchartsService.prototype, "registerTheme", {
/**
* Wrapper for echarts.registerTheme
* @return {?}
*/
get: function () {
return this._checkEcharts() ? echarts.registerTheme : undefined;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
NgxEchartsService.prototype._checkEcharts = function () {
if (echarts) {
return true;
}
else {
console.error('[ngx-echarts] global ECharts not loaded');
return false;
}
};
return NgxEchartsService;
}());
export { NgxEchartsService };
NgxEchartsService.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] },
];
/** @nocollapse */
NgxEchartsService.ctorParameters = function () { return []; };
/** @nocollapse */ NgxEchartsService.ngInjectableDef = i0.defineInjectable({ factory: function NgxEchartsService_Factory() { return new NgxEchartsService(); }, token: NgxEchartsService, providedIn: "root" });
function NgxEchartsService_tsickle_Closure_declarations() {
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
NgxEchartsService.decorators;
/**
* @nocollapse
* @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
*/
NgxEchartsService.ctorParameters;
}
//# sourceMappingURL=ngx-echarts.service.js.map