import FlowEdge from './customNode/edge';
import validateEdge from './validateEdge';
export var FlowZoomRange;
(function (FlowZoomRange) {
  FlowZoomRange[FlowZoomRange["MIN"] = 0.5] = "MIN";
  FlowZoomRange[FlowZoomRange["MAX"] = 3] = "MAX";
  FlowZoomRange[FlowZoomRange["STEP"] = 0.25] = "STEP";
})(FlowZoomRange || (FlowZoomRange = {}));
var graphConfig = {
  // 支持画布拖拽
  panning: true,
  history: true,
  // 画布大小容器自适应
  autoResize: true,
  selecting: {
    enabled: true
  },
  // 辅助线
  snapline: {
    enabled: true
  },
  resizing: {
    enabled: true,
    minHeight: 32,
    maxHeight: 32,
    minWidth: 160,
    autoScroll: true
  },
  /**
   * 缩放比例限制
   */
  scaling: {
    min: FlowZoomRange.MIN,
    max: FlowZoomRange.MAX
  },
  /**
   * 支持缩放
   */
  mousewheel: {
    enabled: true,
    modifiers: ['ctrl', 'meta']
  },
  background: {
    color: '#f9f9fa'
  },
  grid: false,
  /**
   * 支持小地图
   */
  minimap: {
    enabled: false
  },
  connecting: {
    snap: true,
    allowBlank: false,
    allowLoop: false,
    allowNode: false,
    highlight: true,
    allowMulti: true,
    allowEdge: false,
    router: {
      name: 'er'
    },
    connector: {
      name: 'rounded'
    },
    createEdge: function createEdge(args) {
      var edge = new FlowEdge({
        source: args.sourceCell
      });
      this.cleanSelection();
      return edge;
    },
    validateEdge: validateEdge
  }
};
export default graphConfig;