scichart
Version:
Fast WebGL JavaScript Charting Library and Framework
72 lines (71 loc) • 4.26 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.PolarNumericAxis = void 0;
var AxisType_1 = require("../../../../types/AxisType");
var FlippedNumericCoordinateCalculator_1 = require("../../../Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator");
var NumericCoordinateCalculator_1 = require("../../../Numerics/CoordinateCalculators/NumericCoordinateCalculator");
var PolarTickCoordinatesProvider_1 = require("../../../Numerics/TickCoordinateProviders/PolarTickCoordinatesProvider");
var NumericTickProvider_1 = require("../../../Numerics/TickProviders/NumericTickProvider");
var NumericDeltaCalculator_1 = require("../DeltaCalculator/NumericDeltaCalculator");
var NumericLabelProvider_1 = require("../LabelProvider/NumericLabelProvider");
var PolarAxisBase_1 = require("./PolarAxisBase");
/**
* @summary A 2D Chart Numeric / Value Axis type for use with Polar Charts.
* @description A Polar Numeric axis converts to angles around a circle.
* @remarks
* Set a {@link PolarNumericAxis} on the {@link SciChartPolarSurface.xAxes} or {@link SciChartPolarSurface.yAxes} property.
*
* ---
* 📚 Docs: {@link https://www.scichart.com/documentation/js/v4/2d-charts/axis-api/axis-types/polar-numeric-axis/}
*/
var PolarNumericAxis = /** @class */ (function (_super) {
__extends(PolarNumericAxis, _super);
/**
* Creates an instance of a {@link PolarNumericAxis}
* @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
* access to our WebGL2 Engine and WebAssembly numerical methods
* @param options Optional parameters of type {@link IPolarNumericAxisOptions} used to configure the axis at instantiation time
*
* ---
* 📚 Docs: {@link https://www.scichart.com/documentation/js/v4/2d-charts/axis-api/axis-types/polar-numeric-axis/}
*/
function PolarNumericAxis(webAssemblyContext, options) {
var _this = this;
var _a;
_this = _super.call(this, webAssemblyContext, options) || this;
_this.type = AxisType_1.EAxisType.PolarNumericAxis;
_this.tickProvider = new NumericTickProvider_1.NumericTickProvider(_this.webAssemblyContext2D);
_this.tickCoordinatesProvider = new PolarTickCoordinatesProvider_1.PolarTickCoordinatesProvider();
_this.labelProvider =
(_a = options === null || options === void 0 ? void 0 : options.labelProvider) !== null && _a !== void 0 ? _a : new NumericLabelProvider_1.NumericLabelProvider(options);
_this.deltaCalculator = new NumericDeltaCalculator_1.NumericDeltaCalculator(_this.webAssemblyContext2D);
return _this;
}
/** @inheritDoc */
PolarNumericAxis.prototype.getCurrentCoordinateCalculatorInternal = function () {
var min = this.visibleRange.min;
var max = this.visibleRange.max;
var size = this.getAxisSize();
var offset = this.offset;
return this.flippedCoordinates
? new NumericCoordinateCalculator_1.NumericCoordinateCalculator(this.webAssemblyContext2D, size, min, max, offset, this.allowFastMath, 0, 0)
: new FlippedNumericCoordinateCalculator_1.FlippedNumericCoordinateCalculator(this.webAssemblyContext2D, size, min, max, offset, this.allowFastMath, 0);
};
return PolarNumericAxis;
}(PolarAxisBase_1.PolarAxisBase));
exports.PolarNumericAxis = PolarNumericAxis;