scichart
Version:
Fast WebGL JavaScript Charting Library and Framework
81 lines (80 loc) • 3.95 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) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.OhlcPointSeriesResampled = void 0;
var ValueName_1 = require("../../../types/ValueName");
var IDataSeries_1 = require("../IDataSeries");
var BasePointSeriesResampled_1 = require("./BasePointSeriesResampled");
var OhlcPointSeriesResampled = /** @class */ (function (_super) {
__extends(OhlcPointSeriesResampled, _super);
function OhlcPointSeriesResampled(wasmContext, xRange) {
var _this = _super.call(this, wasmContext, xRange, 4, [ValueName_1.EValueName.Close, ValueName_1.EValueName.Open, ValueName_1.EValueName.High, ValueName_1.EValueName.Low]) || this;
_this.type = IDataSeries_1.EDataSeriesType.Ohlc;
return _this;
}
Object.defineProperty(OhlcPointSeriesResampled.prototype, "closeValues", {
get: function () {
return this.yValuesArray[0];
},
enumerable: false,
configurable: true
});
Object.defineProperty(OhlcPointSeriesResampled.prototype, "openValues", {
get: function () {
return this.yValuesArray[1];
},
enumerable: false,
configurable: true
});
Object.defineProperty(OhlcPointSeriesResampled.prototype, "highValues", {
get: function () {
return this.yValuesArray[2];
},
enumerable: false,
configurable: true
});
Object.defineProperty(OhlcPointSeriesResampled.prototype, "lowValues", {
get: function () {
return this.yValuesArray[3];
},
enumerable: false,
configurable: true
});
OhlcPointSeriesResampled.prototype.debugOutputForUnitTests = function () {
console.log("points count ".concat(this.count));
console.log("xResampled at min", this.xValues.get(0));
console.log("openResampled at min", this.openValues.get(0));
console.log("highResampled at min", this.highValues.get(0));
console.log("lowResampled at min", this.lowValues.get(0));
console.log("closeResampled at min", this.closeValues.get(0));
var middle = Math.round(this.count / 2);
console.log("middle", middle);
console.log("xResampled at middle", this.xValues.get(middle));
console.log("openResampled at middle", this.openValues.get(middle));
console.log("highResampled at middle", this.highValues.get(middle));
console.log("lowResampled at middle", this.lowValues.get(middle));
console.log("closeResampled at middle", this.closeValues.get(middle));
var end = this.count - 1;
console.log("xResampled at end", this.xValues.get(end));
console.log("openResampled at end", this.openValues.get(end));
console.log("highResampled at end", this.highValues.get(end));
console.log("lowResampled at end", this.lowValues.get(end));
console.log("closeResampled at end", this.closeValues.get(end));
};
return OhlcPointSeriesResampled;
}(BasePointSeriesResampled_1.BasePointSeriesResampled));
exports.OhlcPointSeriesResampled = OhlcPointSeriesResampled;