New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

dchart-core

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dchart-core - npm Package Compare versions

Comparing version 2.6.31 to 2.6.32

@@ -1,1 +0,1 @@

"use strict";function _typeof(t){return(_typeof="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)}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(t,e){var i=[],n=!0,s=!1,a=void 0;try{for(var r,o=t[Symbol.iterator]();!(n=(r=o.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){s=!0,a=t}finally{try{n||null==o.return||o.return()}finally{if(s)throw a}}return i}function _arrayWithHoles(t){if(Array.isArray(t))return t}var _=require("../util"),Com=require("./index"),d3=require("d3"),numberUtil=require("../util/number"),TICK_PADDING=2,MAX_TICK_COUNT=30,ONE_SECOND=1e3,timeUnitsMSMap={seconds:ONE_SECOND,minutes:60*ONE_SECOND,hours:60*ONE_SECOND*60,days:60*ONE_SECOND*60*24,months:60*ONE_SECOND*60*24*30,years:60*ONE_SECOND*60*24*30*12};function Axis(t,e,i){this.reset(),this.options={fontSize:12,fontColor:"#fff",fontWeight:"normal",fontStrokeWidth:0,key:"x",type:"defaults",orient:null,dy:0,padding:.4,groupPadding:[.4,.4],assistLine:!0,assistLineColor:"#fff",rotate:0,min:null,max:null,tickSize:0,tickValues:null,tickFormat:null,ticks:null,nondecile:{key:"y",tickPadding:10},format:"%Y-%m-%d",label:null,labelColor:"#aaa",labelInAxis:!0,labelFontSize:12,labelFontWeight:"normal",labelFontStrokeWidth:0,textAnchor:"middle",textShow:!0,net:!1,netColor:"#aaa",digit:0,show:!0},this.x=null,this.axisx=null,this.groupX=null,this.net=null,this.init(t,e,i),this._valid()}function getStep(t){var e=t.step,i=t.f,n=t.maxNeedNice,s=t.tickFormat,a="string"==typeof s?(s.split(".")[1]||"0f").split("f")[0]:0;return e=n?i(Math.ceil(Math.pow(10,a)*e)/Math.pow(10,a)):i(10*e)/10}function isTicksOverlap(t,e){if(t&&e&&t.getBoundingClientRect&&e.getBoundingClientRect){var i=t.getBoundingClientRect(),n=e.getBoundingClientRect();return i.left+i.width+TICK_PADDING>n.left&&n.left+n.width+TICK_PADDING>i.left&&i.top+i.height+TICK_PADDING>n.top&&n.top+n.height+TICK_PADDING>i.top}return!1}function removeOverlapTicksOfTargetAxis(t){setTimeout(function(){for(var e=t.selectAll(".tick")[0],i=0;i<e.length;i++){var n=e[i],s=e[i+1];if(n&&s&&n.getBoundingClientRect&&s.getBoundingClientRect)for(;isTicksOverlap(n,s)&&(d3.select(s).remove(),s=e[++i+1]););}},0)}Axis=Com.extend(Axis,{init:function(t,e,i){if(!t&&!this.el)return!1;t&&(this.el=d3.select(t)),this.options&&_.toLower(this.options.type)!==_.toLower(e.type)?this.isReset=!0:this.isReset=!1,this.options=_.deepMerge(this.options,e),this.alloptions=i||this.alloptions},_valid:function(){var t=this.options,e=["defaults","category","time","nondecile"];-1===_.indexOf(e,t.type.toLowerCase())&&(this.msg="axis arguments error. there is no "+t.type+" in types.",t.type=e[0],this.valid=!1),t.type=_.initialUpperCase(t.type);var i=["left","top","right","bottom"];-1===_.indexOf(i,t.orient.toLowerCase())&&(this.msg="axis arguments error. there is no "+t.orient+" in orients.",t.orient=i[0],this.valid=!1),t.orient=_.initialUpperCase(t.orient)},renderSeries:function(){var t=this.options;this["cal"+t.orient](),this.renderStyle(),this.renderLabel(),"function"==typeof t.afterRender&&t.afterRender.call(this),this.el.selectAll(".tick line").style("display",t.net?"block":"none"),this.isReset=!1},cut:function(t,e,i){var n=_slicedToArray(t,2),s=n[0],a=n[1],r=d3.format(i),o=this.options.maxNeedNice,l=((a=+a||0)-(s=+s||0))/(e-1);l=getStep({step:l,f:r,maxNeedNice:o,tickFormat:i}),t=[],+s==+r(s)&&t.push(s);for(var h=0;h<e-1;h++){var c=r(s+l*(h+1));(c<=a||o)&&t.push(c)}var d=(t=(t=_.uniq(t.map(function(t){return+t}).sort(function(t,e){return t-e}))).filter(function(t){return t<=(o?2*a:a)})).length-e,u=r(a),p=r(s);return d>0?t.splice(e-1,t.length-e):0===d?t[t.length-1]<u&&(t[t.length-1]=u):d<0&&(t.push(u),t.push(p)),t},format:function(){var t=this,e=this.options,i=this.axisx,n=this.x;if(i.tickPadding(e.dy),"object"===_typeof(e.tickSize)?i.tickSize.apply(this,e.tickSize):i.tickSize(e.tickSize),e.tickValues&&i.tickValues(e.tickValues),e.ticks){if("Category"===e.type&&_.isNumber(e.ticks)){var s=this._data;e.tickFormat=function(t,i){var n=_.toNumber(e.ticks),a=s.length,r=parseInt((a-1)/(n-1));if(0===r)return t;var o=(a-1)%(n-1),l=parseInt(o%2&&o/2+1||o/2);return i<l?"":a-i<=o-l?"":(i-l)%r?"":t}}else if("array"==typeof e.ticks)i.ticks.apply(this,e.ticks);else if(_.isNumber(e.ticks))if("Time"!==e.type)if(e.ticks=_.toNumber(e.ticks),"string"==typeof e.tickFormat){var a=_.clone(n.domain());switch(e.ticks){case 0:i.tickValues([a[0]]);break;case 1:i.tickValues([a[1]]);break;default:if(e.tickFormat){var r=_slicedToArray(a,2),o=r[0],l=r[1];if(a=this.cut(a,e.ticks,e.tickFormat),"defaults"===e.type.toLocaleLowerCase()){var h=+d3.format(e.tickFormat)(l),c=+d3.format(e.tickFormat)(o);a=a.filter(function(t){return+t==+d3.format(e.tickFormat)(t)&&t<=h&&t>=c})}}i.tickValues(a)}setTimeout(function(){var e=t.el.selectAll(".tick")[0];if(e&&e.length>1){var i=e[e.length-2];isTicksOverlap(i,e[e.length-1])&&d3.select(i).remove()}},0)}else i.ticks(e.ticks).tickValues(null),removeOverlapTicksOfTargetAxis(this.el);else{var d=_slicedToArray(this._getTimeAxisExtent(),2),u=d[0],p=d[1],f=Math.abs(p-u),g=Math.min(MAX_TICK_COUNT,e.ticks),m=g-1?f/(g-1):2*f,x="seconds";Object.keys(timeUnitsMSMap).every(function(t){return m>timeUnitsMSMap[t]&&(x=t),m>timeUnitsMSMap[t]}),i.ticks(d3.time[x],Math.round(m/timeUnitsMSMap[x])),removeOverlapTicksOfTargetAxis(this.el)}}else if(_.isNumber(e.ticks)&&"time"===e.type.toLowerCase()){var y=5*e.tickFormat(new Date).length+5,k=Math.min(e.innerWidth/y||10,MAX_TICK_COUNT);i.ticks(Math.min(k,this._data.length||k)),removeOverlapTicksOfTargetAxis(this.el)}if("string"==typeof e.tickFormat)i.tickFormat(d3.format(e.tickFormat));else if("function"==typeof e.tickFormat){var v=this;i.tickFormat(function(t,i){return e.tickFormat.call(v._data[i],t,i)})}},_afterAxis:function(){var t=this.options;"function"==typeof t._afterAxis&&t._afterAxis.call(this)},renderLabel:function(){var t=this.options,e=this.alloptions;if(t.label){if(t.labelInAxis){var i=this.el.select(".axis-unit")[0][0]&&this.el.select(".axis-unit")||this.el.append("g").attr({class:"axis-unit"}),n=this.el.selectAll(".tick:nth-last-child(3)").select("text");n&&n.length&&n[0].length&&("Left"===t.orient||"Right"===t.orient?i.attr("transform","translate(0,"+-1.5*parseInt(n.style("font-size"))+")"):i.attr("transform","translate("+((t.innerWidth||e.innerWidth)+3*parseInt(n.style("font-size")))+", 0)"),(i.select("text")[0][0]&&i.select("text")||i.append("text")).attr({dy:n.attr("dy"),x:n.attr("x"),y:n.attr("y"),transform:n.attr("transform")}).text(t.label).style({"text-anchor":n.style("text-anchor"),"font-size":n.style("font-size"),"font-weight":n.style("font-weight"),fill:n.style("fill")}))}}else this.el.select(".axis-unit").remove()},calLeft:function(){var t=this.options,e=this.alloptions,i=this.x=this["axis"+t.type].call(this,[t.innerHeight||e.innerHeight,0]),n=this.axisx=d3.svg.axis().scale(i).orient("left");this.format(),this._afterAxis(),-1!==this.el.attr("class").indexOf("axis")?this.el.call(n):this.el=this.el.append("g").attr("class","axis").call(n),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",x2:t.innerWidth||e.innerWidth,y2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},updateLeft:function(){var t=this.options,e=this.alloptions;this["updateAxis"+t.type].call(this,[t.innerHeight||e.innerHeight,0]),this.format(),this._afterAxis(),this.el.call(this.axisx),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",x2:t.innerWidth||e.innerWidth,y2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},calRight:function(){var t=this.options,e=this.alloptions,i=this.x=this["axis"+t.type].call(this,[t.innerHeight||e.innerHeight,0]),n=this.axisx=d3.svg.axis().scale(i).orient("right");this.format(),this._afterAxis(),-1!==this.el.attr("class").indexOf("axis")?this.el.attr({transform:"translate("+(t.innerWidth||e.innerWidth)+", 0)"}).call(n):this.el=this.el.append("g").attr({class:"axis",transform:"translate("+(t.innerWidth||e.innerWidth)+", 0)"}).call(n),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",x2:-t.innerWidth||-e.innerWidth,y2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},updateRight:function(){var t=this.options,e=this.alloptions;this["updateAxis"+t.type].call(this,[t.innerHeight||e.innerHeight,0]),this.format(),this._afterAxis(),this.el.attr({transform:"translate("+(t.innerWidth||e.innerWidth)+", 0)"}).call(this.axisx),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",x2:-t.innerWidth||-e.innerWidth,y2:"0"}).style({stroke:t.netColor})},calTop:function(){var t=this.options,e=this.alloptions,i=this.x=this["axis"+t.type].call(this,[0,t.innerWidth||e.innerWidth]),n=this.axisx=d3.svg.axis().scale(i).orient("top");this.format(),this._afterAxis(),-1!==this.el.attr("class").indexOf("axis")?this.el.call(n):this.el=this.el.append("g").attr("class","axis").call(n),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",y2:t.innerHeight||e.innerHeight,x2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},updateTop:function(){var t=this.options,e=this.alloptions;this["updateAxis"+t.type].call(this,[0,t.innerWidth||e.innerWidth]),this.format(),this._afterAxis(),this.el.call(this.axisx),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",y2:t.innerHeight||e.innerHeight,x2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},calBottom:function(){var t=this.options,e=this.alloptions,i=this.x=this["axis"+t.type].call(this,[0,t.innerWidth||e.innerWidth]),n=this.axisx=d3.svg.axis().scale(i).orient("bottom");this.format(),this._afterAxis(),-1!==this.el.attr("class").indexOf("axis")?this.el.attr({transform:"translate(0,"+(t.innerHeight||e.innerHeight)+")"}).call(n):this.el=this.el.append("g").attr({class:"axis",transform:"translate(0,"+(t.innerHeight||e.innerHeight)+")"}).call(n),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",y2:-t.innerHeight||-e.innerHeight,x2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},updateBottom:function(){var t=this.options,e=this.alloptions;this["updateAxis"+t.type].call(this,[0,t.innerWidth||e.innerWidth]),this.format(),this._afterAxis(),this.el.attr("transform","translate(0,"+(t.innerHeight||e.innerHeight)+")").call(this.axisx),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",y2:-t.innerHeight||-e.innerHeight,x2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},niceExtent:function(t,e){var i=this.options,n=Math.abs(e[1]-e[0]);t<=1&&(t=2);var s=numberUtil.nice(n/t,!0),a=numberUtil.getPrecisionSafe(s)+2,r=[i.minNeedNice?numberUtil.round(Math.floor(e[0]/s)*s,a):e[0],i.maxNeedNice?numberUtil.round(Math.ceil(e[1]/s)*s,a):e[1]];return _.toNumber(r[0])>_.toNumber(r[1])&&_.reverse(r),"defaults"===i.type.toLocaleLowerCase()&&i.tickFormat&&(r=d3.extent(this.cut(r,i.ticks,i.tickFormat).concat(r[0],r[1]))),r},axisDefaults:function(t){var e=this.x=d3.scale.linear().range(t),i=this.calExtent(),n=this.options,s=this.niceExtent(n.ticks,i);return e.domain(s),e},updateAxisDefaults:function(t){this.x.range(t);var e=this.calExtent(),i=this.options,n=this.niceExtent(i.ticks,e);return this.x.domain(n),this.x},axisCategory:function(t){var e,i=this.options;e=_.isArray(i.padding)?this.x=d3.scale.ordinal().rangeBands(t,i.padding[0],i.padding[1]):this.x=d3.scale.ordinal().rangeBands(t,i.padding/2,i.padding);var n=this.calExtent();return e.domain(n),e},updateAxisCategory:function(t){var e=this.options;return _.isArray(e.padding)?this.x.rangeBands(t,e.padding[0],e.padding[1]):this.x.rangeBands(t,e.padding/2,e.padding),this.x.domain(this.calExtent()),this.x},_setTimeAxisBoundaryGap:function(t){var e=this.options.blank?this.options.blankDis:0;if(e&&this._data&&this._data.length){var i=(+t[1]-t[0])/this._data.length,n=parseInt(i*e);t=[new Date(+t[0]-n),new Date(+t[1]+n)]}return t},_getTimeAxisExtent:function(){var t=this.options,e=d3.time.format(t.format),i=t.min,n=t.max,s=[i=i||"auto",n=n||"auto"],a=e.parse(i),r=e.parse(n),o=_.isDate(a),l=_.isDate(r);if(l&&o)s[0]=o?new Date(i):a,s[1]=l?new Date(n):r;else{var h=t.key,c=this._data.map(function(t){var i=t[h];return _.isDate(i)?+i:_.isString(i)?+e.parse(i):(console.log("date error: "+i+"is not a Date"),null)}),d=new Date(_.min(c)),u=new Date(_.max(c));s[0]=o?a:d,s[1]=l?r:u}return+(s=this._setTimeAxisBoundaryGap(s))[0]==+s[1]&&(s[1]=new Date(+s[1]+ONE_SECOND)),s},axisTime:function(t){var e=this._getTimeAxisExtent();return this.x=d3.time.scale().range(t).domain(e),this.x},updateAxisTime:function(t){var e=this._getTimeAxisExtent();return this.x.range(t).domain(e),this.x},axisNondecile:function(t){var e=this.options,i=this.x=d3.scale.linear().range(t);e.max=_.sum(this._data,e.nondecile.key),i.domain(this.calExtent());var n=_.groupBy(this._data,e.key),s=this._data=[],a=0,r=s.length,o=(t[1]-t[0])/(i.domain()[1]-i.domain()[0]);for(var l in n){var h={sum:_.sum(n[l],e.nondecile.key),begin:a,end:0,center:0,radio:0};r--,h[e.key]=l,h.end=h.begin+h.sum,a+=h.sum,h.center=(h.begin+h.end)/2,e.nondecile.tickPadding&&0!==h.begin&&(h.begin=(i(h.begin)-e.nondecile.tickPadding/2-t[0])/o+i.domain()[0]),e.nondecile.tickPadding&&0!==r&&(h.end=(i(h.end)+e.nondecile.tickPadding/2-t[0])/o+i.domain()[0]),h.radio=(h.end-h.begin)/h.sum,s.push(h)}return e._afterAxis=function(){this.axisx.tickValues(_.pluck(this._data,"center"))},e.afterRender=function(){this.el.selectAll(".tick").data(this._data)},i},updateAxisNondecile:function(t){var e=this.options,i=this.x.range(t);e.max=_.sum(this._data,e.nondecile.key),i.domain(this.calExtent());var n=_.groupBy(this._data,e.key),s=this._data=[],a=0,r=s.length,o=(t[1]-t[0])/(i.domain()[1]-i.domain()[0]);for(var l in n){var h={sum:_.sum(n[l],e.nondecile.key),begin:a,end:0,center:0,radio:0};r--,h[e.key]=l,h.end=h.begin+h.sum,a+=h.sum,h.center=(h.begin+h.end)/2,e.nondecile.tickPadding&&0!==h.begin&&(h.begin=(i(h.begin)-e.nondecile.tickPadding/2-t[0])/o+i.domain()[0]),e.nondecile.tickPadding&&0!==r&&(h.end=(i(h.end)+e.nondecile.tickPadding/2-t[0])/o+i.domain()[0]),h.radio=(h.end-h.begin)/h.sum,s.push(h)}return i.domain(this.calExtent()),e._afterAxis=function(){this.axisx.tickValues(_.pluck(this._data,"center")),this.el&&this.el.selectAll(".tick").data(_.pluck(this._data,"center"))},i},calExtent:function(){var t=this,e=this.options,i=[];if("category"!==e.type.toLocaleLowerCase()){var n=[];this._data.forEach(function(i){var s=i[e.key];_.isArray(s)?("defaults"===e.type.toLocaleLowerCase()&&(s=_.map(s,function(e){return _.toNumber(t._getValue(e))})),n=_.union(n,s)):("defaults"===e.type.toLocaleLowerCase()&&(s=_.toNumber(t._getValue(s))),n.push(s))}),i=d3.extent(n),isFinite(e.min)&&null!==e.min&&(i[0]=e.min),i[1]=e.max||i[1]}else i=_.map(this._data,function(i){return t._getValue(i[e.key])});return i},_getValue:function(t){return _.isObject(t)&&t.hasOwnProperty("value")?t.value:t},getX:function(){return this.x},getAxisX:function(){return this.axisx},getMin:function(){return _.first(this.x.domain())},getMax:function(){return _.last(this.x.domain())},calGroupStep:function(t){var e=this.options.groupPadding;return Array.isArray(e)?this.groupX=d3.scale.ordinal().rangeBands([0,this.x.rangeBand()],_.isNumber(e[0])?e[0]:.4,_.isNumber(e[1])?e[1]:0):this.groupX=d3.scale.ordinal().rangeBands([0,this.x.rangeBand()],_.isNumber(e)?e:.4),Array.isArray(t)||(t=this._createCategory(parseInt(t))),this.groupX.domain(t),this.groupX},getGroupStep:function(t){return this.groupX?this.groupX.rangeBand():(this.calGroupStep(t),this.groupX.rangeBand())},_createCategory:function(t){for(var e=[],i=0;i<t;i++)e.push(""+i);return e},getGroupX:function(){return this.groupX},updateSeries:function(){var t=this.options;this.el.selectAll(".net-line").remove(),this.isReset&&this["cal"+t.orient]()||this["update"+t.orient](),this.renderStyle(),this.renderLabel(),"function"==typeof t.afterRender&&t.afterRender.call(this),this.el.selectAll(".net-line").style("display",t.net?"block":"none"),this.isReset=!1},renderStyle:function(){var t=this.options,e=this.el.selectAll(".tick text").style({fill:t.fontColor,"font-size":t.fontSize,"font-weight":t.fontWeight,"stroke-width":0,display:t.textShow?"block":"none"});t.fontStrokeWidth&&e.style({stroke:t.fontColor,"stroke-width":t.fontStrokeWidth}),t.rotate&&_.isNumber(t.rotate)?e.each(function(e){var i=d3.select(this),n=_.toNumber(i.attr("x")),s=_.toNumber(i.attr("y")),a=t.rotate/360*2*Math.PI;i.attr("transform",(("Top"===t.orient||"Bottom"===t.orient)&&"translate(0 "+.5*Math.sin(a)*t.fontSize*("Bottom"===t.orient?.01:-1.99)+")"||"")+" rotate("+t.rotate+" "+n+" "+s+")").style({"text-anchor":"start"})}):e.attr("transform",""),this.el.selectAll(".domain, .tick line:not(.net-line)").style({display:t.assistLine?"block":"none",fill:"none",stroke:t.assistLineColor}),this.el.style("display",t.show?"block":"none")}}),module.exports=Axis;
"use strict";function _typeof(t){return(_typeof="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)}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(t,e){var i=[],n=!0,s=!1,a=void 0;try{for(var r,o=t[Symbol.iterator]();!(n=(r=o.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){s=!0,a=t}finally{try{n||null==o.return||o.return()}finally{if(s)throw a}}return i}function _arrayWithHoles(t){if(Array.isArray(t))return t}var _=require("../util"),Com=require("./index"),d3=require("d3"),numberUtil=require("../util/number"),TICK_PADDING=2,MAX_TICK_COUNT=30,ONE_SECOND=1e3,timeUnitsMSMap={seconds:ONE_SECOND,minutes:60*ONE_SECOND,hours:60*ONE_SECOND*60,days:60*ONE_SECOND*60*24,months:60*ONE_SECOND*60*24*30,years:60*ONE_SECOND*60*24*30*12};function Axis(t,e,i){this.reset(),this.options={fontSize:12,fontColor:"#fff",fontWeight:"normal",fontStrokeWidth:0,key:"x",type:"defaults",orient:null,dy:0,padding:.4,groupPadding:[.4,.4],assistLine:!0,assistLineColor:"#fff",rotate:0,min:null,max:null,tickSize:0,tickValues:null,tickFormat:null,ticks:null,nondecile:{key:"y",tickPadding:10},format:"%Y-%m-%d",label:null,labelColor:"#aaa",labelInAxis:!0,labelFontSize:12,labelFontWeight:"normal",labelFontStrokeWidth:0,textAnchor:"middle",textShow:!0,net:!1,netColor:"#aaa",digit:0,show:!0},this.x=null,this.axisx=null,this.groupX=null,this.net=null,this.init(t,e,i),this._valid()}function getStep(t){var e=t.step,i=t.f,n=t.maxNeedNice,s=t.tickFormat,a="string"==typeof s?(s.split(".")[1]||"0f").split("f")[0]:0;return e=n?i(Math.ceil(Math.pow(10,a)*e)/Math.pow(10,a)):i(10*e)/10}function isTicksOverlap(t,e){if(t&&e&&t.getBoundingClientRect&&e.getBoundingClientRect){var i=t.getBoundingClientRect(),n=e.getBoundingClientRect();return i.left+i.width+TICK_PADDING>n.left&&n.left+n.width+TICK_PADDING>i.left&&i.top+i.height+TICK_PADDING>n.top&&n.top+n.height+TICK_PADDING>i.top}return!1}function removeOverlapTicksOfTargetAxis(t){setTimeout(function(){for(var e=t.selectAll(".tick")[0],i=0;i<e.length;i++){var n=e[i],s=e[i+1];if(n&&s&&n.getBoundingClientRect&&s.getBoundingClientRect)for(;isTicksOverlap(n,s)&&(d3.select(s).remove(),s=e[++i+1]););}},0)}Axis=Com.extend(Axis,{init:function(t,e,i){if(!t&&!this.el)return!1;t&&(this.el=d3.select(t)),this.options&&_.toLower(this.options.type)!==_.toLower(e.type)?this.isReset=!0:this.isReset=!1,this.options=_.deepMerge(this.options,e),this.alloptions=i||this.alloptions},_valid:function(){var t=this.options,e=["defaults","category","time","nondecile"];-1===_.indexOf(e,t.type.toLowerCase())&&(this.msg="axis arguments error. there is no "+t.type+" in types.",t.type=e[0],this.valid=!1),t.type=_.initialUpperCase(t.type);var i=["left","top","right","bottom"];-1===_.indexOf(i,t.orient.toLowerCase())&&(this.msg="axis arguments error. there is no "+t.orient+" in orients.",t.orient=i[0],this.valid=!1),t.orient=_.initialUpperCase(t.orient)},renderSeries:function(){var t=this.options;this["cal"+t.orient](),this.renderStyle(),this.renderLabel(),"function"==typeof t.afterRender&&t.afterRender.call(this),this.el.selectAll(".tick line").style("display",t.net?"block":"none"),this.isReset=!1},cut:function(t,e,i){var n=_slicedToArray(t,2),s=n[0],a=n[1],r=d3.format(i),o=this.options.maxNeedNice,l=((a=+a||0)-(s=+s||0))/(e-1);l=getStep({step:l,f:r,maxNeedNice:o,tickFormat:i}),t=[],+s==+r(s)&&t.push(s);for(var h=0;h<e-1;h++){var c=r(s+l*(h+1));(c<=a||o)&&t.push(c)}var d=(t=(t=_.uniq(t.map(function(t){return+t}).sort(function(t,e){return t-e}))).filter(function(t){return t<=(o?2*a:a)})).length-e,u=r(a),p=r(s);return d>0?t.splice(e-1,t.length-e):0===d?t[t.length-1]<u&&(t[t.length-1]=u):d<0&&(t.push(u),t.push(p)),t},format:function(){var t=this,e=this.options,i=this.axisx,n=this.x;if(i.tickPadding(e.dy),"object"===_typeof(e.tickSize)?i.tickSize.apply(this,e.tickSize):i.tickSize(e.tickSize),e.tickValues&&i.tickValues(e.tickValues),e.ticks){if("Category"===e.type&&_.isNumber(e.ticks)){var s=this._data;e.tickFormat=function(t,i){var n=_.toNumber(e.ticks),a=s.length,r=parseInt((a-1)/(n-1));if(0===r)return t;var o=(a-1)%(n-1),l=parseInt(o%2&&o/2+1||o/2);return i<l?"":a-i<=o-l?"":(i-l)%r?"":t}}else if("array"==typeof e.ticks)i.ticks.apply(this,e.ticks);else if(_.isNumber(e.ticks))if("Time"!==e.type)if(e.ticks=_.toNumber(e.ticks),"string"==typeof e.tickFormat){var a=_.clone(n.domain());switch(e.ticks){case 0:i.tickValues([a[0]]);break;case 1:i.tickValues([a[1]]);break;default:if(e.tickFormat){var r=_slicedToArray(a,2),o=r[0],l=r[1];if(a=this.cut(a,e.ticks,e.tickFormat),"defaults"===e.type.toLocaleLowerCase()){var h=+d3.format(e.tickFormat)(l),c=+d3.format(e.tickFormat)(o);a=a.filter(function(t){return+t==+d3.format(e.tickFormat)(t)&&t<=h&&t>=c})}}i.tickValues(a)}setTimeout(function(){var e=t.el.selectAll(".tick")[0];if(e&&e.length>1){var i=e[e.length-2];isTicksOverlap(i,e[e.length-1])&&d3.select(i).remove()}},0)}else i.ticks(e.ticks).tickValues(null),removeOverlapTicksOfTargetAxis(this.el);else{var d=_slicedToArray(this._getTimeAxisExtent(),2),u=d[0],p=d[1],f=Math.abs(p-u),g=Math.min(MAX_TICK_COUNT,e.ticks),m=g-1?f/(g-1):2*f,x="seconds";Object.keys(timeUnitsMSMap).every(function(t){return m>timeUnitsMSMap[t]&&(x=t),m>timeUnitsMSMap[t]}),i.ticks(d3.time[x],Math.round(m/timeUnitsMSMap[x])),removeOverlapTicksOfTargetAxis(this.el)}}else if(_.isNumber(e.ticks)&&"time"===e.type.toLowerCase()){var y=5*e.tickFormat(new Date).length+5,k=Math.min(e.innerWidth/y||10,MAX_TICK_COUNT);i.ticks(Math.min(k,this._data.length||k)),removeOverlapTicksOfTargetAxis(this.el)}if("string"==typeof e.tickFormat)i.tickFormat(d3.format(e.tickFormat));else if("function"==typeof e.tickFormat){var v=this;i.tickFormat(function(t,i){return e.tickFormat.call(v._data[i],t,i)})}},_afterAxis:function(){var t=this.options;"function"==typeof t._afterAxis&&t._afterAxis.call(this)},renderLabel:function(){var t=this.options,e=this.alloptions;if(t.label){if(t.labelInAxis){var i=this.el.select(".axis-unit")[0][0]&&this.el.select(".axis-unit")||this.el.append("g").attr({class:"axis-unit"}),n=this.el.selectAll(".tick:nth-last-child(3)").select("text");n&&n.length&&n[0].length&&("Left"===t.orient||"Right"===t.orient?i.attr("transform","translate(0,"+-1.5*parseInt(n.style("font-size"))+")"):i.attr("transform","translate("+((t.innerWidth||e.innerWidth)+3*parseInt(n.style("font-size")))+", 0)"),(i.select("text")[0][0]&&i.select("text")||i.append("text")).attr({dy:n.attr("dy"),x:n.attr("x"),y:n.attr("y"),transform:n.attr("transform")}).text(t.label).style({"text-anchor":n.style("text-anchor"),"font-size":n.style("font-size"),"font-weight":n.style("font-weight"),fill:n.style("fill")}))}}else this.el.select(".axis-unit").remove()},calLeft:function(){var t=this.options,e=this.alloptions,i=this.x=this["axis"+t.type].call(this,[t.innerHeight||e.innerHeight,0]),n=this.axisx=d3.svg.axis().scale(i).orient("left");this.format(),this._afterAxis(),-1!==this.el.attr("class").indexOf("axis")?this.el.call(n):this.el=this.el.append("g").attr("class","axis").call(n),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",x2:t.innerWidth||e.innerWidth,y2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},updateLeft:function(){var t=this.options,e=this.alloptions;this["updateAxis"+t.type].call(this,[t.innerHeight||e.innerHeight,0]),this.format(),this._afterAxis(),this.el.call(this.axisx),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",x2:t.innerWidth||e.innerWidth,y2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},calRight:function(){var t=this.options,e=this.alloptions,i=this.x=this["axis"+t.type].call(this,[t.innerHeight||e.innerHeight,0]),n=this.axisx=d3.svg.axis().scale(i).orient("right");this.format(),this._afterAxis(),-1!==this.el.attr("class").indexOf("axis")?this.el.attr({transform:"translate("+(t.innerWidth||e.innerWidth)+", 0)"}).call(n):this.el=this.el.append("g").attr({class:"axis",transform:"translate("+(t.innerWidth||e.innerWidth)+", 0)"}).call(n),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",x2:-t.innerWidth||-e.innerWidth,y2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},updateRight:function(){var t=this.options,e=this.alloptions;this["updateAxis"+t.type].call(this,[t.innerHeight||e.innerHeight,0]),this.format(),this._afterAxis(),this.el.attr({transform:"translate("+(t.innerWidth||e.innerWidth)+", 0)"}).call(this.axisx),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",x2:-t.innerWidth||-e.innerWidth,y2:"0"}).style({stroke:t.netColor})},calTop:function(){var t=this.options,e=this.alloptions,i=this.x=this["axis"+t.type].call(this,[0,t.innerWidth||e.innerWidth]),n=this.axisx=d3.svg.axis().scale(i).orient("top");this.format(),this._afterAxis(),-1!==this.el.attr("class").indexOf("axis")?this.el.call(n):this.el=this.el.append("g").attr("class","axis").call(n),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",y2:t.innerHeight||e.innerHeight,x2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},updateTop:function(){var t=this.options,e=this.alloptions;this["updateAxis"+t.type].call(this,[0,t.innerWidth||e.innerWidth]),this.format(),this._afterAxis(),this.el.call(this.axisx),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",y2:t.innerHeight||e.innerHeight,x2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},calBottom:function(){var t=this.options,e=this.alloptions,i=this.x=this["axis"+t.type].call(this,[0,t.innerWidth||e.innerWidth]),n=this.axisx=d3.svg.axis().scale(i).orient("bottom");this.format(),this._afterAxis(),-1!==this.el.attr("class").indexOf("axis")?this.el.attr({transform:"translate(0,"+(t.innerHeight||e.innerHeight)+")"}).call(n):this.el=this.el.append("g").attr({class:"axis",transform:"translate(0,"+(t.innerHeight||e.innerHeight)+")"}).call(n),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",y2:-t.innerHeight||-e.innerHeight,x2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},updateBottom:function(){var t=this.options,e=this.alloptions;this["updateAxis"+t.type].call(this,[0,t.innerWidth||e.innerWidth]),this.format(),this._afterAxis(),this.el.attr("transform","translate(0,"+(t.innerHeight||e.innerHeight)+")").call(this.axisx),this.net=this.el.selectAll(".tick"+("Category"!==t.type&&1!==t.ticks?":not(:first-child)":"")).append("line").attr({class:"net-line",y2:-t.innerHeight||-e.innerHeight,x2:"0"}).style({"stroke-dasharray":"2 2",stroke:t.netColor})},niceExtent:function(t,e){var i=this.options,n=Math.abs(e[1]-e[0]);t<=1&&(t=2);var s=numberUtil.nice(n/t,!0),a=numberUtil.getPrecisionSafe(s)+2,r=[i.minNeedNice?numberUtil.round(Math.floor(e[0]/s)*s,a):e[0],i.maxNeedNice?numberUtil.round(Math.ceil(e[1]/s)*s,a):e[1]];return _.toNumber(r[0])>_.toNumber(r[1])&&_.reverse(r),"defaults"===i.type.toLocaleLowerCase()&&i.tickFormat&&(r=d3.extent(this.cut(r,i.ticks,i.tickFormat).concat(r[0],r[1]))),r},axisDefaults:function(t){var e=this.x=d3.scale.linear().range(t),i=this.calExtent(),n=this.options,s=this.niceExtent(n.ticks,i);return e.domain(s),e},updateAxisDefaults:function(t){this.x.range(t);var e=this.calExtent(),i=this.options,n=this.niceExtent(i.ticks,e);return this.x.domain(n),this.x},axisCategory:function(t){var e,i=this.options;e=_.isArray(i.padding)?this.x=d3.scale.ordinal().rangeBands(t,i.padding[0],i.padding[1]):this.x=d3.scale.ordinal().rangeBands(t,i.padding/2,i.padding);var n=this.calExtent();return e.domain(n),e},updateAxisCategory:function(t){var e=this.options;return _.isArray(e.padding)?this.x.rangeBands(t,e.padding[0],e.padding[1]):this.x.rangeBands(t,e.padding/2,e.padding),this.x.domain(this.calExtent()),this.x},_setTimeAxisBoundaryGap:function(t){var e=this.options.blank?this.options.blankDis:0;if(e&&this._data&&this._data.length){var i=(+t[1]-t[0])/this._data.length,n=parseInt(i*e);t=[new Date(+t[0]-n),new Date(+t[1]+n)]}return t},_getTimeAxisExtent:function(){var t=this.options,e=d3.time.format(t.format),i=t.min,n=t.max,s=[i=i||"auto",n=n||"auto"],a=e.parse(i),r=e.parse(n),o=_.isDate(a),l=_.isDate(r);if(l&&o)s[0]=a,s[1]=r;else{var h=t.key,c=this._data.map(function(t){var i=t[h];return _.isDate(i)?+i:_.isString(i)?+e.parse(i):(console.log("date error: "+i+"is not a Date"),null)}),d=new Date(_.min(c)),u=new Date(_.max(c));s[0]=o?a:d,s[1]=l?r:u}return+(s=this._setTimeAxisBoundaryGap(s))[0]==+s[1]&&(s[1]=new Date(+s[1]+ONE_SECOND)),s},axisTime:function(t){var e=this._getTimeAxisExtent();return this.x=d3.time.scale().range(t).domain(e),this.x},updateAxisTime:function(t){var e=this._getTimeAxisExtent();return this.x.range(t).domain(e),this.x},axisNondecile:function(t){var e=this.options,i=this.x=d3.scale.linear().range(t);e.max=_.sum(this._data,e.nondecile.key),i.domain(this.calExtent());var n=_.groupBy(this._data,e.key),s=this._data=[],a=0,r=s.length,o=(t[1]-t[0])/(i.domain()[1]-i.domain()[0]);for(var l in n){var h={sum:_.sum(n[l],e.nondecile.key),begin:a,end:0,center:0,radio:0};r--,h[e.key]=l,h.end=h.begin+h.sum,a+=h.sum,h.center=(h.begin+h.end)/2,e.nondecile.tickPadding&&0!==h.begin&&(h.begin=(i(h.begin)-e.nondecile.tickPadding/2-t[0])/o+i.domain()[0]),e.nondecile.tickPadding&&0!==r&&(h.end=(i(h.end)+e.nondecile.tickPadding/2-t[0])/o+i.domain()[0]),h.radio=(h.end-h.begin)/h.sum,s.push(h)}return e._afterAxis=function(){this.axisx.tickValues(_.pluck(this._data,"center"))},e.afterRender=function(){this.el.selectAll(".tick").data(this._data)},i},updateAxisNondecile:function(t){var e=this.options,i=this.x.range(t);e.max=_.sum(this._data,e.nondecile.key),i.domain(this.calExtent());var n=_.groupBy(this._data,e.key),s=this._data=[],a=0,r=s.length,o=(t[1]-t[0])/(i.domain()[1]-i.domain()[0]);for(var l in n){var h={sum:_.sum(n[l],e.nondecile.key),begin:a,end:0,center:0,radio:0};r--,h[e.key]=l,h.end=h.begin+h.sum,a+=h.sum,h.center=(h.begin+h.end)/2,e.nondecile.tickPadding&&0!==h.begin&&(h.begin=(i(h.begin)-e.nondecile.tickPadding/2-t[0])/o+i.domain()[0]),e.nondecile.tickPadding&&0!==r&&(h.end=(i(h.end)+e.nondecile.tickPadding/2-t[0])/o+i.domain()[0]),h.radio=(h.end-h.begin)/h.sum,s.push(h)}return i.domain(this.calExtent()),e._afterAxis=function(){this.axisx.tickValues(_.pluck(this._data,"center")),this.el&&this.el.selectAll(".tick").data(_.pluck(this._data,"center"))},i},calExtent:function(){var t=this,e=this.options,i=[];if("category"!==e.type.toLocaleLowerCase()){var n=[];this._data.forEach(function(i){var s=i[e.key];_.isArray(s)?("defaults"===e.type.toLocaleLowerCase()&&(s=_.map(s,function(e){return _.toNumber(t._getValue(e))})),n=_.union(n,s)):("defaults"===e.type.toLocaleLowerCase()&&(s=_.toNumber(t._getValue(s))),n.push(s))}),i=d3.extent(n),isFinite(e.min)&&null!==e.min&&(i[0]=e.min),i[1]=e.max||i[1]}else i=_.map(this._data,function(i){return t._getValue(i[e.key])});return i},_getValue:function(t){return _.isObject(t)&&t.hasOwnProperty("value")?t.value:t},getX:function(){return this.x},getAxisX:function(){return this.axisx},getMin:function(){return _.first(this.x.domain())},getMax:function(){return _.last(this.x.domain())},calGroupStep:function(t){var e=this.options.groupPadding;return Array.isArray(e)?this.groupX=d3.scale.ordinal().rangeBands([0,this.x.rangeBand()],_.isNumber(e[0])?e[0]:.4,_.isNumber(e[1])?e[1]:0):this.groupX=d3.scale.ordinal().rangeBands([0,this.x.rangeBand()],_.isNumber(e)?e:.4),Array.isArray(t)||(t=this._createCategory(parseInt(t))),this.groupX.domain(t),this.groupX},getGroupStep:function(t){return this.groupX?this.groupX.rangeBand():(this.calGroupStep(t),this.groupX.rangeBand())},_createCategory:function(t){for(var e=[],i=0;i<t;i++)e.push(""+i);return e},getGroupX:function(){return this.groupX},updateSeries:function(){var t=this.options;this.el.selectAll(".net-line").remove(),this.isReset&&this["cal"+t.orient]()||this["update"+t.orient](),this.renderStyle(),this.renderLabel(),"function"==typeof t.afterRender&&t.afterRender.call(this),this.el.selectAll(".net-line").style("display",t.net?"block":"none"),this.isReset=!1},renderStyle:function(){var t=this.options,e=this.el.selectAll(".tick text").style({fill:t.fontColor,"font-size":t.fontSize,"font-weight":t.fontWeight,"stroke-width":0,display:t.textShow?"block":"none"});t.fontStrokeWidth&&e.style({stroke:t.fontColor,"stroke-width":t.fontStrokeWidth}),t.rotate&&_.isNumber(t.rotate)?e.each(function(e){var i=d3.select(this),n=_.toNumber(i.attr("x")),s=_.toNumber(i.attr("y")),a=t.rotate/360*2*Math.PI;i.attr("transform",(("Top"===t.orient||"Bottom"===t.orient)&&"translate(0 "+.5*Math.sin(a)*t.fontSize*("Bottom"===t.orient?.01:-1.99)+")"||"")+" rotate("+t.rotate+" "+n+" "+s+")").style({"text-anchor":"start"})}):e.attr("transform",""),this.el.selectAll(".domain, .tick line:not(.net-line)").style({display:t.assistLine?"block":"none",fill:"none",stroke:t.assistLineColor}),this.el.style("display",t.show?"block":"none")}}),module.exports=Axis;
{
"name": "dchart-core",
"version": "2.6.31",
"version": "2.6.32",
"description": "",

@@ -5,0 +5,0 @@ "scripts": {

@@ -1,1 +0,1 @@

"use strict";var _=require("lodash"),coreUtils=require("bcore/utils"),animationController=require("./animation"),animationUtil=require("../core/animation"),_deepMerge=coreUtils.deepMergeWithoutArray,constants=require("./constants");coreUtils.deepMerge=function(n,t){return _deepMerge(n,t)},_.mixin(coreUtils),_.mixin({animationController:animationController}),_.mixin(animationUtil),_.mixin({exec:function(n){var t=Array.apply(null,arguments).slice(1);return"function"==typeof n?n.call(this,t):n},instance:function(n){return _.has(this,n)?this[n]:new n(Array.apply(null,arguments).slice(1))},initialUpperCase:function(n){var t;return n.replace(/\w+/g,function(n){return t=n.substring(0,1).toUpperCase()+n.substring(1)}),t},pos2Str:function(n){var t="";return n.forEach(function(n){t+=n.x+","+n.y+" "}),t},obj2Str:function(n){var t="",r=null;for(var e in"function"==typeof arguments[1]&&(r=arguments[1]),n)t+=r?r(e,n[e]):e+":"+n[e]+";";return t},pos2Path:function(n,t){var r="M";return n.forEach(function(n,t){r+=0===t?n.x+" "+n.y:"L"+n.x+" "+n.y}),t||(r+="Z"),r},pos2PathByArr:function(n){for(var t="M",r=0;r<n.length;r+=2)t+=0===r?n[r]+","+n[r+1]:"L"+n[r]+","+n[r+1];return t+="Z"},split:function(n,t){if(_.isArray(n))return n.split(t);var r="";for(var e in n)r+=n[e]+t;return r},getUUID:function(){return~~(1e4*Math.random())+ +new Date},getRectPath:function(n,t,r,e){return"M".concat(n," ").concat(t," h").concat(r," v").concat(e," h").concat(-r," L").concat(n," ").concat(t)}}),Object.assign(_,constants),module.exports=_;
"use strict";var _=require("lodash"),coreUtils=require("bcore/utils"),animationController=require("./animation"),animationUtil=require("../core/animation"),_deepMerge=coreUtils.deepMergeWithoutArray,constants=require("./constants");coreUtils.deepMerge=function(n,r){return _deepMerge(n,r)},_.mixin(coreUtils),_.mixin({animationController:animationController}),_.mixin(animationUtil),_.mixin({exec:function(n){var r=Array.apply(null,arguments).slice(1);return"function"==typeof n?n.call(this,r):n},instance:function(n){if(!_.has(this,n)){var r=Array.apply(null,arguments).slice(1);return new n(r)}return this[n]},initialUpperCase:function(n){var r;return n.replace(/\w+/g,function(n){return r=n.substring(0,1).toUpperCase()+n.substring(1)}),r},pos2Str:function(n){var r="";return n.forEach(function(n){r+=n.x+","+n.y+" "}),r},obj2Str:function(n){var r="",t=null;for(var e in"function"==typeof arguments[1]&&(t=arguments[1]),n)r+=t?t(e,n[e]):e+":"+n[e]+";";return r},pos2Path:function(n,r){var t="M";return n.forEach(function(n,r){t+=0===r?n.x+" "+n.y:"L"+n.x+" "+n.y}),r||(t+="Z"),t},pos2PathByArr:function(n){for(var r="M",t=0;t<n.length;t+=2)r+=0===t?n[t]+","+n[t+1]:"L"+n[t]+","+n[t+1];return r+="Z"},split:function(n,r){if(_.isArray(n))return n.split(r);var t="";for(var e in n)t+=n[e]+r;return t},getUUID:function(){return~~(1e4*Math.random())+ +new Date},getRectPath:function(n,r,t,e){return"M".concat(n," ").concat(r," h").concat(t," v").concat(e," h").concat(-t," L").concat(n," ").concat(r)}}),Object.assign(_,constants),module.exports=_;