1. export const defaultEdge = {
    2. labels: [
    3. {
    4. attrs: {
    5. label: {
    6. text: '待配置',
    7. fill: 'var(--main)',
    8. fontSize: 12,
    9. textAnchor: 'middle',
    10. pointerEvents: 'none'
    11. },
    12. body: {
    13. ref: 'label',
    14. fill: 'var(--white8)',
    15. stroke: 'none',
    16. strokeWidth: 1,
    17. rx: 4,
    18. ry: 4,
    19. refWidth: '140%',
    20. refHeight: '140%',
    21. refX: '-20%',
    22. refY: '-20%'
    23. }
    24. },
    25. position: {
    26. distance: 0.5
    27. }
    28. }
    29. ],
    30. attrs: {
    31. line: {
    32. strokeDasharray: '4,2',
    33. stroke: 'var(--textDisable)',
    34. strokeWidth: 1,
    35. targetMarker: {
    36. name: 'block',
    37. fill: '#8c8c8c',
    38. args: {
    39. size: '8'
    40. },
    41. offset: -15
    42. }
    43. }
    44. }
    45. }
    46. // 边设置业务数据后的 配置
    47. export const hasDataEdgeAttrs = {
    48. labels: [
    49. {
    50. attrs: {
    51. label: {
    52. text: '待配置',
    53. fill: 'var(--main)',
    54. fontSize: 12,
    55. textAnchor: 'middle',
    56. pointerEvents: 'none'
    57. },
    58. body: {
    59. ref: 'label',
    60. fill: 'var(--main5)',
    61. stroke: 'none',
    62. strokeWidth: 1,
    63. rx: 4,
    64. ry: 4,
    65. refWidth: '140%',
    66. refHeight: '140%',
    67. refX: '-20%',
    68. refY: '-20%'
    69. }
    70. },
    71. position: {
    72. distance: 0.5
    73. }
    74. }
    75. ],
    76. attrs: {
    77. line: {
    78. strokeDasharray: '4,2',
    79. stroke: 'var(--textDisable)',
    80. strokeWidth: 1,
    81. targetMarker: {
    82. name: 'block',
    83. fill: '#8c8c8c',
    84. args: {
    85. size: '8'
    86. },
    87. offset: -15
    88. }
    89. }
    90. }
    91. }
    92. // 边 tool 工具
    93. export const edgeTool = [
    94. {
    95. // 在指定的位置处,渲染一个删除按钮
    96. name: 'button-remove',
    97. args: {
    98. x: '100%',
    99. y: 0,
    100. offset: { x: 0, y: 0 }
    101. }
    102. }
    103. ]