graph_shapes.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { myMxConstants } from '@/graph/mxGraph'
  2. import { PaletteShape } from '@/types/mxgraph'
  3. const shapes: PaletteShape[] = [
  4. {
  5. index: 0,
  6. idSeed: 1,
  7. type: myMxConstants.SHAPE_RECTANGLE,
  8. id: myMxConstants.SHAPE_RECTANGLE,
  9. title: '矩形',
  10. class: 'common rectangle',
  11. width: 80,
  12. height: 60,
  13. style: {
  14. [myMxConstants.STYLE_SHAPE]: 'rectangle',
  15. [myMxConstants.STYLE_ARCSIZE]: 20
  16. }
  17. },
  18. {
  19. index: 1,
  20. idSeed: 1,
  21. type: myMxConstants.SHAPE_RHOMBUS,
  22. id: myMxConstants.SHAPE_RHOMBUS,
  23. title: '菱形',
  24. class: 'common rhombus',
  25. width: 80,
  26. height: 80,
  27. style: {
  28. [myMxConstants.STYLE_SHAPE]: 'rhombus'
  29. }
  30. },
  31. {
  32. index: 2,
  33. idSeed: 1,
  34. type: myMxConstants.SHAPE_TRIANGLE,
  35. id: myMxConstants.SHAPE_TRIANGLE,
  36. title: '三角形',
  37. class: 'common triangle',
  38. width: 90,
  39. height: 60,
  40. style: {
  41. [myMxConstants.STYLE_SHAPE]: 'triangle',
  42. [myMxConstants.STYLE_DIRECTION]: 'north'
  43. }
  44. }
  45. // 其他形状定义...
  46. ]
  47. export { shapes }