{"size": 3636, "ext": "js", "max_stars_repo_path": "node_modules/react-annotation/lib/Handle.js", "max_stars_repo_name": "dwlarson10/DataDanLarson", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "node_modules/react-annotation/lib/Handle.js", "max_issues_repo_name": "dwlarson10/DataDanLarson", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "node_modules/react-annotation/lib/Handle.js", "max_forks_repo_name": "dwlarson10/DataDanLarson", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 39.956043956, "max_line_length": 564, "alphanum_fraction": 0.6677667767}
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _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; }; }();

var _react = require("react");

var _react2 = _interopRequireDefault(_react);

var _reactDraggable = require("react-draggable");

var _propTypes = require("prop-types");

var _propTypes2 = _interopRequireDefault(_propTypes);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _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; }

function _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; }

var Handle = function (_React$Component) {
  _inherits(Handle, _React$Component);

  function Handle() {
    _classCallCheck(this, Handle);

    return _possibleConstructorReturn(this, (Handle.__proto__ || Object.getPrototypeOf(Handle)).apply(this, arguments));
  }

  _createClass(Handle, [{
    key: "render",
    value: function render() {
      var _props = this.props,
          _props$x = _props.x,
          x = _props$x === undefined ? 0 : _props$x,
          _props$y = _props.y,
          y = _props$y === undefined ? 0 : _props$y,
          _props$r = _props.r,
          r = _props$r === undefined ? 10 : _props$r,
          handleStart = _props.handleStart,
          handleDrag = _props.handleDrag,
          handleStop = _props.handleStop,
          offsetParent = _props.offsetParent;


      return _react2.default.createElement(
        _reactDraggable.DraggableCore,
        {
          handle: ".handle",
          defaultPosition: { x: 0, y: 0 },
          position: null,
          onStart: handleStart,
          onDrag: handleDrag,
          onStop: handleStop,
          offsetParent: offsetParent,
          defaultClassNameDragging: "dragging"
        },
        _react2.default.createElement("circle", {
          className: "handle",
          cx: x,
          cy: y,
          r: r,
          strokeDasharray: "5",
          stroke: "grey",
          fill: "white",
          fillOpacity: 0
        })
      );
    }
  }]);

  return Handle;
}(_react2.default.Component);

exports.default = Handle;


Handle.propTypes = {
  x: _propTypes2.default.number,
  y: _propTypes2.default.number,
  r: _propTypes2.default.number,
  handleStart: _propTypes2.default.func,
  handleStop: _propTypes2.default.func,
  handleDrag: _propTypes2.default.func
};