scichart
Version:
Fast WebGL JavaScript Charting Library and Framework
104 lines (103 loc) • 4.67 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AxisPlane = exports.EAxisPlaneType = void 0;
var PropertyChangedEventArgs_1 = require("../../Core/PropertyChangedEventArgs");
var AxisPlaneDrawLabelsMode_1 = require("../../types/AxisPlaneDrawLabelsMode");
var AxisPlaneVisibilityMode_1 = require("../../types/AxisPlaneVisibilityMode");
var EAxisPlaneType;
(function (EAxisPlaneType) {
EAxisPlaneType["XY"] = "xyAxisPlane";
EAxisPlaneType["ZX"] = "zxAxisPlane";
EAxisPlaneType["ZY"] = "zyAxisPlane";
})(EAxisPlaneType = exports.EAxisPlaneType || (exports.EAxisPlaneType = {}));
var AxisPlane = /** @class */ (function () {
function AxisPlane(parentSurface, planeType, options) {
var _a, _b, _c, _d;
this.drawLabelsModeProperty = AxisPlaneDrawLabelsMode_1.EAxisPlaneDrawLabelsMode.Both;
this.drawTitlesModeProperty = AxisPlaneDrawLabelsMode_1.EAxisPlaneDrawLabelsMode.Both;
this.visibilityModeProperty = AxisPlaneVisibilityMode_1.EAxisPlaneVisibilityMode.Auto;
this.isVisibleProperty = true;
this.parentSurface = parentSurface;
this.planeType = planeType;
this.drawLabelsModeProperty = (_a = options === null || options === void 0 ? void 0 : options.drawLabelsMode) !== null && _a !== void 0 ? _a : this.drawLabelsModeProperty;
this.drawTitlesModeProperty = (_b = options === null || options === void 0 ? void 0 : options.drawTitlesMode) !== null && _b !== void 0 ? _b : this.drawTitlesModeProperty;
this.visibilityModeProperty = (_c = options === null || options === void 0 ? void 0 : options.visibilityMode) !== null && _c !== void 0 ? _c : this.visibilityModeProperty;
this.isVisibleProperty = (_d = options === null || options === void 0 ? void 0 : options.isVisible) !== null && _d !== void 0 ? _d : this.isVisibleProperty;
}
AxisPlane.prototype.notifyPropertyChanged = function (propertyName) {
var _a;
(_a = this.parentSurface.propertyChanged) === null || _a === void 0 ? void 0 : _a.raiseEvent(new PropertyChangedEventArgs_1.PropertyChangedEventArgs("".concat(this.planeType, ".").concat(propertyName)));
this.parentSurface.invalidateElement();
};
Object.defineProperty(AxisPlane.prototype, "drawLabelsMode", {
/**
* Gets / sets the draw labels mode for the XY axis plane
*/
get: function () {
return this.drawLabelsModeProperty;
},
set: function (value) {
if (this.drawLabelsModeProperty !== value) {
this.drawLabelsModeProperty = value;
this.notifyPropertyChanged("drawLabelsMode");
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisPlane.prototype, "drawTitlesMode", {
/**
* Gets / sets the draw titles mode for the axis plane
*/
get: function () {
return this.drawTitlesModeProperty;
},
set: function (value) {
if (this.drawTitlesModeProperty !== value) {
this.drawTitlesModeProperty = value;
this.notifyPropertyChanged("drawTitlesMode");
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisPlane.prototype, "visibilityMode", {
/**
* Gets / sets the visibility mode for the axis plane
*/
get: function () {
return this.visibilityModeProperty;
},
set: function (value) {
if (this.visibilityModeProperty !== value) {
this.visibilityModeProperty = value;
this.notifyPropertyChanged("visibilityMode");
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisPlane.prototype, "isVisible", {
get: function () {
return this.isVisibleProperty;
},
set: function (value) {
if (this.isVisibleProperty !== value) {
this.isVisibleProperty = value;
this.notifyPropertyChanged("isVisible");
}
},
enumerable: false,
configurable: true
});
AxisPlane.prototype.toJSON = function () {
return {
drawLabelsMode: this.drawLabelsMode,
drawTitlesMode: this.drawTitlesMode,
visibilityMode: this.visibilityMode,
isVisible: this.isVisible
};
};
return AxisPlane;
}());
exports.AxisPlane = AxisPlane;