all files / chart/series/ radar-series.js

98.18% Statements 54/55
89.29% Branches 25/28
100% Functions 13/13
98.08% Lines 51/52
11 statements, 6 functions, 9 branches Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73          31×   37× 37× 37× 37× 598× 598×     37× 37× 25×     12×               41538×          
/* istanbul ignore next */ 
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 (b.hasOwnProperty(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 __());
    };
})();
define(["require", "exports", "../../common/utils/helper", "../series/polar-series", "@syncfusion/ej2-base"], function (require, exports, helper_1, polar_series_1, ej2_base_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var RadarSeries = (function (_super) {
        __extends(RadarSeries, _super);
        function RadarSeries() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RadarSeries.prototype.render = function (series, xAxis, yAxis, inverted) {
            var seriesType = helper_1.firstToLowerCase(series.drawType);
            var yAxisMin = yAxis.minimum;
            var yAxisMax = yAxis.maximum;
            for (var _i = 0, _a = series.points; _i < _a.length; _i++) {
                var point = _a[_i];
                point.visible = point.visible && !((!ej2_base_1.isNullOrUndefined(yAxisMin) && point.yValue < yAxisMin) ||
                    (!ej2_base_1.isNullOrUndefined(yAxisMax) && point.yValue > yAxisMax));
            }
            Eif (series.points.length) {
                if (series.drawType.indexOf('Column') === -1) {
                    series.chart[seriesType + 'SeriesModule'].render(series, xAxis, yAxis, inverted);
                }
                else {
                    this.columnDrawTypeRender(series, xAxis, yAxis);
                }
            }
        };
        RadarSeries.prototype.getRadarIsInversedPath = function (xAxis, endPoint) {
            var chart = this.chart;
            var x1;
            var y1;
            var vector;
            var radius = chart.radius;
            var length = xAxis.visibleLabels.length;
            var direction = endPoint;
            vector = helper_1.CoefficientToVector(helper_1.valueToPolarCoefficient(xAxis.visibleLabels[0].value, xAxis), this.startAngle);
            y1 = this.centerY + radius * vector.y;
            x1 = this.centerX + radius * vector.x;
            Iif (isNaN(x1) || isNaN(y1)) {
                return direction;
            }
            direction += ' L ' + x1 + ' ' + y1 + ' ';
            for (var i = length - 1; i >= 0; i--) {
                vector = helper_1.CoefficientToVector(helper_1.valueToPolarCoefficient(xAxis.visibleLabels[i].value, xAxis), this.startAngle);
                y1 = this.centerY + radius * vector.y;
                x1 = this.centerX + radius * vector.x;
                direction += 'L ' + x1 + ' ' + y1 + ' ';
            }
            return direction;
        };
        RadarSeries.prototype.getModuleName = function () {
            return 'RadarSeries';
        };
        RadarSeries.prototype.destroy = function () {
        };
        return RadarSeries;
    }(polar_series_1.PolarSeries));
    exports.RadarSeries = RadarSeries;
});