diff --git a/dist/datav.map.vue.js b/dist/datav.map.vue.js index 35444cb..da1dc5c 100644 --- a/dist/datav.map.vue.js +++ b/dist/datav.map.vue.js @@ -192,132 +192,132 @@ } }; - function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { - if (typeof shadowMode !== 'boolean') { - createInjectorSSR = createInjector; - createInjector = shadowMode; - shadowMode = false; - } - // Vue.extend constructor export interop. - const options = typeof script === 'function' ? script.options : script; - // render functions - if (template && template.render) { - options.render = template.render; - options.staticRenderFns = template.staticRenderFns; - options._compiled = true; - // functional template - if (isFunctionalTemplate) { - options.functional = true; - } - } - // scopedId - if (scopeId) { - options._scopeId = scopeId; - } - let hook; - if (moduleIdentifier) { - // server build - hook = function (context) { - // 2.3 injection - context = - context || // cached call - (this.$vnode && this.$vnode.ssrContext) || // stateful - (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional - // 2.2 with runInNewContext: true - if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { - context = __VUE_SSR_CONTEXT__; - } - // inject component styles - if (style) { - style.call(this, createInjectorSSR(context)); - } - // register component module identifier for async chunk inference - if (context && context._registeredComponents) { - context._registeredComponents.add(moduleIdentifier); - } - }; - // used by ssr in case component is cached and beforeCreate - // never gets called - options._ssrRegister = hook; - } - else if (style) { - hook = shadowMode - ? function (context) { - style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); - } - : function (context) { - style.call(this, createInjector(context)); - }; - } - if (hook) { - if (options.functional) { - // register for functional component in vue file - const originalRender = options.render; - options.render = function renderWithStyleInjection(h, context) { - hook.call(context); - return originalRender(h, context); - }; - } - else { - // inject component registration as beforeCreate hook - const existing = options.beforeCreate; - options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; - } - } - return script; + function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { + if (typeof shadowMode !== 'boolean') { + createInjectorSSR = createInjector; + createInjector = shadowMode; + shadowMode = false; + } + // Vue.extend constructor export interop. + const options = typeof script === 'function' ? script.options : script; + // render functions + if (template && template.render) { + options.render = template.render; + options.staticRenderFns = template.staticRenderFns; + options._compiled = true; + // functional template + if (isFunctionalTemplate) { + options.functional = true; + } + } + // scopedId + if (scopeId) { + options._scopeId = scopeId; + } + let hook; + if (moduleIdentifier) { + // server build + hook = function (context) { + // 2.3 injection + context = + context || // cached call + (this.$vnode && this.$vnode.ssrContext) || // stateful + (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional + // 2.2 with runInNewContext: true + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__; + } + // inject component styles + if (style) { + style.call(this, createInjectorSSR(context)); + } + // register component module identifier for async chunk inference + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier); + } + }; + // used by ssr in case component is cached and beforeCreate + // never gets called + options._ssrRegister = hook; + } + else if (style) { + hook = shadowMode + ? function (context) { + style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); + } + : function (context) { + style.call(this, createInjector(context)); + }; + } + if (hook) { + if (options.functional) { + // register for functional component in vue file + const originalRender = options.render; + options.render = function renderWithStyleInjection(h, context) { + hook.call(context); + return originalRender(h, context); + }; + } + else { + // inject component registration as beforeCreate hook + const existing = options.beforeCreate; + options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; + } + } + return script; } - const isOldIE = typeof navigator !== 'undefined' && - /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); - function createInjector(context) { - return (id, style) => addStyle(id, style); - } - let HEAD; - const styles = {}; - function addStyle(id, css) { - const group = isOldIE ? css.media || 'default' : id; - const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] }); - if (!style.ids.has(id)) { - style.ids.add(id); - let code = css.source; - if (css.map) { - // https://developer.chrome.com/devtools/docs/javascript-debugging - // this makes source maps inside style tags work properly in Chrome - code += '\n/*# sourceURL=' + css.map.sources[0] + ' */'; - // http://stackoverflow.com/a/26603875 - code += - '\n/*# sourceMappingURL=data:application/json;base64,' + - btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + - ' */'; - } - if (!style.element) { - style.element = document.createElement('style'); - style.element.type = 'text/css'; - if (css.media) - style.element.setAttribute('media', css.media); - if (HEAD === undefined) { - HEAD = document.head || document.getElementsByTagName('head')[0]; - } - HEAD.appendChild(style.element); - } - if ('styleSheet' in style.element) { - style.styles.push(code); - style.element.styleSheet.cssText = style.styles - .filter(Boolean) - .join('\n'); - } - else { - const index = style.ids.size - 1; - const textNode = document.createTextNode(code); - const nodes = style.element.childNodes; - if (nodes[index]) - style.element.removeChild(nodes[index]); - if (nodes.length) - style.element.insertBefore(textNode, nodes[index]); - else - style.element.appendChild(textNode); - } - } + const isOldIE = typeof navigator !== 'undefined' && + /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); + function createInjector(context) { + return (id, style) => addStyle(id, style); + } + let HEAD; + const styles = {}; + function addStyle(id, css) { + const group = isOldIE ? css.media || 'default' : id; + const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] }); + if (!style.ids.has(id)) { + style.ids.add(id); + let code = css.source; + if (css.map) { + // https://developer.chrome.com/devtools/docs/javascript-debugging + // this makes source maps inside style tags work properly in Chrome + code += '\n/*# sourceURL=' + css.map.sources[0] + ' */'; + // http://stackoverflow.com/a/26603875 + code += + '\n/*# sourceMappingURL=data:application/json;base64,' + + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + + ' */'; + } + if (!style.element) { + style.element = document.createElement('style'); + style.element.type = 'text/css'; + if (css.media) + style.element.setAttribute('media', css.media); + if (HEAD === undefined) { + HEAD = document.head || document.getElementsByTagName('head')[0]; + } + HEAD.appendChild(style.element); + } + if ('styleSheet' in style.element) { + style.styles.push(code); + style.element.styleSheet.cssText = style.styles + .filter(Boolean) + .join('\n'); + } + else { + const index = style.ids.size - 1; + const textNode = document.createTextNode(code); + const nodes = style.element.childNodes; + if (nodes[index]) + style.element.removeChild(nodes[index]); + if (nodes.length) + style.element.insertBefore(textNode, nodes[index]); + else + style.element.appendChild(textNode); + } + } } /* script */ @@ -732,11 +732,11 @@ max = Math.max, min = Math.min, PI = Math.PI; - /** - * @description Clone an object or array - * @param {Object|Array} object Cloned object - * @param {Boolean} recursion Whether to use recursive cloning - * @return {Object|Array} Clone object + /** + * @description Clone an object or array + * @param {Object|Array} object Cloned object + * @param {Boolean} recursion Whether to use recursive cloning + * @return {Object|Array} Clone object */ function deepClone(object) { @@ -761,10 +761,10 @@ return clonedObj; } - /** - * @description Eliminate line blur due to 1px line width - * @param {Array} points Line points - * @return {Array} Line points after processed + /** + * @description Eliminate line blur due to 1px line width + * @param {Array} points Line points + * @return {Array} Line points after processed */ @@ -777,24 +777,24 @@ return [parseInt(x) + 0.5, parseInt(y) + 0.5]; }); } - /** - * @description Check if the point is inside the circle - * @param {Array} point Postion of point - * @param {Number} rx Circle x coordinate - * @param {Number} ry Circle y coordinate - * @param {Number} r Circle radius - * @return {Boolean} Result of check + /** + * @description Check if the point is inside the circle + * @param {Array} point Postion of point + * @param {Number} rx Circle x coordinate + * @param {Number} ry Circle y coordinate + * @param {Number} r Circle radius + * @return {Boolean} Result of check */ function checkPointIsInCircle(point, rx, ry, r) { return getTwoPointDistance(point, [rx, ry]) <= r; } - /** - * @description Get the distance between two points - * @param {Array} point1 point1 - * @param {Array} point2 point2 - * @return {Number} Distance between two points + /** + * @description Get the distance between two points + * @param {Array} point1 point1 + * @param {Array} point2 point2 + * @return {Number} Distance between two points */ @@ -811,11 +811,11 @@ var minusY = abs(ya - yb); return sqrt(minusX * minusX + minusY * minusY); } - /** - * @description Check if the point is inside the polygon - * @param {Array} point Postion of point - * @param {Array} points The points that makes up a polyline - * @return {Boolean} Result of check + /** + * @description Check if the point is inside the polygon + * @param {Array} point Postion of point + * @param {Array} points The points that makes up a polyline + * @return {Boolean} Result of check */ @@ -848,16 +848,16 @@ return counter % 2 === 1; } - /** - * @description Check if the point is inside the sector - * @param {Array} point Postion of point - * @param {Number} rx Sector x coordinate - * @param {Number} ry Sector y coordinate - * @param {Number} r Sector radius - * @param {Number} startAngle Sector start angle - * @param {Number} endAngle Sector end angle - * @param {Boolean} clockWise Whether the sector angle is clockwise - * @return {Boolean} Result of check + /** + * @description Check if the point is inside the sector + * @param {Array} point Postion of point + * @param {Number} rx Sector x coordinate + * @param {Number} ry Sector y coordinate + * @param {Number} r Sector radius + * @param {Number} startAngle Sector start angle + * @param {Number} endAngle Sector end angle + * @param {Boolean} clockWise Whether the sector angle is clockwise + * @return {Boolean} Result of check */ @@ -918,11 +918,11 @@ if (reverseBE) inSector = !inSector; return inSector; } - /** - * @description Determine if the point is in the clockwise direction of the vector - * @param {Array} vArm Vector - * @param {Array} vPoint Point - * @return {Boolean} Result of check + /** + * @description Determine if the point is in the clockwise direction of the vector + * @param {Array} vArm Vector + * @param {Array} vPoint Point + * @return {Boolean} Result of check */ @@ -937,12 +937,12 @@ return -ay * px + ax * py > 0; } - /** - * @description Check if the point is inside the polyline - * @param {Array} point Postion of point - * @param {Array} polyline The points that makes up a polyline - * @param {Number} lineWidth Polyline linewidth - * @return {Boolean} Result of check + /** + * @description Check if the point is inside the polyline + * @param {Array} point Postion of point + * @param {Array} polyline The points that makes up a polyline + * @param {Number} lineWidth Polyline linewidth + * @return {Boolean} Result of check */ @@ -965,14 +965,14 @@ var polygon = [].concat((0, _toConsumableArray2["default"])(moveUpPolyline), (0, _toConsumableArray2["default"])(moveDownPolyline.reverse())); return checkPointIsInPolygon(point, polygon); } - /** - * @description Check if the point is inside the rect - * @param {Array} point Postion of point - * @param {Number} x Rect start x coordinate - * @param {Number} y Rect start y coordinate - * @param {Number} width Rect width - * @param {Number} height Rect height - * @return {Boolean} Result of check + /** + * @description Check if the point is inside the rect + * @param {Array} point Postion of point + * @param {Number} x Rect start x coordinate + * @param {Number} y Rect start y coordinate + * @param {Number} width Rect width + * @param {Number} height Rect height + * @return {Boolean} Result of check */ @@ -987,13 +987,13 @@ if (py > y + height) return false; return true; } - /** - * @description Get the coordinates of the rotated point - * @param {Number} rotate Degree of rotation - * @param {Array} point Postion of point - * @param {Array} origin Rotation center - * @param {Array} origin Rotation center - * @return {Number} Coordinates after rotation + /** + * @description Get the coordinates of the rotated point + * @param {Number} rotate Degree of rotation + * @param {Array} point Postion of point + * @param {Array} origin Rotation center + * @param {Array} origin Rotation center + * @return {Number} Coordinates after rotation */ @@ -1015,12 +1015,12 @@ rotate *= PI / 180; return [(x - ox) * cos(rotate) - (y - oy) * sin(rotate) + ox, (x - ox) * sin(rotate) + (y - oy) * cos(rotate) + oy]; } - /** - * @description Get the coordinates of the scaled point - * @param {Array} scale Scale factor - * @param {Array} point Postion of point - * @param {Array} origin Scale center - * @return {Number} Coordinates after scale + /** + * @description Get the coordinates of the scaled point + * @param {Array} scale Scale factor + * @param {Array} point Postion of point + * @param {Array} origin Scale center + * @return {Number} Coordinates after scale */ @@ -1047,11 +1047,11 @@ var relativePosY = y - oy; return [relativePosX * xs + ox, relativePosY * ys + oy]; } - /** - * @description Get the coordinates of the scaled point - * @param {Array} translate Translation distance - * @param {Array} point Postion of point - * @return {Number} Coordinates after translation + /** + * @description Get the coordinates of the scaled point + * @param {Array} translate Translation distance + * @param {Array} point Postion of point + * @return {Number} Coordinates after translation */ @@ -1068,12 +1068,12 @@ return [x + tx, y + ty]; } - /** - * @description Get the distance from the point to the line - * @param {Array} point Postion of point - * @param {Array} lineBegin Line start position - * @param {Array} lineEnd Line end position - * @return {Number} Distance between point and line + /** + * @description Get the distance from the point to the line + * @param {Array} point Postion of point + * @param {Array} lineBegin Line start position + * @param {Array} lineEnd Line end position + * @return {Number} Distance between point and line */ @@ -1099,27 +1099,27 @@ var denominator = sqrt(a * a + b * b); return molecule / denominator; } - /** - * @description Get the coordinates of the specified radian on the circle - * @param {Number} x Circle x coordinate - * @param {Number} y Circle y coordinate - * @param {Number} radius Circle radius - * @param {Number} radian Specfied radian - * @return {Array} Postion of point + /** + * @description Get the coordinates of the specified radian on the circle + * @param {Number} x Circle x coordinate + * @param {Number} y Circle y coordinate + * @param {Number} radius Circle radius + * @param {Number} radian Specfied radian + * @return {Array} Postion of point */ function getCircleRadianPoint(x, y, radius, radian) { return [x + cos(radian) * radius, y + sin(radian) * radius]; } - /** - * @description Get the points that make up a regular polygon - * @param {Number} x X coordinate of the polygon inscribed circle - * @param {Number} y Y coordinate of the polygon inscribed circle - * @param {Number} r Radius of the polygon inscribed circle - * @param {Number} side Side number - * @param {Number} minus Radian offset - * @return {Array} Points that make up a regular polygon + /** + * @description Get the points that make up a regular polygon + * @param {Number} x X coordinate of the polygon inscribed circle + * @param {Number} y Y coordinate of the polygon inscribed circle + * @param {Number} r Radius of the polygon inscribed circle + * @param {Number} side Side number + * @param {Number} minus Radian offset + * @return {Array} Points that make up a regular polygon */ @@ -3823,10 +3823,10 @@ var hexReg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var rgbReg = /^(rgb|rgba|RGB|RGBA)/; var rgbaReg = /^(rgba|RGBA)/; - /** - * @description Color validator - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {String|Boolean} Valid color Or false + /** + * @description Color validator + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {String|Boolean} Valid color Or false */ function validator(color) { @@ -3842,10 +3842,10 @@ return color; } - /** - * @description Get color by keyword - * @param {String} keyword Color keyword like red, green and etc. - * @return {String|Boolean} Hex or rgba color (Invalid keyword will return false) + /** + * @description Get color by keyword + * @param {String} keyword Color keyword like red, green and etc. + * @return {String|Boolean} Hex or rgba color (Invalid keyword will return false) */ @@ -3858,10 +3858,10 @@ if (!_keywords["default"].has(keyword)) return false; return _keywords["default"].get(keyword); } - /** - * @description Get the Rgb value of the color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {Array|Boolean} Rgb value of the color (Invalid input will return false) + /** + * @description Get the Rgb value of the color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {Array|Boolean} Rgb value of the color (Invalid input will return false) */ @@ -3879,10 +3879,10 @@ if (isHex) return getRgbValueFromHex(lowerColor); if (isRgb) return getRgbValueFromRgb(lowerColor); } - /** - * @description Get the rgb value of the hex color - * @param {String} color Hex color - * @return {Array} Rgb value of the color + /** + * @description Get the rgb value of the hex color + * @param {String} color Hex color + * @return {Array} Rgb value of the color */ @@ -3896,10 +3896,10 @@ return parseInt("0x".concat(color[i * 2]).concat(color[i * 2 + 1])); }); } - /** - * @description Get the rgb value of the rgb/rgba color - * @param {String} color Hex color - * @return {Array} Rgb value of the color + /** + * @description Get the rgb value of the rgb/rgba color + * @param {String} color Hex color + * @return {Array} Rgb value of the color */ @@ -3908,10 +3908,10 @@ return parseInt(n); }); } - /** - * @description Get the Rgba value of the color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {Array|Boolean} Rgba value of the color (Invalid input will return false) + /** + * @description Get the Rgba value of the color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {Array|Boolean} Rgba value of the color (Invalid input will return false) */ @@ -3926,10 +3926,10 @@ colorValue.push(getOpacity(color)); return colorValue; } - /** - * @description Get the opacity of color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {Number|Boolean} Color opacity (Invalid input will return false) + /** + * @description Get the opacity of color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {Number|Boolean} Color opacity (Invalid input will return false) */ @@ -3946,11 +3946,11 @@ color = color.toLowerCase(); return Number(color.split(',').slice(-1)[0].replace(/[)|\s]/g, '')); } - /** - * @description Convert color to Rgb|Rgba color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @param {Number} opacity The opacity of color - * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false) + /** + * @description Convert color to Rgb|Rgba color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @param {Number} opacity The opacity of color + * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false) */ @@ -3966,10 +3966,10 @@ if (addOpacity) return 'rgba(' + rgbValue.join(',') + ",".concat(opacity, ")"); return 'rgb(' + rgbValue.join(',') + ')'; } - /** - * @description Convert color to Hex color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {String|Boolean} Hex color (Invalid input will return false) + /** + * @description Convert color to Hex color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {String|Boolean} Hex color (Invalid input will return false) */ @@ -3988,10 +3988,10 @@ return n === '0' ? '00' : n; }).join(''); } - /** - * @description Get Color from Rgb|Rgba value - * @param {Array} value Rgb|Rgba color value - * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false) + /** + * @description Get Color from Rgb|Rgba value + * @param {Array} value Rgb|Rgba color value + * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false) */ @@ -4012,11 +4012,11 @@ color += value.join(',') + ')'; return color; } - /** - * @description Deepen color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {Number} Percent of Deepen (1-100) - * @return {String|Boolean} Rgba color (Invalid input will return false) + /** + * @description Deepen color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {Number} Percent of Deepen (1-100) + * @return {String|Boolean} Rgba color (Invalid input will return false) */ @@ -4037,11 +4037,11 @@ }); return getColorFromRgbValue(rgbaValue); } - /** - * @description Brighten color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {Number} Percent of brighten (1-100) - * @return {String|Boolean} Rgba color (Invalid input will return false) + /** + * @description Brighten color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {Number} Percent of brighten (1-100) + * @return {String|Boolean} Rgba color (Invalid input will return false) */ @@ -4062,11 +4062,11 @@ }); return getColorFromRgbValue(rgbaValue); } - /** - * @description Adjust color opacity - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @param {Number} Percent of opacity - * @return {String|Boolean} Rgba color (Invalid input will return false) + /** + * @description Adjust color opacity + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @param {Number} Percent of opacity + * @return {String|Boolean} Rgba color (Invalid input will return false) */ @@ -7627,27 +7627,27 @@ abs = Math.abs; // Initialize the number of points per curve var defaultSegmentPointsNum = 50; - /** - * @example data structure of bezierCurve - * bezierCurve = [ - * // Starting point of the curve - * [10, 10], - * // BezierCurve segment data (controlPoint1, controlPoint2, endPoint) - * [ - * [20, 20], [40, 20], [50, 10] - * ], - * ... - * ] + /** + * @example data structure of bezierCurve + * bezierCurve = [ + * // Starting point of the curve + * [10, 10], + * // BezierCurve segment data (controlPoint1, controlPoint2, endPoint) + * [ + * [20, 20], [40, 20], [50, 10] + * ], + * ... + * ] */ - /** - * @description Abstract the curve as a polyline consisting of N points - * @param {Array} bezierCurve bezierCurve data - * @param {Number} precision calculation accuracy. Recommended for 1-20. Default = 5 - * @return {Object} Calculation results and related data - * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation - * @return {Number} Option.cycles Number of iterations - * @return {Number} Option.rounds The number of recursions for the last iteration + /** + * @description Abstract the curve as a polyline consisting of N points + * @param {Array} bezierCurve bezierCurve data + * @param {Number} precision calculation accuracy. Recommended for 1-20. Default = 5 + * @return {Object} Calculation results and related data + * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation + * @return {Number} Option.cycles Number of iterations + * @return {Number} Option.rounds The number of recursions for the last iteration */ function abstractBezierCurveToPolyline(bezierCurve) { @@ -7668,13 +7668,13 @@ result.segmentPoints.push(endPoint); return result; } - /** - * @description Generate a method for obtaining corresponding point by t according to curve data - * @param {Array} beginPoint BezierCurve begin point. [x, y] - * @param {Array} controlPoint1 BezierCurve controlPoint1. [x, y] - * @param {Array} controlPoint2 BezierCurve controlPoint2. [x, y] - * @param {Array} endPoint BezierCurve end point. [x, y] - * @return {Function} Expected function + /** + * @description Generate a method for obtaining corresponding point by t according to curve data + * @param {Array} beginPoint BezierCurve begin point. [x, y] + * @param {Array} controlPoint1 BezierCurve controlPoint1. [x, y] + * @param {Array} controlPoint2 BezierCurve controlPoint2. [x, y] + * @param {Array} endPoint BezierCurve end point. [x, y] + * @return {Function} Expected function */ @@ -7688,11 +7688,11 @@ return [beginPoint[0] * tSubed1Pow3 + 3 * controlPoint1[0] * t * tSubed1Pow2 + 3 * controlPoint2[0] * tPow2 * tSubed1 + endPoint[0] * tPow3, beginPoint[1] * tSubed1Pow3 + 3 * controlPoint1[1] * t * tSubed1Pow2 + 3 * controlPoint2[1] * tPow2 * tSubed1 + endPoint[1] * tPow3]; }; } - /** - * @description Get the distance between two points - * @param {Array} point1 BezierCurve begin point. [x, y] - * @param {Array} point2 BezierCurve controlPoint1. [x, y] - * @return {Number} Expected distance + /** + * @description Get the distance between two points + * @param {Array} point1 BezierCurve begin point. [x, y] + * @param {Array} point2 BezierCurve controlPoint1. [x, y] + * @return {Number} Expected distance */ @@ -7707,10 +7707,10 @@ return sqrt(pow(ax - bx, 2) + pow(ay - by, 2)); } - /** - * @description Get the sum of the array of numbers - * @param {Array} nums An array of numbers - * @return {Number} Expected sum + /** + * @description Get the sum of the array of numbers + * @param {Array} nums An array of numbers + * @return {Number} Expected sum */ @@ -7719,10 +7719,10 @@ return sum + num; }, 0); } - /** - * @description Get the distance of multiple sets of points - * @param {Array} segmentPoints Multiple sets of point data - * @return {Array} Distance of multiple sets of point data + /** + * @description Get the distance of multiple sets of points + * @param {Array} segmentPoints Multiple sets of point data + * @return {Array} Distance of multiple sets of point data */ @@ -7733,10 +7733,10 @@ }); }); } - /** - * @description Get the distance of multiple sets of points - * @param {Array} segmentPoints Multiple sets of point data - * @return {Array} Distance of multiple sets of point data + /** + * @description Get the distance of multiple sets of points + * @param {Array} segmentPoints Multiple sets of point data + * @return {Array} Distance of multiple sets of point data */ @@ -7748,11 +7748,11 @@ }); }); } - /** - * @description Get the sum of deviations between line segment and the average length - * @param {Array} segmentPointsDistance Segment length of polyline - * @param {Number} avgLength Average length of the line segment - * @return {Number} Deviations + /** + * @description Get the sum of deviations between line segment and the average length + * @param {Array} segmentPointsDistance Segment length of polyline + * @param {Number} avgLength Average length of the line segment + * @return {Number} Deviations */ @@ -7767,16 +7767,16 @@ return total + v; }, 0); } - /** - * @description Calculate uniformly distributed points by iteratively - * @param {Array} segmentPoints Multiple setd of points that make up a polyline - * @param {Array} getSegmentTPointFuns Functions of get a point on the curve with t - * @param {Array} segments BezierCurve data - * @param {Number} precision Calculation accuracy - * @return {Object} Calculation results and related data - * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation - * @return {Number} Option.cycles Number of iterations - * @return {Number} Option.rounds The number of recursions for the last iteration + /** + * @description Calculate uniformly distributed points by iteratively + * @param {Array} segmentPoints Multiple setd of points that make up a polyline + * @param {Array} getSegmentTPointFuns Functions of get a point on the curve with t + * @param {Array} segments BezierCurve data + * @param {Number} precision Calculation accuracy + * @return {Object} Calculation results and related data + * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation + * @return {Number} Option.cycles Number of iterations + * @return {Number} Option.rounds The number of recursions for the last iteration */ @@ -7873,11 +7873,11 @@ rounds: rounds }; } - /** - * @description Get the polyline corresponding to the Bezier curve - * @param {Array} bezierCurve BezierCurve data - * @param {Number} precision Calculation accuracy. Recommended for 1-20. Default = 5 - * @return {Array|Boolean} Point data that constitutes a polyline after calculation (Invalid input will return false) + /** + * @description Get the polyline corresponding to the Bezier curve + * @param {Array} bezierCurve BezierCurve data + * @param {Number} precision Calculation accuracy. Recommended for 1-20. Default = 5 + * @return {Array|Boolean} Point data that constitutes a polyline after calculation (Invalid input will return false) */ @@ -7904,11 +7904,11 @@ return segmentPoints; } - /** - * @description Get the bezier curve length - * @param {Array} bezierCurve bezierCurve data - * @param {Number} precision calculation accuracy. Recommended for 5-10. Default = 5 - * @return {Number|Boolean} BezierCurve length (Invalid input will return false) + /** + * @description Get the bezier curve length + * @param {Array} bezierCurve bezierCurve data + * @param {Number} precision calculation accuracy. Recommended for 5-10. Default = 5 + * @return {Number|Boolean} BezierCurve length (Invalid input will return false) */ @@ -7960,13 +7960,13 @@ var _toConsumableArray2 = interopRequireDefault(toConsumableArray); - /** - * @description Abstract the polyline formed by N points into a set of bezier curve - * @param {Array} polyline A set of points that make up a polyline - * @param {Boolean} close Closed curve - * @param {Number} offsetA Smoothness - * @param {Number} offsetB Smoothness - * @return {Array|Boolean} A set of bezier curve (Invalid input will return false) + /** + * @description Abstract the polyline formed by N points into a set of bezier curve + * @param {Array} polyline A set of points that make up a polyline + * @param {Boolean} close Closed curve + * @param {Number} offsetA Smoothness + * @param {Number} offsetB Smoothness + * @return {Array|Boolean} A set of bezier curve (Invalid input will return false) */ function polylineToBezierCurve(polyline) { var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; @@ -7992,14 +7992,14 @@ bezierCurvePoints.unshift(polyline[0]); return bezierCurvePoints; } - /** - * @description Get the control points of the Bezier curve - * @param {Array} polyline A set of points that make up a polyline - * @param {Number} index The index of which get controls points's point in polyline - * @param {Boolean} close Closed curve - * @param {Number} offsetA Smoothness - * @param {Number} offsetB Smoothness - * @return {Array} Control points + /** + * @description Get the control points of the Bezier curve + * @param {Array} polyline A set of points that make up a polyline + * @param {Number} index The index of which get controls points's point in polyline + * @param {Boolean} close Closed curve + * @param {Number} offsetA Smoothness + * @param {Number} offsetB Smoothness + * @return {Array} Control points */ @@ -8021,11 +8021,11 @@ var pointAfterNext = polyline[afterNextPointIndex]; return [[pointMiddle[0] + offsetA * (pointAfter[0] - pointBefore[0]), pointMiddle[1] + offsetA * (pointAfter[1] - pointBefore[1])], [pointAfter[0] - offsetB * (pointAfterNext[0] - pointMiddle[0]), pointAfter[1] - offsetB * (pointAfterNext[1] - pointMiddle[1])]]; } - /** - * @description Get the last curve of the closure - * @param {Array} bezierCurve A set of sub-curve - * @param {Array} startPoint Start point - * @return {Array} The last curve for closure + /** + * @description Get the last curve of the closure + * @param {Array} bezierCurve A set of sub-curve + * @param {Array} startPoint Start point + * @return {Array} The last curve for closure */ @@ -8035,11 +8035,11 @@ bezierCurve.push([getSymmetryPoint(lastSubCurve[1], lastSubCurve[2]), getSymmetryPoint(firstSubCurve[0], startPoint), startPoint]); return bezierCurve; } - /** - * @description Get the symmetry point - * @param {Array} point Symmetric point - * @param {Array} centerPoint Symmetric center - * @return {Array} Symmetric point + /** + * @description Get the symmetry point + * @param {Array} point Symmetric point + * @param {Array} centerPoint Symmetric center + * @return {Array} Symmetric point */ @@ -8117,13 +8117,13 @@ var _toConsumableArray2 = interopRequireDefault(toConsumableArray); - /** - * @description Draw a polyline path - * @param {Object} ctx Canvas 2d context - * @param {Array} points The points that makes up a polyline - * @param {Boolean} beginPath Whether to execute beginPath - * @param {Boolean} closePath Whether to execute closePath - * @return {Undefined} Void + /** + * @description Draw a polyline path + * @param {Object} ctx Canvas 2d context + * @param {Array} points The points that makes up a polyline + * @param {Boolean} beginPath Whether to execute beginPath + * @param {Boolean} closePath Whether to execute closePath + * @return {Undefined} Void */ function drawPolylinePath(ctx, points) { var beginPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; @@ -8135,14 +8135,14 @@ }); if (closePath) ctx.closePath(); } - /** - * @description Draw a bezier curve path - * @param {Object} ctx Canvas 2d context - * @param {Array} points The points that makes up a bezier curve - * @param {Array} moveTo The point need to excute moveTo - * @param {Boolean} beginPath Whether to execute beginPath - * @param {Boolean} closePath Whether to execute closePath - * @return {Undefined} Void + /** + * @description Draw a bezier curve path + * @param {Object} ctx Canvas 2d context + * @param {Array} points The points that makes up a bezier curve + * @param {Array} moveTo The point need to excute moveTo + * @param {Boolean} beginPath Whether to execute beginPath + * @param {Boolean} closePath Whether to execute closePath + * @return {Undefined} Void */ @@ -9039,11 +9039,11 @@ exports.text = text; var graphs = new Map([['circle', circle], ['ellipse', ellipse], ['rect', rect], ['ring', ring], ['arc', arc], ['sector', sector], ['regPolygon', regPolygon], ['polyline', polyline], ['smoothline', smoothline], ['bezierCurve', bezierCurve], ['text', text]]); var _default = graphs; - /** - * @description Extend new graph - * @param {String} name Name of Graph - * @param {Object} config Configuration of Graph - * @return {Undefined} Void + /** + * @description Extend new graph + * @param {String} name Name of Graph + * @param {Object} config Configuration of Graph + * @return {Undefined} Void */ exports["default"] = _default; @@ -9875,254 +9875,254 @@ - /** - * @description Class Style - * @param {Object} style Style configuration - * @return {Style} Instance of Style + /** + * @description Class Style + * @param {Object} style Style configuration + * @return {Style} Instance of Style */ var Style = function Style(style) { (0, _classCallCheck2["default"])(this, Style); this.colorProcessor(style); var defaultStyle = { - /** - * @description Rgba value of graph fill color - * @type {Array} - * @default fill = [0, 0, 0, 1] + /** + * @description Rgba value of graph fill color + * @type {Array} + * @default fill = [0, 0, 0, 1] */ fill: [0, 0, 0, 1], - /** - * @description Rgba value of graph stroke color - * @type {Array} - * @default stroke = [0, 0, 0, 1] + /** + * @description Rgba value of graph stroke color + * @type {Array} + * @default stroke = [0, 0, 0, 1] */ stroke: [0, 0, 0, 0], - /** - * @description Opacity of graph - * @type {Number} - * @default opacity = 1 + /** + * @description Opacity of graph + * @type {Number} + * @default opacity = 1 */ opacity: 1, - /** - * @description LineCap of Ctx - * @type {String} - * @default lineCap = null - * @example lineCap = 'butt'|'round'|'square' + /** + * @description LineCap of Ctx + * @type {String} + * @default lineCap = null + * @example lineCap = 'butt'|'round'|'square' */ lineCap: null, - /** - * @description Linejoin of Ctx - * @type {String} - * @default lineJoin = null - * @example lineJoin = 'round'|'bevel'|'miter' + /** + * @description Linejoin of Ctx + * @type {String} + * @default lineJoin = null + * @example lineJoin = 'round'|'bevel'|'miter' */ lineJoin: null, - /** - * @description LineDash of Ctx - * @type {Array} - * @default lineDash = null - * @example lineDash = [10, 10] + /** + * @description LineDash of Ctx + * @type {Array} + * @default lineDash = null + * @example lineDash = [10, 10] */ lineDash: null, - /** - * @description LineDashOffset of Ctx - * @type {Number} - * @default lineDashOffset = null - * @example lineDashOffset = 10 + /** + * @description LineDashOffset of Ctx + * @type {Number} + * @default lineDashOffset = null + * @example lineDashOffset = 10 */ lineDashOffset: null, - /** - * @description ShadowBlur of Ctx - * @type {Number} - * @default shadowBlur = 0 + /** + * @description ShadowBlur of Ctx + * @type {Number} + * @default shadowBlur = 0 */ shadowBlur: 0, - /** - * @description Rgba value of graph shadow color - * @type {Array} - * @default shadowColor = [0, 0, 0, 0] + /** + * @description Rgba value of graph shadow color + * @type {Array} + * @default shadowColor = [0, 0, 0, 0] */ shadowColor: [0, 0, 0, 0], - /** - * @description ShadowOffsetX of Ctx - * @type {Number} - * @default shadowOffsetX = 0 + /** + * @description ShadowOffsetX of Ctx + * @type {Number} + * @default shadowOffsetX = 0 */ shadowOffsetX: 0, - /** - * @description ShadowOffsetY of Ctx - * @type {Number} - * @default shadowOffsetY = 0 + /** + * @description ShadowOffsetY of Ctx + * @type {Number} + * @default shadowOffsetY = 0 */ shadowOffsetY: 0, - /** - * @description LineWidth of Ctx - * @type {Number} - * @default lineWidth = 0 + /** + * @description LineWidth of Ctx + * @type {Number} + * @default lineWidth = 0 */ lineWidth: 0, - /** - * @description Center point of the graph - * @type {Array} - * @default graphCenter = null - * @example graphCenter = [10, 10] + /** + * @description Center point of the graph + * @type {Array} + * @default graphCenter = null + * @example graphCenter = [10, 10] */ graphCenter: null, - /** - * @description Graph scale - * @type {Array} - * @default scale = null - * @example scale = [1.5, 1.5] + /** + * @description Graph scale + * @type {Array} + * @default scale = null + * @example scale = [1.5, 1.5] */ scale: null, - /** - * @description Graph rotation degree - * @type {Number} - * @default rotate = null - * @example rotate = 10 + /** + * @description Graph rotation degree + * @type {Number} + * @default rotate = null + * @example rotate = 10 */ rotate: null, - /** - * @description Graph translate distance - * @type {Array} - * @default translate = null - * @example translate = [10, 10] + /** + * @description Graph translate distance + * @type {Array} + * @default translate = null + * @example translate = [10, 10] */ translate: null, - /** - * @description Cursor status when hover - * @type {String} - * @default hoverCursor = 'pointer' - * @example hoverCursor = 'default'|'pointer'|'auto'|'crosshair'|'move'|'wait'|... + /** + * @description Cursor status when hover + * @type {String} + * @default hoverCursor = 'pointer' + * @example hoverCursor = 'default'|'pointer'|'auto'|'crosshair'|'move'|'wait'|... */ hoverCursor: 'pointer', - /** - * @description Font style of Ctx - * @type {String} - * @default fontStyle = 'normal' - * @example fontStyle = 'normal'|'italic'|'oblique' + /** + * @description Font style of Ctx + * @type {String} + * @default fontStyle = 'normal' + * @example fontStyle = 'normal'|'italic'|'oblique' */ fontStyle: 'normal', - /** - * @description Font varient of Ctx - * @type {String} - * @default fontVarient = 'normal' - * @example fontVarient = 'normal'|'small-caps' + /** + * @description Font varient of Ctx + * @type {String} + * @default fontVarient = 'normal' + * @example fontVarient = 'normal'|'small-caps' */ fontVarient: 'normal', - /** - * @description Font weight of Ctx - * @type {String|Number} - * @default fontWeight = 'normal' - * @example fontWeight = 'normal'|'bold'|'bolder'|'lighter'|Number + /** + * @description Font weight of Ctx + * @type {String|Number} + * @default fontWeight = 'normal' + * @example fontWeight = 'normal'|'bold'|'bolder'|'lighter'|Number */ fontWeight: 'normal', - /** - * @description Font size of Ctx - * @type {Number} - * @default fontSize = 10 + /** + * @description Font size of Ctx + * @type {Number} + * @default fontSize = 10 */ fontSize: 10, - /** - * @description Font family of Ctx - * @type {String} - * @default fontFamily = 'Arial' + /** + * @description Font family of Ctx + * @type {String} + * @default fontFamily = 'Arial' */ fontFamily: 'Arial', - /** - * @description TextAlign of Ctx - * @type {String} - * @default textAlign = 'center' - * @example textAlign = 'start'|'end'|'left'|'right'|'center' + /** + * @description TextAlign of Ctx + * @type {String} + * @default textAlign = 'center' + * @example textAlign = 'start'|'end'|'left'|'right'|'center' */ textAlign: 'center', - /** - * @description TextBaseline of Ctx - * @type {String} - * @default textBaseline = 'middle' - * @example textBaseline = 'top'|'bottom'|'middle'|'alphabetic'|'hanging' + /** + * @description TextBaseline of Ctx + * @type {String} + * @default textBaseline = 'middle' + * @example textBaseline = 'top'|'bottom'|'middle'|'alphabetic'|'hanging' */ textBaseline: 'middle', - /** - * @description The color used to create the gradient - * @type {Array} - * @default gradientColor = null - * @example gradientColor = ['#000', '#111', '#222'] + /** + * @description The color used to create the gradient + * @type {Array} + * @default gradientColor = null + * @example gradientColor = ['#000', '#111', '#222'] */ gradientColor: null, - /** - * @description Gradient type - * @type {String} - * @default gradientType = 'linear' - * @example gradientType = 'linear' | 'radial' + /** + * @description Gradient type + * @type {String} + * @default gradientType = 'linear' + * @example gradientType = 'linear' | 'radial' */ gradientType: 'linear', - /** - * @description Gradient params - * @type {Array} - * @default gradientParams = null - * @example gradientParams = [x0, y0, x1, y1] (Linear Gradient) - * @example gradientParams = [x0, y0, r0, x1, y1, r1] (Radial Gradient) + /** + * @description Gradient params + * @type {Array} + * @default gradientParams = null + * @example gradientParams = [x0, y0, x1, y1] (Linear Gradient) + * @example gradientParams = [x0, y0, r0, x1, y1, r1] (Radial Gradient) */ gradientParams: null, - /** - * @description When to use gradients - * @type {String} - * @default gradientWith = 'stroke' - * @example gradientWith = 'stroke' | 'fill' + /** + * @description When to use gradients + * @type {String} + * @default gradientWith = 'stroke' + * @example gradientWith = 'stroke' | 'fill' */ gradientWith: 'stroke', - /** - * @description Gradient color stops - * @type {String} - * @default gradientStops = 'auto' - * @example gradientStops = 'auto' | [0, .2, .3, 1] + /** + * @description Gradient color stops + * @type {String} + * @default gradientStops = 'auto' + * @example gradientStops = 'auto' | [0, .2, .3, 1] */ gradientStops: 'auto', - /** - * @description Extended color that supports animation transition - * @type {Array|Object} - * @default colors = null - * @example colors = ['#000', '#111', '#222', 'red' ] - * @example colors = { a: '#000', b: '#111' } + /** + * @description Extended color that supports animation transition + * @type {Array|Object} + * @default colors = null + * @example colors = ['#000', '#111', '#222', 'red' ] + * @example colors = { a: '#000', b: '#111' } */ colors: null }; Object.assign(this, defaultStyle, style); }; - /** - * @description Set colors to rgba value - * @param {Object} style style config - * @param {Boolean} reverse Whether to perform reverse operation - * @return {Undefined} Void + /** + * @description Set colors to rgba value + * @param {Object} style style config + * @param {Boolean} reverse Whether to perform reverse operation + * @return {Undefined} Void */ @@ -10154,10 +10154,10 @@ }); } }; - /** - * @description Init graph style - * @param {Object} ctx Context of canvas - * @return {Undefined} Void + /** + * @description Init graph style + * @param {Object} ctx Context of canvas + * @return {Undefined} Void */ @@ -10166,11 +10166,11 @@ initGraphStyle(ctx, this); initGradient(ctx, this); }; - /** - * @description Init canvas transform - * @param {Object} ctx Context of canvas - * @param {Style} style Instance of Style - * @return {Undefined} Void + /** + * @description Init canvas transform + * @param {Object} ctx Context of canvas + * @param {Style} style Instance of Style + * @return {Undefined} Void */ @@ -10189,11 +10189,11 @@ } var autoSetStyleKeys = ['lineCap', 'lineJoin', 'lineDashOffset', 'shadowOffsetX', 'shadowOffsetY', 'lineWidth', 'textAlign', 'textBaseline']; - /** - * @description Set the style of canvas ctx - * @param {Object} ctx Context of canvas - * @param {Style} style Instance of Style - * @return {Undefined} Void + /** + * @description Set the style of canvas ctx + * @param {Object} ctx Context of canvas + * @param {Style} style Instance of Style + * @return {Undefined} Void */ function initGraphStyle(ctx, style) { @@ -10231,11 +10231,11 @@ fontFamily = style.fontFamily; ctx.font = fontStyle + ' ' + fontVarient + ' ' + fontWeight + ' ' + fontSize + 'px' + ' ' + fontFamily; } - /** - * @description Set the gradient color of canvas ctx - * @param {Object} ctx Context of canvas - * @param {Style} style Instance of Style - * @return {Undefined} Void + /** + * @description Set the gradient color of canvas ctx + * @param {Object} ctx Context of canvas + * @param {Style} style Instance of Style + * @return {Undefined} Void */ @@ -10263,10 +10263,10 @@ }); ctx["".concat(gradientWith, "Style")] = gradient; } - /** - * @description Check if the gradient configuration is legal - * @param {Style} style Instance of Style - * @return {Boolean} Check Result + /** + * @description Check if the gradient configuration is legal + * @param {Style} style Instance of Style + * @return {Boolean} Check Result */ @@ -10307,10 +10307,10 @@ return true; } - /** - * @description Get a uniform gradient color stop - * @param {Array} color Gradient color - * @return {Array} Gradient color stop + /** + * @description Get a uniform gradient color stop + * @param {Array} color Gradient color + * @return {Array} Gradient color stop */ @@ -10320,20 +10320,20 @@ return stopGap * i; }); } - /** - * @description Restore canvas ctx transform - * @param {Object} ctx Context of canvas - * @return {Undefined} Void + /** + * @description Restore canvas ctx transform + * @param {Object} ctx Context of canvas + * @return {Undefined} Void */ Style.prototype.restoreTransform = function (ctx) { ctx.restore(); }; - /** - * @description Update style data - * @param {Object} change Changed data - * @return {Undefined} Void + /** + * @description Update style data + * @param {Object} change Changed data + * @return {Undefined} Void */ @@ -10341,9 +10341,9 @@ this.colorProcessor(change); Object.assign(this, change); }; - /** - * @description Get the current style configuration - * @return {Object} Style configuration + /** + * @description Get the current style configuration + * @return {Object} Style configuration */ @@ -10363,8 +10363,8 @@ }); exports["default"] = exports.easeInOutBounce = exports.easeOutBounce = exports.easeInBounce = exports.easeInOutElastic = exports.easeOutElastic = exports.easeInElastic = exports.easeInOutBack = exports.easeOutBack = exports.easeInBack = exports.easeInOutQuint = exports.easeOutQuint = exports.easeInQuint = exports.easeInOutQuart = exports.easeOutQuart = exports.easeInQuart = exports.easeInOutCubic = exports.easeOutCubic = exports.easeInCubic = exports.easeInOutQuad = exports.easeOutQuad = exports.easeInQuad = exports.easeInOutSine = exports.easeOutSine = exports.easeInSine = exports.linear = void 0; var linear = [[[0, 1], '', [0.33, 0.67]], [[1, 0], [0.67, 0.33]]]; - /** - * @description Sine + /** + * @description Sine */ exports.linear = linear; @@ -10373,8 +10373,8 @@ var easeOutSine = [[[0, 1]], [[0.444, 0.448], [0.169, 0.736], [0.718, 0.16]], [[1, 0]]]; exports.easeOutSine = easeOutSine; var easeInOutSine = [[[0, 1]], [[0.5, 0.5], [0.2, 1], [0.8, 0]], [[1, 0]]]; - /** - * @description Quad + /** + * @description Quad */ exports.easeInOutSine = easeInOutSine; @@ -10383,8 +10383,8 @@ var easeOutQuad = [[[0, 1]], [[0.413, 0.428], [0.065, 0.816], [0.760, 0.04]], [[1, 0]]]; exports.easeOutQuad = easeOutQuad; var easeInOutQuad = [[[0, 1]], [[0.5, 0.5], [0.3, 0.9], [0.7, 0.1]], [[1, 0]]]; - /** - * @description Cubic + /** + * @description Cubic */ exports.easeInOutQuad = easeInOutQuad; @@ -10393,8 +10393,8 @@ var easeOutCubic = [[[0, 1]], [[0.321, 0.312], [0.008, 0.616], [0.634, 0.008]], [[1, 0]]]; exports.easeOutCubic = easeOutCubic; var easeInOutCubic = [[[0, 1]], [[0.5, 0.5], [0.3, 1], [0.7, 0]], [[1, 0]]]; - /** - * @description Quart + /** + * @description Quart */ exports.easeInOutCubic = easeInOutCubic; @@ -10403,8 +10403,8 @@ var easeOutQuart = [[[0, 1]], [[0.152, 0.244], [0.001, 0.448], [0.285, -0.02]], [[1, 0]]]; exports.easeOutQuart = easeOutQuart; var easeInOutQuart = [[[0, 1]], [[0.5, 0.5], [0.4, 1], [0.6, 0]], [[1, 0]]]; - /** - * @description Quint + /** + * @description Quint */ exports.easeInOutQuart = easeInOutQuart; @@ -10413,8 +10413,8 @@ var easeOutQuint = [[[0, 1]], [[0.108, 0.2], [0.001, 0.4], [0.214, -0.012]], [[1, 0]]]; exports.easeOutQuint = easeOutQuint; var easeInOutQuint = [[[0, 1]], [[0.5, 0.5], [0.5, 1], [0.5, 0]], [[1, 0]]]; - /** - * @description Back + /** + * @description Back */ exports.easeInOutQuint = easeInOutQuint; @@ -10423,8 +10423,8 @@ var easeOutBack = [[[0, 1]], [[0.335, 0.028], [0.061, 0.22], [0.631, -0.18]], [[1, 0]]]; exports.easeOutBack = easeOutBack; var easeInOutBack = [[[0, 1]], [[0.5, 0.5], [0.4, 1.4], [0.6, -0.4]], [[1, 0]]]; - /** - * @description Elastic + /** + * @description Elastic */ exports.easeInOutBack = easeInOutBack; @@ -10433,8 +10433,8 @@ var easeOutElastic = [[[0, 1]], [[0.073, -0.32], [0.034, -0.328], [0.104, -0.344]], [[0.191, 0.092], [0.110, 0.06], [0.256, 0.08]], [[0.310, -0.076], [0.260, -0.068], [0.357, -0.076]], [[0.432, 0.032], [0.362, 0.028], [0.683, -0.004]], [[1, 0]]]; exports.easeOutElastic = easeOutElastic; var easeInOutElastic = [[[0, 1]], [[0.210, 0.94], [0.167, 0.884], [0.252, 0.98]], [[0.299, 1.104], [0.256, 1.092], [0.347, 1.108]], [[0.5, 0.496], [0.451, 0.672], [0.548, 0.324]], [[0.696, -0.108], [0.652, -0.112], [0.741, -0.124]], [[0.805, 0.064], [0.756, 0.012], [0.866, 0.096]], [[1, 0]]]; - /** - * @description Bounce + /** + * @description Bounce */ exports.easeInOutElastic = easeInOutElastic; @@ -10495,15 +10495,15 @@ var _curves = interopRequireDefault(curves); var defaultTransitionBC = 'linear'; - /** - * @description Get the N-frame animation state by the start and end state - * of the animation and the easing curve - * @param {String|Array} tBC Easing curve name or data - * @param {Number|Array|Object} startState Animation start state - * @param {Number|Array|Object} endState Animation end state - * @param {Number} frameNum Number of Animation frames - * @param {Boolean} deep Whether to use recursive mode - * @return {Array|Boolean} State of each frame of the animation (Invalid input will return false) + /** + * @description Get the N-frame animation state by the start and end state + * of the animation and the easing curve + * @param {String|Array} tBC Easing curve name or data + * @param {Number|Array|Object} startState Animation start state + * @param {Number|Array|Object} endState Animation end state + * @param {Number} frameNum Number of Animation frames + * @param {Boolean} deep Whether to use recursive mode + * @return {Array|Boolean} State of each frame of the animation (Invalid input will return false) */ function transition(tBC) { @@ -10526,13 +10526,13 @@ return [endState]; } } - /** - * @description Check if the parameters are legal - * @param {String} tBC Name of transition bezier curve - * @param {Any} startState Transition start state - * @param {Any} endState Transition end state - * @param {Number} frameNum Number of transition frames - * @return {Boolean} Is the parameter legal + /** + * @description Check if the parameters are legal + * @param {String} tBC Name of transition bezier curve + * @param {Any} startState Transition start state + * @param {Any} endState Transition end state + * @param {Number} frameNum Number of transition frames + * @return {Boolean} Is the parameter legal */ @@ -10564,10 +10564,10 @@ return true; } - /** - * @description Get the transition bezier curve - * @param {String} tBC Name of transition bezier curve - * @return {Array} Bezier curve data + /** + * @description Get the transition bezier curve + * @param {String} tBC Name of transition bezier curve + * @return {Array} Bezier curve data */ @@ -10584,11 +10584,11 @@ return bezierCurve; } - /** - * @description Get the progress of each frame state - * @param {Array} bezierCurve Transition bezier curve - * @param {Number} frameNum Number of transition frames - * @return {Array} Progress of each frame state + /** + * @description Get the progress of each frame state + * @param {Array} bezierCurve Transition bezier curve + * @param {Number} frameNum Number of transition frames + * @return {Array} Progress of each frame state */ @@ -10602,11 +10602,11 @@ }); return frameState; } - /** - * @description Get the progress of the corresponding frame according to t - * @param {Array} bezierCurve Transition bezier curve - * @param {Number} t Current frame t - * @return {Number} Progress of current frame + /** + * @description Get the progress of the corresponding frame according to t + * @param {Array} bezierCurve Transition bezier curve + * @param {Number} t Current frame t + * @return {Number} Progress of current frame */ @@ -10615,11 +10615,11 @@ var bezierCurvePointT = getBezierCurvePointTFromReT(tBezierCurvePoint, t); return getBezierCurveTState(tBezierCurvePoint, bezierCurvePointT); } - /** - * @description Get the corresponding sub-curve according to t - * @param {Array} bezierCurve Transition bezier curve - * @param {Number} t Current frame t - * @return {Array} Sub-curve of t + /** + * @description Get the corresponding sub-curve according to t + * @param {Array} bezierCurve Transition bezier curve + * @param {Number} t Current frame t + * @return {Array} Sub-curve of t */ @@ -10641,11 +10641,11 @@ var p3 = end[0]; return [p0, p1, p2, p3]; } - /** - * @description Get local t based on t and sub-curve - * @param {Array} bezierCurve Sub-curve - * @param {Number} t Current frame t - * @return {Number} local t of sub-curve + /** + * @description Get local t based on t and sub-curve + * @param {Array} bezierCurve Sub-curve + * @param {Number} t Current frame t + * @return {Number} local t of sub-curve */ @@ -10656,11 +10656,11 @@ var tMinus = t - reBeginX; return tMinus / xMinus; } - /** - * @description Get the curve progress of t - * @param {Array} bezierCurve Sub-curve - * @param {Number} t Current frame t - * @return {Number} Progress of current frame + /** + * @description Get the curve progress of t + * @param {Array} bezierCurve Sub-curve + * @param {Number} t Current frame t + * @return {Number} Progress of current frame */ @@ -10683,12 +10683,12 @@ var result4 = p3 * pow(t, 3); return 1 - (result1 + result2 + result3 + result4); } - /** - * @description Get transition state according to frame progress - * @param {Any} startState Transition start state - * @param {Any} endState Transition end state - * @param {Array} frameState Frame state progress - * @return {Array} Transition frame state + /** + * @description Get transition state according to frame progress + * @param {Any} startState Transition start state + * @param {Any} endState Transition end state + * @param {Array} frameState Frame state progress + * @return {Array} Transition frame state */ @@ -10703,12 +10703,12 @@ return end; }); } - /** - * @description Get the transition data of the number type - * @param {Number} startState Transition start state - * @param {Number} endState Transition end state - * @param {Array} frameState Frame state progress - * @return {Array} Transition frame state + /** + * @description Get the transition data of the number type + * @param {Number} startState Transition start state + * @param {Number} endState Transition end state + * @param {Array} frameState Frame state progress + * @return {Array} Transition frame state */ @@ -10718,12 +10718,12 @@ return begin + minus * s; }); } - /** - * @description Get the transition data of the array type - * @param {Array} startState Transition start state - * @param {Array} endState Transition end state - * @param {Array} frameState Frame state progress - * @return {Array} Transition frame state + /** + * @description Get the transition data of the array type + * @param {Array} startState Transition start state + * @param {Array} endState Transition end state + * @param {Array} frameState Frame state progress + * @return {Array} Transition frame state */ @@ -10739,12 +10739,12 @@ }); }); } - /** - * @description Get the transition data of the object type - * @param {Object} startState Transition start state - * @param {Object} endState Transition end state - * @param {Array} frameState Frame state progress - * @return {Array} Transition frame state + /** + * @description Get the transition data of the object type + * @param {Object} startState Transition start state + * @param {Object} endState Transition end state + * @param {Array} frameState Frame state progress + * @return {Array} Transition frame state */ @@ -10765,12 +10765,12 @@ return frameData; }); } - /** - * @description Get the transition state data by recursion - * @param {Array|Object} startState Transition start state - * @param {Array|Object} endState Transition end state - * @param {Array} frameState Frame state progress - * @return {Array} Transition frame state + /** + * @description Get the transition state data by recursion + * @param {Array|Object} startState Transition start state + * @param {Array|Object} endState Transition end state + * @param {Array} frameState Frame state progress + * @return {Array} Transition frame state */ @@ -10795,11 +10795,11 @@ return state; } - /** - * @description Inject new curve into curves as config - * @param {Any} key The key of curve - * @param {Array} curve Bezier curve data - * @return {Undefined} No return + /** + * @description Inject new curve into curves as config + * @param {Any} key The key of curve + * @param {Array} curve Bezier curve data + * @return {Undefined} No return */ @@ -10845,101 +10845,101 @@ - /** - * @description Class Graph - * @param {Object} graph Graph default configuration - * @param {Object} config Graph config - * @return {Graph} Instance of Graph + /** + * @description Class Graph + * @param {Object} graph Graph default configuration + * @param {Object} config Graph config + * @return {Graph} Instance of Graph */ var Graph = function Graph(graph, config) { (0, _classCallCheck2["default"])(this, Graph); config = (0, util.deepClone)(config, true); var defaultConfig = { - /** - * @description Weather to render graph - * @type {Boolean} - * @default visible = true + /** + * @description Weather to render graph + * @type {Boolean} + * @default visible = true */ visible: true, - /** - * @description Whether to enable drag - * @type {Boolean} - * @default drag = false + /** + * @description Whether to enable drag + * @type {Boolean} + * @default drag = false */ drag: false, - /** - * @description Whether to enable hover - * @type {Boolean} - * @default hover = false + /** + * @description Whether to enable hover + * @type {Boolean} + * @default hover = false */ hover: false, - /** - * @description Graph rendering index - * Give priority to index high graph in rendering - * @type {Number} - * @example index = 1 + /** + * @description Graph rendering index + * Give priority to index high graph in rendering + * @type {Number} + * @example index = 1 */ index: 1, - /** - * @description Animation delay time(ms) - * @type {Number} - * @default animationDelay = 0 + /** + * @description Animation delay time(ms) + * @type {Number} + * @default animationDelay = 0 */ animationDelay: 0, - /** - * @description Number of animation frames - * @type {Number} - * @default animationFrame = 30 + /** + * @description Number of animation frames + * @type {Number} + * @default animationFrame = 30 */ animationFrame: 30, - /** - * @description Animation dynamic curve (Supported by transition) - * @type {String} - * @default animationCurve = 'linear' - * @link https://github.com/jiaming743/Transition + /** + * @description Animation dynamic curve (Supported by transition) + * @type {String} + * @default animationCurve = 'linear' + * @link https://github.com/jiaming743/Transition */ animationCurve: 'linear', - /** - * @description Weather to pause graph animation - * @type {Boolean} - * @default animationPause = false + /** + * @description Weather to pause graph animation + * @type {Boolean} + * @default animationPause = false */ animationPause: false, - /** - * @description Rectangular hover detection zone - * Use this method for hover detection first - * @type {Null|Array} - * @default hoverRect = null - * @example hoverRect = [0, 0, 100, 100] // [Rect start x, y, Rect width, height] + /** + * @description Rectangular hover detection zone + * Use this method for hover detection first + * @type {Null|Array} + * @default hoverRect = null + * @example hoverRect = [0, 0, 100, 100] // [Rect start x, y, Rect width, height] */ hoverRect: null, - /** - * @description Mouse enter event handler - * @type {Function|Null} - * @default mouseEnter = null + /** + * @description Mouse enter event handler + * @type {Function|Null} + * @default mouseEnter = null */ mouseEnter: null, - /** - * @description Mouse outer event handler - * @type {Function|Null} - * @default mouseOuter = null + /** + * @description Mouse outer event handler + * @type {Function|Null} + * @default mouseOuter = null */ mouseOuter: null, - /** - * @description Mouse click event handler - * @type {Function|Null} - * @default click = null + /** + * @description Mouse click event handler + * @type {Function|Null} + * @default click = null */ click: null }; @@ -10959,9 +10959,9 @@ this.style = new _style["default"](config.style); this.addedProcessor(); }; - /** - * @description Processor of added - * @return {Undefined} Void + /** + * @description Processor of added + * @return {Undefined} Void */ @@ -10972,11 +10972,11 @@ if (typeof this.added === 'function') this.added(this); }; - /** - * @description Processor of draw - * @param {CRender} render Instance of CRender - * @param {Graph} graph Instance of Graph - * @return {Undefined} Void + /** + * @description Processor of draw + * @param {CRender} render Instance of CRender + * @param {Graph} graph Instance of Graph + * @return {Undefined} Void */ @@ -10988,11 +10988,11 @@ if (typeof this.drawed === 'function') this.drawed(this, render); graph.style.restoreTransform(ctx); }; - /** - * @description Processor of hover check - * @param {Array} position Mouse Position - * @param {Graph} graph Instance of Graph - * @return {Boolean} Result of hover check + /** + * @description Processor of hover check + * @param {Array} position Mouse Position + * @param {Graph} graph Instance of Graph + * @return {Boolean} Result of hover check */ @@ -11018,10 +11018,10 @@ if (hoverRect) return util.checkPointIsInRect.apply(void 0, [position].concat((0, _toConsumableArray2["default"])(hoverRect))); return hoverCheck(position, this); }; - /** - * @description Processor of move - * @param {Event} e Mouse movement event - * @return {Undefined} Void + /** + * @description Processor of move + * @param {Event} e Mouse movement event + * @return {Undefined} Void */ @@ -11031,11 +11031,11 @@ if (typeof this.setGraphCenter === 'function') this.setGraphCenter(e, this); if (typeof this.moved === 'function') this.moved(e, this); }; - /** - * @description Update graph state - * @param {String} attrName Updated attribute name - * @param {Any} change Updated value - * @return {Undefined} Void + /** + * @description Update graph state + * @param {String} attrName Updated attribute name + * @param {Any} change Updated value + * @return {Undefined} Void */ @@ -11057,14 +11057,14 @@ if (attrName === 'index') render.sortGraphsByIndex(); render.drawAllGraph(); }; - /** - * @description Update graphics state (with animation) - * Only shape and style attributes are supported - * @param {String} attrName Updated attribute name - * @param {Any} change Updated value - * @param {Boolean} wait Whether to store the animation waiting - * for the next animation request - * @return {Promise} Animation Promise + /** + * @description Update graphics state (with animation) + * Only shape and style attributes are supported + * @param {String} attrName Updated attribute name + * @param {Any} change Updated value + * @param {Boolean} wait Whether to store the animation waiting + * for the next animation request + * @return {Promise} Animation Promise */ @@ -11172,10 +11172,10 @@ return _ref2.apply(this, arguments); }; }(); - /** - * @description Extract the next frame of data from the animation queue - * and update the graph state - * @return {Undefined} Void + /** + * @description Extract the next frame of data from the animation queue + * and update the graph state + * @return {Undefined} Void */ @@ -11208,9 +11208,9 @@ return keys; }); }; - /** - * @description Skip to the last frame of animation - * @return {Undefined} Void + /** + * @description Skip to the last frame of animation + * @return {Undefined} Void */ @@ -11231,18 +11231,18 @@ this.animationRoot = []; return render.drawAllGraph(); }; - /** - * @description Pause animation behavior - * @return {Undefined} Void + /** + * @description Pause animation behavior + * @return {Undefined} Void */ Graph.prototype.pauseAnimation = function () { this.attr('animationPause', true); }; - /** - * @description Try animation behavior - * @return {Undefined} Void + /** + * @description Try animation behavior + * @return {Undefined} Void */ @@ -11278,10 +11278,10 @@ }; }()); }; - /** - * @description Processor of delete - * @param {CRender} render Instance of CRender - * @return {Undefined} Void + /** + * @description Processor of delete + * @param {CRender} render Instance of CRender + * @return {Undefined} Void */ @@ -11297,10 +11297,10 @@ graphs.splice(index, 1, null); if (typeof this.deleted === 'function') this.deleted(this); }; - /** - * @description Return a timed release Promise - * @param {Number} time Release time - * @return {Promise} A timed release Promise + /** + * @description Return a timed release Promise + * @param {Number} time Release time + * @return {Promise} A timed release Promise */ @@ -11342,10 +11342,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - /** - * @description Class of CRender - * @param {Object} canvas Canvas DOM - * @return {CRender} Instance of CRender + /** + * @description Class of CRender + * @param {Object} canvas Canvas DOM + * @return {CRender} Instance of CRender */ var CRender = function CRender(canvas) { (0, _classCallCheck2["default"])(this, CRender); @@ -11361,45 +11361,45 @@ var area = [clientWidth, clientHeight]; canvas.setAttribute('width', clientWidth); canvas.setAttribute('height', clientHeight); - /** - * @description Context of the canvas - * @type {Object} - * @example ctx = canvas.getContext('2d') + /** + * @description Context of the canvas + * @type {Object} + * @example ctx = canvas.getContext('2d') */ this.ctx = ctx; - /** - * @description Width and height of the canvas - * @type {Array} - * @example area = [300,100] + /** + * @description Width and height of the canvas + * @type {Array} + * @example area = [300,100] */ this.area = area; - /** - * @description Whether render is in animation rendering - * @type {Boolean} - * @example animationStatus = true|false + /** + * @description Whether render is in animation rendering + * @type {Boolean} + * @example animationStatus = true|false */ this.animationStatus = false; - /** - * @description Added graph - * @type {[Graph]} - * @example graphs = [Graph, Graph, ...] + /** + * @description Added graph + * @type {[Graph]} + * @example graphs = [Graph, Graph, ...] */ this.graphs = []; - /** - * @description Color plugin - * @type {Object} - * @link https://github.com/jiaming743/color + /** + * @description Color plugin + * @type {Object} + * @link https://github.com/jiaming743/color */ this.color = _color["default"]; - /** - * @description Bezier Curve plugin - * @type {Object} - * @link https://github.com/jiaming743/BezierCurve + /** + * @description Bezier Curve plugin + * @type {Object} + * @link https://github.com/jiaming743/BezierCurve */ this.bezierCurve = _bezierCurve["default"]; // bind event handler @@ -11408,9 +11408,9 @@ canvas.addEventListener('mousemove', mouseMove.bind(this)); canvas.addEventListener('mouseup', mouseUp.bind(this)); }; - /** - * @description Clear canvas drawing area - * @return {Undefined} Void + /** + * @description Clear canvas drawing area + * @return {Undefined} Void */ @@ -11423,10 +11423,10 @@ (_this$ctx = this.ctx).clearRect.apply(_this$ctx, [0, 0].concat((0, _toConsumableArray2["default"])(area))); }; - /** - * @description Add graph to render - * @param {Object} config Graph configuration - * @return {Graph} Graph instance + /** + * @description Add graph to render + * @param {Object} config Graph configuration + * @return {Graph} Graph instance */ @@ -11454,9 +11454,9 @@ this.drawAllGraph(); return graph; }; - /** - * @description Sort the graph by index - * @return {Undefined} Void + /** + * @description Sort the graph by index + * @return {Undefined} Void */ @@ -11468,10 +11468,10 @@ if (a.index < b.index) return -1; }); }; - /** - * @description Delete graph in render - * @param {Graph} graph The graph to be deleted - * @return {Undefined} Void + /** + * @description Delete graph in render + * @param {Graph} graph The graph to be deleted + * @return {Undefined} Void */ @@ -11483,9 +11483,9 @@ }); this.drawAllGraph(); }; - /** - * @description Delete all graph in render - * @return {Undefined} Void + /** + * @description Delete all graph in render + * @return {Undefined} Void */ @@ -11500,9 +11500,9 @@ }); this.drawAllGraph(); }; - /** - * @description Draw all the graphs in the render - * @return {Undefined} Void + /** + * @description Draw all the graphs in the render + * @return {Undefined} Void */ @@ -11516,10 +11516,10 @@ return graph.drawProcessor(_this2, graph); }); }; - /** - * @description Animate the graph whose animation queue is not empty - * and the animationPause is equal to false - * @return {Promise} Animation Promise + /** + * @description Animate the graph whose animation queue is not empty + * and the animationPause is equal to false + * @return {Promise} Animation Promise */ @@ -11536,11 +11536,11 @@ }, Date.now()); }); }; - /** - * @description Try to animate every graph - * @param {Function} callback Callback in animation end - * @param {Number} timeStamp Time stamp of animation start - * @return {Undefined} Void + /** + * @description Try to animate every graph + * @param {Function} callback Callback in animation end + * @param {Number} timeStamp Time stamp of animation start + * @return {Undefined} Void */ @@ -11558,10 +11558,10 @@ this.drawAllGraph(); requestAnimationFrame(animation.bind(this, callback, timeStamp)); } - /** - * @description Find if there are graph that can be animated - * @param {[Graph]} graphs - * @return {Boolean} + /** + * @description Find if there are graph that can be animated + * @param {[Graph]} graphs + * @return {Boolean} */ @@ -11570,9 +11570,9 @@ return !graph.animationPause && graph.animationFrameState.length; }); } - /** - * @description Handler of CRender mousedown event - * @return {Undefined} Void + /** + * @description Handler of CRender mousedown event + * @return {Undefined} Void */ @@ -11584,9 +11584,9 @@ if (!hoverGraph) return; hoverGraph.status = 'active'; } - /** - * @description Handler of CRender mousemove event - * @return {Undefined} Void + /** + * @description Handler of CRender mousemove event + * @return {Undefined} Void */ @@ -11655,9 +11655,9 @@ hoveredGraph.status = 'hover'; } } - /** - * @description Handler of CRender mouseup event - * @return {Undefined} Void + /** + * @description Handler of CRender mouseup event + * @return {Undefined} Void */ @@ -11676,10 +11676,10 @@ if (activeGraph) activeGraph.status = 'hover'; if (dragGraph) dragGraph.status = 'hover'; } - /** - * @description Clone Graph - * @param {Graph} graph The target to be cloned - * @return {Graph} Cloned graph + /** + * @description Clone Graph + * @param {Graph} graph The target to be cloned + * @return {Graph} Cloned graph */