viser
Version:
viser is a toolkit fit for data vis engineer.
1 lines • 667 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Viser=e():t.Viser=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=75)}([function(t,e){var n=Array.isArray;t.exports=n},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){var r=n(50),i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")();t.exports=a},function(t,e,n){var r=n(9),i=n(77),a=n(78),o="[object Null]",s="[object Undefined]",u=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?s:o:u&&u in Object(t)?i(t):a(t)}},function(t,e,n){var r=n(54),i=1,a=4;t.exports=function(t){return r(t,i|a)}},function(t,e){t.exports=function(t){return null==t}},function(t,e,n){var r=n(52),i=n(12),a=n(20),o=n(0),s=n(10),u=n(21),l=n(19),c=n(37),h="[object Map]",f="[object Set]",p=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(s(t)&&(o(t)||"string"==typeof t||"function"==typeof t.splice||u(t)||c(t)||a(t)))return!t.length;var e=i(t);if(e==h||e==f)return!t.size;if(l(t))return!r(t).length;for(var n in t)if(p.call(t,n))return!1;return!0}},function(t,e,n){var r=n(81),i=n(84);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(2).Symbol;t.exports=r},function(t,e,n){var r=n(13),i=n(35);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSEvent=function(t,e,n,r){if((0,i.default)(n))return;var o=a.exec(n);if(!o||o.length<=2)return;var s=o[1].toLowerCase(),u=o[2].toLowerCase(),l=e+"-"+s;t.on(l+":"+u,(function(e){r&&r(e,t)}))},e.setEvent=function(t,e,n){if((0,i.default)(n))return;var r=Object.keys(n).filter((function(t){return/^on/.test(t)}));if((0,i.default)(r))return;r.forEach((function(r){var i=r.slice(2,r.length).toLowerCase(),a=n[r];if(n.gemo&&i.indexOf("label")>=0){var o=i.replace("label","");t.on("label:"+o,(function(e){a&&a(e,t)}))}else e?t.on(e+":"+i,(function(e){a&&a(e,t)})):t.on(i,(function(e){a&&a(e,t)}))}))};var r,i=(r=n(6))&&r.__esModule?r:{default:r};var a=/on(.+)(MouseEnter|MouseMove|MouseLeave|Click|DdlClick|MouseDown|MouseUp|TouchStart|TouchMove|TouchEnd)/},function(t,e,n){var r=n(80),i=n(34),a=n(85),o=n(86),s=n(87),u=n(3),l=n(53),c=l(r),h=l(i),f=l(a),p=l(o),g=l(s),d=u;(r&&"[object DataView]"!=d(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=d(new i)||a&&"[object Promise]"!=d(a.resolve())||o&&"[object Set]"!=d(new o)||s&&"[object WeakMap]"!=d(new s))&&(d=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?l(n):"";if(r)switch(r){case c:return"[object DataView]";case h:return"[object Map]";case f:return"[object Promise]";case p:return"[object Set]";case g:return"[object WeakMap]"}return e}),t.exports=d},function(t,e,n){var r=n(3),i=n(8),a="[object AsyncFunction]",o="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";t.exports=function(t){if(!i(t))return!1;var e=r(t);return e==o||e==s||e==a||e==u}},function(t,e,n){var r=n(39);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},function(t,e,n){var r=n(24),i=1/0;t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e}},function(t,e,n){var r=n(42),i=n(54),a=n(142),o=n(23),s=n(17),u=n(146),l=n(147),c=n(64),h=l((function(t,e){var n={};if(null==t)return n;var l=!1;e=r(e,(function(e){return e=o(e,t),l||(l=e.length>1),e})),s(t,c(t),n),l&&(n=i(n,7,u));for(var h=e.length;h--;)a(n,e[h]);return n}));t.exports=h},function(t,e,n){var r=n(55),i=n(56);t.exports=function(t,e,n,a){var o=!n;n||(n={});for(var s=-1,u=e.length;++s<u;){var l=e[s],c=a?a(n[l],t[l],l,n,t):void 0;void 0===c&&(c=t[l]),o?i(n,l,c):r(n,l,c)}return n}},function(t,e,n){var r=n(58),i=n(52),a=n(10);t.exports=function(t){return a(t)?r(t):i(t)}},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(88),i=n(1),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&o.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},function(t,e,n){(function(t){var r=n(2),i=n(89),a=e&&!e.nodeType&&e,o=a&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===a?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;t.exports=u}).call(this,n(36)(t))},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){var r=n(0),i=n(40),a=n(92),o=n(112);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:a(o(t))}},function(t,e,n){var r=n(3),i=n(1),a="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||i(t)&&r(t)==a}},function(t,e,n){var r=n(7)(Object,"create");t.exports=r},function(t,e,n){var r=n(102),i=n(103),a=n(104),o=n(105),s=n(106);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,t.exports=u},function(t,e,n){var r=n(28);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(108);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r;"undefined"!=typeof self&&self,r=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=402)}([function(t,e,n){var r=n(126),i=n(16),a=r.mix({},r,{assign:r.mix,merge:r.deepMix,cloneDeep:r.clone,isFinite:isFinite,isNaN:isNaN,snapEqual:r.isNumberEqual,remove:r.pull,inArray:r.contains,toAllPadding:function(t){var e=0,n=0,r=0,i=0;return a.isNumber(t)||a.isString(t)?e=n=r=i=t:a.isArray(t)?(e=t[0],r=a.isNil(t[1])?t[0]:t[1],i=a.isNil(t[2])?t[0]:t[2],n=a.isNil(t[3])?r:t[3]):a.isObject(t)&&(e=t.top||0,r=t.right||0,i=t.bottom||0,n=t.left||0),[e,r,i,n]},getClipByRange:function(t){var e=t.tl,n=t.br;return new i.Rect({attrs:{x:e.x,y:e.y,width:n.x-e.x,height:n.y-e.y}})}});a.Array={groupToMap:r.groupToMap,group:r.group,merge:r.merge,values:r.valuesOfKey,getRange:r.getRange,firstValue:r.firstValue,remove:r.pull},t.exports=a},function(t,e,n){var r=n(81),i={};r.merge(i,r,{mixin:function(t,e){var n=t.CFG?"CFG":"ATTRS";if(t&&e){t._mixins=e,t[n]=t[n]||{};var r={};i.each(e,(function(e){i.augment(t,e);var a=e[n];a&&i.merge(r,a)})),t[n]=i.merge(r,t[n])}}}),t.exports=i},function(t,e,n){var r=n(25),i=n(4);t.exports=function(t,e){if(t)if(i(t))for(var n=0,a=t.length;n<a&&!1!==e(t[n],n);n++);else if(r(t))for(var o in t)if(t.hasOwnProperty(o)&&!1===e(t[o],o))break}},function(t,e,n){var r=n(20),i=n(126),a=i.mix({assign:i.mix,isFinite:isFinite,isNaN:isNaN,Group:r.Group,Event:r.Event},i);t.exports=a},function(t,e,n){var r=n(12),i=Array.isArray?Array.isArray:function(t){return r(t,"Array")};t.exports=i},function(t,e){t.exports=function(t){return null==t}},function(t,e,n){var r=n(1),i=n(190),a=n(102),o=n(55),s=function t(e){t.superclass.constructor.call(this,e)};s.ATTRS={},r.extend(s,a);var u={matrix:"matrix",path:"path",points:"points",lineDash:"lineDash"};r.augment(s,i,{isShape:!0,drawInner:function(t){var e=this._attrs;this.createPath(t);var n=t.globalAlpha;if(this.hasFill()){var i=e.fillOpacity;r.isNil(i)||1===i?t.fill():(t.globalAlpha=i,t.fill(),t.globalAlpha=n)}if(this.hasStroke()&&this._attrs.lineWidth>0){var a=e.strokeOpacity;r.isNil(a)||1===a||(t.globalAlpha=a),t.stroke()}this.afterPath(t)},afterPath:function(){},isHitBox:function(){return!0},isHit:function(t,e){var n=[t,e,1];if(this.invert(n),this.isHitBox()){var r=this.getBBox();if(r&&!o.box(r.minX,r.maxX,r.minY,r.maxY,n[0],n[1]))return!1}var i=this._attrs.clip;return i?(i.invert(n,this.get("canvas")),!!i.isPointInPath(n[0],n[1])&&this.isPointInPath(n[0],n[1])):this.isPointInPath(n[0],n[1])},calculateBox:function(){return null},getHitLineWidth:function(){var t=this._attrs,e=t.lineAppendWidth||0;return(t.lineWidth||0)+e},clearTotalMatrix:function(){this._cfg.totalMatrix=null,this._cfg.region=null},clearBBox:function(){this._cfg.box=null,this._cfg.region=null},getBBox:function(){var t=this._cfg.box;return t||((t=this.calculateBox())&&(t.x=t.minX,t.y=t.minY,t.width=t.maxX-t.minX,t.height=t.maxY-t.minY),this._cfg.box=t),t},clone:function(){var t=null,e=this._attrs,n={};return r.each(e,(function(t,i){u[i]&&r.isArray(e[i])?n[i]=function(t){for(var e=[],n=0;n<t.length;n++)r.isArray(t[n])?e.push([].concat(t[n])):e.push(t[n]);return e}(e[i]):n[i]=e[i]})),t=new this.constructor({attrs:n}),t._cfg.zIndex=this._cfg.zIndex,t}}),t.exports=s},function(t,e,n){var r=n(0),i=n(150),a={version:"3.5.8",renderer:"canvas",trackingInfo:{},animate:!0,widthRatio:{column:.5,rose:.9999999,multiplePie:1/1.3},showSinglePoint:!1,connectNulls:!1,scales:{},registerTheme:function(t,e){i[t]=e},setTheme:function(t){var e={};e=r.isObject(t)?t:-1!==r.indexOf(Object.keys(i),t)?i[t]:i.default,r.deepMix(a,e)}};a.setTheme("default"),t.exports=a},function(t,e){function n(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}t.exports=function(t,e,r,i){return e&&n(t,e),r&&n(t,r),i&&n(t,i),t}},function(t,e,n){var r=n(12);t.exports=function(t){return r(t,"Number")}},function(t,e,n){var r=n(12);t.exports=function(t){return r(t,"String")}},function(t,e,n){var r=n(12);t.exports=function(t){return r(t,"Function")}},function(t,e){var n={}.toString;t.exports=function(t,e){return n.call(t)==="[object "+e+"]"}},function(t,e){t.exports=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}},function(t,e){t.exports={FONT_FAMILY:'"-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",SimSun, "sans-serif"'}},function(t,e,n){var r=n(3),i=n(155),a=n(32),o=["min","max","median","start","end"],s=function(t){var e,n;function a(){return t.apply(this,arguments)||this}n=t,(e=a).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var s=a.prototype;return s.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return r.mix({},e,{xScales:null,yScales:null,el:null})},s.render=function(){},s.clear=function(){var t=this.get("el");t&&t.remove(),this.set("el",null)},s.destroy=function(){this.clear(),t.prototype.destroy.call(this)},s.changeVisible=function(t){this.set("visible",t);var e=this.get("el");e&&(e.set?e.set("visible",t):e.style.display=t?"":"none")},s.parsePoint=function(t,e){var n,a,o=this.get("xScales"),s=this.get("yScales");if(r.isFunction(e)&&(e=e(o,s)),r.isArray(e)&&r.isString(e[0])&&-1!==e[0].indexOf("%"))return this._parsePercentPoint(t,e);if(r.isArray(e))n=this._getNormalizedValue(e[0],i.getFirstScale(o)),a=this._getNormalizedValue(e[1],i.getFirstScale(s));else for(var u in e){var l=e[u];o[u]&&(n=this._getNormalizedValue(l,o[u])),s[u]&&(a=this._getNormalizedValue(l,s[u],"y"))}return r.isNil(n)||r.isNil(a)||isNaN(n)||isNaN(a)?null:t.convert({x:n,y:a})},s._getNormalizedValue=function(t,e){var n,i;return-1!==r.indexOf(o,t)?"start"===t?n=0:"end"===t?n=1:"median"===t?(i=e.isCategory?(e.values.length-1)/2:(e.min+e.max)/2,n=e.scale(i)):(i=e.isCategory?"min"===t?0:e.values.length-1:e[t],n=e.scale(i)):n=e.scale(t),n},s._parsePercentPoint=function(t,e){var n=parseFloat(e[0])/100,r=parseFloat(e[1])/100,i=t.start,a=t.end,o=Math.min(i.x,a.x),s=Math.min(i.y,a.y);return{x:t.width*n+o,y:t.height*r+s}},a}(a);t.exports=s},function(t,e,n){var r=n(20);t.exports=r},function(t,e,n){"use strict";var r=n(61);n.d(e,"a",(function(){return r.e})),n.d(e,"f",(function(){return r.g})),n.d(e,"d",(function(){return r.f}));var i=n(205);n.d(e,"e",(function(){return i.a})),n.d(e,"c",(function(){return i.b}));var a=n(206);n.d(e,"b",(function(){return a.a}))},function(t,e,n){var r=n(8),i=n(2),a=n(25),o=n(5),s=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),r(this,t),this.init()}return t._initDefaultCfg=function(){this.type="base",this.formatter=null,this.range=[0,1],this.ticks=null,this.values=[]},t.init=function(){},t.getTicks=function(){var t=this,e=t.ticks,n=[];return i(e,(function(e){var r;r=a(e)?e:{text:t.getText(e),tickValue:e,value:t.scale(e)},n.push(r)})),n},t.getText=function(t,e){var n=this.formatter;return t=n?n(t,e):t,!o(t)&&t.toString||(t=""),t.toString()},t.rangeMin=function(){return this.range[0]},t.rangeMax=function(){var t=this.range;return t[t.length-1]},t.invert=function(t){return t},t.translate=function(t){return t},t.scale=function(t){return t},t.clone=function(){var t=this,e=t.constructor,n={};return i(t,(function(e,r){n[r]=t[r]})),new e(n)},t.change=function(t){return this.ticks=null,r(this,t),this.init(),this},e}();t.exports=s},function(t,e,n){var r=n(0),i=n(23),a=r.PathUtil,o={},s={_coord:null,draw:function(t,e){return this.drawShape?this.drawShape(t,e):null},setCoord:function(t){this._coord=t},parsePath:function(t,e){var n=this._coord;return t=a.parsePathString(t),t=n.isPolar&&!1!==e?i.convertPolarPath(n,t):i.convertNormalPath(n,t)},parsePoint:function(t){return this._coord.convertPoint(t)},parsePoints:function(t){var e=this._coord,n=[];return r.each(t,(function(t){n.push(e.convertPoint(t))})),n}},u={defaultShapeType:null,setCoord:function(t){this._coord=t},getShape:function(t){r.isArray(t)&&(t=t[0]);var e=this[t]||this[this.defaultShapeType];return e._coord=this._coord,e},getShapePoints:function(t,e){var n=this.getShape(t);return(n.getPoints||n.getShapePoints||this.getDefaultPoints)(e)},getDefaultPoints:function(){return[]},getMarkerCfg:function(t,e){var n=this.getShape(t);if(!n.getMarkerCfg){var r=this.defaultShapeType;n=this.getShape(r)}return n.getMarkerCfg(e)},getSelectedCfg:function(){return{}},drawShape:function(t,e,n){var r=this.getShape(t).draw(e,n);return r&&(r.setSilent("origin",e.origin),r._id=e.yIndex?e._id+e.yIndex:e._id,r.name=this.name),r}};o.registerFactory=function(t,e){var n=r.upperFirst(t),i=r.assign({},u,e);return o[n]=i,i.name=t,i},o.registerShape=function(t,e,n){var i=r.upperFirst(t),a=o[i],u=r.assign({},s,n);return a[e]=u,u},o.getShapeFactory=function(t){return t=t||"point",this[r.upperFirst(t)]},t.exports=o},function(t,e,n){t.exports={Canvas:n(182),Group:n(101),Shape:n(6),Arc:n(105),Circle:n(106),Dom:n(107),Ellipse:n(108),Fan:n(109),Image:n(110),Line:n(111),Marker:n(57),Path:n(112),Polygon:n(113),Polyline:n(114),Rect:n(115),Text:n(116),PathSegment:n(39),PathUtil:n(58),Event:n(100),version:"3.3.6"}},function(t,e,n){var r=n(73),i=n(299),a=n(147),o=n(0),s=n(7),u=n(307),l=n(19),c=n(339),h=n(340),f=n(341),p=n(342),g=["color","shape","size"];function d(t){return(o.isString(t)||o.isPlainObject(t))&&(t=[t]),o.each(t,(function(e,n){o.isObject(e)||(t[n]={type:e})})),t}var v=function(t){var e,n;n=t,(e=v).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var a=v.prototype;function v(e){var n;return(n=t.call(this,e)||this).viewTheme=n.get("viewTheme"),o.assign(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n),c,h,f),n.get("container")&&n._initContainer(),n._initOptions(),n}return a.getDefaultCfg=function(){return{_id:null,type:"base",coord:null,attrs:{},view:null,data:[],scales:{},container:null,labelContainer:null,shapeContainer:null,attrOptions:{},styleOptions:null,selectedOptions:null,activedOptions:null,hasDefaultAdjust:!1,adjusts:null,shapeType:null,generatePoints:!1,sortable:!1,labelCfg:null,shareTooltip:!0,tooltipCfg:null,animate:!0,animateCfg:null,visible:!0}},a._initOptions=function(){var t=this.get("adjusts");t&&(t=d(t),this.set("adjusts",t))},a._createScale=function(t,e){var n=this.get("scales"),r=n[t];return r||(r=this.get("view").createScale(t,e),n[t]=r),r},a._setAttrOptions=function(t,e){this.get("attrOptions")[t]=e},a._createAttrOption=function(t,e,n,r){var i={};i.field=e,n?o.isFunction(n)?i.callback=n:i.values=n:"color"!==t&&(i.values=r),this._setAttrOptions(t,i)},a.position=function(t){return this._setAttrOptions("position",{field:t}),this},a.color=function(t,e){var n=this.viewTheme||s;return this._createAttrOption("color",t,e,n.colors),this},a.size=function(t,e){var n=this.viewTheme||s;return this._createAttrOption("size",t,e,n.sizes),this},a.shape=function(t,e){var n=this.viewTheme||s,r=this.get("type"),i=n.shapes[r]||[];return this._createAttrOption("shape",t,e,i),this},a.opacity=function(t,e){var n=this.viewTheme||s;return this._createAttrOption("opacity",t,e,n.opacities),this},a.style=function(t,e){var n,r=this.get("styleOptions");return r||(r={},this.set("styleOptions",r)),o.isObject(t)&&(e=t,t=null),t&&(n=p(t)),r.fields=n,r.style=e,this},a.label=function(t,e,n){var r,i=this.get("labelCfg");return i||(i={},this.set("labelCfg",i)),t&&(r=p(t)),i.fields=r,o.isFunction(e)?(n||(n={}),i.callback=e):o.isObject(e)&&(n=e),i.globalCfg=n,this},a.tooltip=function(t,e){var n,r=this.get("tooltipCfg");return r||(r={}),!1===t?this.set("tooltipCfg",!1):(t&&(n=p(t)),r.fields=n,r.cfg=e),this.set("tooltipCfg",r),this},a.animate=function(t){return this.set("animateCfg",t),this},a.active=function(t,e){return!1===t?this.set("allowActive",!1):o.isObject(t)?(this.set("allowActive",!0),this.set("activedOptions",t)):(this.set("allowActive",!0),this.set("activedOptions",e)),this},a.adjust=function(t){return this.get("hasDefaultAdjust")||(t&&(t=d(t)),this.set("adjusts",t)),this},a.select=function(t,e){return!1===t?this.set("allowSelect",!1):o.isObject(t)?(this.set("allowSelect",!0),this.set("selectedOptions",t)):(this.set("allowSelect",!0),this.set("selectedOptions",e)),this},a.hasAdjust=function(t){var e=this.get("adjusts");if(!t)return!1;var n=!1;return o.each(e,(function(e){if(e.type===t)return n=!0,!1})),n},a.hasStack=function(){var t=this.get("isStacked");return o.isNil(t)&&(t=this.hasAdjust("stack"),this.set("isStacked",t)),t},a.isInCircle=function(){var t=this.get("coord");return t&&t.isPolar},a._initContainer=function(){var t=this.get("shapeContainer");if(!t){var e=this.get("container"),n=this.get("view"),r=n&&n.get("_id");t=e.addGroup({viewId:r,visible:this.get("visible")}),this.set("shapeContainer",t)}},a.init=function(){var t=this;if(t._initContainer(),t._initAttrs(),t.get("tooltipCfg")&&t.get("tooltipCfg").fields){var e=t.get("tooltipCfg").fields;o.each(e,(function(e){t._createScale(e)}))}var n=t._processData();t.get("adjusts")&&t._adjust(n),t.set("dataArray",n)},a._initAttrs=function(){var t=this.get("attrs"),e=this.get("attrOptions"),n=this.get("coord"),i=this.viewTheme||s,a=!1;for(var u in e)if(e.hasOwnProperty(u)){var l=e[u],c=o.upperFirst(u),h=p(l.field);"position"===u&&(l.coord=n,1===h.length&&"theta"===n.type&&(h.unshift("1"),a=!0));for(var f=[],g=0;g<h.length;g++){var d=h[g],v=this._createScale(d);"color"===u&&o.isNil(l.values)&&(v.values.length<=8?l.values=a?i.colors_pie:i.colors:v.values.length<=16?l.values=a?i.colors_pie_16:i.colors_16:l.values=i.colors_24,o.isNil(l.values)&&(l.values=i.colors)),f.push(v)}if("theta"===n.type&&"position"===u&&f.length>1){var y=f[1],x=Math.max.apply(null,y.values);isFinite(x)||(x=1),y.change({nice:!1,min:0,max:x})}l.scales=f;var m=new r[c](l);t[u]=m}},a._processData=function(){for(var t=this.get("data"),e=[],n=this._groupData(t),r=0;r<n.length;r++){var i=n[r],a=this._saveOrigin(i);e.push(this._numberic(a))}return e},a._groupData=function(t){var e=this._getGroupScales().map((function(t){return t.field}));return o.Array.group(t,e)},a._saveOrigin=function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],i={};for(var a in r)i[a]=r[a];i._origin=r,e.push(i)}return e},a._numberic=function(t){for(var e=this.getAttr("position").scales,n=[],r=0;r<t.length;r++){for(var i=t[r],a=!0,o=0;o<Math.min(2,e.length);o++){var s=e[o];if(s.isCategory){var u=s.field;i[u]=s.translate(i[u]),Number.isNaN(i[u])&&(a=!1)}}a&&n.push(i)}return n},a._getGroupScales=function(){var t=this.get("groupScales");if(!t){t=[];var e=this.get("attrs");o.each(e,(function(e){if(g.includes(e.type)){var n=e.scales;o.each(n,(function(e){e.isCategory&&-1===o.indexOf(t,e)&&t.push(e)}))}})),this.set("groupScales",t)}return t},a._updateStackRange=function(t,e,n){for(var r=o.Array.merge(n),i=e.min,a=e.max,s=0;s<r.length;s++){var u=r[s];if(o.isArray(u[t])){var l=Math.min.apply(null,u[t]),c=Math.max.apply(null,u[t]);l<i&&(i=l),c>a&&(a=c)}}(i<e.min||a>e.max)&&e.change({min:i,max:a})},a._adjust=function(t){if(t&&t.length){var e=this,n=e.get("adjusts"),r=this.viewTheme||s,a=e.getYScale(),u=e.getXScale(),l=u.field,c=a?a.field:null;o.each(n,(function(n){var s=o.mix({xField:l,yField:c},n),h=o.upperFirst(n.type);if("Dodge"===h){var f=[];if(u.isCategory||u.isIdentity)f.push("x");else{if(a)throw new Error("dodge is not support linear attribute, please use category attribute!");f.push("y")}s.adjustNames=f,s.dodgeRatio=s.dodgeRatio||r.widthRatio.column}else if("Stack"===h){var p=e.get("coord");if(!a){s.height=p.getHeight();var g=e.getDefaultValue("size")||3;s.size=g}!p.isTransposed&&o.isNil(s.reverseOrder)&&(s.reverseOrder=!0)}new i[h](s).processAdjust(t),"Stack"===h&&a&&e._updateStackRange(c,a,t)}))}},a.setCoord=function(t){this.set("coord",t);var e=this.getAttr("position");this.get("shapeContainer").setMatrix(t.matrix),e&&(e.coord=t)},a.paint=function(){var t=this.get("dataArray"),e=[],n=this.getShapeFactory();n.setCoord(this.get("coord")),this.set("shapeFactory",n);var r=this.get("shapeContainer");this._beforeMapping(t);for(var i=0;i<t.length;i++){var a=t[i],s=i;a=this._mapping(a),e.push(a),this.draw(a,r,n,s)}this.get("labelCfg")&&this._addLabels(o.union.apply(null,e),r.get("children")),this.get("sortable")?this.set("dataArray",e):this._sort(e)},a._sort=function(t){var e=this.getXScale(),n=e.field;o.each(t,(function(t){t.sort((function(t,r){return e.translate(t._origin[n])-e.translate(r._origin[n])}))})),this.set("dataArray",t)},a._beforeMapping=function(t){var e=this;if(e.get("sortable")){var n=e.getXScale(),r=n.field;o.each(t,(function(t){t.sort((function(t,e){return n.translate(t[r])-n.translate(e[r])}))}))}e.get("generatePoints")&&(o.each(t,(function(t){e._generatePoints(t)})),o.each(t,(function(e,n){var r=t[n+1];r&&(e[0].nextPoints=r[0].points)})))},a._addLabels=function(t,e){var n=this,r=n.get("type"),i=n.get("viewTheme")||s,a=n.get("coord"),l=u.getLabelsClass(a.type,r),c=n.get("container"),h=o.map(n.get("labelCfg").fields,(function(t){return n._createScale(t)})),f=c.addGroup(l,{_id:this.get("_id"),labelCfg:o.mix({scales:h},n.get("labelCfg")),coord:a,geom:n,geomType:r,yScale:n.getYScale(),viewTheme:i,visible:n.get("visible")});f.showLabels(t,e),n.set("labelContainer",f)},a.getShapeFactory=function(){var t=this.get("shapeFactory");if(!t){var e=this.get("shapeType");t=l.getShapeFactory(e),this.set("shapeFactory",t)}return t},a._generatePoints=function(t){for(var e=this.getShapeFactory(),n=this.getAttr("shape"),r=0;r<t.length;r++){var i=t[r],a=this.createShapePointsCfg(i),o=n?this._getAttrValues(n,i):null,s=e.getShapePoints(o,a);i.points=s}},a.createShapePointsCfg=function(t){var e=this.getXScale(),n=this.getYScale();return{x:this._normalizeValues(t[e.field],e),y:n?this._normalizeValues(t[n.field],n):t.y?t.y:.1,y0:n?n.scale(this.getYMinValue()):void 0}},a.getYMinValue=function(){var t=this.getYScale(),e=t.min,n=t.max;return e>=0?e:n<=0?n:0},a._normalizeValues=function(t,e){var n=[];if(o.isArray(t))for(var r=0;r<t.length;r++){var i=t[r];n.push(e.scale(i))}else n=e.scale(t);return n},a._mapping=function(t){for(var e=this.get("attrs"),n=[],r=0;r<t.length;r++){var i=t[r],a={};for(var s in a._origin=i._origin,a.points=i.points,a.nextPoints=i.nextPoints,e)if(e.hasOwnProperty(s)){var u=e[s],l=u.names,c=this._getAttrValues(u,i);if(l.length>1)for(var h=0;h<c.length;h++){var f=c[h];a[l[h]]=o.isArray(f)&&1===f.length?f[0]:f}else a[l[0]]=1===c.length?c[0]:c}n.push(a)}return n},a._getAttrValues=function(t,e){for(var n=t.scales,r=[],i=0;i<n.length;i++){var a=n[i],o=a.field;"identity"===a.type?r.push(a.value):r.push(e[o])}return t.mapping.apply(t,r)},a.getAttrValue=function(t,e){var n=this.getAttr(t),r=null;return n&&(r=this._getAttrValues(n,e)[0]),r},a.getDefaultValue=function(t){var e=this.get(t),n=this.getAttr(t);if(n){var r=n.getScale(t);"identity"===r.type&&(e=r.value)}return e},a.draw=function(t,e,n,r){for(var i=0;i<t.length;i++){var a=t[i];this.drawPoint(a,e,n,r+i)}},a.getCallbackCfg=function(t,e,n){if(!t)return e;var r={},i=t.map((function(t){return n[t]}));return o.each(e,(function(t,e){o.isFunction(t)?r[e]=t.apply(null,i):r[e]=t})),r},a._getShapeId=function(t){var e=this.get("_id"),n=this.get("keyFields");if(n&&n.length>0)o.each(n,(function(n){e+="-"+t[n]}));else{var r,i=this.get("type"),a=this.getXScale(),s=this.getYScale(),u=a.field||"x",l=s.field||"y",c=t[l];r=a.isIdentity?a.value:t[u],e+="interval"===i||"schema"===i?"-"+r:"line"===i||"area"===i||"path"===i?"-"+i:"-"+r+"-"+c;var h=this._getGroupScales();o.isEmpty(h)||o.each(h,(function(n){var r=n.field;"identity"!==n.type&&(e+="-"+t[r])}))}return e},a.getDrawCfg=function(t){var e={origin:t,x:t.x,y:t.y,color:t.color,size:t.size,shape:t.shape,isInCircle:this.isInCircle(),opacity:t.opacity},n=this.get("styleOptions");return n&&n.style&&(e.style=this.getCallbackCfg(n.fields,n.style,t._origin)),this.get("generatePoints")&&(e.points=t.points,e.nextPoints=t.nextPoints),this.get("animate")&&(e._id=this._getShapeId(t._origin)),e},a.appendShapeInfo=function(t,e){t&&(t.setSilent("index",e),t.setSilent("coord",this.get("coord")),this.get("animate")&&this.get("animateCfg")&&t.setSilent("animateCfg",this.get("animateCfg")))},a._applyViewThemeShapeStyle=function(t,e,n){var r=this.viewTheme||s,i=n.name;e?e&&(e.indexOf("hollow")>-1||e.indexOf("liquid")>-1)&&(i="hollow"+o.upperFirst(i)):n.defaultShapeType.indexOf("hollow")>-1&&(i="hollow"+o.upperFirst(i));var a=r.shape[i]||{};t.style=o.mix({},a,t.style)},a.drawPoint=function(t,e,n,r){var i=t.shape,a=this.getDrawCfg(t);this._applyViewThemeShapeStyle(a,i,n);var o=n.drawShape(i,a,e);this.appendShapeInfo(o,r)},a.getAttr=function(t){return this.get("attrs")[t]},a.getXScale=function(){return this.getAttr("position").scales[0]},a.getYScale=function(){return this.getAttr("position").scales[1]},a.getShapes=function(){var t=[],e=this.get("shapeContainer").get("children");return o.each(e,(function(e){e.get("origin")&&t.push(e)})),t},a.getAttrsForLegend=function(){var t=this.get("attrs"),e=[];return o.each(t,(function(t){g.includes(t.type)&&e.push(t)})),e},a.getFieldsForLegend=function(){var t=[],e=this.get("attrOptions");return o.each(g,(function(n){var r=e[n];r&&r.field&&o.isString(r.field)&&(t=t.concat(r.field.split("*")))})),o.uniq(t)},a.changeVisible=function(t,e){this.set("visible",t);var n=this.get("shapeContainer");n&&n.set("visible",t);var r=this.get("labelContainer");r&&r.set("visible",t),!e&&n&&n.get("canvas").draw()},a.reset=function(){this.set("attrOptions",{}),this.clearInner()},a.clearInner=function(){this.clearActivedShapes(),this.clearSelected();var t=this.get("shapeContainer");t&&t.clear();var e=this.get("labelContainer");e&&e.remove(),this.set("attrs",{}),this.set("groupScales",null),this.set("labelContainer",null),this.set("xDistance",null),this.set("isStacked",null)},a.clear=function(){this.clearInner(),this.set("scales",{})},a.destroy=function(){this.clear();var e=this.get("shapeContainer");e&&e.remove(),this.offEvents(),t.prototype.destroy.call(this)},a.bindEvents=function(){this.get("view")&&(this._bindActiveAction(),this._bindSelectedAction())},a.offEvents=function(){this.get("view")&&(this._offActiveAction(),this._offSelectedAction())},v}(a);t.exports=v},function(t,e,n){t.exports={Axis:n(308),Component:n(67),Guide:n(316),Label:n(325),Legend:n(326),Tooltip:n(332)}},function(t,e,n){var r=n(0),i=n(336);function a(t,e){var n=t.getCenter();return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function o(t,e){for(var n=t.length,r=[t[0]],i=1;i<n;i+=2){var a=e.convertPoint({x:t[i],y:t[i+1]});r.push(a.x,a.y)}return r}var s={getLinePath:function(t,e){return function(t,e){if(!t.length)return[];for(var n=[],r=0,i=t.length;r<i;r++){var a=t[r];0===r?n.push(["M",a.x,a.y]):n.push(["L",a.x,a.y])}return e&&n.push(["Z"]),n}(t,e)},getSplinePath:function(t,e,n){var a=[],o=t[0],u=null;if(t.length<=2)return s.getLinePath(t,e);r.each(t,(function(t){u&&u.x===t.x&&u.y===t.y||(a.push(t.x),a.push(t.y),u=t)})),n=n||[[0,0],[1,1]];var l=i.catmullRom2bezier(a,e,n);return l.unshift(["M",o.x,o.y]),l},getPointRadius:function(t,e){return a(t,e)},getPointAngle:function(t,e){var n=t.getCenter();return Math.atan2(e.y-n.y,e.x-n.x)},convertNormalPath:function(t,e){var n=[];return r.each(e,(function(e){switch(e[0].toLowerCase()){case"m":case"l":case"c":n.push(o(e,t));break;case"z":default:n.push(e)}})),n},convertPolarPath:function(t,e){var n,i,s=[];return r.each(e,(function(r,u){switch(r[0].toLowerCase()){case"m":case"c":case"q":s.push(o(r,t));break;case"l":n=e[u-1],i=r,(t.isTransposed?n[n.length-2]===i[1]:n[n.length-1]===i[2])?s=s.concat(function(t,e,n){var r=n.isTransposed,i=n.startAngle,o=n.endAngle,s={x:t[1],y:t[2]},u={x:e[1],y:e[2]},l=[],c=r?"y":"x",h=Math.abs(u[c]-s[c])*(o-i),f=u[c]>=s[c]?1:0,p=h>Math.PI?1:0,g=n.convertPoint(u),d=a(n,g);if(d>=.5)if(h===2*Math.PI){var v={x:(u.x+s.x)/2,y:(u.y+s.y)/2},y=n.convertPoint(v);l.push(["A",d,d,0,p,f,y.x,y.y]),l.push(["A",d,d,0,p,f,g.x,g.y])}else l.push(["A",d,d,0,p,f,g.x,g.y]);return l}(n,i,t)):s.push(o(r,t));break;case"z":default:s.push(r)}})),function(t){r.each(t,(function(e,n){if("a"===e[0].toLowerCase()){var r=t[n-1],i=t[n+1];i&&"a"===i[0].toLowerCase()?r&&"l"===r[0].toLowerCase()&&(r[0]="M"):r&&"a"===r[0].toLowerCase()&&i&&"l"===i[0].toLowerCase()&&(i[0]="M")}}))}(s),s}};t.exports=s},function(t,e,n){var r=n(5);t.exports=function(t){return r(t)?"":t.toString()}},function(t,e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){var e=void 0===t?"undefined":n(t);return null!==t&&"object"===e||"function"===e}},function(t,e,n){var r=n(49),i=n(12);t.exports=function(t){if(!r(t)||!i(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}},function(t,e,n){var r=n(1),i=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,a=/[^\s\,]+/gi,o={};t.exports={parseRadius:function(t){var e=0,n=0,i=0,a=0;return r.isArray(t)?1===t.length?e=n=i=a=t[0]:2===t.length?(e=i=t[0],n=a=t[1]):3===t.length?(e=t[0],n=a=t[1],i=t[2]):(e=t[0],n=t[1],i=t[2],a=t[3]):e=n=i=a=t,{r1:e,r2:n,r3:i,r4:a}},parsePath:function(t){return t=t||[],r.isArray(t)?t:r.isString(t)?(t=t.match(i),r.each(t,(function(e,n){if((e=e.match(a))[0].length>1){var i=e[0].charAt(0);e.splice(1,0,e[0].substr(1)),e[0]=i}r.each(e,(function(t,n){isNaN(t)||(e[n]=+t)})),t[n]=e})),t):void 0},numberToColor:function(t){var e=o[t];if(!e){for(var n=t.toString(16),r=n.length;r<6;r++)n="0"+n;e="#"+n,o[t]=e}return e}}},function(t,e,n){"use strict";e.c=function(t,e){var n=e-t;return n?i(t,n>180||n<-180?n-360*Math.round(n/360):n):Object(r.a)(isNaN(t)?e:t)},e.b=function(t){return 1==(t=+t)?a:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Object(r.a)(isNaN(e)?n:e)}},e.a=a;var r=n(120);function i(t,e){return function(n){return t+n*e}}function a(t,e){var n=e-t;return n?i(t,n):Object(r.a)(isNaN(t)?e:t)}},function(t,e,n){var r=n(10),i=n(4),a=n(5),o=n(8),s=n(2);function u(t,e){return r(e)?e:t.invert(t.scale(e))}var l=function(){function t(t){var e=this;this.type="base",this.name=null,this.method=null,this.values=[],this.scales=[],this.linear=null;var n=null,r=this.callback;if(t.callback){var i=t.callback;n=function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];var s=i.apply(void 0,n);return a(s)&&(s=r.apply(e,n)),s}}o(this,t),n&&o(this,{callback:n})}var e=t.prototype;return e._getAttrValue=function(t,e){var n=this.values;if(t.isCategory&&!this.linear)return n[t.translate(e)%n.length];var r=t.scale(e);return this.getLinearValue(r)},e.getLinearValue=function(t){var e=this.values,n=e.length-1,r=Math.floor(n*t),i=n*t-r,a=e[r];return a+((r===n?a:e[r+1])-a)*i},e.callback=function(t){var e=this.scales[0];return"identity"===e.type?e.value:this._getAttrValue(e,t)},e.getNames=function(){for(var t=this.scales,e=this.names,n=Math.min(t.length,e.length),r=[],i=0;i<n;i++)r.push(e[i]);return r},e.getFields=function(){var t=this.scales,e=[];return s(t,(function(t){e.push(t.field)})),e},e.getScale=function(t){return this.scales[this.names.indexOf(t)]},e.mapping=function(){for(var t=this.scales,e=this.callback,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=r;if(e){for(var o=0,s=r.length;o<s;o++)r[o]=this._toOriginParam(r[o],t[o]);a=e.apply(this,r)}return a=[].concat(a)},e._toOriginParam=function(t,e){var n=t;if(!e.isLinear)if(i(t)){n=[];for(var r=0,a=t.length;r<a;r++)n.push(u(e,t[r]))}else n=u(e,t);return n},t}();t.exports=l},function(t,e,n){var r=n(8),i=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),r(this,t)}return t._initDefaultCfg=function(){this.adjustNames=["x","y"]},t.processAdjust=function(){},e}();t.exports=i},function(t,e,n){var r=n(32),i=n(3),a=n(152),o=n(153),s=n(14).FONT_FAMILY,u=function(t){var e,n;function r(){return t.apply(this,arguments)||this}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var u=r.prototype;return u.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{_id:null,zIndex:4,ticks:null,line:null,tickLine:null,subTickCount:0,subTickLine:null,grid:null,label:{offset:0,offsetX:0,offsetY:0,textStyle:{},autoRotate:!0,autoHide:!1,formatter:null},labelItems:[],title:{autoRotate:!0,textStyle:{}},autoPaint:!0})},u.beforeRender=function(){var t=this.get("title"),e=this.get("label"),n=this.get("grid");t&&this.set("title",i.deepMix({autoRotate:!0,textStyle:{fontSize:12,fill:"#ccc",textBaseline:"middle",fontFamily:s,textAlign:"center"},offset:48},t)),e&&this.set("label",i.deepMix({autoRotate:!0,autoHide:!0,textStyle:{fontSize:12,fill:"#ccc",textBaseline:"middle",fontFamily:s},offset:10},e)),n&&this.set("grid",i.deepMix({lineStyle:{lineWidth:1,stroke:"#C0D0E0"}},n))},u.render=function(){this.beforeRender(),this.get("label")&&this.renderLabels(),this.get("autoPaint")&&this.paint(),i.isNil(this.get("title"))||this.renderTitle(),this.get("group").sort()},u.renderLabels=function(){var t=this.get("group"),e=this.get("label"),n=new o({name:"axis-label"});this.set("labelRenderer",n),n.set("labelCfg",e),i.each(["formatter","htmlTemplate","labelLine","textStyle","useHtml"],(function(t){e[t]&&n.set(t,e[t])})),n.set("coord",this.get("coord")),n.set("group",t.addGroup()),n.set("canvas",this.get("canvas"))},u._parseTicks=function(t){for(var e=(t=t||[]).length,n=0;n<e;n++){var r=t[n];i.isObject(r)||(t[n]=this.parseTick(r,n,e))}return this.set("ticks",t),t},u._addTickItem=function(t,e,n,r){void 0===r&&(r="");var i=this.get("tickItems"),a=this.get("subTickItems"),o=this.getTickEnd(e,n,t),s={x1:e.x,y1:e.y,x2:o.x,y2:o.y};i||(i=[]),a||(a=[]),"sub"===r?a.push(s):i.push(s),this.set("tickItems",i),this.set("subTickItems",a)},u._renderLine=function(){var t,e=this.get("line");if(e){t=this.getLinePath(),e=i.mix({path:t},e);var n=this.get("group").addShape("path",{attrs:e});n.name="axis-line",this.get("appendInfo")&&n.setSilent("appendInfo",this.get("appendInfo")),this.set("lineShape",n)}},u._processCatTicks=function(){var t=this.get("label"),e=this.get("tickLine"),n=this.get("ticks");n=this._parseTicks(n);for(var r=this._getNormalizedTicks(n),i=0;i<r.length;i+=3){var a=this.getTickPoint(r[i]),o=this.getTickPoint(r[i+1]),s=this.getTickPoint(r[i+2]),u=Math.floor(i/3),l=n[u];e&&(0===u&&this._addTickItem(u,o,e.length),this._addTickItem(u,s,e.length)),t&&this.addLabel(l,a,u)}},u._getNormalizedTicks=function(t){var e=0;t.length>1&&(e=(t[1].value-t[0].value)/2);for(var n=[],r=0;r<t.length;r++){var a=t[r],o=a.value,s=a.value-e,u=a.value+e;n.push(o,s,u)}var l=i.arrayUtil.getRange(n);return n.map((function(t){return(t-l.min)/(l.max-l.min)}))},u.addLabel=function(t,e,n){var r=this.get("labelItems"),a=this.get("labelRenderer"),o=i.deepMix({},this.get("label"));if(a){var s=this.get("_labelOffset");i.isNil(this.get("label").offset)||(s=this.get("label").offset);var u=this.getSideVector(s,e,n);e={x:e.x+u[0]+o.offsetX,y:e.y+u[1]+o.offsetY},o.text=t.text,o.x=e.x,o.y=e.y,o.point=e,o.textAlign=this.getTextAnchor(u),e.rotate&&(o.rotate=e.rotate),r.push(o)}},u._processTicks=function(){var t=this,e=t.get("label"),n=t.get("subTickCount"),r=t.get("tickLine"),a=t.get("ticks");if(a=t._parseTicks(a),i.each(a,(function(n,i){var a=t.getTickPoint(n.value,i);r&&t._addTickItem(i,a,r.length),e&&t.addLabel(n,a,i)})),n){var o=t.get("subTickLine");i.each(a,(function(e,i){if(i>0){var s=e.value-a[i-1].value;s/=t.get("subTickCount")+1;for(var u=1;u<=n;u++){var l={text:"",value:i?a[i-1].value+u*s:u*s},c=t.getTickPoint(l.value),h=void 0;h=o&&o.length?o.length:parseInt(.6*r.length,10),t._addTickItem(u-1,c,h,"sub")}}}))}},u._addTickLine=function(t,e){var n=i.mix({},e),r=[];i.each(t,(function(t){r.push(["M",t.x1,t.y1]),r.push(["L",t.x2,t.y2])})),delete n.length,n.path=r;var a=this.get("group").addShape("path",{attrs:n});a.name="axis-ticks",a._id=this.get("_id")+"-ticks",a.set("coord",this.get("coord")),this.get("appendInfo")&&a.setSilent("appendInfo",this.get("appendInfo"))},u._renderTicks=function(){var t=this.get("tickItems"),e=this.get("subTickItems");if(!i.isEmpty(t)){var n=this.get("tickLine");this._addTickLine(t,n)}if(!i.isEmpty(e)){var r=this.get("subTickLine")||this.get("tickLine");this._addTickLine(e,r)}},u._renderGrid=function(){var t=this.get("grid");if(t){t.coord=this.get("coord"),t.appendInfo=this.get("appendInfo");var e=this.get("group");this.set("gridGroup",e.addGroup(a,t))}},u._renderLabels=function(){var t=this.get("labelRenderer"),e=this.get("labelItems");t&&(t.set("items",e),t._dryDraw())},u.paint=function(){var t=this.get("tickLine"),e=!0;t&&t.hasOwnProperty("alignWithLabel")&&(e=t.alignWithLabel),this._renderLine();var n=this.get("type");"cat"!==n&&"timeCat"!==n||!1!==e?this._processTicks():this._processCatTicks(),this._renderTicks(),this._renderGrid(),this._renderLabels();var r=this.get("label");r&&r.autoRotate&&this.autoRotateLabels(),r&&r.autoHide&&this.autoHideLabels()},u.parseTick=function(t,e,n){return{text:t,value:e/(n-1)}},u.getTextAnchor=function(t){return Math.abs(t[1]/t[0])>=1?"center":t[0]>0?"start":"end"},u.getMaxLabelWidth=function(t){var e=t.getLabels(),n=0;return i.each(e,(function(t){var e=t.getBBox().width;n<e&&(n=e)})),n},u.getMaxLabelHeight=function(t){var e=t.getLabels(),n=0;return i.each(e,(function(t){var e=t.getBBox().height;n<e&&(n=e)})),n},u.destroy=function(){if(!this.destroyed){var e=this.get("gridGroup");e&&e.remove();var n=this.get("labelRenderer");n&&n.destroy(),this.get("group").destroy(),t.prototype.destroy.call(this)}},u.clear=function(){var t=this.get("group");if(!t.get("destroyed")&&t.get("children").length){var e=this.get("gridGroup");e&&e.clear();var n=this.get("labelRenderer");n&&n.clear(),this.get("group").clear()}},u.autoRotateLabels=function(){},u.autoHideLabels=function(){},u.renderTitle=function(){},u.getLinePath=function(){},u.getTickPoint=function(){},u.getTickEnd=function(){},u.getSideVector=function(){},r}(r);t.exports=u},function(t,e,n){var r=function(t){var e,n;function r(){return t.apply(this,arguments)||this}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var i=r.prototype;return i.getDefaultCfg=function(){return{_id:null,canvas:null,container:null,group:null,capture:!1,coord:null,offset:[0,0],plotRange:null,position:[0,0],visible:!0,zIndex:1}},i._init=function(){},i.clear=function(){},i.destroy=function(){t.prototype.destroy.call(this)},i.beforeRender=function(){},i.render=function(){},i.afterRender=function(){},i.beforeDraw=function(){},i.draw=function(){},i.afterDraw=function(){},i.show=function(){},i.hide=function(){},i.setOffset=function(){},i.setPosition=function(){},i.setVisible=function(){},i.setZIndex=function(){},r}(n(67));t.exports=r},function(t,e,n){var r=n(5),i=n(2),a=n(18),o=n(175),s=function(t){var e,n;function a(){return t.apply(this,arguments)||this}n=t,(e=a).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var s=a.prototype;return s._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="linear",this.isLinear=!0,this.nice=!1,this.min=null,this.minLimit=null,this.max=null,this.maxLimit=null,this.tickCount=null,this.tickInterval=null,this.minTickInterval=null,this.snapArray=null},s.init=function(){if(this.ticks){var t=this.ticks,e=this.translate(t[0]),n=this.translate(t[t.length-1]);(r(this.min)||this.min>e)&&(this.min=e),(r(this.max)||this.max<n)&&(this.max=n)}else this.min=this.translate(this.min),this.max=this.translate(this.max),this.initTicks()},s.calculateTicks=function(){var t=this.min,e=this.max,n=this.minLimit,r=this.maxLimit,i=this.tickCount,a=this.tickInterval,s=this.minTickInterval,u=this.snapArray;if(1===i)throw new Error("linear scale'tickCount should not be 1");if(e<t)throw new Error("max: "+e+" should not be less than min: "+t);return o({min:t,max:e,minLimit:n,maxLimit:r,minCount:i,maxCount:i,interval:a,minTickInterval:s,snapArray:u}).ticks},s.initTicks=function(){var t=this,e=t.calculateTicks();if(t.nice)t.ticks=e,t.min=e[0],t.max=e[e.length-1];else{var n=[];i(e,(function(e){e>=t.min&&e<=t.max&&n.push(e)})),n.length||(n.push(t.min),n.push(t.max)),t.ticks=n}},s.scale=function(t){if(r(t))return NaN;var e=this.max,n=this.min;if(e===n)return 0;var i=(t-n)/(e-n),a=this.rangeMin();return a+i*(this.rangeMax()-a)},s.invert=function(t){var e=(t-this.rangeMin())/(this.rangeMax()-this.rangeMin());return this.min+e*(this.max-this.min)},a}(a);a.Linear=s,t.exports=s},function(t,e,n){var r=n(13);t.exports=function(t){return r(t)?Array.prototype.slice.call(t):[]}},function(t,e){t.exports=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-5;return Math.abs(t-e)<n}},function(t,e,n){var r=n(1).vec2;t.exports={at:function(t,e,n){return(e-t)*n+t},pointDistance:function(t,e,n,i,a,o){var s=[n-t,i-e];if(r.exactEquals(s,[0,0]))return NaN;var u=[-s[1],s[0]];r.normalize(u,u);var l=[a-t,o-e];return Math.abs(r.dot(l,u))},box:function(t,e,n,r,i){var a=i/2,o=Math.min(t,n),s=Math.max(t,n);return{minX:o-a,minY:Math.min(e,r)-a,maxX:s+a,maxY:Math.max(e,r)+a}},len:function(t,e,n,r){return Math.sqrt((n-t)*(n-t)+(r-e)*(r-e))}}},function(t,e,n){var r=n(1);function i(t,e,n,r){return{x:Math.cos(r)*n+t,y:Math.sin(r)*n+e}}function a(t,e,n,r){var i,a;return r?t<e?(i=e-t,a=2*Math.PI-n+t):t>n&&(i=2*Math.PI-t+e,a=t-n):(i=t-e,a=n-t),i>a?n:e}function o(t,e,n,i){var o=0;return n-e>=2*Math.PI&&(o=2*Math.PI),e=r.mod(e,2*Math.PI),n=r.mod(n,2*Math.PI)+o,t=r.mod(t,2*Math.PI),i?e>=n?t>n&&t<e?t:a(t,n,e,!0):t<e||t>n?t:a(t,e,n):e<=n?e<t&&t<n?t:a(t,e,n,!0):t>e||t<n?t:a(t,n,e)}function s(t,e,n,i,a,s,u,l,c){var h=[u,l],f=[t,e],p=r.vec2.subtract([],h,f),g=r.vec2.angleTo([1,0],p);g=o(g,i,a,s);var d=[n*Math.cos(g)+t,n*Math.sin(g)+e];return c&&(c.x=d[0],c.y=d[1]),r.vec2.distance(d,h)}t.exports={nearAngle:o,projectPoint:function(t,e,n,r,i,a,o,u){var l={};return s(t,e,n,r,i,a,o,u,l),l},pointDistance:s,box:function(t,e,n,a,s,u){var l=Math.PI/2,c=Math.PI,h=3*Math.PI/2,f=[],p=o(0,a,s,u);0===p&&f.push(i(t,e,n,0)),(p=o(l,a,s,u))===l&&f.push(i(t,e,n,l)),(p=o(c,a,s,u))===c&&f.push(i(t,e,n,c)),(p=o(h,a,s,u))===h&&f.push(i(t,e,n,h)),f.push(i(t,e,n,a)),f.push(i(t,e,n,s));var g=1/0,d=-1/0,v=1/0,y=-1/0;return r.each(f,(function(t){g>t.x&&(g=t.x),d<t.x&&(d=t.x),v>t.y&&(v=t.y),y<t.y&&(y=t.y)})),{minX:g,minY:v,maxX:d,maxY:y}}}},function(t,e,n){var r=n(27),i=n(39),a=Math.PI,o=Math.sin,s=Math.cos,u=Math.atan2,l=10,c=a/3;function h(t,e,n,r,i,h,f){var p,g,d,v,y,x,m;if(!e.fill){var b=e.arrowLength||l,_=e.arrowAngle?e.arrowAngle*a/180:c;m=u(r-h,n-i),y=Math.abs(e.lineWidth*s(m))/2,x=Math.abs(e.lineWidth*o(m))/2,f&&(y=-y,x=-x),p=i+b*s(m+_/2),g=h+b*o(m+_/2),d=i+b*s(m-_/2),v=h+b*o(m-_/2),t.beginPath(),t.moveTo(p-y,g-x),t.lineTo(i-y,h-x),t.lineTo(d-y,v-x),t.moveTo(i-y,h-x),t.lineTo(i+y,h+x),t.moveTo(i,h),t.stroke()}}function f(t,e,n,a,o,s,u){var l=u?e.startArrow:e.endArrow,c=l.d,h=0,f=o-n,p=s-a,g=Math.atan(f/p);0===p&&f<0?h=Math.PI:f>0&&p>0?h=Math.PI/2-g:f<0&&p<0?h=-Math.PI/2-g:f>=0&&p<0?h=-g-Math.PI/2:f<=0&&p>0&&(h=Math.PI/2-g);var d=function(t){var e,n=[],a=r.parsePath(t.path);if(!Array.isArray(a)||0===a.length||"M"!==a[0][0]&&"m"!==a[0][0])return!1;for(var o=a.length,s=0;s<a.length;s++){var u=a[s];e=new i(u,e,s===o-1),n.push(e)}return n}(l);if(d){c&&(u?(o+=Math.sin(Math.abs(g))*c,s=s+Math.cos(Math.abs(g))*c-.5*t.lineWidth):(o-=Math.sin(Math.abs(g))*c,s=s-Math.cos(Math.abs(g))*c+.5*t.lineWidth)),t.save(),t.beginPath(),t.translate(o,s),t.rotate(h);for(var v=0;v<d.length;v++)d[v].draw(t);t.setTransform(1,0,0,1,0,0),t.fillStyle=t.strokeStyle,t.fill(),t.restore()}}t.exports={addStartArrow:function(t,e,n,r,i,a){"object"==typeof e.startArrow?f(t,e,n,r,i,a,!0):e.startArrow&&h(t,e,n,r,i,a,!0)},addEndArrow:function(t,e,n,r,i,a){"object"==typeof e.endArrow?f(t,e,n,r,i,a,!1):e.endArrow&&h(t,e,n,r,i,a,!1)}}},function(t,e,n){var r=n(1),i=n(55),a=n(56),o=n(103),s=n(104),u=r.vec3,l=r.mat3,c=["m","l","c","a","q","h","v","t","s","z"];function h(t,e,n){return{x:n.x+t,y:n.y+e}}function f(t,e){return{x:e.x+(e.x-t.x),y:e.y+(e.y-t.y)}}function p(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function g(t,e){return(t[0]*e[0]+t[1]*e[1])/(p(t)*p(e))}function d(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(g(t,e))}var v=function(t,e,n){this.preSegment=e,this.isLast=n,this.init(t,e)};r.augment(v,{init:function(t,e){var n=t[0];e=e||{endPoint:{x:0,y:0}};var i,a,o,s,u=c.indexOf(n)>=0,l=u?n.toUpperCase():n,p=t,v=e.endPoint,y=p[1],x=p[2];switch(l){default:break;case"M":s=u?h(y,x,v):{x:y,y:x},this.command="M",this.params=[v,s],this.subStart=s,this.endPoint=s;break;case"L":s=u?h(y,x,v):{x:y,y:x},this.command="L",this.params=[v,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return[s.x-v.x,s.y-v.y]},this.startTangent=function(){return[v.x-s.x,v.y-s.y]};break;case"H":s=u?h(y,0,v):{x:y,y:v.y},this.command="L",this.params=[v,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return[s.x-v.x,s.y-v.y]},this.startTangent=function(){return[v.x-s.x,v.y-s.y]};break;case"V":s=u?h(0,y,v):{x:v.x,y:y},this.command="L",this.params=[v,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return[s.x-v.x,s.y-v.y]},this.startTangent=function(){return[v.x-s.x,v.y-s.y]};break;case"Q":u?(i=h(y,x,v),a=h(p[3],p[4],v)):(i={x:y,y:x},a={x:p[3],y:p[4]}),this.command="Q",this.params=[v,i,a],this.subStart=e.subStart,this.endPoint=a,this.endTangent=function(){return[a.x-i.x,a.y-i.y]},this.startTangent=function(){return[v.x-i.x,v.y-i.y]};break;case"T":a=u?h(y,x,v):{x:y,y:x},"Q"===e.command?(i=f(e.params[1],v),this.command="Q",this.params=[v,i,a],this.subStart=e.subStart,this.endPoint=a,this.endTangent=function(){return[a.x-i.x,a.y-i.y]},this.startTangent=function(){return[v.x-i.x,v.y-i.y]}):(this.command="TL",this.params=[v,a],this.subStart=e.subStart,this.endPoint=a,this.endTangent=function(){return[a.x-v.x,a.y-v.y]},this.startTangent=function(){return[v.x-a.x,v.y-a.y]});break;case"C":u?(i=h(y,x,v),a=h(p[3],p[4],v),o=h(p[5],p[6],v)):(i={x:y,y:x},a={x:p[3],y:p[4]},o={x:p[5],y:p[6]}),this.command="C",this.params=[v,i,a,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return[o.x-a.x,o.y-a.y]},this.startTangent=function(){return[v.x-i.x,v.y-i.y]};break;case"S":u?(a=h(y,x,v),o=h(p[3],p[4],v)):(a={x:y,y:x},o={x:p[3],y:p[4]}),"C"===e.command?(i=f(e.params[2],v),this.command="C",this.params=[v,i,a,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return[o.x-a.x,o.y-a.y]},this.startTangent=function(){return[v.x-i.x,v.y-i.y]}):(this.command="SQ",this.params=[v,a,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return[o.x-a.x,o.y-a.y]},this.startTangent=function(){return[v.x-a.x,v.y-a.y]});break;case"A":var m=y,b=x,_=p[3],w=p[4],S=p[5];s=u?h(p[6],p[7],v):{x:p[6],y:p[7]},this.command="A";var M=function(t,e,n,i,a,o,s){var u=r.mod(r.toRadian(s),2*Math.PI),l=t.x,c=t.y,h=e.x,f=e.y,p=Math.cos(u)*(l-h)/2+Math.sin(u)*(c-f)/2,v=-1*Math.sin(u)*(l-h)/2+Math.cos(u)*(c-f)/2,y=p*p/(a*a)+v*v/(o*o);y>1&&(a*=Math.sqrt(y),o*=Math.sqr