Blame view

HHECS.Web/src/components/MapModule/flow/graph/ports.js 3 KB
胡菁 authored
1
2
3
export const basicPorts = {
  groups: {
    top: {
胡菁 authored
4
      position: 'top',
胡菁 authored
5
6
7
8
      attrs: {
        circle: {
          r: 4,
          magnet: true,
胡菁 authored
9
          stroke: '#5F95FF',
胡菁 authored
10
          strokeWidth: 1,
胡菁 authored
11
          fill: '#fff',
胡菁 authored
12
          style: {
胡菁 authored
13
14
15
16
            visibility: 'hidden'
          }
        }
      }
胡菁 authored
17
18
    },
    right: {
胡菁 authored
19
      position: 'right',
胡菁 authored
20
21
22
23
      attrs: {
        circle: {
          r: 4,
          magnet: true,
胡菁 authored
24
          stroke: '#5F95FF',
胡菁 authored
25
          strokeWidth: 1,
胡菁 authored
26
          fill: '#fff',
胡菁 authored
27
          style: {
胡菁 authored
28
29
30
31
            visibility: 'hidden'
          }
        }
      }
胡菁 authored
32
33
    },
    bottom: {
胡菁 authored
34
      position: 'bottom',
胡菁 authored
35
36
37
38
      attrs: {
        circle: {
          r: 4,
          magnet: true,
胡菁 authored
39
          stroke: '#5F95FF',
胡菁 authored
40
          strokeWidth: 1,
胡菁 authored
41
          fill: '#fff',
胡菁 authored
42
          style: {
胡菁 authored
43
44
45
46
            visibility: 'hidden'
          }
        }
      }
胡菁 authored
47
48
    },
    left: {
胡菁 authored
49
      position: 'left',
胡菁 authored
50
51
52
53
      attrs: {
        circle: {
          r: 4,
          magnet: true,
胡菁 authored
54
          stroke: '#5F95FF',
胡菁 authored
55
          strokeWidth: 1,
胡菁 authored
56
          fill: '#fff',
胡菁 authored
57
          style: {
胡菁 authored
58
59
60
61
62
            visibility: 'hidden'
          }
        }
      }
    }
胡菁 authored
63
64
65
  },
  items: [
    {
胡菁 authored
66
      group: 'top'
胡菁 authored
67
68
    },
    {
胡菁 authored
69
      group: 'right'
胡菁 authored
70
71
    },
    {
胡菁 authored
72
      group: 'bottom'
胡菁 authored
73
74
    },
    {
胡菁 authored
75
76
77
78
      group: 'left'
    }
  ]
}
胡菁 authored
79
80
81
82
83

export const customPorts = {
  groups: {
    top: {
      position: {
胡菁 authored
84
85
        name: 'absolute'
      }
胡菁 authored
86
87
88
    },
    right: {
      position: {
胡菁 authored
89
90
        name: 'absolute'
      }
胡菁 authored
91
92
93
    },
    bottom: {
      position: {
胡菁 authored
94
95
        name: 'absolute'
      }
胡菁 authored
96
97
98
    },
    left: {
      position: {
胡菁 authored
99
100
101
        name: 'absolute'
      }
    }
胡菁 authored
102
103
104
  },
  items: [
    {
胡菁 authored
105
106
      id: 'port1',
      group: 'top',
胡菁 authored
107
108
      // 通过 args 指定绝对位置
      args: {
胡菁 authored
109
110
        x: '50%',
        y: '0%'
胡菁 authored
111
112
113
114
115
      },
      attrs: {
        circle: {
          r: 4,
          magnet: true,
胡菁 authored
116
          stroke: '#5F95FF',
胡菁 authored
117
          strokeWidth: 1,
胡菁 authored
118
          fill: '#fff',
胡菁 authored
119
          style: {
胡菁 authored
120
121
122
123
            visibility: 'hidden'
          }
        }
      }
胡菁 authored
124
125
    },
    {
胡菁 authored
126
127
      id: 'port2',
      group: 'right',
胡菁 authored
128
      args: {
胡菁 authored
129
130
        x: '100%',
        y: '50%'
胡菁 authored
131
132
133
134
135
      },
      attrs: {
        circle: {
          r: 4,
          magnet: true,
胡菁 authored
136
          stroke: '#5F95FF',
胡菁 authored
137
          strokeWidth: 1,
胡菁 authored
138
          fill: '#fff',
胡菁 authored
139
          style: {
胡菁 authored
140
141
142
143
            visibility: 'hidden'
          }
        }
      }
胡菁 authored
144
145
    },
    {
胡菁 authored
146
147
      id: 'port3',
      group: 'bottom',
胡菁 authored
148
      args: {
胡菁 authored
149
150
        x: '50%',
        y: '100%'
胡菁 authored
151
152
153
154
155
      },
      attrs: {
        circle: {
          r: 4,
          magnet: true,
胡菁 authored
156
          stroke: '#5F95FF',
胡菁 authored
157
          strokeWidth: 1,
胡菁 authored
158
          fill: '#fff',
胡菁 authored
159
          style: {
胡菁 authored
160
161
162
163
            visibility: 'hidden'
          }
        }
      }
胡菁 authored
164
165
    },
    {
胡菁 authored
166
167
      id: 'port4',
      group: 'left',
胡菁 authored
168
      args: {
胡菁 authored
169
170
        x: '0%',
        y: '50%'
胡菁 authored
171
172
173
174
175
      },
      attrs: {
        circle: {
          r: 4,
          magnet: true,
胡菁 authored
176
          stroke: '#5F95FF',
胡菁 authored
177
          strokeWidth: 1,
胡菁 authored
178
          fill: '#fff',
胡菁 authored
179
          style: {
胡菁 authored
180
181
182
183
184
185
186
            visibility: 'hidden'
          }
        }
      }
    }
  ]
}