in web/src/components/PluginFlow/components/FlowGraph/FlowGraph.ts [102:190]
private static initShape() {
const { graph } = this;
const r1 = graph.createNode({
shape: FlowGraphShape.start,
attrs: {
body: {
rx: 24,
ry: 24,
},
text: {
textWrap: {
text: formatMessage({ id: 'component.plugin-flow.text.start-node' }),
},
},
},
});
const r3 = graph.createNode({
shape: FlowGraphShape.condition,
width: 58,
height: 58,
angle: 45,
attrs: {
text: {
textWrap: {
text: formatMessage({ id: 'component.plugin-flow.text.condition2' }),
},
transform: 'rotate(-45deg)',
},
},
ports: {
groups: {
top: {
position: {
name: 'top',
args: {
dx: -26,
},
},
},
right: {
position: {
name: 'right',
args: {
dy: -26,
},
},
},
bottom: {
position: {
name: 'bottom',
args: {
dx: 26,
},
},
},
left: {
position: {
name: 'left',
args: {
dy: 26,
},
},
},
},
},
});
this.stencil.load([r1, r3], 'basic');
this.pluginTypeList.forEach((type) => {
const plugins = this.plugins
.filter((plugin) => plugin.type === type)
.map((plugin) => {
return graph.createNode({
shape: FlowGraphShape.plugin,
attrs: {
title: {
text: plugin.name,
},
text: {
text: plugin.name,
},
},
});
});
this.stencil.load(plugins, type);
});
}