import { MxConstants } from "@/graph/index";
// const { MxConstants } = mxgraph;
export const generalToolbarItems = [
  //长方形 rectangle_2
  {
    index: 0,
    idSeed: 1,
    id: "rectangle",
    title: "rectangle",
    class: "common rectangle",
    width: 120,
    height: 40,
    style: {
      shape: "rectangle",
      // perimeter: 'ellipsePerimeter', // 让锚点以节点为圆心环形分布在节点外围
      arcSize: 20,
    },
    alt: "长方形",
  },
  // //长方圆 rectangle_2
  // {
  //   index: 13,
  //   idSeed: 1,
  //   id: "rectangleCircle",
  //   title: "rectangleCircle",
  //   class: "common rectangle_2",
  //   width: 120,
  //   height: 40,
  //   style: {
  //     shape: "diamond", // 或 "ellipse"（如果 mxGraph 支持）
  //     // aspect: "fixed",
  //     // rounded: 1, // 启用圆角
  //     // arcSize: 1, // 圆角半径 = height / 2（即半圆）
  //     // perimeter: "ellipsePerimeter", // 可选：让锚点环绕形状
  //     // whiteSpace: "wrap", // 允许文本换行
  //     // shape: "rectangleCircle",
  //     // perimeter: 'ellipsePerimeter', // 让锚点以节点为圆心环形分布在节点外围
  //     // arcSize: 20,
  //   },
  //   alt: "长方圆",
  // },

  //圆形
  {
    index: 2,
    idSeed: 1,
    title: "circle",
    id: "circle",
    class: "common circle",
    width: 80,
    height: 80,
    style: {
      shape: "ellipse",
      // perimeter: 'ellipsePerimeter',
    },
    alt: "圆形",
  },
  //双圈
  {
    index: 9,
    idSeed: 1,
    title: "doubleEllipse",
    id: "doubleEllipse",
    class: "common doubleEllipse",
    width: 80,
    height: 80,
    style: {
      shape: "doubleEllipse",
      // perimeter: 'ellipsePerimeter',
    },
    alt: "双圈",
  },
  //三角形
  {
    index: 1,
    idSeed: 1,
    title: "triangle",
    id: "triangle",
    class: "common triangle",
    width: 120,
    height: 60,
    style: {
      shape: "triangle",
      direction: "north",
    },
    alt: "三角形",
  },
  //菱形
  {
    index: 3,
    idSeed: 1,
    title: "rhombus",
    id: "rhombus",
    class: "common rhombus",
    width: 80,
    height: 80,
    style: {
      shape: "rhombus",
      // perimeter: 'ellipsePerimeter',
    },
    alt: "菱形",
  },
  //六边形
  {
    index: 8,
    idSeed: 1,
    title: "hexagon",
    id: "hexagon",
    class: "common hexagon",
    width: 80,
    height: 80,
    style: {
      shape: "hexagon",
      // perimeter: 'ellipsePerimeter',
    },
    alt: "六边形",
  },

  //文本
  {
    index: 11,
    idSeed: 1,
    title: "Text",
    id: "Text",
    class: "common word",
    width: 70,
    height: 20,
    style: {
      shape: "Text",
      strokeColor: "transparent",
      strokeWidth: "1",
      html: 1,
      fillColor: "#FFFFFF",
      verticalAlign: MxConstants.ALIGN_MIDDLE,
      align: MxConstants.ALIGN_CENTER,
      whiteSpace: "wrap",
      rounded: 0,
    },
    alt: "文本",
  },
  //线
  {
    index: 12,
    idSeed: 1,
    title: "line",
    id: "line",
    class: "common line",
    width: 70,
    height: 20,
    style: {
      shape: "line",
    },
    alt: "线",
  },
];

