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AAK,MAAM,MAEvB,KAAK,MAAQ,IAAI,EAAM,KAAK,OAC5B,KAAK,gBACP,GACC,CACD,IAAK,4BACL,MAAO,SAAmC,GACxC,KAAK,MAAM,OAAO,EAAW,KAAK,IACpC,GACC,CACD,IAAK,uBACL,MAAO,WACL,KAAK,OAAO,oBAAoB,YAAa,KAAK,QAAQ,GAC1D,KAAK,OAAO,oBAAoB,QAAS,KAAK,SAAS,GACvD,OAAO,oBAAoB,SAAU,KAAK,cAAc,GACxD,OAAO,KAAK,WACR,KAAK,OAAO,aAAa,KAAK,OAC9B,KAAK,WAAW,aAAa,KAAK,UACxC,GACC,CACD,IAAK,SACL,MAAO,WACL,IAAI,EAAS,KAET,EAAS,KAAK,MACd,EAAO,EAAO,KACd,EAAgB,EAAO,cACvB,EAAQ,EAAO,MACf,EAAS,EAAO,OAChB,EAAS,KAAK,MACd,EAAU,EAAO,QACjB,EAAQ,EAAO,MACf,EAAe,EAAO,aAE1B,OAAO,MAAM,cACX,MACA,CACE,IAAK,SAAa,GAChB,EAAO,UAAY,CACrB,EACA,MAAO,CAAE,SAAU,WAAY,MAAO,OAAQ,OAAQ,SAExD,MAAM,cAAc,oBAAoB,QAAS,SAAS,CACxD,MAAO,EACP,OAAQ,EACR,QAAS,EACT,MAAO,EACP,KAAM,EACN,aAAc,GACb,IACH,MAAM,cAAc,SAAU,CAAE,MAAO,CAAE,SAAU,WAAY,MAAO,EAAO,OAAQ,GAAU,IAAK,SAAa,GAC7G,EAAO,OAAS,CAClB,IAEN,KAGK,CACT,CA9JqB,GAgKrB,QAAQ,QAAU","file":"/npm/react-chart-canvas@0.1.7/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-chart-canvas@0.1.7/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar React = _interopRequireWildcard(_react);\n\nvar _reactChartTooltip = require('react-chart-tooltip');\n\nvar _reactChartTooltip2 = _interopRequireDefault(_reactChartTooltip);\n\nvar _elementResizeEvent = require('element-resize-event');\n\nvar _elementResizeEvent2 = _interopRequireDefault(_elementResizeEvent);\n\nvar _config = require('./config');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar unbind = _elementResizeEvent2.default.unbind;\n\nvar RadialBarChart = function (_React$Component) {\n  _inherits(RadialBarChart, _React$Component);\n\n  function RadialBarChart() {\n    var _ref;\n\n    var _temp, _this, _ret;\n\n    _classCallCheck(this, RadialBarChart);\n\n    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = RadialBarChart.__proto__ || Object.getPrototypeOf(RadialBarChart)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n      info: null,\n      eventPosition: null,\n      width: null,\n      height: null\n    }, _this.onClick = function (e) {\n      var onClick = _this.props.onClick;\n\n      var info = _this.chart.update({ event: 'onClick', eventPosition: (0, _config.getEventPosition)(e) }, _this.ctx);\n      if (onClick && info) onClick(e, info);\n    }, _this.onMove = function (e) {\n      var onHover = _this.props.onHover;\n\n      var eventPosition = (0, _config.getEventPosition)(e);\n      var info = _this.chart.update({ event: 'onMove', eventPosition: eventPosition }, _this.ctx);\n      if (onHover && info) onHover(e, info);\n      _this.setState({ info: info, eventPosition: eventPosition });\n    }, _this.handleResize = function () {\n      if (_this.timer) clearTimeout(_this.timer);\n      _this.timer = setTimeout(_this.dispatchResize, 100); // 延后处理\n    }, _this.dispatchResize = function () {\n      var ratio = (0, _config.getPixelRatio)(_this.ctx);\n      var $parentNode = _this.canvasBox.parentNode;\n      var clientWidth = $parentNode.clientWidth;\n      var clientHeight = $parentNode.clientHeight;\n      var ratioWidth = clientWidth * ratio;\n      var ratioHeight = clientHeight * ratio;\n      if (_this.width && _this.height) {\n        var doneValue = [clientWidth, clientHeight, ratioWidth, ratioHeight];\n        if (_this.drewTimer) clearTimeout(_this.drewTimer);\n\n        var startDrew = function startDrew() {\n          var currentValue = [_this.width, _this.height, _this.canvas.width, _this.canvas.height];\n          if (!_.isEqual(doneValue, currentValue)) {\n            var values = currentValue.map(function (val, ind) {\n              var dis = (doneValue[ind] - val) / 3;\n              return val + (dis > 0 ? Math.ceil(dis) : Math.floor(dis));\n            });\n\n            var _values = _slicedToArray(values, 4),\n                w = _values[0],\n                h = _values[1],\n                rw = _values[2],\n                rh = _values[3];\n\n            _this.resize({ ratio: ratio, clientWidth: w, clientHeight: h, ratioWidth: rw, ratioHeight: rh });\n            _this.drewTimer = setTimeout(startDrew, 25); // 缓慢增大\n          }\n        };\n        startDrew();\n      } else {\n        _this.resize({ ratio: ratio, clientWidth: clientWidth, clientHeight: clientHeight, ratioWidth: ratioWidth, ratioHeight: ratioHeight });\n      }\n    }, _this.resize = function (_ref2) {\n      var ratio = _ref2.ratio,\n          clientWidth = _ref2.clientWidth,\n          clientHeight = _ref2.clientHeight,\n          ratioWidth = _ref2.ratioWidth,\n          ratioHeight = _ref2.ratioHeight;\n      var onResize = _this.props.onResize;\n      var _this$state = _this.state,\n          width = _this$state.width,\n          height = _this$state.height;\n\n      _this.canvas.width = ratioWidth;\n      _this.canvas.height = ratioHeight;\n      // setState异步，用this存储上次的值\n      _this.width = clientWidth;\n      _this.height = clientHeight;\n      if (onResize) onResize({ ratio: ratio, clientWidth: clientWidth, clientHeight: clientHeight, ratioWidth: ratioWidth, ratioHeight: ratioHeight });\n      if (_this.chart) _this.chart.update(Object.assign(_extends({}, _this.props), { width: ratioWidth, height: ratioHeight, ratio: ratio }), _this.ctx);\n      if (width !== clientWidth || height !== clientHeight) {\n        _this.setState({ width: clientWidth, height: clientHeight, info: null, eventPosition: null });\n      }\n    }, _temp), _possibleConstructorReturn(_this, _ret);\n  }\n\n  _createClass(RadialBarChart, [{\n    key: 'componentDidMount',\n    value: function componentDidMount() {\n      this.ctx = this.canvas.getContext('2d');\n      this.canvas.addEventListener('mousemove', this.onMove);\n      this.canvas.addEventListener('click', this.onClick);\n      (0, _elementResizeEvent2.default)(this.canvasBox, this.handleResize);\n      window.addEventListener('resize', this.handleResize, false);\n      var Chart = this.props.Chart;\n\n      this.chart = new Chart(this.props);\n      this.dispatchResize();\n    }\n  }, {\n    key: 'componentWillReceiveProps',\n    value: function componentWillReceiveProps(nextProps) {\n      this.chart.update(nextProps, this.ctx);\n    }\n  }, {\n    key: 'componentWillUnmount',\n    value: function componentWillUnmount() {\n      this.canvas.removeEventListener('mousemove', this.onMove, false);\n      this.canvas.removeEventListener('click', this.onClick, false);\n      window.removeEventListener('resize', this.handleResize, false);\n      unbind(this.canvasBox);\n      if (this.timer) clearTimeout(this.timer);\n      if (this.drewTimer) clearTimeout(this.drewTimer);\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var _this2 = this;\n\n      var _state = this.state,\n          info = _state.info,\n          eventPosition = _state.eventPosition,\n          width = _state.width,\n          height = _state.height;\n      var _props = this.props,\n          tooltip = _props.tooltip,\n          title = _props.title,\n          tooltipStyle = _props.tooltipStyle;\n\n      return React.createElement(\n        'div',\n        {\n          ref: function ref(canvasBox) {\n            _this2.canvasBox = canvasBox;\n          },\n          style: { position: 'relative', width: '100%', height: '100%' }\n        },\n        React.createElement(_reactChartTooltip2.default, _extends({\n          width: width,\n          height: height,\n          tooltip: tooltip,\n          title: title,\n          info: info,\n          tooltipStyle: tooltipStyle\n        }, eventPosition)),\n        React.createElement('canvas', { style: { position: 'absolute', width: width, height: height }, ref: function ref(canvas) {\n            _this2.canvas = canvas;\n          } })\n      );\n    }\n  }]);\n\n  return RadialBarChart;\n}(React.Component);\n\nexports.default = RadialBarChart;"]}