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

salad-ui.chart

Package Overview
Dependencies
Maintainers
3
Versions
263
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

salad-ui.chart - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11

2

package.json

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

{"name":"salad-ui.chart","version":"1.0.10","description":"Reusable React UI Components Toolkit","main":"./salad-ui.chart.js","repository":{"type":"git","url":"https://github.com/dailymotion/salad-ui.git"},"keywords":["react","react-component","react-chart","react-graph"],"peerDependencies":{"react":"^15.0.0","react-dom":"^15.0.0","react-router":"^2.4.1"}}
{"name":"salad-ui.chart","version":"1.0.11","description":"Reusable React UI Components Toolkit","main":"./salad-ui.chart.js","repository":{"type":"git","url":"https://github.com/dailymotion/salad-ui.git"},"keywords":["react","react-component","react-chart","react-graph"],"peerDependencies":{"react":"^15.0.0","react-dom":"^15.0.0","react-router":"^2.4.1"}}

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

module.exports=function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var r={};return t.m=e,t.c=r,t.p="/dist/",t(0)}({0:function(e,t,r){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var n=r(190),i=o(n);e.exports=i},5:function(e,t){e.exports=require("react")},33:function(e,t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return"undefined"==typeof e?"undefined":r(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":"undefined"==typeof e?"undefined":r(e)},n=t.currencyToSymbol=function(e){switch(e){case"EUR":return"€";default:return"$"}},i=(t.formatCurrency=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(null!==e&&""!==e)return"number"!=typeof e&&(e=parseFloat(e)),e=e.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g,"$1,"),n(t)+" "+e},t.formatNumber=function(e){var t=e.toString(),r=t.split("."),o=r[0]+(r[1]?"."+r[1].slice(0,2):"");return o.replace(/\B(?=(\d{3})+(?!\d))/g,",")},t.numberToString=function(e){var t=parseFloat(e);return isNaN(t)?e:t>1e9?Math.round(t/1e8)/10+"B":t>1e7?Math.round(t/1e6)+"M":t>1e6?Math.round(t/1e5)/10+"M":t>1e4?Math.round(t/1e3)+"K":t>1e3?Math.round(t/100)/10+"K":Math.round(100*t)/100},t.mapList=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.map(function(t){return"object"===("undefined"==typeof t?"undefined":o(t))?l(e,t,r+1).value:t});if(0===n.length)return"none";var i="",a=0;for(a;a<=n.length-1;a++)i+=n[a],i+=a===n.length-1?"":a===n.length-2?" and ":", ";return i}),a=t.mapSum=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.map(function(t){return"object"===("undefined"==typeof t?"undefined":o(t))?l(e,t,r+1).value:t});if(0===n.length)return 0;var i=0,a=0;for(a;a<=n.length-1;a++)i+=parseFloat(n[a]);return i},l=t.readProperty=function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t||!t[n])return{value:"_invalid_key_",iteration:n};var l="undefined"==typeof r?"undefined":o(r);if("string"===l||"number"===l);else{if(t[n]&&t[n]in r)return n<t.length-1&&"object"===o(r[t[n]])?e(t,r[t[n]],n+1):{value:r[t[n]],iteration:n};if(~["all","first","sum","mean","random"].indexOf(t[n])&&r instanceof Array)switch(t[n]){case"first":return r[0]?e(t,r[0],n+1):{value:"_invalid_array_",iteration:n};case"random":var s=r[Math.floor(Math.random()*r.length)];return e(t,s,n+1);case"all":return e(t,i(t,r,n),n);case"sum":return e(t,a(t,r,n),n);case"mean":case"avg":return e(t,a(t,r,n)/r.length,n)}}return{value:"_invalid_key_",iteration:n}};t.render=function(e,t){return e.replace(/([{}])\1|[{](.*?)(?:!(.+?))?[}]/g,function(e,r,o){var n=l(o.split("."),t).value;return"function"==typeof n?n():n})}},60:function(e,t){e.exports=require("react-dom")},96:function(e,t){e.exports=require("moment")},97:function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":l(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":l(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},p=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),u=r(5),f=o(u),d=function(e){function t(){return n(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),p(t,[{key:"render",value:function(){return f.default.createElement("svg",{className:"react-chart "+this.props.type,width:this.props.width,style:s({overflow:"visible",border:this.props.border},this.props.style),height:this.props.height},this.props.children)}}]),t}(u.Component);d.defaultProps={border:"none",height:400,width:600,style:{}},t.default=d},188:function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":s(t))&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":s(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),u=r(5),f=o(u),d=r(60),c=(o(d),r(96)),h=o(c),y=r(33),b=r(97),m=o(b),g=function(e){function t(){var e,r,o,n;i(this,t);for(var l=arguments.length,s=Array(l),p=0;p<l;p++)s[p]=arguments[p];return r=o=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),o.tipsData={},o.xAxisLabels=[],n=r,a(o,n)}return l(t,e),p(t,[{key:"describeLine",value:function(e,t,r,o,n,i,a){var l=this,s=0===n&&0===r;return e.map(function(e,o){return Math.max(0,(e.time-t)*i-l.props.strokeWidth)+","+(s?a:(n-(e.value-r))*a)}).join(" ")}},{key:"centerElement",value:function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];o&&e.setAttribute("width",r);var n=t-r/2;e.setAttribute("x",n)}},{key:"showPointTip",value:function(e,t){var r=this.refs[e.ref],o=r.getElementsByClassName("tip-background")[0],n=r.getElementsByClassName("tip-text-date")[0],i=r.getElementsByClassName("tip-text-value")[0];this.centerElement(n,this.tipsData[e.ref].xBase,n.getBBox().width),this.centerElement(i,this.tipsData[e.ref].xBase,i.getBBox().width),this.centerElement(o,this.tipsData[e.ref].xBase,Math.max(n.getBBox().width,i.getBBox().width)+2*this.props.tipsPadding,!0),r.style.display="block"}},{key:"hidePointTip",value:function(e,t){this.refs[e.ref].style.display="none"}},{key:"renderTipText",value:function(e,t){if("function"==typeof e)return e(t);if("string"==typeof e)return e.replace("{{date}}",(0,h.default)(t.date).format(t.dateFormat||"YYYY-MM-DD")).replace("{{date1}}",(0,h.default)(t.date1).format(t.dateFormat||"YYYY-MM-DD")).replace("{{date2}}",(0,h.default)(t.date2).format(t.dateFormat||"YYYY-MM-DD")).replace("{{value}}",(0,y.formatNumber)(t.value));throw new Error("Invalid labelTemplate type!")}},{key:"renderTips",value:function(e,t,r,o,n,i,a){var l=this,s=void 0,p=void 0,u=void 0,d=void 0,c="{{value}} views",h=864e5,y=0===n&&0===r;if(0!==e.length)return s=1===e.length?0:e[1].time-e[0].time,s>27*h&&s<32*h?(p="MMMM",u="{{date}}"):s>h?(p="MMM Do",u="{{date1}} through {{date2}}"):(p="MMM Do",u="{{date}}"),e.map(function(o,h){if(0!==h&&h!==e.length-1||l.props.showFirstAndLastTip){d=e[h+1]?e[h+1].time:o.time+s,o.label||(o.label=c);var b=(o.time-t)*i,m="point_"+h+"_tooltip",g=p,v=38,k=25,x=(y?a:(n-(o.value-r))*a)-l.props.tipsPadding/2,P=25,T=10,w=[b-l.props.tipStrokeWidth-P/2+","+(x-k+9),b-l.props.tipStrokeWidth+P/2+","+(x-k+9),b-l.props.tipStrokeWidth+","+(x-k+T+9)].join(" "),M=[b-l.props.tipStrokeWidth-P/2+","+(x-k+10),b-l.props.tipStrokeWidth+P/2+","+(x-k+10),b-l.props.tipStrokeWidth+","+(x-k+T+10)].join(" ");return l.tipsData[m]={xBase:b},new Date(o.time).getFullYear()!==(new Date).getFullYear()&&(g+=" YYYY"),f.default.createElement("g",{key:"point-"+h,ref:m,style:{display:"none",position:"relative",zIndex:4},className:"value-tip"},f.default.createElement("rect",{className:"tip-background",x:(o.time-t)*i-l.props.strokeWidth-l.props.tipsWidth/2,y:x-v-k,width:l.props.tipsWidth+l.props.tipsPadding,height:v+l.props.tipsPadding,style:{stroke:l.props.tipStrokeColor,strokeWidth:l.props.tipStrokeWidth,fill:l.props.tipsFill}}),f.default.createElement("polygon",{points:M,style:{stroke:l.props.tipStrokeColor,opacity:.5,strokeWidth:l.props.tipStrokeWidth}}),f.default.createElement("polygon",{points:w,style:{fill:l.props.tipsFill}}),f.default.createElement("text",{className:"tip-text-date",x:b-l.props.tipsWidth/2+2,y:x-l.props.strokeWidth-v-k+l.props.tipsPadding+10,style:{fontSize:14,fontWeight:"light"},dangerouslySetInnerHTML:{__html:l.renderTipText(u,{dateFormat:g,date:o.time,date1:o.time,date2:d,value:o.value})}}),f.default.createElement("text",{className:"tip-text-value",x:b-l.props.tipsWidth/2+2,y:x-l.props.strokeWidth-v-k+l.props.tipsPadding+30,style:{fontSize:16,fontWeight:"bold"},dangerouslySetInnerHTML:{__html:l.renderTipText(l.props.labelTemplate,{value:o.value,date:o.time})}}))}})}},{key:"renderPoints",value:function(e,t,r,o,n,i,a){var l=this,s=0===n&&0===r;return e.map(function(o,p){if(0!==p&&p!==e.length-1||l.props.showFirstAndLastTip)return f.default.createElement("circle",{key:"point-"+p,cx:(o.time-t)*i-l.props.strokeWidth/2,cy:s?a:(n-(o.value-r))*a,r:l.props.pointsRadius,onMouseOver:l.showPointTip.bind(l,{ref:"point_"+p+"_tooltip"}),onMouseLeave:l.hidePointTip.bind(l,{ref:"point_"+p+"_tooltip"}),style:{stroke:l.props.strokeColor,strokeWidth:l.props.strokeWidth,fill:"white",cursor:"default"}})})}},{key:"renderLabel",value:function(e,t){return e.x||("right"===this.props.yLabelsPosition?e.x=this.activeWidth+(this.props.yLabelsOutside?5:-1*(20+5*(e.txt.length||1))):e.x=20),e.ref||(e.ref="label."+t+","+e.x+","+e.y),f.default.createElement("text",{key:"graph.xAxis.label."+e.ref,x:e.x,y:e.y,ref:e.ref,fill:this.props.labelColor,style:{fontSize:this.props.labelFontSize,textShadow:this.props.labelTextShadow}},e.txt)}},{key:"renderYGridLine",value:function(e,t){return f.default.createElement("line",{key:"graph.ygridLine."+t,x1:"0",y1:e.y,x2:this.activeWidth-this.props.strokeWidth,y2:e.y,fill:this.props.labelColor,style:{stroke:this.props.gridColor,strokeWidth:1}})}},{key:"describeYAxis",value:function(e,t,r){function o(e,t){return t||(t=100),e>t&&o(e,5*t),Math.ceil(e/t)*t/10}var n=o(t,t/10),i=[1,2,3,4,5,6,7,8,9],a=[0,1,2,3,4],l=0===t&&0===e;return{gridLines:i.map(function(e){return{y:l?r:(t-e*n)*r}}),labels:a.map(function(o){var i=o*n*2;return{y:l?r:(t-o*n*2)*r,txt:(0,y.formatNumber)(Math.round(i+e))}})}}},{key:"describeXAxis",value:function(e,t,r,o){var n=this,i=[1,2,3,4,5,6,7,8,9],a=o.length/i.length,l="ddd",s=[],p=864e5;return e<1e4?{labels:[]}:(i.length>o.length&&(i=o.map(function(e,t){return t+1}),a=1),t>365*p*7?l="YYYY":t>30*p*9?l="MMM":t>7*p&&(l="MMM Do"),i.forEach(function(o,a){var p=e+o*(t/i.length);a<i.length-1&&s.push({txt:(0,h.default)(p).format(l),time:p,x:(p-e)*r,y:n.activeHeight+30,ref:"xLabel."+a})}),this.xAxisLabels=s,{labels:s})}},{key:"centerXAxisLabelMarkers",value:function(){var e=this;this.xAxisLabels.forEach(function(t){var r=e.refs[t.ref];e.centerElement(r,t.x,r.getBBox().width)})}},{key:"componentDidMount",value:function(){this.centerXAxisLabelMarkers()}},{key:"componentDidUpdate",value:function(){this.centerXAxisLabelMarkers()}},{key:"render",value:function(){var e=this,t=this.props.data;this.activeWidth=this.props.width,this.activeHeight=this.props.height-50,t.forEach(function(e,r){e.time||(t[r].time=r),e.time instanceof Date||(t[r].time=new Date(t[r].time).getTime())}),t=t.sort(function(e,t){return e.time===t.time?0:e.time>t.time?1:-1});var r=Math.max.apply(Math,n(t.map(function(e,t){return e.time})).concat([t.length])),o=Math.max.apply(Math,n(t.map(function(e){return e.value}))),i=Math.pow(10,String(Math.round(o)).length-1),a=(1+1/this.props.yPadding,Math.max(Math.ceil(o/i)*i,1)),l=Math.min.apply(Math,n(t.map(function(e,t){return e.time}))),s=this.props.useDynamicYMin?Math.min.apply(Math,n(t.map(function(e){return e.value})))-a/5:0,p=r-l,u=a-s,d=this.activeWidth/(p||1),c=this.activeHeight/(u||1),h=this.describeLine(t,l,s,p,u,d,c),y=this.describeYAxis(s,u,c),b=this.describeXAxis(l,p,d,t),g=0===u&&0===s;return f.default.createElement(m.default,{width:this.props.width,height:this.props.height,type:"area"},y.gridLines.map(this.renderYGridLine.bind(this)),f.default.createElement("polygon",{points:"0,"+((g?c:u*c)-this.props.strokeWidth)+" "+h+" "+((r-l)*d-this.props.strokeWidth)+","+((g?c:u*c)-this.props.strokeWidth),style:{fill:this.props.fillColor,strokeWidth:0}}),f.default.createElement("polyline",{points:h,style:{stroke:this.props.strokeColor,strokeDasharray:this.props.strokeDasharray,strokeWidth:this.props.strokeWidth,fill:"none"}}),y.labels.map(this.renderLabel.bind(this)),b.labels.map(function(t,r){return f.default.createElement("line",{key:"graph.xAxis.label."+r,ref:t.ref+".marker",x1:t.x,x2:t.x,y1:e.activeHeight,y2:e.activeHeight+10,stroke:e.props.gridColor,strokeWidth:1})}),b.labels.map(this.renderLabel.bind(this)),this.renderPoints(t,l,s,p,u,d,c),this.renderTips(t,l,s,p,u,d,c))}}]),t}(u.Component);g.propTypes={width:f.default.PropTypes.number,height:f.default.PropTypes.number,border:f.default.PropTypes.string,strokeWidth:f.default.PropTypes.number,useDynamicYMin:f.default.PropTypes.bool,strokeColor:f.default.PropTypes.string,strokeDasharray:f.default.PropTypes.number,pointsRadius:f.default.PropTypes.number,showFirstAndLastTip:f.default.PropTypes.bool,tipsWidth:f.default.PropTypes.number,tipsHeight:f.default.PropTypes.number,tipsPadding:f.default.PropTypes.number,tipStrokeWidth:f.default.PropTypes.number,tipStrokeColor:f.default.PropTypes.string,tipsFill:f.default.PropTypes.string,gridColor:f.default.PropTypes.string,labelFontSize:f.default.PropTypes.number,labelTextShadow:f.default.PropTypes.string,labelColor:f.default.PropTypes.string,fillColor:f.default.PropTypes.string,maxOverflow:f.default.PropTypes.number,yLabelsOutside:f.default.PropTypes.bool,yLabelsPosition:f.default.PropTypes.string,yPadding:f.default.PropTypes.number,data:f.default.PropTypes.array},g.defaultProps={width:640,height:320,border:"none",strokeWidth:2,useDynamicYMin:!1,strokeColor:"#408AE5",strokeDasharray:0,pointsRadius:5,showFirstAndLastTip:!1,tipsWidth:240,tipsHeight:22,tipsPadding:10,tipStrokeWidth:1,tipStrokeColor:"#BBBBBB",tipsFill:"white",gridColor:"rgba(230,230,230,.5)",labelFontSize:12,labelTextShadow:"1px 1px #fff",labelColor:"#555",labelTemplate:"{{value}}",fillColor:"rgba(191, 216, 246, 0.3)",maxOverflow:20,yLabelsOutside:!1,yLabelsPosition:"left",yPadding:10,data:[]},t.default=g},189:function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":l(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":l(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),p=r(5),u=o(p),f=r(33),d=function(e){function t(){return n(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),s(t,[{key:"formatValue",value:function(e){return"%"===this.props.metricName?Math.round(e):(0,f.formatNumber)(e)}},{key:"render",value:function(){return u.default.createElement("div",null,u.default.createElement("div",{style:{fontSize:13,textTransform:"uppercase"}},this.props.label),u.default.createElement("div",{className:"bar-row"},u.default.createElement("div",{style:{backgroundColor:this.props.barRailColor,width:this.props.barWidth+"%",height:this.props.barHeight,marginTop:4,display:"inline-block",position:"relative"}},u.default.createElement("div",{style:{width:this.props.percent+"%",height:this.props.barHeight,position:"absolute",backgroundColor:this.props.barColor,top:0,left:0,bottom:0,transition:"all .5s"}})),u.default.createElement("div",{style:{width:100-this.props.barWidth+"%",paddingLeft:this.props.metricPadding,fontSize:13,display:"inline-block",color:this.props.metricColor,textAlign:"right"}},this.formatValue(this.props.value)+" "+this.props.metricName)),u.default.createElement("br",{style:{display:"table",clear:"both"}}))}}]),t}(u.default.Component);d.defaultProps={metricName:"points",value:"0",percent:100,metricPadding:15,metricColor:"#777",barWidth:70,barHeight:7,barRailColor:"#ddd",barColor:"#408AE5",label:"N/A"},d.propTypes={metricName:u.default.PropTypes.string,percent:u.default.PropTypes.number,barWidth:u.default.PropTypes.number,barHeight:u.default.PropTypes.number,metricPadding:u.default.PropTypes.number,label:u.default.PropTypes.string,metricColor:u.default.PropTypes.string,barColor:u.default.PropTypes.string,barRailColor:u.default.PropTypes.string},t.default=d},190:function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.BarMetric=t.CirclePie=t.Area=void 0;var n=r(188),i=o(n),a=r(191),l=o(a),s=r(189),p=o(s);t.Area=i.default,t.CirclePie=l.default,t.BarMetric=p.default},191:function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":l(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":l(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),p=r(5),u=o(p),f=r(97),d=o(f),c=function(e){function t(){return n(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),s(t,[{key:"polarToCartesian",value:function(e,t,r,o){var n=(o-90)*Math.PI/180;return{x:e+r*Math.cos(n),y:t+r*Math.sin(n)}}},{key:"describeArc",value:function(e,t,r,o,n){e&&t||console.error("x or y missing to describeArc");var i=this.polarToCartesian(e,t,r,n),a=this.polarToCartesian(e,t,r,o),l=n-o<=180?"0":"1";return["M",i.x,i.y,"A",r,r,0,l,0,a.x,a.y].join(" ")}},{key:"render",value:function(){var e=this.props.width/2-this.props.strokeWidth/2-this.props.padding,t=e+this.props.strokeWidth/2+this.props.padding,r=0,o=3.6*this.props.percent,n=this.props.percent+"%",i=3===n.length?-.95:-.6,a=this.describeArc(t,t,e,r,o);return u.default.createElement(d.default,{width:this.props.width,style:this.props.style,height:this.props.height,border:this.props.border},u.default.createElement("circle",{cx:t,cy:t,r:e,fill:this.props.fillColor,stroke:this.props.railColor,strokeWidth:this.props.strokeWidth}),u.default.createElement("path",{fill:this.props.fillColor,stroke:this.props.strokeColor,strokeWidth:this.props.strokeWidth,d:a}),u.default.createElement("text",{x:t,y:t,dx:i+"em",dy:".35em",fill:this.props.labelColor,fontWeight:this.props.labelFontWeight,fontSize:this.props.labelFontSize},n))}}]),t}(p.Component);c.propTypes={width:u.default.PropTypes.number,height:u.default.PropTypes.number,strokeWidth:u.default.PropTypes.number,strokeColor:u.default.PropTypes.string,labelFontWeight:u.default.PropTypes.string,labelFontSize:u.default.PropTypes.string,fillColor:u.default.PropTypes.string,startAngle:u.default.PropTypes.number,endAngle:u.default.PropTypes.number,radius:u.default.PropTypes.number,style:u.default.PropTypes.object},c.defaultProps={width:150,height:150,border:"none",strokeWidth:10,style:{},labelColor:"#408AE5",labelFontSize:"1.2em",labelFontWeight:"bold",strokeColor:"#408AE5",railColor:"#f5f5f5",fillColor:"none",percent:70,padding:0},t.default=c}});
module.exports=function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var r={};return t.m=e,t.c=r,t.p="/dist/",t(0)}({0:function(e,t,r){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}var n=r(195),i=o(n);e.exports=i},5:function(e,t){e.exports=require("react")},34:function(e,t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return"undefined"==typeof e?"undefined":r(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":"undefined"==typeof e?"undefined":r(e)},n=t.currencyToSymbol=function(e){switch(e){case"EUR":return"€";default:return"$"}},i=(t.formatCurrency=function(e){var t=arguments.length<=1||void 0===arguments[1]?"":arguments[1];if(null!==e&&""!==e)return"number"!=typeof e&&(e=parseFloat(e)),e=e.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g,"$1,"),n(t)+" "+e},t.formatNumber=function(e){var t=e.toString(),r=t.split("."),o=r[0]+(r[1]?"."+r[1].slice(0,2):"");return o.replace(/\B(?=(\d{3})+(?!\d))/g,",")},t.numberToString=function(e){var t=parseFloat(e);return isNaN(t)?e:t>1e9?Math.round(t/1e8)/10+"B":t>1e7?Math.round(t/1e6)+"M":t>1e6?Math.round(t/1e5)/10+"M":t>1e4?Math.round(t/1e3)+"K":t>1e3?Math.round(t/100)/10+"K":Math.round(100*t)/100},t.mapList=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?0:arguments[2],n=t.map(function(t){return"object"===("undefined"==typeof t?"undefined":o(t))?s(e,t,r+1).value:t});if(0===n.length)return"none";var i="",a=0;for(a;a<=n.length-1;a++)i+=n[a],i+=a===n.length-1?"":a===n.length-2?" and ":", ";return i}),a=t.mapSum=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?0:arguments[2],n=t.map(function(t){return"object"===("undefined"==typeof t?"undefined":o(t))?s(e,t,r+1).value:t});if(0===n.length)return 0;var i=0,a=0;for(a;a<=n.length-1;a++)i+=parseFloat(n[a]);return i},s=t.readProperty=function l(e,t){var r=arguments.length<=2||void 0===arguments[2]?0:arguments[2];if(!e||!e[r])return{value:"_invalid_key_",iteration:r};var n="undefined"==typeof t?"undefined":o(t);if("string"===n||"number"===n);else{if(e[r]&&e[r]in t)return r<e.length-1&&"object"===o(t[e[r]])?l(e,t[e[r]],r+1):{value:t[e[r]],iteration:r};if(~["all","first","sum","mean","random"].indexOf(e[r])&&t instanceof Array)switch(e[r]){case"first":return t[0]?l(e,t[0],r+1):{value:"_invalid_array_",iteration:r};case"random":var s=t[Math.floor(Math.random()*t.length)];return l(e,s,r+1);case"all":return l(e,i(e,t,r),r);case"sum":return l(e,a(e,t,r),r);case"mean":case"avg":return l(e,a(e,t,r)/t.length,r)}}return{value:"_invalid_key_",iteration:r}};t.render=function(e,t){return e.replace(/([{}])\1|[{](.*?)(?:!(.+?))?[}]/g,function(e,r,o){var n=s(o.split("."),t).value;return"function"==typeof n?n():n})}},65:function(e,t){e.exports=require("react-dom")},101:function(e,t){e.exports=require("moment")},102:function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":s(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":s(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},p=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),u=r(5),f=o(u),d=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),p(t,[{key:"render",value:function(){return f["default"].createElement("svg",{className:"react-chart "+this.props.type,width:this.props.width,style:l({overflow:"visible",border:this.props.border},this.props.style),height:this.props.height},this.props.children)}}]),t}(u.Component);d.defaultProps={border:"none",height:400,width:600,style:{}},t["default"]=d},193:function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":l(t))&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":l(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),u=r(5),f=o(u),d=r(65),c=(o(d),r(101)),h=o(c),y=r(34),b=r(102),m=o(b),g=function(e){function t(){var e,r,o,n;i(this,t);for(var s=arguments.length,l=Array(s),p=0;s>p;p++)l[p]=arguments[p];return r=o=a(this,(e=Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),o.tipsData={},o.xAxisLabels=[],n=r,a(o,n)}return s(t,e),p(t,[{key:"describeLine",value:function(e,t,r,o,n,i,a){var s=this,l=0===n&&0===r;return e.map(function(e,o){return Math.max(0,(e.time-t)*i-s.props.strokeWidth)+","+(l?a:(n-(e.value-r))*a)}).join(" ")}},{key:"centerElement",value:function(e,t,r){var o=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];o&&e.setAttribute("width",r);var n=t-r/2;e.setAttribute("x",n)}},{key:"showPointTip",value:function(e,t){var r=this.refs[e.ref],o=r.getElementsByClassName("tip-background")[0],n=r.getElementsByClassName("tip-text-date")[0],i=r.getElementsByClassName("tip-text-value")[0];this.centerElement(n,this.tipsData[e.ref].xBase,n.getBBox().width),this.centerElement(i,this.tipsData[e.ref].xBase,i.getBBox().width),this.centerElement(o,this.tipsData[e.ref].xBase,Math.max(n.getBBox().width,i.getBBox().width)+2*this.props.tipsPadding,!0),r.style.display="block"}},{key:"hidePointTip",value:function(e,t){this.refs[e.ref].style.display="none"}},{key:"renderTipText",value:function(e,t){if("function"==typeof e)return e(t);if("string"==typeof e)return e.replace("{{date}}",(0,h["default"])(t.date).format(t.dateFormat||"YYYY-MM-DD")).replace("{{date1}}",(0,h["default"])(t.date1).format(t.dateFormat||"YYYY-MM-DD")).replace("{{date2}}",(0,h["default"])(t.date2).format(t.dateFormat||"YYYY-MM-DD")).replace("{{value}}",(0,y.formatNumber)(t.value));throw new Error("Invalid labelTemplate type!")}},{key:"renderTips",value:function(e,t,r,o,n,i,a){var s=this,l=void 0,p=void 0,u=void 0,d=void 0,c="{{value}} views",h=864e5,y=0===n&&0===r;return 0!==e.length?(l=1===e.length?0:e[1].time-e[0].time,l>27*h&&32*h>l?(p="MMMM",u="{{date}}"):l>h?(p="MMM Do",u="{{date1}} through {{date2}}"):(p="MMM Do",u="{{date}}"),e.map(function(o,h){if(0!==h&&h!==e.length-1||s.props.showFirstAndLastTip){d=e[h+1]?e[h+1].time:o.time+l,o.label||(o.label=c);var b=(o.time-t)*i,m="point_"+h+"_tooltip",g=p,v=38,k=25,x=(y?a:(n-(o.value-r))*a)-s.props.tipsPadding/2,P=25,T=10,w=[b-s.props.tipStrokeWidth-P/2+","+(x-k+9),b-s.props.tipStrokeWidth+P/2+","+(x-k+9),b-s.props.tipStrokeWidth+","+(x-k+T+9)].join(" "),M=[b-s.props.tipStrokeWidth-P/2+","+(x-k+10),b-s.props.tipStrokeWidth+P/2+","+(x-k+10),b-s.props.tipStrokeWidth+","+(x-k+T+10)].join(" ");return s.tipsData[m]={xBase:b},new Date(o.time).getFullYear()!==(new Date).getFullYear()&&(g+=" YYYY"),f["default"].createElement("g",{key:"point-"+h,ref:m,style:{display:"none",position:"relative",zIndex:4},className:"value-tip"},f["default"].createElement("rect",{className:"tip-background",x:(o.time-t)*i-s.props.strokeWidth-s.props.tipsWidth/2,y:x-v-k,width:s.props.tipsWidth+s.props.tipsPadding,height:v+s.props.tipsPadding,style:{stroke:s.props.tipStrokeColor,strokeWidth:s.props.tipStrokeWidth,fill:s.props.tipsFill}}),f["default"].createElement("polygon",{points:M,style:{stroke:s.props.tipStrokeColor,opacity:.5,strokeWidth:s.props.tipStrokeWidth}}),f["default"].createElement("polygon",{points:w,style:{fill:s.props.tipsFill}}),f["default"].createElement("text",{className:"tip-text-date",x:b-s.props.tipsWidth/2+2,y:x-s.props.strokeWidth-v-k+s.props.tipsPadding+10,style:{fontSize:14,fontWeight:"light"},dangerouslySetInnerHTML:{__html:s.renderTipText(u,{dateFormat:g,date:o.time,date1:o.time,date2:d,value:o.value})}}),f["default"].createElement("text",{className:"tip-text-value",x:b-s.props.tipsWidth/2+2,y:x-s.props.strokeWidth-v-k+s.props.tipsPadding+30,style:{fontSize:16,fontWeight:"bold"},dangerouslySetInnerHTML:{__html:s.renderTipText(s.props.labelTemplate,{value:o.value,date:o.time})}}))}})):void 0}},{key:"renderPoints",value:function(e,t,r,o,n,i,a){var s=this,l=0===n&&0===r;return e.map(function(o,p){return 0!==p&&p!==e.length-1||s.props.showFirstAndLastTip?f["default"].createElement("circle",{key:"point-"+p,cx:(o.time-t)*i-s.props.strokeWidth/2,cy:l?a:(n-(o.value-r))*a,r:s.props.pointsRadius,onMouseOver:s.showPointTip.bind(s,{ref:"point_"+p+"_tooltip"}),onMouseLeave:s.hidePointTip.bind(s,{ref:"point_"+p+"_tooltip"}),style:{stroke:s.props.strokeColor,strokeWidth:s.props.strokeWidth,fill:"white",cursor:"default"}}):void 0})}},{key:"renderLabel",value:function(e,t){return e.x||("right"===this.props.yLabelsPosition?e.x=this.activeWidth+(this.props.yLabelsOutside?5:-1*(20+5*(e.txt.length||1))):e.x=20),e.ref||(e.ref="label."+t+","+e.x+","+e.y),f["default"].createElement("text",{key:"graph.xAxis.label."+e.ref,x:e.x,y:e.y,ref:e.ref,fill:this.props.labelColor,style:{fontSize:this.props.labelFontSize,textShadow:this.props.labelTextShadow}},e.txt)}},{key:"renderYGridLine",value:function(e,t){return f["default"].createElement("line",{key:"graph.ygridLine."+t,x1:"0",y1:e.y,x2:this.activeWidth-this.props.strokeWidth,y2:e.y,fill:this.props.labelColor,style:{stroke:this.props.gridColor,strokeWidth:1}})}},{key:"describeYAxis",value:function(e,t,r){function o(e,t){return t||(t=100),e>t&&o(e,5*t),Math.ceil(e/t)*t/10}var n=o(t,t/10),i=[1,2,3,4,5,6,7,8,9],a=[0,1,2,3,4],s=0===t&&0===e;return{gridLines:i.map(function(e){return{y:s?r:(t-e*n)*r}}),labels:a.map(function(o){var i=o*n*2;return{y:s?r:(t-o*n*2)*r,txt:(0,y.formatNumber)(Math.round(i+e))}})}}},{key:"describeXAxis",value:function(e,t,r,o){var n=this,i=[1,2,3,4,5,6,7,8,9],a=o.length/i.length,s="ddd",l=[],p=864e5;return 1e4>e?{labels:[]}:(i.length>o.length&&(i=o.map(function(e,t){return t+1}),a=1),t>365*p*7?s="YYYY":t>30*p*9?s="MMM":t>7*p&&(s="MMM Do"),i.forEach(function(o,a){var p=e+o*(t/i.length);a<i.length-1&&l.push({txt:(0,h["default"])(p).format(s),time:p,x:(p-e)*r,y:n.activeHeight+30,ref:"xLabel."+a})}),this.xAxisLabels=l,{labels:l})}},{key:"centerXAxisLabelMarkers",value:function(){var e=this;this.xAxisLabels.forEach(function(t){var r=e.refs[t.ref];e.centerElement(r,t.x,r.getBBox().width)})}},{key:"componentDidMount",value:function(){this.centerXAxisLabelMarkers()}},{key:"componentDidUpdate",value:function(){this.centerXAxisLabelMarkers()}},{key:"render",value:function(){var e=this,t=this.props.data;this.activeWidth=this.props.width,this.activeHeight=this.props.height-50,t.forEach(function(e,r){e.time||(t[r].time=r),e.time instanceof Date||(t[r].time=new Date(t[r].time).getTime())}),t=t.sort(function(e,t){return e.time===t.time?0:e.time>t.time?1:-1});var r=Math.max.apply(Math,n(t.map(function(e,t){return e.time})).concat([t.length])),o=Math.max.apply(Math,n(t.map(function(e){return e.value}))),i=Math.pow(10,String(Math.round(o)).length-1),a=(1+1/this.props.yPadding,Math.max(Math.ceil(o/i)*i,1)),s=Math.min.apply(Math,n(t.map(function(e,t){return e.time}))),l=this.props.useDynamicYMin?Math.min.apply(Math,n(t.map(function(e){return e.value})))-a/5:0,p=r-s,u=a-l,d=this.activeWidth/(p||1),c=this.activeHeight/(u||1),h=this.describeLine(t,s,l,p,u,d,c),y=this.describeYAxis(l,u,c),b=this.describeXAxis(s,p,d,t),g=0===u&&0===l;return f["default"].createElement(m["default"],{width:this.props.width,height:this.props.height,type:"area"},y.gridLines.map(this.renderYGridLine.bind(this)),f["default"].createElement("polygon",{points:"0,"+((g?c:u*c)-this.props.strokeWidth)+" "+h+" "+((r-s)*d-this.props.strokeWidth)+","+((g?c:u*c)-this.props.strokeWidth),style:{fill:this.props.fillColor,strokeWidth:0}}),f["default"].createElement("polyline",{points:h,style:{stroke:this.props.strokeColor,strokeDasharray:this.props.strokeDasharray,strokeWidth:this.props.strokeWidth,fill:"none"}}),y.labels.map(this.renderLabel.bind(this)),b.labels.map(function(t,r){return f["default"].createElement("line",{key:"graph.xAxis.label."+r,ref:t.ref+".marker",x1:t.x,x2:t.x,y1:e.activeHeight,y2:e.activeHeight+10,stroke:e.props.gridColor,strokeWidth:1})}),b.labels.map(this.renderLabel.bind(this)),this.renderPoints(t,s,l,p,u,d,c),this.renderTips(t,s,l,p,u,d,c))}}]),t}(u.Component);g.propTypes={width:f["default"].PropTypes.number,height:f["default"].PropTypes.number,border:f["default"].PropTypes.string,strokeWidth:f["default"].PropTypes.number,useDynamicYMin:f["default"].PropTypes.bool,strokeColor:f["default"].PropTypes.string,strokeDasharray:f["default"].PropTypes.number,pointsRadius:f["default"].PropTypes.number,showFirstAndLastTip:f["default"].PropTypes.bool,tipsWidth:f["default"].PropTypes.number,tipsHeight:f["default"].PropTypes.number,tipsPadding:f["default"].PropTypes.number,tipStrokeWidth:f["default"].PropTypes.number,tipStrokeColor:f["default"].PropTypes.string,tipsFill:f["default"].PropTypes.string,gridColor:f["default"].PropTypes.string,labelFontSize:f["default"].PropTypes.number,labelTextShadow:f["default"].PropTypes.string,labelColor:f["default"].PropTypes.string,fillColor:f["default"].PropTypes.string,maxOverflow:f["default"].PropTypes.number,yLabelsOutside:f["default"].PropTypes.bool,yLabelsPosition:f["default"].PropTypes.string,yPadding:f["default"].PropTypes.number,data:f["default"].PropTypes.array},g.defaultProps={width:640,height:320,border:"none",strokeWidth:2,useDynamicYMin:!1,strokeColor:"#408AE5",strokeDasharray:0,pointsRadius:5,showFirstAndLastTip:!1,tipsWidth:240,tipsHeight:22,tipsPadding:10,tipStrokeWidth:1,tipStrokeColor:"#BBBBBB",tipsFill:"white",gridColor:"rgba(230,230,230,.5)",labelFontSize:12,labelTextShadow:"1px 1px #fff",labelColor:"#555",labelTemplate:"{{value}}",fillColor:"rgba(191, 216, 246, 0.3)",maxOverflow:20,yLabelsOutside:!1,yLabelsPosition:"left",yPadding:10,data:[]},t["default"]=g},194:function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":s(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":s(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),p=r(5),u=o(p),f=r(34),d=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),l(t,[{key:"formatValue",value:function(e){return"%"===this.props.metricName?Math.round(e):(0,f.formatNumber)(e)}},{key:"render",value:function(){return u["default"].createElement("div",null,u["default"].createElement("div",{style:{fontSize:13,textTransform:"uppercase"}},this.props.label),u["default"].createElement("div",{className:"bar-row"},u["default"].createElement("div",{style:{backgroundColor:this.props.barRailColor,width:this.props.barWidth+"%",height:this.props.barHeight,marginTop:4,display:"inline-block",position:"relative"}},u["default"].createElement("div",{style:{width:this.props.percent+"%",height:this.props.barHeight,position:"absolute",backgroundColor:this.props.barColor,top:0,left:0,bottom:0,transition:"all .5s"}})),u["default"].createElement("div",{style:{width:100-this.props.barWidth+"%",paddingLeft:this.props.metricPadding,fontSize:13,display:"inline-block",color:this.props.metricColor,textAlign:"right"}},this.formatValue(this.props.value)+" "+this.props.metricName)),u["default"].createElement("br",{style:{display:"table",clear:"both"}}))}}]),t}(u["default"].Component);d.defaultProps={metricName:"points",value:"0",percent:100,metricPadding:15,metricColor:"#777",barWidth:70,barHeight:7,barRailColor:"#ddd",barColor:"#408AE5",label:"N/A"},d.propTypes={metricName:u["default"].PropTypes.string,percent:u["default"].PropTypes.number,barWidth:u["default"].PropTypes.number,barHeight:u["default"].PropTypes.number,metricPadding:u["default"].PropTypes.number,label:u["default"].PropTypes.string,metricColor:u["default"].PropTypes.string,barColor:u["default"].PropTypes.string,barRailColor:u["default"].PropTypes.string},t["default"]=d},195:function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.BarMetric=t.CirclePie=t.Area=void 0;var n=r(193),i=o(n),a=r(196),s=o(a),l=r(194),p=o(l);t.Area=i["default"],t.CirclePie=s["default"],t.BarMetric=p["default"]},196:function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":s(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":s(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),p=r(5),u=o(p),f=r(102),d=o(f),c=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),l(t,[{key:"polarToCartesian",value:function(e,t,r,o){var n=(o-90)*Math.PI/180;return{x:e+r*Math.cos(n),y:t+r*Math.sin(n)}}},{key:"describeArc",value:function(e,t,r,o,n){e&&t||console.error("x or y missing to describeArc");var i=this.polarToCartesian(e,t,r,n),a=this.polarToCartesian(e,t,r,o),s=180>=n-o?"0":"1";return["M",i.x,i.y,"A",r,r,0,s,0,a.x,a.y].join(" ")}},{key:"render",value:function(){var e=this.props.width/2-this.props.strokeWidth/2-this.props.padding,t=e+this.props.strokeWidth/2+this.props.padding,r=0,o=3.6*this.props.percent,n=this.props.percent+"%",i=3===n.length?-.95:-.6,a=this.describeArc(t,t,e,r,o);return u["default"].createElement(d["default"],{width:this.props.width,style:this.props.style,height:this.props.height,border:this.props.border},u["default"].createElement("circle",{cx:t,cy:t,r:e,fill:this.props.fillColor,stroke:this.props.railColor,strokeWidth:this.props.strokeWidth}),u["default"].createElement("path",{fill:this.props.fillColor,stroke:this.props.strokeColor,strokeWidth:this.props.strokeWidth,d:a}),u["default"].createElement("text",{x:t,y:t,dx:i+"em",dy:".35em",fill:this.props.labelColor,fontWeight:this.props.labelFontWeight,fontSize:this.props.labelFontSize},n))}}]),t}(p.Component);c.propTypes={width:u["default"].PropTypes.number,height:u["default"].PropTypes.number,strokeWidth:u["default"].PropTypes.number,strokeColor:u["default"].PropTypes.string,labelFontWeight:u["default"].PropTypes.string,labelFontSize:u["default"].PropTypes.string,fillColor:u["default"].PropTypes.string,startAngle:u["default"].PropTypes.number,endAngle:u["default"].PropTypes.number,radius:u["default"].PropTypes.number,style:u["default"].PropTypes.object},c.defaultProps={width:150,height:150,border:"none",strokeWidth:10,style:{},labelColor:"#408AE5",labelFontSize:"1.2em",labelFontWeight:"bold",strokeColor:"#408AE5",railColor:"#f5f5f5",fillColor:"none",percent:70,padding:0},t["default"]=c}});
//# sourceMappingURL=salad-ui.chart.js.map

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc