import _Object$assign from "@babel/runtime-corejs2/core-js/object/assign";
import _inheritsLoose from "../../../inheritsLoose";
import _defineProperty from "@babel/runtime-corejs2/helpers/defineProperty";
import { DLayout } from './layout';
import mx from '../mxgraph';
var mxCircleLayout = mx.mxCircleLayout;
export var DCircleLayout =
/*#__PURE__*/
function (_DLayout) {
  _inheritsLoose(DCircleLayout, _DLayout);

  function DCircleLayout() {
    return _DLayout.apply(this, arguments) || this;
  }

  var _proto = DCircleLayout.prototype;

  _proto.defaults = function defaults() {
    return _Object$assign({}, _DLayout.prototype.defaults.call(this), {
      x0: 0,
      y0: 0
    });
  };

  _proto._getLayout = function _getLayout(graph) {
    var _this$get = this.get(),
        x0 = _this$get.x0,
        y0 = _this$get.y0;

    var layout = new mxCircleLayout(graph); // layout.radius = radius;

    layout.moveCircle = true;
    layout.x0 = x0;
    layout.y0 = y0;
    layout.disableEdgeStyle = false;
    return layout;
  };

  _proto._execute = function _execute(layout, cells, parent, graph) {
    if (!cells.length) return;
    var tmp = parent.cell;
    layout.execute(tmp); // if (graph.getModel().isVertex(tmp)) {
    // graph.updateGroupBounds([tmp], graph.gridSize * 2, true);
    // }
  };

  return DCircleLayout;
}(DLayout);

_defineProperty(DCircleLayout, "displayName", 'DCircleLayout');