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

calvin-svg

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calvin-svg - npm Package Compare versions

Comparing version 1.2.4 to 1.4.3

2

dist/index.js

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

'use strict';Object.defineProperty(exports,"__esModule",{value:!0});function _interopDefault(a){return a&&"object"==typeof a&&"default"in a?a["default"]:a}var React=require("react"),React__default=_interopDefault(React),PropTypes=_interopDefault(require("prop-types")),d3=require("d3");function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&_setPrototypeOf(a,b)}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],!(0<=b.indexOf(c))&&Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _possibleConstructorReturn(a,b){return b&&("object"==typeof b||"function"==typeof b)?b:_assertThisInitialized(a)}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_nonIterableRest()}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _iterableToArrayLimit(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{d||null==h["return"]||h["return"]()}finally{if(e)throw f}}return c}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var SVG=function(a){var b=a.children,c=a.height,d=a.width,e=_objectWithoutProperties(a,["children","height","width"]);return React__default.createElement("svg",_extends({preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 ".concat(d," ").concat(c)},e),b)};SVG.defaultProps={children:void 0,height:0,width:0},SVG.propTypes={children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),height:PropTypes.number,width:PropTypes.number};var Layer=function(a){var b=a.children,c=a.x,d=a.y,e=_objectWithoutProperties(a,["children","x","y"]);return React__default.createElement("g",_extends({transform:"translate(".concat(c,", ").concat(d,")")},e),b)};Layer.defaultProps={children:void 0,x:0,y:0},Layer.propTypes={children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),x:PropTypes.number,y:PropTypes.number};var Layer$1=React.memo(Layer),Arc=function(a){var c=Math.min;function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"centroid",value:function(){var a=this.props,b=a.endAngle,d=a.gauge,e=a.height,f=a.startAngle,g=a.width,h=c(e,g/2);return d3.arc().centroid({endAngle:b,innerRadius:h-d,outerRadius:h,startAngle:f})}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.endAngle,f=a.gauge,g=a.height,h=a.radius,i=a.startAngle,j=a.width,k=a.x,l=a.y,m=_objectWithoutProperties(a,["color","endAngle","gauge","height","radius","startAngle","width","x","y"]),n=b.d({endAngle:e,gauge:f,height:g,radius:h,startAngle:i,width:j});return React__default.createElement(Layer$1,{x:k,y:l},React__default.createElement("path",_extends({fill:c},m,{d:n,onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}],[{key:"d",value:function(a){var b=Math.PI,d=a.endAngle,e=a.gauge,f=a.height,g=a.radius,h=a.startAngle,i=a.width,j=c(f,i/2),k=d3.arc();return g&&k.cornerRadius(g),k({endAngle:2*(d/360)*b,innerRadius:e?j-e:0,outerRadius:j,startAngle:2*(h/360)*b})}}]),b}(React.PureComponent);_defineProperty(Arc,"defaultProps",{color:void 0,endAngle:0,gauge:0,height:0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:0,startAngle:0,width:0,x:0,y:0}),_defineProperty(Arc,"propTypes",{color:PropTypes.string,endAngle:PropTypes.number,gauge:PropTypes.number,height:PropTypes.number,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,startAngle:PropTypes.number,width:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var Curves={Basis:d3.curveBasis,BasisClosed:d3.curveBasisClosed,BasisOpen:d3.curveBasisOpen,Bundle:d3.curveBundle,Cardinal:d3.curveCardinal,CardinalClosed:d3.curveCardinalClosed,CardinalOpen:d3.curveCardinalOpen,CatmullRom:d3.curveCatmullRom,CatmullRomClosed:d3.curveCatmullRomClosed,CatmullRomOpen:d3.curveCatmullRomOpen,Linear:d3.curveLinear,LinearClosed:d3.curveLinearClosed,MonotoneX:d3.curveMonotoneX,MonotoneY:d3.curveMonotoneY,Natural:d3.curveNatural,Step:d3.curveStep,StepAfter:d3.curveStepAfter,StepBefore:d3.curveStepBefore},Area=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"centroid",value:function(){var a=this.props.points,b=a[0]||[0,0],c=a[a.length-1]||[0,0];return[(b[0]+c[0])/2,(b[1]+c[1])/2]}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.curve,f=a.points,g=a.x,h=a.y,i=_objectWithoutProperties(a,["color","curve","points","x","y"]),j=b.d({curve:e,points:f});return React__default.createElement(Layer$1,{x:g,y:h},React__default.createElement("path",_extends({fill:c},i,{d:j,onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}],[{key:"d",value:function(a){var b=a.curve,c=a.points,d=void 0===c?[]:c,e=d3.area();return b&&e.curve(Curves[b]),e(d)}}]),b}(React.PureComponent);_defineProperty(Area,"defaultProps",{color:"#222222",curve:void 0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},points:[],x:0,y:0}),_defineProperty(Area,"propTypes",{color:PropTypes.string,curve:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,points:PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)),x:PropTypes.number,y:PropTypes.number});var Circle=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.radius,d=a.x,e=a.y,f=_objectWithoutProperties(a,["color","radius","x","y"]);return React__default.createElement("circle",_extends({cx:d,cy:e,fill:b,r:c},f,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver}))}}]),b}(React.PureComponent);_defineProperty(Circle,"defaultProps",{onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:1,x:0,y:0}),_defineProperty(Circle,"propTypes",{color:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var useDirection=function(a){var b=a.bottom,c=a.left,d=a.right,e=a.top,f=c?1:0,g=d?1:0,h=e?1:0,i=b?1:0;return[f,g,h,i]},Stop=function(a){var b=a.color,c=a.offset,d=a.opacity,e=_objectWithoutProperties(a,["color","offset","opacity"]);return React__default.createElement("stop",_extends({offset:"".concat(c,"%"),stopColor:b,stopOpacity:d},e))};Stop.defaultProps={opacity:1},Stop.propTypes={color:PropTypes.string.isRequired,offset:PropTypes.number.isRequired,opacity:PropTypes.number};var Gradient=function(a){var b=a.bottom,c=a.children,d=a.id,e=a.left,f=a.right,g=a.top,h=_objectWithoutProperties(a,["bottom","children","id","left","right","top"]),i=useDirection({bottom:b,left:e,right:f,top:g}),j=_slicedToArray(i,4),k=j[0],l=j[1],m=j[2],n=j[3];return React__default.createElement("defs",null,React__default.createElement("linearGradient",_extends({id:d,x1:k,x2:l,y1:m,y2:n},h),c))};Gradient.defaultProps={bottom:!1,left:!1,right:!1,top:!1},Gradient.propTypes={bottom:PropTypes.bool,children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),id:PropTypes.string.isRequired,left:PropTypes.bool,right:PropTypes.bool,top:PropTypes.bool};var Line=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"element",React.createRef()),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.width,f=b.x,g=b.y;a.shape={length:c.length(),width:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.width,f=b.x,g=b.y;a.shape={length:c.length(),width:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.width,f=b.x,g=b.y;a.shape={length:c.length(),width:e,x:f,y:g},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"length",value:function(){return this.element.current?this.element.current.getTotalLength():0}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.curve,f=a.points,g=a.width,h=a.x,i=a.y,j=_objectWithoutProperties(a,["color","curve","points","width","x","y"]),k=b.d({curve:e,points:f});return React__default.createElement(Layer$1,{x:h,y:i},React__default.createElement("path",_extends({stroke:c,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:g},j,{d:k,fill:"none",onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver,ref:this.element})))}}],[{key:"d",value:function(a){var b=a.curve,c=a.points,d=d3.line();return b&&d.curve(Curves[b]),d(c)}}]),b}(React.PureComponent);_defineProperty(Line,"defaultProps",{color:"#222222",curve:void 0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},points:[],width:1,x:0,y:0}),_defineProperty(Line,"propTypes",{color:PropTypes.string,curve:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,points:PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)),width:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var Rect=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.height,e=b.onClick,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.height,e=b.onFocus,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.height,e=b.onMouseOver,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.radius,d=_objectWithoutProperties(a,["color","radius"]);return React__default.createElement("rect",_extends({fill:b,rx:c},d,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver}))}}]),b}(React.PureComponent);_defineProperty(Rect,"defaultProps",{color:"#222222",height:0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:0,width:0,x:0,y:0}),_defineProperty(Rect,"propTypes",{color:PropTypes.string,height:PropTypes.number,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,width:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var TEXT={center:"middle",left:"start",right:"end"},VERTICAL={baseline:"baseline",middle:"central",top:"hanging"},Text=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.textAlign,d=a.verticalAlign,e=a.x,f=a.y,g=_objectWithoutProperties(a,["color","textAlign","verticalAlign","x","y"]);return React__default.createElement(Layer$1,{x:e,y:f},React__default.createElement("text",_extends({alignmentBaseline:VERTICAL[d],dominantBaseline:VERTICAL[d],fill:b,textAnchor:TEXT[c]},g,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}]),b}(React.PureComponent);_defineProperty(Text,"defaultProps",{children:void 0,color:void 0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},textAlign:"center",verticalAlign:"center",x:0,y:0}),_defineProperty(Text,"propTypes",{children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),color:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,textAlign:PropTypes.oneOf(["center","left","right"]),verticalAlign:PropTypes.oneOf(["baseline","middle","top"]),x:PropTypes.number,y:PropTypes.number});var Easings={back:d3.easeBack,"back-in":d3.easeBackIn,"back-in-out":d3.easeBackInOut,"back-out":d3.easeBackOut,bounce:d3.easeBounce,"bounce-in":d3.easeBounceIn,"bounce-in-out":d3.easeBounceInOut,"bounce-out":d3.easeBounceOut,circle:d3.easeCircle,"circle-in":d3.easeCircleIn,"circle-in-out":d3.easeCircleInOut,"circle-out":d3.easeCircleOut,cubic:d3.easeCubic,"cubic-in":d3.easeCubicIn,"cubic-in-out":d3.easeCubicInOut,"cubic-out":d3.easeCubicOut,exp:d3.easeExp,"exp-in":d3.easeExpIn,"exp-in-out":d3.easeExpInOut,"exp-out":d3.easeExpOut,linear:d3.easeLinear,"poly-in":d3.easePolyIn,"poly-in-out":d3.easePolyInOut,"poly-out":d3.easePolyOut,quad:d3.easeQuad,"quad-in":d3.easeQuadIn,"quad-in-out":d3.easeQuadInOut,"quad-out":d3.easeQuadOut,sin:d3.easeSin,"sin-in":d3.easeSinIn,"sin-in-out":d3.easeSinInOut,"sin-out":d3.easeSinOut},FPS=16,Animation=function(a){var b=a.attribute,c=a.callback,d=a.delay,e=a.duration,f=a.ease,g=a.from,h=a.to,i=_objectWithoutProperties(a,["attribute","callback","delay","duration","ease","from","to"]),j=c||function(a){return a*(h-g)+g},k=Easings[f]||Easings.linear,l=Math.round(e/FPS),m=Array(l).fill(0).map(function(a,b){return j(k(b/l))}).join(";");return React__default.createElement("animate",_extends({attributeName:b,begin:"".concat(d,"ms"),dur:"".concat(e,"ms"),from:g,to:h,repeatCount:1,values:"linear"!==f||"d"===b?m:void 0},i))};Animation.defaultProps={delay:0,duration:250,callback:void 0,ease:"linear",from:0,to:0},Animation.propTypes={attribute:PropTypes.string.isRequired,callback:PropTypes.func,delay:PropTypes.number,duration:PropTypes.number,ease:PropTypes.string,from:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),to:PropTypes.oneOfType([PropTypes.number,PropTypes.string])};var Shapes={Arc:Arc,Area:Area,Circle:Circle,Gradient:Gradient,Line:Line,Rect:Rect,Stop:Stop,Text:Text};exports.Animation=Animation,exports.Arc=Arc,exports.Area=Area,exports.Circle=Circle,exports.Gradient=Gradient,exports.Layer=Layer$1,exports.Line=Line,exports.Rect=Rect,exports.SVG=SVG,exports.Shapes=Shapes,exports.Stop=Stop,exports.Text=Text,exports.default=SVG;
'use strict';Object.defineProperty(exports,"__esModule",{value:!0});function _interopDefault(a){return a&&"object"==typeof a&&"default"in a?a["default"]:a}var React=require("react"),React__default=_interopDefault(React),PropTypes=_interopDefault(require("prop-types")),d3=require("d3");function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&_setPrototypeOf(a,b)}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],!(0<=b.indexOf(c))&&Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _possibleConstructorReturn(a,b){return b&&("object"==typeof b||"function"==typeof b)?b:_assertThisInitialized(a)}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_nonIterableRest()}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _iterableToArrayLimit(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{d||null==h["return"]||h["return"]()}finally{if(e)throw f}}return c}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var SVG=function(a){var b=a.children,c=a.height,d=a.width,e=_objectWithoutProperties(a,["children","height","width"]);return React__default.createElement("svg",_extends({preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 ".concat(d," ").concat(c)},e),b)};SVG.defaultProps={children:void 0,height:0,width:0},SVG.propTypes={children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),height:PropTypes.number,width:PropTypes.number};var Layer=function(a){var b=a.children,c=a.x,d=a.y,e=_objectWithoutProperties(a,["children","x","y"]);return React__default.createElement("g",_extends({transform:"translate(".concat(c,", ").concat(d,")")},e),b)};Layer.defaultProps={children:void 0,x:0,y:0},Layer.propTypes={children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),x:PropTypes.number,y:PropTypes.number};var Layer$1=React.memo(Layer),Arc=function(a){var c=Math.min;function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"centroid",value:function(){var a=this.props,b=a.endAngle,d=a.height,e=a.startAngle,f=a.thickness,g=a.width,h=c(d,g/2);return d3.arc().centroid({endAngle:b,innerRadius:h-f,outerRadius:h,startAngle:e})}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.endAngle,f=a.height,g=a.radius,h=a.startAngle,i=a.thickness,j=a.width,k=a.x,l=a.y,m=_objectWithoutProperties(a,["color","endAngle","height","radius","startAngle","thickness","width","x","y"]),n=b.d({endAngle:e,height:f,radius:g,startAngle:h,thickness:i,width:j});return React__default.createElement(Layer$1,{x:k,y:l},React__default.createElement("path",_extends({fill:c},m,{d:n,onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}],[{key:"d",value:function(a){var b=Math.PI,d=a.endAngle,e=a.thickness,f=a.height,g=a.radius,h=a.startAngle,i=a.width,j=c(f/2,i/2),k=d3.arc();return g&&k.cornerRadius(g),k({endAngle:2*(d/360)*b,innerRadius:e?j-e:0,outerRadius:j,startAngle:2*(h/360)*b})}}]),b}(React.PureComponent);_defineProperty(Arc,"defaultProps",{color:"#222222",endAngle:0,height:0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:0,startAngle:0,thickness:0,width:0,x:0,y:0}),_defineProperty(Arc,"propTypes",{color:PropTypes.string,endAngle:PropTypes.number,height:PropTypes.number,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,startAngle:PropTypes.number,thickness:PropTypes.number,width:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var Curves={Basis:d3.curveBasis,BasisClosed:d3.curveBasisClosed,BasisOpen:d3.curveBasisOpen,Bundle:d3.curveBundle,Cardinal:d3.curveCardinal,CardinalClosed:d3.curveCardinalClosed,CardinalOpen:d3.curveCardinalOpen,CatmullRom:d3.curveCatmullRom,CatmullRomClosed:d3.curveCatmullRomClosed,CatmullRomOpen:d3.curveCatmullRomOpen,Linear:d3.curveLinear,LinearClosed:d3.curveLinearClosed,MonotoneX:d3.curveMonotoneX,MonotoneY:d3.curveMonotoneY,Natural:d3.curveNatural,Step:d3.curveStep,StepAfter:d3.curveStepAfter,StepBefore:d3.curveStepBefore},Area=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"centroid",value:function(){var a=this.props.points,b=a[0]||[0,0],c=a[a.length-1]||[0,0];return[(b[0]+c[0])/2,(b[1]+c[1])/2]}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.curve,f=a.points,g=a.x,h=a.y,i=_objectWithoutProperties(a,["color","curve","points","x","y"]),j=b.d({curve:e,points:f});return React__default.createElement(Layer$1,{x:g,y:h},React__default.createElement("path",_extends({fill:c},i,{d:j,onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}],[{key:"d",value:function(a){var b=a.curve,c=a.points,d=void 0===c?[]:c,e=d3.area();return b&&e.curve(Curves[b]),e(d)}}]),b}(React.PureComponent);_defineProperty(Area,"defaultProps",{color:"#222222",onClick:function(){},onFocus:function(){},onMouseOver:function(){},points:[],x:0,y:0}),_defineProperty(Area,"propTypes",{color:PropTypes.string,curve:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,points:PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)),x:PropTypes.number,y:PropTypes.number});var Circle=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.radius,d=a.x,e=a.y,f=_objectWithoutProperties(a,["color","radius","x","y"]);return React__default.createElement("circle",_extends({cx:d,cy:e,fill:b,r:c},f,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver}))}}]),b}(React.PureComponent);_defineProperty(Circle,"defaultProps",{onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:0,x:0,y:0}),_defineProperty(Circle,"propTypes",{color:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var useDirection=function(a){var b=a.bottom,c=a.left,d=a.right,e=a.top,f=c?1:0,g=d?1:0,h=e?1:0,i=b?1:0;return[f,g,h,i]},Stop=function(a){var b=a.color,c=a.offset,d=a.opacity,e=_objectWithoutProperties(a,["color","offset","opacity"]);return React__default.createElement("stop",_extends({offset:"".concat(c,"%"),stopColor:b,stopOpacity:d},e))};Stop.defaultProps={opacity:1},Stop.propTypes={color:PropTypes.string.isRequired,offset:PropTypes.number.isRequired,opacity:PropTypes.number};var Gradient=function(a){var b=a.bottom,c=a.children,d=a.id,e=a.left,f=a.right,g=a.top,h=_objectWithoutProperties(a,["bottom","children","id","left","right","top"]),i=useDirection({bottom:b,left:e,right:f,top:g}),j=_slicedToArray(i,4),k=j[0],l=j[1],m=j[2],n=j[3];return React__default.createElement("defs",null,React__default.createElement("linearGradient",_extends({id:d,x1:k,x2:l,y1:m,y2:n},h),c))};Gradient.defaultProps={bottom:!1,left:!1,right:!1,top:!1},Gradient.propTypes={bottom:PropTypes.bool,children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),id:PropTypes.string.isRequired,left:PropTypes.bool,right:PropTypes.bool,top:PropTypes.bool};var Line=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"element",React.createRef()),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.thickness,f=b.x,g=b.y;a.shape={length:c.length(),thickness:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.thickness,f=b.x,g=b.y;a.shape={length:c.length(),thickness:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.thickness,f=b.x,g=b.y;a.shape={length:c.length(),thickness:e,x:f,y:g},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"length",value:function(){return this.element.current?this.element.current.getTotalLength():0}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.curve,f=a.points,g=a.thickness,h=a.x,i=a.y,j=_objectWithoutProperties(a,["color","curve","points","thickness","x","y"]),k=b.d({curve:e,points:f});return React__default.createElement(Layer$1,{x:h,y:i},React__default.createElement("path",_extends({stroke:c,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:g},j,{d:k,fill:"none",onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver,ref:this.element})))}}],[{key:"d",value:function(a){var b=a.curve,c=a.points,d=d3.line();return b&&d.curve(Curves[b]),d(c)}}]),b}(React.PureComponent);_defineProperty(Line,"defaultProps",{color:"#222222",onClick:function(){},onFocus:function(){},onMouseOver:function(){},points:[],thickness:0,x:0,y:0}),_defineProperty(Line,"propTypes",{color:PropTypes.string,curve:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,points:PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)),thickness:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var Rect=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.height,e=b.onClick,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.height,e=b.onFocus,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.height,e=b.onMouseOver,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.radius,d=_objectWithoutProperties(a,["color","radius"]);return React__default.createElement("rect",_extends({fill:b,rx:c},d,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver}))}}]),b}(React.PureComponent);_defineProperty(Rect,"defaultProps",{color:"#222222",height:0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:0,width:0,x:0,y:0}),_defineProperty(Rect,"propTypes",{color:PropTypes.string,height:PropTypes.number,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,width:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var TEXT={center:"middle",left:"start",right:"end"},VERTICAL={baseline:"baseline",middle:"central",top:"hanging"},Text=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.textAlign,d=a.verticalAlign,e=a.x,f=a.y,g=_objectWithoutProperties(a,["color","textAlign","verticalAlign","x","y"]);return React__default.createElement(Layer$1,{x:e,y:f},React__default.createElement("text",_extends({alignmentBaseline:VERTICAL[d],dominantBaseline:VERTICAL[d],fill:b,textAnchor:TEXT[c]},g,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}]),b}(React.PureComponent);_defineProperty(Text,"defaultProps",{color:"#222222",onClick:function(){},onFocus:function(){},onMouseOver:function(){},textAlign:"center",verticalAlign:"center",x:0,y:0}),_defineProperty(Text,"propTypes",{color:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,textAlign:PropTypes.oneOf(["center","left","right"]),verticalAlign:PropTypes.oneOf(["baseline","middle","top"]),x:PropTypes.number,y:PropTypes.number});var Easings={back:d3.easeBack,"back-in":d3.easeBackIn,"back-in-out":d3.easeBackInOut,"back-out":d3.easeBackOut,bounce:d3.easeBounce,"bounce-in":d3.easeBounceIn,"bounce-in-out":d3.easeBounceInOut,"bounce-out":d3.easeBounceOut,circle:d3.easeCircle,"circle-in":d3.easeCircleIn,"circle-in-out":d3.easeCircleInOut,"circle-out":d3.easeCircleOut,cubic:d3.easeCubic,"cubic-in":d3.easeCubicIn,"cubic-in-out":d3.easeCubicInOut,"cubic-out":d3.easeCubicOut,exp:d3.easeExp,"exp-in":d3.easeExpIn,"exp-in-out":d3.easeExpInOut,"exp-out":d3.easeExpOut,linear:d3.easeLinear,"poly-in":d3.easePolyIn,"poly-in-out":d3.easePolyInOut,"poly-out":d3.easePolyOut,quad:d3.easeQuad,"quad-in":d3.easeQuadIn,"quad-in-out":d3.easeQuadInOut,"quad-out":d3.easeQuadOut,sin:d3.easeSin,"sin-in":d3.easeSinIn,"sin-in-out":d3.easeSinInOut,"sin-out":d3.easeSinOut},FPS=60,Animation=function(a){var b=a.attribute,c=a.delay,d=a.duration,e=a.ease,f=a.from,g=a.step,h=a.to,i=_objectWithoutProperties(a,["attribute","delay","duration","ease","from","step","to"]),j=React.useRef(null),k=React.useRef(!0);React.useLayoutEffect(function(){k.current?k.current=!1:j.current.beginElement()});var l=Easings[e]||Easings.linear,m=Math.round(d/1e3/FPS),n=Array(m).fill(0).map(function(a,b){return g(l(b/m),f,h)}).join(";");return React__default.createElement("animate",_extends({attributeName:b,begin:"".concat(c,"ms"),dur:"".concat(d,"ms"),from:f,to:h,ref:j,repeatCount:1,values:"linear"!==e||"d"===b?n:void 0},i))};Animation.defaultProps={delay:0,duration:250,ease:"linear",from:0,step:function(a,b,c){return b+(c-b)*a},to:0},Animation.propTypes={attribute:PropTypes.string.isRequired,delay:PropTypes.number,duration:PropTypes.number,ease:PropTypes.string,from:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),step:PropTypes.func,to:PropTypes.oneOfType([PropTypes.number,PropTypes.string])};var Shapes={Arc:Arc,Area:Area,Circle:Circle,Gradient:Gradient,Line:Line,Rect:Rect,Stop:Stop,Text:Text};exports.Animation=Animation,exports.Arc=Arc,exports.Area=Area,exports.Circle=Circle,exports.Gradient=Gradient,exports.Layer=Layer$1,exports.Line=Line,exports.Rect=Rect,exports.SVG=SVG,exports.Shapes=Shapes,exports.Stop=Stop,exports.Text=Text,exports.default=SVG;
//# sourceMappingURL=index.js.map

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

import React,{memo,PureComponent,createRef}from"react";import PropTypes from"prop-types";import{arc,curveBasis,curveBasisClosed,curveBasisOpen,curveBundle,curveCardinal,curveCardinalClosed,curveCardinalOpen,curveCatmullRom,curveCatmullRomClosed,curveCatmullRomOpen,curveLinear,curveLinearClosed,curveMonotoneX,curveMonotoneY,curveNatural,curveStep,curveStepAfter,curveStepBefore,area,line,easeBack,easeBackIn,easeBackInOut,easeBackOut,easeBounce,easeBounceIn,easeBounceInOut,easeBounceOut,easeCircle,easeCircleIn,easeCircleInOut,easeCircleOut,easeCubic,easeCubicIn,easeCubicInOut,easeCubicOut,easeExp,easeExpIn,easeExpInOut,easeExpOut,easeLinear,easePolyIn,easePolyInOut,easePolyOut,easeQuad,easeQuadIn,easeQuadInOut,easeQuadOut,easeSin,easeSinIn,easeSinInOut,easeSinOut}from"d3";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&_setPrototypeOf(a,b)}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],!(0<=b.indexOf(c))&&Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _possibleConstructorReturn(a,b){return b&&("object"==typeof b||"function"==typeof b)?b:_assertThisInitialized(a)}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_nonIterableRest()}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _iterableToArrayLimit(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{d||null==h["return"]||h["return"]()}finally{if(e)throw f}}return c}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var SVG=function(a){var b=a.children,c=a.height,d=a.width,e=_objectWithoutProperties(a,["children","height","width"]);return React.createElement("svg",_extends({preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 ".concat(d," ").concat(c)},e),b)};SVG.defaultProps={children:void 0,height:0,width:0},SVG.propTypes={children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),height:PropTypes.number,width:PropTypes.number};var Layer=function(a){var b=a.children,c=a.x,d=a.y,e=_objectWithoutProperties(a,["children","x","y"]);return React.createElement("g",_extends({transform:"translate(".concat(c,", ").concat(d,")")},e),b)};Layer.defaultProps={children:void 0,x:0,y:0},Layer.propTypes={children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),x:PropTypes.number,y:PropTypes.number};var Layer$1=memo(Layer),Arc=function(a){var c=Math.min;function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"centroid",value:function(){var a=this.props,b=a.endAngle,d=a.gauge,e=a.height,f=a.startAngle,g=a.width,h=c(e,g/2);return arc().centroid({endAngle:b,innerRadius:h-d,outerRadius:h,startAngle:f})}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.endAngle,f=a.gauge,g=a.height,h=a.radius,i=a.startAngle,j=a.width,k=a.x,l=a.y,m=_objectWithoutProperties(a,["color","endAngle","gauge","height","radius","startAngle","width","x","y"]),n=b.d({endAngle:e,gauge:f,height:g,radius:h,startAngle:i,width:j});return React.createElement(Layer$1,{x:k,y:l},React.createElement("path",_extends({fill:c},m,{d:n,onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}],[{key:"d",value:function(a){var b=Math.PI,d=a.endAngle,e=a.gauge,f=a.height,g=a.radius,h=a.startAngle,i=a.width,j=c(f,i/2),k=arc();return g&&k.cornerRadius(g),k({endAngle:2*(d/360)*b,innerRadius:e?j-e:0,outerRadius:j,startAngle:2*(h/360)*b})}}]),b}(PureComponent);_defineProperty(Arc,"defaultProps",{color:void 0,endAngle:0,gauge:0,height:0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:0,startAngle:0,width:0,x:0,y:0}),_defineProperty(Arc,"propTypes",{color:PropTypes.string,endAngle:PropTypes.number,gauge:PropTypes.number,height:PropTypes.number,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,startAngle:PropTypes.number,width:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var Curves={Basis:curveBasis,BasisClosed:curveBasisClosed,BasisOpen:curveBasisOpen,Bundle:curveBundle,Cardinal:curveCardinal,CardinalClosed:curveCardinalClosed,CardinalOpen:curveCardinalOpen,CatmullRom:curveCatmullRom,CatmullRomClosed:curveCatmullRomClosed,CatmullRomOpen:curveCatmullRomOpen,Linear:curveLinear,LinearClosed:curveLinearClosed,MonotoneX:curveMonotoneX,MonotoneY:curveMonotoneY,Natural:curveNatural,Step:curveStep,StepAfter:curveStepAfter,StepBefore:curveStepBefore},Area=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"centroid",value:function(){var a=this.props.points,b=a[0]||[0,0],c=a[a.length-1]||[0,0];return[(b[0]+c[0])/2,(b[1]+c[1])/2]}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.curve,f=a.points,g=a.x,h=a.y,i=_objectWithoutProperties(a,["color","curve","points","x","y"]),j=b.d({curve:e,points:f});return React.createElement(Layer$1,{x:g,y:h},React.createElement("path",_extends({fill:c},i,{d:j,onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}],[{key:"d",value:function(a){var b=a.curve,c=a.points,d=void 0===c?[]:c,e=area();return b&&e.curve(Curves[b]),e(d)}}]),b}(PureComponent);_defineProperty(Area,"defaultProps",{color:"#222222",curve:void 0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},points:[],x:0,y:0}),_defineProperty(Area,"propTypes",{color:PropTypes.string,curve:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,points:PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)),x:PropTypes.number,y:PropTypes.number});var Circle=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.radius,d=a.x,e=a.y,f=_objectWithoutProperties(a,["color","radius","x","y"]);return React.createElement("circle",_extends({cx:d,cy:e,fill:b,r:c},f,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver}))}}]),b}(PureComponent);_defineProperty(Circle,"defaultProps",{onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:1,x:0,y:0}),_defineProperty(Circle,"propTypes",{color:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var useDirection=function(a){var b=a.bottom,c=a.left,d=a.right,e=a.top,f=c?1:0,g=d?1:0,h=e?1:0,i=b?1:0;return[f,g,h,i]},Stop=function(a){var b=a.color,c=a.offset,d=a.opacity,e=_objectWithoutProperties(a,["color","offset","opacity"]);return React.createElement("stop",_extends({offset:"".concat(c,"%"),stopColor:b,stopOpacity:d},e))};Stop.defaultProps={opacity:1},Stop.propTypes={color:PropTypes.string.isRequired,offset:PropTypes.number.isRequired,opacity:PropTypes.number};var Gradient=function(a){var b=a.bottom,c=a.children,d=a.id,e=a.left,f=a.right,g=a.top,h=_objectWithoutProperties(a,["bottom","children","id","left","right","top"]),i=useDirection({bottom:b,left:e,right:f,top:g}),j=_slicedToArray(i,4),k=j[0],l=j[1],m=j[2],n=j[3];return React.createElement("defs",null,React.createElement("linearGradient",_extends({id:d,x1:k,x2:l,y1:m,y2:n},h),c))};Gradient.defaultProps={bottom:!1,left:!1,right:!1,top:!1},Gradient.propTypes={bottom:PropTypes.bool,children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),id:PropTypes.string.isRequired,left:PropTypes.bool,right:PropTypes.bool,top:PropTypes.bool};var Line=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"element",createRef()),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.width,f=b.x,g=b.y;a.shape={length:c.length(),width:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.width,f=b.x,g=b.y;a.shape={length:c.length(),width:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.width,f=b.x,g=b.y;a.shape={length:c.length(),width:e,x:f,y:g},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"length",value:function(){return this.element.current?this.element.current.getTotalLength():0}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.curve,f=a.points,g=a.width,h=a.x,i=a.y,j=_objectWithoutProperties(a,["color","curve","points","width","x","y"]),k=b.d({curve:e,points:f});return React.createElement(Layer$1,{x:h,y:i},React.createElement("path",_extends({stroke:c,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:g},j,{d:k,fill:"none",onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver,ref:this.element})))}}],[{key:"d",value:function(a){var b=a.curve,c=a.points,d=line();return b&&d.curve(Curves[b]),d(c)}}]),b}(PureComponent);_defineProperty(Line,"defaultProps",{color:"#222222",curve:void 0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},points:[],width:1,x:0,y:0}),_defineProperty(Line,"propTypes",{color:PropTypes.string,curve:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,points:PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)),width:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var Rect=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.height,e=b.onClick,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.height,e=b.onFocus,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.height,e=b.onMouseOver,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.radius,d=_objectWithoutProperties(a,["color","radius"]);return React.createElement("rect",_extends({fill:b,rx:c},d,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver}))}}]),b}(PureComponent);_defineProperty(Rect,"defaultProps",{color:"#222222",height:0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:0,width:0,x:0,y:0}),_defineProperty(Rect,"propTypes",{color:PropTypes.string,height:PropTypes.number,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,width:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var TEXT={center:"middle",left:"start",right:"end"},VERTICAL={baseline:"baseline",middle:"central",top:"hanging"},Text=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.textAlign,d=a.verticalAlign,e=a.x,f=a.y,g=_objectWithoutProperties(a,["color","textAlign","verticalAlign","x","y"]);return React.createElement(Layer$1,{x:e,y:f},React.createElement("text",_extends({alignmentBaseline:VERTICAL[d],dominantBaseline:VERTICAL[d],fill:b,textAnchor:TEXT[c]},g,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}]),b}(PureComponent);_defineProperty(Text,"defaultProps",{children:void 0,color:void 0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},textAlign:"center",verticalAlign:"center",x:0,y:0}),_defineProperty(Text,"propTypes",{children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),color:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,textAlign:PropTypes.oneOf(["center","left","right"]),verticalAlign:PropTypes.oneOf(["baseline","middle","top"]),x:PropTypes.number,y:PropTypes.number});var Easings={back:easeBack,"back-in":easeBackIn,"back-in-out":easeBackInOut,"back-out":easeBackOut,bounce:easeBounce,"bounce-in":easeBounceIn,"bounce-in-out":easeBounceInOut,"bounce-out":easeBounceOut,circle:easeCircle,"circle-in":easeCircleIn,"circle-in-out":easeCircleInOut,"circle-out":easeCircleOut,cubic:easeCubic,"cubic-in":easeCubicIn,"cubic-in-out":easeCubicInOut,"cubic-out":easeCubicOut,exp:easeExp,"exp-in":easeExpIn,"exp-in-out":easeExpInOut,"exp-out":easeExpOut,linear:easeLinear,"poly-in":easePolyIn,"poly-in-out":easePolyInOut,"poly-out":easePolyOut,quad:easeQuad,"quad-in":easeQuadIn,"quad-in-out":easeQuadInOut,"quad-out":easeQuadOut,sin:easeSin,"sin-in":easeSinIn,"sin-in-out":easeSinInOut,"sin-out":easeSinOut},FPS=16,Animation=function(a){var b=a.attribute,c=a.callback,d=a.delay,e=a.duration,f=a.ease,g=a.from,h=a.to,i=_objectWithoutProperties(a,["attribute","callback","delay","duration","ease","from","to"]),j=c||function(a){return a*(h-g)+g},k=Easings[f]||Easings.linear,l=Math.round(e/FPS),m=Array(l).fill(0).map(function(a,b){return j(k(b/l))}).join(";");return React.createElement("animate",_extends({attributeName:b,begin:"".concat(d,"ms"),dur:"".concat(e,"ms"),from:g,to:h,repeatCount:1,values:"linear"!==f||"d"===b?m:void 0},i))};Animation.defaultProps={delay:0,duration:250,callback:void 0,ease:"linear",from:0,to:0},Animation.propTypes={attribute:PropTypes.string.isRequired,callback:PropTypes.func,delay:PropTypes.number,duration:PropTypes.number,ease:PropTypes.string,from:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),to:PropTypes.oneOfType([PropTypes.number,PropTypes.string])};var Shapes={Arc:Arc,Area:Area,Circle:Circle,Gradient:Gradient,Line:Line,Rect:Rect,Stop:Stop,Text:Text};export default SVG;export{Animation,Arc,Area,Circle,Gradient,Layer$1 as Layer,Line,Rect,SVG,Shapes,Stop,Text};
import React,{memo,PureComponent,createRef,useRef,useLayoutEffect}from"react";import PropTypes from"prop-types";import{arc,curveBasis,curveBasisClosed,curveBasisOpen,curveBundle,curveCardinal,curveCardinalClosed,curveCardinalOpen,curveCatmullRom,curveCatmullRomClosed,curveCatmullRomOpen,curveLinear,curveLinearClosed,curveMonotoneX,curveMonotoneY,curveNatural,curveStep,curveStepAfter,curveStepBefore,area,line,easeBack,easeBackIn,easeBackInOut,easeBackOut,easeBounce,easeBounceIn,easeBounceInOut,easeBounceOut,easeCircle,easeCircleIn,easeCircleInOut,easeCircleOut,easeCubic,easeCubicIn,easeCubicInOut,easeCubicOut,easeExp,easeExpIn,easeExpInOut,easeExpOut,easeLinear,easePolyIn,easePolyInOut,easePolyOut,easeQuad,easeQuadIn,easeQuadInOut,easeQuadOut,easeSin,easeSinIn,easeSinInOut,easeSinOut}from"d3";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&_setPrototypeOf(a,b)}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],!(0<=b.indexOf(c))&&Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _possibleConstructorReturn(a,b){return b&&("object"==typeof b||"function"==typeof b)?b:_assertThisInitialized(a)}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_nonIterableRest()}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _iterableToArrayLimit(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{d||null==h["return"]||h["return"]()}finally{if(e)throw f}}return c}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var SVG=function(a){var b=a.children,c=a.height,d=a.width,e=_objectWithoutProperties(a,["children","height","width"]);return React.createElement("svg",_extends({preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 ".concat(d," ").concat(c)},e),b)};SVG.defaultProps={children:void 0,height:0,width:0},SVG.propTypes={children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),height:PropTypes.number,width:PropTypes.number};var Layer=function(a){var b=a.children,c=a.x,d=a.y,e=_objectWithoutProperties(a,["children","x","y"]);return React.createElement("g",_extends({transform:"translate(".concat(c,", ").concat(d,")")},e),b)};Layer.defaultProps={children:void 0,x:0,y:0},Layer.propTypes={children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),x:PropTypes.number,y:PropTypes.number};var Layer$1=memo(Layer),Arc=function(a){var c=Math.min;function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"centroid",value:function(){var a=this.props,b=a.endAngle,d=a.height,e=a.startAngle,f=a.thickness,g=a.width,h=c(d,g/2);return arc().centroid({endAngle:b,innerRadius:h-f,outerRadius:h,startAngle:e})}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.endAngle,f=a.height,g=a.radius,h=a.startAngle,i=a.thickness,j=a.width,k=a.x,l=a.y,m=_objectWithoutProperties(a,["color","endAngle","height","radius","startAngle","thickness","width","x","y"]),n=b.d({endAngle:e,height:f,radius:g,startAngle:h,thickness:i,width:j});return React.createElement(Layer$1,{x:k,y:l},React.createElement("path",_extends({fill:c},m,{d:n,onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}],[{key:"d",value:function(a){var b=Math.PI,d=a.endAngle,e=a.thickness,f=a.height,g=a.radius,h=a.startAngle,i=a.width,j=c(f/2,i/2),k=arc();return g&&k.cornerRadius(g),k({endAngle:2*(d/360)*b,innerRadius:e?j-e:0,outerRadius:j,startAngle:2*(h/360)*b})}}]),b}(PureComponent);_defineProperty(Arc,"defaultProps",{color:"#222222",endAngle:0,height:0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:0,startAngle:0,thickness:0,width:0,x:0,y:0}),_defineProperty(Arc,"propTypes",{color:PropTypes.string,endAngle:PropTypes.number,height:PropTypes.number,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,startAngle:PropTypes.number,thickness:PropTypes.number,width:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var Curves={Basis:curveBasis,BasisClosed:curveBasisClosed,BasisOpen:curveBasisOpen,Bundle:curveBundle,Cardinal:curveCardinal,CardinalClosed:curveCardinalClosed,CardinalOpen:curveCardinalOpen,CatmullRom:curveCatmullRom,CatmullRomClosed:curveCatmullRomClosed,CatmullRomOpen:curveCatmullRomOpen,Linear:curveLinear,LinearClosed:curveLinearClosed,MonotoneX:curveMonotoneX,MonotoneY:curveMonotoneY,Natural:curveNatural,Step:curveStep,StepAfter:curveStepAfter,StepBefore:curveStepBefore},Area=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={centroid:c.centroid(),x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"centroid",value:function(){var a=this.props.points,b=a[0]||[0,0],c=a[a.length-1]||[0,0];return[(b[0]+c[0])/2,(b[1]+c[1])/2]}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.curve,f=a.points,g=a.x,h=a.y,i=_objectWithoutProperties(a,["color","curve","points","x","y"]),j=b.d({curve:e,points:f});return React.createElement(Layer$1,{x:g,y:h},React.createElement("path",_extends({fill:c},i,{d:j,onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}],[{key:"d",value:function(a){var b=a.curve,c=a.points,d=void 0===c?[]:c,e=area();return b&&e.curve(Curves[b]),e(d)}}]),b}(PureComponent);_defineProperty(Area,"defaultProps",{color:"#222222",onClick:function(){},onFocus:function(){},onMouseOver:function(){},points:[],x:0,y:0}),_defineProperty(Area,"propTypes",{color:PropTypes.string,curve:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,points:PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)),x:PropTypes.number,y:PropTypes.number});var Circle=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.radius,f=b.x,g=b.y;a.shape={centroid:[(f+e)/2,(g+e)/2],radius:e,x:f,y:g},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.radius,d=a.x,e=a.y,f=_objectWithoutProperties(a,["color","radius","x","y"]);return React.createElement("circle",_extends({cx:d,cy:e,fill:b,r:c},f,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver}))}}]),b}(PureComponent);_defineProperty(Circle,"defaultProps",{onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:0,x:0,y:0}),_defineProperty(Circle,"propTypes",{color:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var useDirection=function(a){var b=a.bottom,c=a.left,d=a.right,e=a.top,f=c?1:0,g=d?1:0,h=e?1:0,i=b?1:0;return[f,g,h,i]},Stop=function(a){var b=a.color,c=a.offset,d=a.opacity,e=_objectWithoutProperties(a,["color","offset","opacity"]);return React.createElement("stop",_extends({offset:"".concat(c,"%"),stopColor:b,stopOpacity:d},e))};Stop.defaultProps={opacity:1},Stop.propTypes={color:PropTypes.string.isRequired,offset:PropTypes.number.isRequired,opacity:PropTypes.number};var Gradient=function(a){var b=a.bottom,c=a.children,d=a.id,e=a.left,f=a.right,g=a.top,h=_objectWithoutProperties(a,["bottom","children","id","left","right","top"]),i=useDirection({bottom:b,left:e,right:f,top:g}),j=_slicedToArray(i,4),k=j[0],l=j[1],m=j[2],n=j[3];return React.createElement("defs",null,React.createElement("linearGradient",_extends({id:d,x1:k,x2:l,y1:m,y2:n},h),c))};Gradient.defaultProps={bottom:!1,left:!1,right:!1,top:!1},Gradient.propTypes={bottom:PropTypes.bool,children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),id:PropTypes.string.isRequired,left:PropTypes.bool,right:PropTypes.bool,top:PropTypes.bool};var Line=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"element",createRef()),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.thickness,f=b.x,g=b.y;a.shape={length:c.length(),thickness:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.thickness,f=b.x,g=b.y;a.shape={length:c.length(),thickness:e,x:f,y:g},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.thickness,f=b.x,g=b.y;a.shape={length:c.length(),thickness:e,x:f,y:g},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"length",value:function(){return this.element.current?this.element.current.getTotalLength():0}},{key:"render",value:function(){var a=this.props,c=a.color,e=a.curve,f=a.points,g=a.thickness,h=a.x,i=a.y,j=_objectWithoutProperties(a,["color","curve","points","thickness","x","y"]),k=b.d({curve:e,points:f});return React.createElement(Layer$1,{x:h,y:i},React.createElement("path",_extends({stroke:c,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:g},j,{d:k,fill:"none",onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver,ref:this.element})))}}],[{key:"d",value:function(a){var b=a.curve,c=a.points,d=line();return b&&d.curve(Curves[b]),d(c)}}]),b}(PureComponent);_defineProperty(Line,"defaultProps",{color:"#222222",onClick:function(){},onFocus:function(){},onMouseOver:function(){},points:[],thickness:0,x:0,y:0}),_defineProperty(Line,"propTypes",{color:PropTypes.string,curve:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,points:PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)),thickness:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var Rect=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.height,e=b.onClick,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.height,e=b.onFocus,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.height,e=b.onMouseOver,f=b.width,g=b.x,h=b.y;a.shape={centroid:[g+f/2,h+d],height:d,width:f,x:g,y:h},e(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.radius,d=_objectWithoutProperties(a,["color","radius"]);return React.createElement("rect",_extends({fill:b,rx:c},d,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver}))}}]),b}(PureComponent);_defineProperty(Rect,"defaultProps",{color:"#222222",height:0,onClick:function(){},onFocus:function(){},onMouseOver:function(){},radius:0,width:0,x:0,y:0}),_defineProperty(Rect,"propTypes",{color:PropTypes.string,height:PropTypes.number,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,radius:PropTypes.number,width:PropTypes.number,x:PropTypes.number,y:PropTypes.number});var TEXT={center:"middle",left:"start",right:"end"},VERTICAL={baseline:"baseline",middle:"central",top:"hanging"},Text=function(a){function b(){var a,c;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return c=_possibleConstructorReturn(this,(a=_getPrototypeOf(b)).call.apply(a,[this].concat(e))),_defineProperty(_assertThisInitialized(c),"handleClick",function(a){var b=c.props,d=b.onClick,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleFocus",function(a){var b=c.props,d=b.onFocus,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),_defineProperty(_assertThisInitialized(c),"handleMouseOver",function(a){var b=c.props,d=b.onMouseOver,e=b.x,f=b.y;a.shape={x:e,y:f},d(a)}),c}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.props,b=a.color,c=a.textAlign,d=a.verticalAlign,e=a.x,f=a.y,g=_objectWithoutProperties(a,["color","textAlign","verticalAlign","x","y"]);return React.createElement(Layer$1,{x:e,y:f},React.createElement("text",_extends({alignmentBaseline:VERTICAL[d],dominantBaseline:VERTICAL[d],fill:b,textAnchor:TEXT[c]},g,{onClick:this.handleClick,onFocus:this.handleFocus,onMouseOver:this.handleMouseOver})))}}]),b}(PureComponent);_defineProperty(Text,"defaultProps",{color:"#222222",onClick:function(){},onFocus:function(){},onMouseOver:function(){},textAlign:"center",verticalAlign:"center",x:0,y:0}),_defineProperty(Text,"propTypes",{color:PropTypes.string,onClick:PropTypes.func,onFocus:PropTypes.func,onMouseOver:PropTypes.func,textAlign:PropTypes.oneOf(["center","left","right"]),verticalAlign:PropTypes.oneOf(["baseline","middle","top"]),x:PropTypes.number,y:PropTypes.number});var Easings={back:easeBack,"back-in":easeBackIn,"back-in-out":easeBackInOut,"back-out":easeBackOut,bounce:easeBounce,"bounce-in":easeBounceIn,"bounce-in-out":easeBounceInOut,"bounce-out":easeBounceOut,circle:easeCircle,"circle-in":easeCircleIn,"circle-in-out":easeCircleInOut,"circle-out":easeCircleOut,cubic:easeCubic,"cubic-in":easeCubicIn,"cubic-in-out":easeCubicInOut,"cubic-out":easeCubicOut,exp:easeExp,"exp-in":easeExpIn,"exp-in-out":easeExpInOut,"exp-out":easeExpOut,linear:easeLinear,"poly-in":easePolyIn,"poly-in-out":easePolyInOut,"poly-out":easePolyOut,quad:easeQuad,"quad-in":easeQuadIn,"quad-in-out":easeQuadInOut,"quad-out":easeQuadOut,sin:easeSin,"sin-in":easeSinIn,"sin-in-out":easeSinInOut,"sin-out":easeSinOut},FPS=60,Animation=function(a){var b=a.attribute,c=a.delay,d=a.duration,e=a.ease,f=a.from,g=a.step,h=a.to,i=_objectWithoutProperties(a,["attribute","delay","duration","ease","from","step","to"]),j=useRef(null),k=useRef(!0);useLayoutEffect(function(){k.current?k.current=!1:j.current.beginElement()});var l=Easings[e]||Easings.linear,m=Math.round(d/1e3/FPS),n=Array(m).fill(0).map(function(a,b){return g(l(b/m),f,h)}).join(";");return React.createElement("animate",_extends({attributeName:b,begin:"".concat(c,"ms"),dur:"".concat(d,"ms"),from:f,to:h,ref:j,repeatCount:1,values:"linear"!==e||"d"===b?n:void 0},i))};Animation.defaultProps={delay:0,duration:250,ease:"linear",from:0,step:function(a,b,c){return b+(c-b)*a},to:0},Animation.propTypes={attribute:PropTypes.string.isRequired,delay:PropTypes.number,duration:PropTypes.number,ease:PropTypes.string,from:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),step:PropTypes.func,to:PropTypes.oneOfType([PropTypes.number,PropTypes.string])};var Shapes={Arc:Arc,Area:Area,Circle:Circle,Gradient:Gradient,Line:Line,Rect:Rect,Stop:Stop,Text:Text};export default SVG;export{Animation,Arc,Area,Circle,Gradient,Layer$1 as Layer,Line,Rect,SVG,Shapes,Stop,Text};
//# sourceMappingURL=index.module.js.map

@@ -10,35 +10,35 @@ {

"devDependencies": {
"@babel/core": "^7.4.0",
"@babel/core": "^7.4.3",
"@babel/plugin-proposal-class-properties": "^7.4.0",
"@babel/plugin-proposal-export-namespace-from": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.4.0",
"@babel/preset-env": "^7.4.2",
"@babel/plugin-transform-runtime": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"@babel/preset-react": "^7.0.0",
"@babel/runtime": "^7.4.2",
"@babel/runtime": "^7.4.3",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.5.0",
"babel-jest": "^24.7.1",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"husky": "^1.3.1",
"jest": "^24.5.0",
"jest": "^24.7.1",
"lint-staged": "^8.1.5",
"prettier": "^1.16.4",
"prettier": "^1.17.0",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"regenerator-runtime": "^0.13.2",
"rollup": "^1.7.4",
"rollup": "^1.10.1",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-babel-minify": "^8.0.0",
"rollup-plugin-commonjs": "^9.2.2",
"rollup-plugin-delete": "^0.2.1",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-delete": "^0.2.2",
"rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-peer-deps-external": "^2.2.0",
"rollup-plugin-replace": "^2.1.1",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-size-snapshot": "^0.8.0",
"rollup-plugin-visualizer": "^1.1.0"
"rollup-plugin-visualizer": "^1.1.1"
},

@@ -76,3 +76,3 @@ "files": [

},
"version": "1.2.4"
"version": "1.4.3"
}

Sorry, the diff of this file is not supported yet

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