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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 688× 688× 688× 688× 1× 1× 1× 1× 293× 293× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 102× 102× 102× 102× 102× 102× 102× 102× 102× 102× 1× 1× 1× 1× 7× 7× 7× 1× 1× 1× 3× 1× 1× 11× 11× 1× 1× 4× 4× 1× 1× 3× 3× 3× 3× 3× 3× 3× 3× 3× 3× 3× 1× 1× 1× 24× 24× 24× 24× 24× 24× 24× 24× 24× 24× 24× 1× 1× 1× 8466× 8466× 1× 1× 709× 709× 709× 709× 709× 603× 106× 709× 709× 283× 426× 709× 1× 1× 846× 468× 378× 1× 1× 6× 6× 24× 6× 1× 1× 1397× 1397× 1397× 1× 1× 1× 3× 1× 1× 3× 1× 2× 2× 2× 1× 1× 1× 46× 46× 1× 1× | /* 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", "@syncfusion/ej2-svg-base", "@syncfusion/ej2-base"], function (require, exports, ej2_svg_base_1, ej2_base_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Rect = (function () { function Rect(x, y, height, width) { this.x = x; this.y = y; this.height = height; this.width = width; } return Rect; }()); exports.Rect = Rect; var Size = (function () { function Size(height, width) { this.height = height; this.width = width; } return Size; }()); exports.Size = Size; var Pos = (function () { function Pos(x, y) { this.x = x; this.y = y; } return Pos; }()); exports.Pos = Pos; var RectOption = (function (_super) { __extends(RectOption, _super); function RectOption(id, fill, width, color, opacity, rect, rx, ry, transform, dashArray) { var _this = _super.call(this, id, fill, width, color, opacity, dashArray) || this; _this.y = rect.y; _this.x = rect.x; _this.height = rect.height; _this.width = rect.width; _this.rx = rx ? rx : 0; _this.ry = ry ? ry : 0; _this.transform = transform ? transform : ''; _this.stroke = (width !== 0 && _this.stroke !== '') ? color : 'transparent'; return _this; } return RectOption; }(ej2_svg_base_1.PathOption)); exports.RectOption = RectOption; var ColorValue = (function () { function ColorValue(r, g, b) { this.r = r; this.g = g; this.b = b; } return ColorValue; }()); exports.ColorValue = ColorValue; function convertToHexCode(value) { return '#' + componentToHex(value.r) + componentToHex(value.g) + componentToHex(value.b); } exports.convertToHexCode = convertToHexCode; function componentToHex(value) { var hex = value.toString(16); return hex.length === 1 ? '0' + hex : hex; } exports.componentToHex = componentToHex; function convertHexToColor(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? new ColorValue(parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)) : new ColorValue(255, 255, 255); } exports.convertHexToColor = convertHexToColor; function colorNameToHex(color) { color = color === 'transparent' ? 'white' : color; document.body.appendChild(ej2_base_1.createElement('text', { id: 'chartmeasuretext' })); var element = document.getElementById('chartmeasuretext'); element.style.color = color; color = window.getComputedStyle(element).color; ej2_base_1.remove(element); var isRGBValue; Eif (color.indexOf('rgb') === 0 || color.indexOf('hsl') === 0) { color = color.replace(/\s/g, '').replace(/[()]/g, ''); isRGBValue = color.slice(3).split(','); } return convertToHexCode(new ColorValue(parseInt(isRGBValue[3], 10), parseInt(isRGBValue[4], 10), parseInt(isRGBValue[5], 10))); } exports.colorNameToHex = colorNameToHex; var TextOption = (function () { function TextOption(id, fontSize, fontStyle, fontFamily, fontWeight, textAnchor, fill, x, y, width, height) { this.id = id; this['font-size'] = fontSize; this['font-style'] = fontStyle; this['font-family'] = fontFamily; this['font-weight'] = fontWeight; this['text-anchor'] = textAnchor; this.fill = fill; this.x = x; this.y = y; this.width = width ? width : 0; this.height = height ? height : 0; } return TextOption; }()); exports.TextOption = TextOption; function degreeToLocation(centerX, centerY, radius, angleInDegrees) { var angleInRadians = (angleInDegrees - 90) * (Math.PI / 180); return { x: centerX + (radius * Math.cos(angleInRadians)), y: centerY + (radius * Math.sin(angleInRadians)) }; } exports.degreeToLocation = degreeToLocation; function getPathArc(x, y, radius, startAngle, endAngle, enableRtl, pieView) { var start = degreeToLocation(x, y, radius, startAngle); var end = degreeToLocation(x, y, radius, endAngle); var largeArcFlag = '0'; var sweepFlag = (enableRtl) ? '0' : '1'; if (!enableRtl) { largeArcFlag = ((endAngle >= startAngle) ? endAngle : endAngle + 360) - startAngle <= 180 ? '0' : '1'; } else { largeArcFlag = ((startAngle >= endAngle) ? startAngle : startAngle + 360) - endAngle <= 180 ? '0' : '1'; } var d; if (pieView) { d = 'M ' + x + ' ' + y + ' L ' + start.x + ' ' + start.y + ' A ' + radius + ' ' + radius + ' ' + ' 0 ' + ' ' + largeArcFlag + ' ' + sweepFlag + ' ' + end.x + ' ' + end.y + ' ' + 'Z'; } else { d = 'M' + start.x + ' ' + start.y + 'A' + radius + ' ' + radius + ' ' + '0' + ' ' + largeArcFlag + ' ' + sweepFlag + ' ' + end.x + ' ' + end.y; } return d; } exports.getPathArc = getPathArc; function stringToNumber(value, containerSize) { if (value !== null && value !== undefined) { return value.indexOf('%') !== -1 ? (containerSize / 100) * parseInt(value, 10) : parseInt(value, 10); } return null; } exports.stringToNumber = stringToNumber; function setAttributes(options, element) { var keys = Object.keys(options); for (var i = 0; i < keys.length; i++) { element.setAttribute(keys[i], options[keys[i]]); } return element; } exports.setAttributes = setAttributes; function effect(currentTime, startValue, endValue, duration, enableRtl) { var start = (enableRtl) ? endValue : -endValue; var end = startValue + ((enableRtl) ? -endValue : endValue); return start * Math.cos(currentTime / duration * (Math.PI / 2)) + end; } exports.effect = effect; exports.annotationRender = 'annotationRender'; function getElement(id) { return document.getElementById(id); } exports.getElement = getElement; function removeElement(id) { if (!id) { return null; } var element = typeof id === 'string' ? getElement(id) : id; Eif (element) { ej2_base_1.remove(element); } } exports.removeElement = removeElement; var ProgressLocation = (function () { function ProgressLocation(x, y) { this.x = x; this.y = y; } return ProgressLocation; }()); exports.ProgressLocation = ProgressLocation; }); |