@qn-pandora/pandora-visualization
Version:
Pandora 通用可视化库
109 lines (108 loc) • 4.78 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { action } from 'mobx';
import bind from '../../../../../utils/bind';
import MetricBasePanelStyleService from './base';
import { styleOption } from '../base';
import { ChartType } from '../../../../../constants/chart-style';
import { defaultLevels } from '../../../../../constants/metric-panel-style';
var StatusPanelStyleService = /** @class */ (function (_super) {
__extends(StatusPanelStyleService, _super);
function StatusPanelStyleService(option) {
var _this = _super.call(this, option) || this;
_this.chartType = ChartType.StatusPanel;
_this.levels = defaultLevels;
_this.rules = [];
_this.contentFontSize = 0;
_this.contentColor = '';
_this.panelAutoSort = false;
_this.metricAutoSort = false;
_this.showMetricName = true;
_this.set(option);
return _this;
}
StatusPanelStyleService.prototype.setOptInit = function (width, height, titleFontSize, contentFontSize, contentColor) {
this.width = width;
this.height = height;
this.titleFontSize = titleFontSize;
this.contentFontSize = contentFontSize;
this.contentColor = contentColor;
};
StatusPanelStyleService.prototype.setContentFontSize = function (contentFontSize) {
this.contentFontSize = contentFontSize;
};
StatusPanelStyleService.prototype.setContentColor = function (contentColor) {
this.contentColor = contentColor;
};
__decorate([
styleOption(),
__metadata("design:type", Array)
], StatusPanelStyleService.prototype, "levels", void 0);
__decorate([
styleOption(),
__metadata("design:type", Array)
], StatusPanelStyleService.prototype, "rules", void 0);
__decorate([
styleOption(),
__metadata("design:type", Object)
], StatusPanelStyleService.prototype, "contentFontSize", void 0);
__decorate([
styleOption(),
__metadata("design:type", Object)
], StatusPanelStyleService.prototype, "contentColor", void 0);
__decorate([
styleOption(),
__metadata("design:type", Object)
], StatusPanelStyleService.prototype, "panelAutoSort", void 0);
__decorate([
styleOption(),
__metadata("design:type", Object)
], StatusPanelStyleService.prototype, "metricAutoSort", void 0);
__decorate([
styleOption(),
__metadata("design:type", Object)
], StatusPanelStyleService.prototype, "showMetricName", void 0);
__decorate([
bind,
action,
__metadata("design:type", Function),
__metadata("design:paramtypes", [Number, Number, Number, Number, String]),
__metadata("design:returntype", void 0)
], StatusPanelStyleService.prototype, "setOptInit", null);
__decorate([
bind,
action,
__metadata("design:type", Function),
__metadata("design:paramtypes", [Number]),
__metadata("design:returntype", void 0)
], StatusPanelStyleService.prototype, "setContentFontSize", null);
__decorate([
bind,
action,
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], StatusPanelStyleService.prototype, "setContentColor", null);
return StatusPanelStyleService;
}(MetricBasePanelStyleService));
export default StatusPanelStyleService;