@aj-shadow/z-abs-complayer-markup-client 0.0.0-aj-beta.221
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +26 -0
- package/LICENSE.txt +96 -0
- package/README.md +5 -0
- package/npm-shrinkwrap.json +13 -0
- package/package.json +10 -0
- package/project/client/_build/Bundle-CompLayer-Markup-client.bld +40 -0
- package/project/client/_build/Client-CompLayer-Markup-client-jsx.bld +10 -0
- package/project/client/_build/Client-CompLayer-Markup-client.bld +10 -0
- package/project/client/_build/Client-css-CompLayer-Markup-bundle.bld +9 -0
- package/project/client/_build/z-abs-complayer-markup-client.prj +36 -0
- package/project/client/actions/action-style.js +17 -0
- package/project/client/actions/data-action-style.js +13 -0
- package/project/client/css/markup_addressing.css +30 -0
- package/project/client/css/markup_flowchart.css +53 -0
- package/project/client/css/markup_general.css +4 -0
- package/project/client/css/markup_image.css +10 -0
- package/project/client/css/markup_license.css +107 -0
- package/project/client/css/markup_login.css +201 -0
- package/project/client/css/markup_node_diagram.css +51 -0
- package/project/client/css/markup_sequence_diagram.css +6 -0
- package/project/client/css/markup_state.css +5 -0
- package/project/client/css/markup_table.css +57 -0
- package/project/client/css/markup_tc.css +32 -0
- package/project/client/css/markup_ts.css +36 -0
- package/project/client/data/addresses/data-addresses-client-address-global.js +20 -0
- package/project/client/data/addresses/data-addresses-client-address-local.js +20 -0
- package/project/client/data/addresses/data-addresses-client-interface-global.js +17 -0
- package/project/client/data/addresses/data-addresses-client-interface-local.js +17 -0
- package/project/client/data/addresses/data-addresses-dns-global.js +18 -0
- package/project/client/data/addresses/data-addresses-dns-local.js +19 -0
- package/project/client/data/addresses/data-addresses-dst-global.js +20 -0
- package/project/client/data/addresses/data-addresses-dst-local.js +20 -0
- package/project/client/data/addresses/data-addresses-network-interface-global.js +17 -0
- package/project/client/data/addresses/data-addresses-network-interface-local.js +17 -0
- package/project/client/data/addresses/data-addresses-ports-global.js +18 -0
- package/project/client/data/addresses/data-addresses-ports-local.js +18 -0
- package/project/client/data/addresses/data-addresses-server-address-global.js +20 -0
- package/project/client/data/addresses/data-addresses-server-address-local.js +20 -0
- package/project/client/data/addresses/data-addresses-server-interface-global.js +17 -0
- package/project/client/data/addresses/data-addresses-server-interface-local.js +17 -0
- package/project/client/data/addresses/data-addresses-src-global.js +21 -0
- package/project/client/data/addresses/data-addresses-src-local.js +21 -0
- package/project/client/data/addresses/data-addresses-srv-global.js +20 -0
- package/project/client/data/addresses/data-addresses-srv-local.js +20 -0
- package/project/client/data/addresses/data-addresses-sut-address-global.js +20 -0
- package/project/client/data/addresses/data-addresses-sut-address-local.js +20 -0
- package/project/client/data/addresses/data-addresses-sut-interface-global.js +19 -0
- package/project/client/data/addresses/data-addresses-sut-interface-local.js +19 -0
- package/project/client/data/data-chart/data-chart-axis.js +13 -0
- package/project/client/data/data-chart/data-chart-grid.js +14 -0
- package/project/client/data/data-chart/data-chart-line/data-chart-line-config.js +17 -0
- package/project/client/data/data-chart/data-chart-line/data-chart-line.js +41 -0
- package/project/client/data/data-config.js +14 -0
- package/project/client/data/data-constructor.js +18 -0
- package/project/client/data/data-content/data-content-audio-global.js +18 -0
- package/project/client/data/data-content/data-content-audio-local.js +18 -0
- package/project/client/data/data-content/data-content-documents-global.js +18 -0
- package/project/client/data/data-content/data-content-documents-local.js +18 -0
- package/project/client/data/data-content/data-content-image-global.js +21 -0
- package/project/client/data/data-content/data-content-image-local.js +21 -0
- package/project/client/data/data-content/data-content-other-global.js +20 -0
- package/project/client/data/data-content/data-content-other-local.js +20 -0
- package/project/client/data/data-content/data-content-text-global.js +20 -0
- package/project/client/data/data-content/data-content-text-local.js +20 -0
- package/project/client/data/data-content/data-content-video-global.js +20 -0
- package/project/client/data/data-content/data-content-video-local.js +20 -0
- package/project/client/data/data-data.js +28 -0
- package/project/client/data/data-dependencies/data-dependencies.js +17 -0
- package/project/client/data/data-documentation/data-documentation-navigation.js +15 -0
- package/project/client/data/data-documentation/data-documentation.js +20 -0
- package/project/client/data/data-flowchart/data-flowchart-block.js +33 -0
- package/project/client/data/data-flowchart/data-flowchart-connection.js +17 -0
- package/project/client/data/data-flowchart/data-flowchart.js +30 -0
- package/project/client/data/data-html/data-html-anchor.js +12 -0
- package/project/client/data/data-html/data-html-br.js +11 -0
- package/project/client/data/data-html/data-html-button.js +15 -0
- package/project/client/data/data-html/data-html-log-start.js +12 -0
- package/project/client/data/data-html/data-html-log-stop.js +13 -0
- package/project/client/data/data-html/data-html-log.js +16 -0
- package/project/client/data/data-html/data-html-toolbar.js +19 -0
- package/project/client/data/data-image/data-image.js +20 -0
- package/project/client/data/data-lab/data-lab-interface-client.js +19 -0
- package/project/client/data/data-lab/data-lab-interface-server.js +19 -0
- package/project/client/data/data-lab/data-lab-interface-sut.js +20 -0
- package/project/client/data/data-lab/data-lab-network.js +31 -0
- package/project/client/data/data-lab/data-lab.js +21 -0
- package/project/client/data/data-licenses/data-licenses.js +16 -0
- package/project/client/data/data-node-diagram/data-node-diagram-config.js +21 -0
- package/project/client/data/data-node-diagram/data-node-diagram-connection.js +18 -0
- package/project/client/data/data-node-diagram/data-node-diagram-group.js +16 -0
- package/project/client/data/data-node-diagram/data-node-diagram-node.js +22 -0
- package/project/client/data/data-node-diagram/data-node-diagram.js +47 -0
- package/project/client/data/data-repos/data-repos-content-local.js +15 -0
- package/project/client/data/data-repos/data-repos-data-local.js +15 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram-config.js +22 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram-message.js +17 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram-node.js +11 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram.js +32 -0
- package/project/client/data/data-state-machine/data-state-machine-config.js +17 -0
- package/project/client/data/data-state-machine/data-state-machine-state.js +29 -0
- package/project/client/data/data-state-machine/data-state-machine-transition.js +18 -0
- package/project/client/data/data-state-machine/data-state-machine.js +37 -0
- package/project/client/data/data-system-under-test/data-system-under-test-instances.js +15 -0
- package/project/client/data/data-system-under-test/data-system-under-test-nodes.js +18 -0
- package/project/client/data/data-table/data-table-config.js +21 -0
- package/project/client/data/data-table-key-value.js +56 -0
- package/project/client/data/data-test-case/data-actor.js +282 -0
- package/project/client/data/data-test-case/data-test-case-settings.js +49 -0
- package/project/client/data/data-test-case/data-test-case.js +19 -0
- package/project/client/data/data-test-case/data-test-data-iteration.js +54 -0
- package/project/client/data/data-test-case/data-test-data-test-case.js +16 -0
- package/project/client/data/data-test-case/data-verification-test-case.js +24 -0
- package/project/client/data/data-test-data/data-test-data-environment-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-environment-local.js +18 -0
- package/project/client/data/data-test-data/data-test-data-environment-static.js +16 -0
- package/project/client/data/data-test-data/data-test-data-general-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-general-local.js +18 -0
- package/project/client/data/data-test-data/data-test-data-output-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-output-local.js +18 -0
- package/project/client/data/data-test-data/data-test-data-system-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-system-local.js +18 -0
- package/project/client/data/data-test-suite/data-test-suite-abstraction.js +72 -0
- package/project/client/data/data-test-suite/data-test-suite.js +15 -0
- package/project/client/data/data-tree/data-tree-node.js +17 -0
- package/project/client/data/data-tree/data-tree.js +13 -0
- package/project/client/markup/markup-addresses/markup-addresses-client-address.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-client-interface.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-dns.js +32 -0
- package/project/client/markup/markup-addresses/markup-addresses-dst.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-network-interface.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-ports.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-server-address.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-server-interface.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-src.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-srv.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-sut-address.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-sut-interface.js +31 -0
- package/project/client/markup/markup-chart/markup-chart-line.js +92 -0
- package/project/client/markup/markup-content/markup-content-audio.js +31 -0
- package/project/client/markup/markup-content/markup-content-documents.js +31 -0
- package/project/client/markup/markup-content/markup-content-image.js +31 -0
- package/project/client/markup/markup-content/markup-content-other.js +31 -0
- package/project/client/markup/markup-content/markup-content-text.js +31 -0
- package/project/client/markup/markup-content/markup-content-video.js +31 -0
- package/project/client/markup/markup-dependencies/markup-dependencies.js +30 -0
- package/project/client/markup/markup-documentation/markup-documentation-anchor.js +37 -0
- package/project/client/markup/markup-documentation/markup-documentation-api-status.js +67 -0
- package/project/client/markup/markup-documentation/markup-documentation-code.js +20 -0
- package/project/client/markup/markup-documentation/markup-documentation-div.js +34 -0
- package/project/client/markup/markup-documentation/markup-documentation-documentation-status.js +67 -0
- package/project/client/markup/markup-documentation/markup-documentation-embed.js +23 -0
- package/project/client/markup/markup-documentation/markup-documentation-html.js +139 -0
- package/project/client/markup/markup-documentation/markup-documentation-ie.js +21 -0
- package/project/client/markup/markup-documentation/markup-documentation-image.js +46 -0
- package/project/client/markup/markup-documentation/markup-documentation-lab.js +19 -0
- package/project/client/markup/markup-documentation/markup-documentation-local-note.js +33 -0
- package/project/client/markup/markup-documentation/markup-documentation-navigation.js +109 -0
- package/project/client/markup/markup-documentation/markup-documentation-page.js +262 -0
- package/project/client/markup/markup-documentation/markup-documentation-ref.js +28 -0
- package/project/client/markup/markup-documentation/markup-documentation-result.js +21 -0
- package/project/client/markup/markup-documentation/markup-documentation-state-machine.js +194 -0
- package/project/client/markup/markup-documentation/markup-documentation.js +74 -0
- package/project/client/markup/markup-flowchart.js +264 -0
- package/project/client/markup/markup-lab.js +116 -0
- package/project/client/markup/markup-licenses/markup-licenses.js +29 -0
- package/project/client/markup/markup-node-diagram.js +435 -0
- package/project/client/markup/markup-parse-helper.js +26 -0
- package/project/client/markup/markup-pattern-config.js +53 -0
- package/project/client/markup/markup-pattern-data.js +50 -0
- package/project/client/markup/markup-pattern-function.js +47 -0
- package/project/client/markup/markup-repos/markup-repos.js +31 -0
- package/project/client/markup/markup-sequence-diagram.js +466 -0
- package/project/client/markup/markup-system-under-test/markup-system-under-test-instances.js +29 -0
- package/project/client/markup/markup-system-under-test/markup-system-under-test-nodes.js +30 -0
- package/project/client/markup/markup-table-key-value-parse.js +25 -0
- package/project/client/markup/markup-table-key-value-stringify.js +91 -0
- package/project/client/markup/markup-table-key-value.js +18 -0
- package/project/client/markup/markup-table-name-value.js +101 -0
- package/project/client/markup/markup-table.js +85 -0
- package/project/client/markup/markup-tables-parser.js +122 -0
- package/project/client/markup/markup-test-case/markup-test-case.js +67 -0
- package/project/client/markup/markup-test-data/markup-test-data-environment.js +31 -0
- package/project/client/markup/markup-test-data/markup-test-data-general.js +31 -0
- package/project/client/markup/markup-test-data/markup-test-data-output.js +31 -0
- package/project/client/markup/markup-test-data/markup-test-data-system.js +31 -0
- package/project/client/markup/markup-test-suite/markup-test-suite.js +40 -0
- package/project/client/react-components/helper/line-data.js +16 -0
- package/project/client/react-components/helper/line-object.js +22 -0
- package/project/client/react-components/helper/scroll-data.js +74 -0
- package/project/client/react-components/markup/component-chart/component-image-chart-line.jsx +203 -0
- package/project/client/react-components/markup/component-code.jsx +50 -0
- package/project/client/react-components/markup/component-document.jsx +105 -0
- package/project/client/react-components/markup/component-documentation-anchor.jsx +47 -0
- package/project/client/react-components/markup/component-embed.jsx +48 -0
- package/project/client/react-components/markup/component-image-flowchart.jsx +389 -0
- package/project/client/react-components/markup/component-image-image.jsx +32 -0
- package/project/client/react-components/markup/component-image-lab.jsx +696 -0
- package/project/client/react-components/markup/component-image-node-diagram.jsx +506 -0
- package/project/client/react-components/markup/component-image-result.jsx +22 -0
- package/project/client/react-components/markup/component-image-sequence-diagram.jsx +645 -0
- package/project/client/react-components/markup/component-image-state-machine.jsx +633 -0
- package/project/client/react-components/markup/component-image-table.jsx +96 -0
- package/project/client/react-components/markup/component-local-note.jsx +99 -0
- package/project/client/react-components/markup/component-markup-remarkable.jsx +79 -0
- package/project/client/react-components/markup/component-markup.jsx +1036 -0
- package/project/client/react-components/markup/component-table-data-table.jsx +146 -0
- package/project/client/stores/style-store.js +96 -0
- package/project/z-abs-complayer-markup-client.tree +239 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
import ReactComponentBase from 'z-abs-corelayer-client/client/react-component/react-component-base';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export default class ComponentImageNodeDiagram extends ReactComponentBase {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
shouldUpdate(nextProps, nextState) {
|
|
14
|
+
return !this.shallowCompareObjectValues(this.props.nodeDiagram, nextProps.nodeDiagram);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
renderTitle(title, x) {
|
|
18
|
+
if(0 !== title) {
|
|
19
|
+
return (
|
|
20
|
+
<text x={x} y={ComponentImageNodeDiagram.TITLE_TOP} textAnchor="middle" style={{fontSize:ComponentImageNodeDiagram.TITLE_FONT_SIZE,fontWeight:'bold'}}>
|
|
21
|
+
{title}
|
|
22
|
+
</text>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
renderGroup(group, titleHeight, config, index) {
|
|
28
|
+
if(-1 === group.leftStartIndex || -1 === group.leftStopIndex || -1 === group.topStartIndex || -1 === group.topStopIndex) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const groupBias = 25;
|
|
32
|
+
const halfNodeWidthBetween = config.nodeWidthBetween / 2;
|
|
33
|
+
const halfNodeHeightBetween = config.nodeHeightBetween / 2;
|
|
34
|
+
const left = config.widthBias + group.leftStartIndex * (config.nodeWidth + config.nodeWidthBetween) - halfNodeWidthBetween;
|
|
35
|
+
const top = titleHeight + config.heightBias + group.topStartIndex * (config.nodeHeight + config.nodeHeightBetween) - halfNodeHeightBetween;
|
|
36
|
+
const width = (group.leftStopIndex - group.leftStartIndex) * (config.nodeWidth + config.nodeWidthBetween);
|
|
37
|
+
const height = (group.topStopIndex - group.topStartIndex) * (config.nodeHeight + config.nodeHeightBetween);
|
|
38
|
+
return (
|
|
39
|
+
<g key={`group_${index}`}>
|
|
40
|
+
<rect className="node_diagram_group" style={{fill:group.color}} x={left} y={top} rx="4" ry="4" width={width} height={height} />
|
|
41
|
+
<text x={left + 5} y={top + 15} style={{fontSize:'12px',fontWeight:'bold',textAnchor:'left'}}>
|
|
42
|
+
{group.name}
|
|
43
|
+
</text>
|
|
44
|
+
</g>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
renderGroups(groups, titleHeight, config) {
|
|
49
|
+
return groups.map((group, index) => {
|
|
50
|
+
return this.renderGroup(group, titleHeight, config, index);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
renderStar(node, titleHeight, config) {
|
|
55
|
+
const left = config.widthBias + node.xIndex * (config.nodeWidth + config.nodeWidthBetween);
|
|
56
|
+
const top = titleHeight + config.heightBias + node.yIndex * (config.nodeHeight + config.nodeHeightBetween);
|
|
57
|
+
|
|
58
|
+
const lengthW = config.nodeWidth / 2;
|
|
59
|
+
const lengthH = config.nodeHeight / 2;
|
|
60
|
+
const corners = node.corners ? node.corners : 5;
|
|
61
|
+
const points = new Array(corners);
|
|
62
|
+
const angle = 360 / corners;
|
|
63
|
+
for(let i = 0; i < corners; ++i) {
|
|
64
|
+
const px = left + lengthW + lengthW * Math.sin((180 + angle * i) * Math.PI / 180);
|
|
65
|
+
const py = top + lengthH + lengthH * Math.cos((180 + angle * i) * Math.PI / 180);
|
|
66
|
+
points[i] = `${px},${py}`;
|
|
67
|
+
}
|
|
68
|
+
return (
|
|
69
|
+
<g key={`node_${node.xIndex}_${node.yIndex}`}>
|
|
70
|
+
<polygon className="node_diagram_star" points={`${points.join(' ')}`} />
|
|
71
|
+
<text x={left + config.nodeWidth / 2} y={top + config.nodeHeight / 2 + 5} style={{fontSize:'10px',fontWeight:'bold',textAnchor:'middle'}}>
|
|
72
|
+
{node.name}
|
|
73
|
+
</text>
|
|
74
|
+
</g>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
renderPolygon(node, titleHeight, config) {
|
|
79
|
+
const left = config.widthBias + node.xIndex * (config.nodeWidth + config.nodeWidthBetween);
|
|
80
|
+
const top = titleHeight + config.heightBias + node.yIndex * (config.nodeHeight + config.nodeHeightBetween);
|
|
81
|
+
|
|
82
|
+
const lengthW = config.nodeWidth / 2;
|
|
83
|
+
const lengthH = config.nodeHeight / 2;
|
|
84
|
+
const corners = node.corners ? node.corners : 5;
|
|
85
|
+
const points = new Array(corners);
|
|
86
|
+
const angle = 360 / corners;
|
|
87
|
+
for(let i = 0; i < corners; ++i) {
|
|
88
|
+
const px = left + lengthW + lengthW * Math.sin((180 + angle * i) * Math.PI / 180);
|
|
89
|
+
const py = top + lengthH + lengthH * Math.cos((180 + angle * i) * Math.PI / 180);
|
|
90
|
+
points[i] = `${px},${py}`;
|
|
91
|
+
}
|
|
92
|
+
return (
|
|
93
|
+
<g key={`node_${node.xIndex}_${node.yIndex}`}>
|
|
94
|
+
<polygon className="node_diagram_star" points={`${points.join(' ')}`} />
|
|
95
|
+
<text x={left + config.nodeWidth / 2} y={top + config.nodeHeight / 2 + 5} style={{fontSize:'10px',fontWeight:'bold',textAnchor:'middle'}}>
|
|
96
|
+
{node.name}
|
|
97
|
+
</text>
|
|
98
|
+
</g>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
renderSquare(node, titleHeight, config) {
|
|
103
|
+
if('' === node.name) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
const left = config.widthBias + node.xIndex * (config.nodeWidth + config.nodeWidthBetween);
|
|
107
|
+
const top = titleHeight + config.heightBias + node.yIndex * (config.nodeHeight + config.nodeHeightBetween);
|
|
108
|
+
return (
|
|
109
|
+
<g key={`node_${node.xIndex}_${node.yIndex}`}>
|
|
110
|
+
<rect className="node_diagram_square" style={{fill:node.color}} x={left} y={top} rx="4" ry="4" width={config.nodeWidth} height={config.nodeHeight} />
|
|
111
|
+
<text x={left + config.nodeWidth / 2} y={top + config.nodeHeight / 2 + 5} style={{fontSize:'10px',fontWeight:'bold',textAnchor:'middle'}}>
|
|
112
|
+
{node.name}
|
|
113
|
+
</text>
|
|
114
|
+
</g>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
renderNode(node, titleHeight, config) {
|
|
119
|
+
switch(node.type) {
|
|
120
|
+
case 'polygon':
|
|
121
|
+
return this.renderPolygon(node, titleHeight, config);
|
|
122
|
+
case 'star':
|
|
123
|
+
return this.renderStar(node, titleHeight, config);
|
|
124
|
+
case 'square':
|
|
125
|
+
default:
|
|
126
|
+
return this.renderSquare(node, titleHeight, config);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
renderNodes(nodeRows, titleHeight, config) {
|
|
131
|
+
const svgNodes = nodeRows.map((nodes, yIndex) => {
|
|
132
|
+
return nodes.map((node, xIndex) => {
|
|
133
|
+
return this.renderNode(node, titleHeight, config);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
return (
|
|
137
|
+
<g>
|
|
138
|
+
{svgNodes}
|
|
139
|
+
</g>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
calculateCurrentPoint(length, current, currents) {
|
|
144
|
+
const line = length * 0.8;
|
|
145
|
+
const bais = length * 0.1;
|
|
146
|
+
const linePart = line / (currents + 1);
|
|
147
|
+
return bais + (current + 1) * linePart;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
calculatePoint(position, current, currents, xIndex, yIndex, titleHeight, config, calculatedConfig) {
|
|
151
|
+
const left = config.widthBias + xIndex * (config.nodeWidth + config.nodeWidthBetween);
|
|
152
|
+
const top = titleHeight + config.heightBias + yIndex * (config.nodeHeight + config.nodeHeightBetween);
|
|
153
|
+
if(ComponentImageNodeDiagram.RIGHT === position || ComponentImageNodeDiagram.LEFT === position) {
|
|
154
|
+
return {
|
|
155
|
+
x: left + calculatedConfig.positionX[position],
|
|
156
|
+
y: top + this.calculateCurrentPoint(config.nodeHeight, current, currents)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
return {
|
|
161
|
+
x: left + this.calculateCurrentPoint(config.nodeWidth, current, currents),
|
|
162
|
+
y: top + calculatedConfig.positionY[position]
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
getPosition(decidedPosition, calculatedPosition) {
|
|
168
|
+
if('top' === decidedPosition) {
|
|
169
|
+
return ComponentImageNodeDiagram.TOP;
|
|
170
|
+
}
|
|
171
|
+
else if('right' === decidedPosition) {
|
|
172
|
+
return ComponentImageNodeDiagram.RIGHT;
|
|
173
|
+
}
|
|
174
|
+
else if('bottom' === decidedPosition) {
|
|
175
|
+
return ComponentImageNodeDiagram.BOTTOM;
|
|
176
|
+
}
|
|
177
|
+
else if('left' === decidedPosition) {
|
|
178
|
+
return ComponentImageNodeDiagram.LEFT;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
return calculatedPosition;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
calculatePosition(connection, fromNode, toNode) {
|
|
186
|
+
const position = {
|
|
187
|
+
from: -1,
|
|
188
|
+
to: -1
|
|
189
|
+
};
|
|
190
|
+
const xDiff = fromNode.xIndex - toNode.xIndex;
|
|
191
|
+
const yDiff = fromNode.yIndex - toNode.yIndex;
|
|
192
|
+
if(xDiff < 0) {
|
|
193
|
+
position.from = this.getPosition(connection.fromPosition, ComponentImageNodeDiagram.RIGHT);
|
|
194
|
+
position.to = this.getPosition(connection.toPosition, ComponentImageNodeDiagram.LEFT);
|
|
195
|
+
}
|
|
196
|
+
else if(xDiff > 0) {
|
|
197
|
+
position.from = this.getPosition(connection.fromPosition, ComponentImageNodeDiagram.LEFT);
|
|
198
|
+
position.to = this.getPosition(connection.toPosition, ComponentImageNodeDiagram.RIGHT);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
if(yDiff < 0) {
|
|
202
|
+
position.from = this.getPosition(connection.fromPosition, ComponentImageNodeDiagram.BOTTOM);
|
|
203
|
+
position.to = this.getPosition(connection.toPosition, ComponentImageNodeDiagram.TOP);
|
|
204
|
+
}
|
|
205
|
+
else if(yDiff > 0) {
|
|
206
|
+
position.from = this.getPosition(connection.fromPosition, ComponentImageNodeDiagram.TOP);
|
|
207
|
+
position.to = this.getPosition(connection.toPosition, ComponentImageNodeDiagram.BOTTOM);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return position;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
calculateTextPoint(outPoint, inPoint) {
|
|
214
|
+
return {
|
|
215
|
+
x: (outPoint.x + inPoint.x) / 2,
|
|
216
|
+
y: (outPoint.y + inPoint.y) / 2 - 2
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
renderConnectionStart(connection, outPoint) {
|
|
221
|
+
return (
|
|
222
|
+
<circle cx={outPoint.x} cy={outPoint.y} r="3"/>
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
renderConnectionEnd(connection, inPoint, position, slope) {
|
|
227
|
+
if(!slope) {
|
|
228
|
+
if(ComponentImageNodeDiagram.TOP === position) {
|
|
229
|
+
return (
|
|
230
|
+
<polygon points={`${inPoint.x}, ${inPoint.y} ${inPoint.x - 3}, ${inPoint.y - 6} ${inPoint.x + 3}, ${inPoint.y - 6}`}/>
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
else if(ComponentImageNodeDiagram.RIGHT === position) {
|
|
234
|
+
return (
|
|
235
|
+
<polygon points={`${inPoint.x}, ${inPoint.y} ${inPoint.x + 6}, ${inPoint.y - 3} ${inPoint.x + 6}, ${inPoint.y + 3}`}/>
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
else if(ComponentImageNodeDiagram.BOTTOM === position) {
|
|
239
|
+
return (
|
|
240
|
+
<polygon points={`${inPoint.x}, ${inPoint.y} ${inPoint.x - 3}, ${inPoint.y + 6} ${inPoint.x + 3}, ${inPoint.y + 6}`}/>
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
else if(ComponentImageNodeDiagram.LEFT === position) {
|
|
244
|
+
return (
|
|
245
|
+
<polygon points={`${inPoint.x}, ${inPoint.y} ${inPoint.x - 6}, ${inPoint.y - 3} ${inPoint.x - 6}, ${inPoint.y + 3}`}/>
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
return (
|
|
251
|
+
<circle cx={inPoint.x} cy={inPoint.y} r="3"/>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
calculateLineConnectingPoints(outPoint, inPoint) {
|
|
257
|
+
const points = [];
|
|
258
|
+
if(undefined !== outPoint && undefined !== inPoint) {
|
|
259
|
+
if(outPoint.x === inPoint.x) {
|
|
260
|
+
if(outPoint.y !== inPoint.y) {
|
|
261
|
+
points.push(outPoint, inPoint);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
else if(outPoint.y === inPoint.y) {
|
|
265
|
+
if(outPoint.x !== inPoint.x) {
|
|
266
|
+
points.push(outPoint, inPoint);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
points.push(outPoint, {x: outPoint.x, y: inPoint.y}, inPoint);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return points;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
calculateLinePoints(point, indexXFrom, indexXTo, indexYFrom, indexYTo, positionFrom, positionTo, config, calculatedConfig, direction) {
|
|
277
|
+
const points = [];
|
|
278
|
+
const hDiff = calculatedConfig.halfNodeHeightBetween / 5;
|
|
279
|
+
const wDiff = calculatedConfig.halfNodeWidthBetween / 5;
|
|
280
|
+
const MoreIndex = [1, 0];
|
|
281
|
+
const LessIndex = [0, 1];
|
|
282
|
+
const MoreH = [hDiff, -hDiff];
|
|
283
|
+
const LessH = [-hDiff, hDiff];
|
|
284
|
+
const MoreW = [-wDiff, wDiff];
|
|
285
|
+
const LessW = [wDiff, -wDiff];
|
|
286
|
+
const h = hDiff;
|
|
287
|
+
const w = wDiff;
|
|
288
|
+
if(ComponentImageNodeDiagram.TOP === positionFrom) {
|
|
289
|
+
if(indexXFrom === indexXTo) {
|
|
290
|
+
if(indexYFrom - 1 === indexYTo && ComponentImageNodeDiagram.BOTTOM === positionTo) {
|
|
291
|
+
points.push(point, {x:point.x, y:point.y - calculatedConfig.halfNodeHeightBetween});
|
|
292
|
+
}
|
|
293
|
+
else if(indexYFrom < indexYTo) {
|
|
294
|
+
points.push(point, {x:point.x, y:point.y - calculatedConfig.halfNodeHeightBetween + h}, {x:config.widthBias + (indexXFrom + LessIndex[direction]) * (config.nodeWidth + config.nodeWidthBetween) - calculatedConfig.halfNodeWidthBetween + LessW[direction], y:point.y - calculatedConfig.halfNodeHeightBetween + MoreH[0]});
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
points.push(point, {x:point.x, y:point.y - calculatedConfig.halfNodeHeightBetween + h}, {x:config.widthBias + (indexXFrom + MoreIndex[direction]) * (config.nodeWidth + config.nodeWidthBetween) - calculatedConfig.halfNodeWidthBetween + MoreW[direction], y:point.y - calculatedConfig.halfNodeHeightBetween + MoreH[0]});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
else if(indexXFrom < indexXTo) {
|
|
301
|
+
points.push(point, {x:point.x, y:point.y - calculatedConfig.halfNodeHeightBetween + h}, {x:config.widthBias + (indexXFrom + 1) * (config.nodeWidth + config.nodeWidthBetween) - calculatedConfig.halfNodeWidthBetween + w, y:point.y - calculatedConfig.halfNodeHeightBetween + h});
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
points.push(point, {x:point.x, y:point.y - calculatedConfig.halfNodeHeightBetween + h}, {x:config.widthBias + indexXFrom * (config.nodeWidth + config.nodeWidthBetween) - calculatedConfig.halfNodeWidthBetween + w, y:point.y - calculatedConfig.halfNodeHeightBetween + h});
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
else if(ComponentImageNodeDiagram.RIGHT === positionFrom) {
|
|
308
|
+
if(indexYFrom === indexYTo) {
|
|
309
|
+
if(indexXFrom + 1 === indexXTo && ComponentImageNodeDiagram.LEFT === positionTo) {
|
|
310
|
+
points.push(point, {x:point.x + calculatedConfig.halfNodeWidthBetween, y:point.y});
|
|
311
|
+
}
|
|
312
|
+
else if(indexXFrom < indexXTo) {
|
|
313
|
+
points.push(point, {x:point.x + calculatedConfig.halfNodeWidthBetween - w, y:point.y}, {x:point.x + calculatedConfig.halfNodeWidthBetween - w, y:config.heightBias + (indexYFrom + LessIndex[direction]) * (config.nodeHeight + config.nodeHeightBetween) - calculatedConfig.halfNodeHeightBetween + MoreH[direction]});
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
points.push(point, {x:point.x + calculatedConfig.halfNodeWidthBetween - w, y:point.y}, {x:point.x + calculatedConfig.halfNodeWidthBetween - w, y:config.heightBias + (indexYFrom + MoreIndex[direction]) * (config.nodeHeight + config.nodeHeightBetween) - calculatedConfig.halfNodeHeightBetween + LessH[direction]});
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
else if(indexYFrom < indexYTo) {
|
|
320
|
+
points.push(point, {x:point.x + calculatedConfig.halfNodeWidthBetween - w, y:point.y}, {x:point.x + calculatedConfig.halfNodeWidthBetween - w, y:config.heightBias + (indexYFrom + 1) * (config.nodeHeight + config.nodeHeightBetween) - calculatedConfig.halfNodeHeightBetween + MoreH[direction]});
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
points.push(point, {x:point.x + calculatedConfig.halfNodeWidthBetween - w, y:point.y}, {x:point.x + calculatedConfig.halfNodeWidthBetween - w, y:config.heightBias + indexYFrom * (config.nodeHeight + config.nodeHeightBetween) - calculatedConfig.halfNodeHeightBetween + LessH[direction]});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
else if(ComponentImageNodeDiagram.BOTTOM === positionFrom) {
|
|
327
|
+
if(indexXFrom === indexXTo) {
|
|
328
|
+
if(indexYFrom + 1 === indexYTo && ComponentImageNodeDiagram.TOP === positionTo) {
|
|
329
|
+
points.push(point, {x:point.x, y:point.y + calculatedConfig.halfNodeHeightBetween});
|
|
330
|
+
}
|
|
331
|
+
else if(indexYFrom < indexYTo) {
|
|
332
|
+
points.push(point, {x:point.x, y:point.y + calculatedConfig.halfNodeHeightBetween - h}, {x:config.widthBias + (indexXFrom + LessIndex[direction]) * (config.nodeWidth + config.nodeWidthBetween) - calculatedConfig.halfNodeWidthBetween + LessW[direction], y:point.y + calculatedConfig.halfNodeHeightBetween - MoreH[0]});
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
points.push(point, {x:point.x, y:point.y + calculatedConfig.halfNodeHeightBetween - h}, {x:config.widthBias + (indexXFrom + MoreIndex[direction]) * (config.nodeWidth + config.nodeWidthBetween) - calculatedConfig.halfNodeWidthBetween + MoreW[direction], y:point.y + calculatedConfig.halfNodeHeightBetween - MoreH[0]});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
else if(indexXFrom < indexXTo) {
|
|
339
|
+
points.push(point, {x:point.x, y:point.y + calculatedConfig.halfNodeHeightBetween - h}, {x:config.widthBias + (indexXFrom + 1) * (config.nodeWidth + config.nodeWidthBetween) - calculatedConfig.halfNodeWidthBetween + w, y:point.y + calculatedConfig.halfNodeHeightBetween - h});
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
points.push(point, {x:point.x, y:point.y + calculatedConfig.halfNodeHeightBetween - h}, {x:config.widthBias + indexXFrom * (config.nodeWidth + config.nodeWidthBetween) - calculatedConfig.halfNodeWidthBetween + w, y:point.y + calculatedConfig.halfNodeHeightBetween - h});
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
else if(ComponentImageNodeDiagram.LEFT === positionFrom) {
|
|
346
|
+
if(indexYFrom === indexYTo) {
|
|
347
|
+
if(indexXFrom - 1 === indexXTo && ComponentImageNodeDiagram.RIGHT === positionTo) {
|
|
348
|
+
points.push(point, {x:point.x - calculatedConfig.halfNodeWidthBetween, y:point.y});
|
|
349
|
+
}
|
|
350
|
+
else if(indexXFrom < indexXTo) {
|
|
351
|
+
points.push(point, {x:point.x - calculatedConfig.halfNodeWidthBetween + w, y:point.y}, {x:point.x - calculatedConfig.halfNodeWidthBetween + w, y:config.heightBias + (indexYFrom + LessIndex[direction]) * (config.nodeHeight + config.nodeHeightBetween) - calculatedConfig.halfNodeHeightBetween + MoreH[direction]});
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
points.push(point, {x:point.x - calculatedConfig.halfNodeWidthBetween + w, y:point.y}, {x:point.x - calculatedConfig.halfNodeWidthBetween + w, y:config.heightBias + (indexYFrom + MoreIndex[direction]) * (config.nodeHeight + config.nodeHeightBetween) - calculatedConfig.halfNodeHeightBetween + LessH[direction]});
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
else if(indexYFrom < indexYTo) {
|
|
358
|
+
points.push(point, {x:point.x - calculatedConfig.halfNodeWidthBetween + w, y:point.y}, {x:point.x - calculatedConfig.halfNodeWidthBetween + w, y:config.heightBias + (indexYFrom + 1) * (config.nodeHeight + config.nodeHeightBetween) - calculatedConfig.halfNodeHeightBetween + MoreH[direction]});
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
points.push(point, {x:point.x - calculatedConfig.halfNodeWidthBetween + w, y:point.y}, {x:point.x - calculatedConfig.halfNodeWidthBetween + w, y:config.heightBias + indexYFrom * (config.nodeHeight + config.nodeHeightBetween) - calculatedConfig.halfNodeHeightBetween + LessH[direction]});
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return points;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
renderNoneSlopeLine(points, type) {
|
|
368
|
+
const lines = [];
|
|
369
|
+
for(let i = 1; i < points.length; ++i) {
|
|
370
|
+
lines.push(<line key={i} className={type} x1={points[i - 1].x} y1={points[i - 1].y} x2={points[i].x} y2= {points[i].y} style={{strokeWidth:2}} />);
|
|
371
|
+
}
|
|
372
|
+
return lines;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
renderNoneSlopeLines(outPoint, inPoint, outXIndex, inXIndex, outYIndex, inYIndex, position, config, calculatedConfig, type) {
|
|
376
|
+
const startPoints = this.calculateLinePoints(outPoint, outXIndex, inXIndex, outYIndex, inYIndex, position.from, position.to, config, calculatedConfig, 1);
|
|
377
|
+
const endPoints = this.calculateLinePoints(inPoint, inXIndex, outXIndex, inYIndex, outYIndex, position.to, position.from, config, calculatedConfig, 0);
|
|
378
|
+
const connectingPoints = this.calculateLineConnectingPoints(startPoints[startPoints.length - 1], endPoints[endPoints.length - 1]);
|
|
379
|
+
return (
|
|
380
|
+
<g>
|
|
381
|
+
{this.renderNoneSlopeLine(startPoints, type)}
|
|
382
|
+
{this.renderNoneSlopeLine(endPoints, type)}
|
|
383
|
+
{this.renderNoneSlopeLine(connectingPoints, type)}
|
|
384
|
+
</g>
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
renderConnection(connection, fromNode, toNode, titleHeight, config, calculatedConfig) {
|
|
389
|
+
const position = this.calculatePosition(connection, fromNode, toNode);
|
|
390
|
+
const currentOut = fromNode.currentOut[position.from]++;
|
|
391
|
+
const currentIn = toNode.currentIn[position.to]++;
|
|
392
|
+
const outPoint = this.calculatePoint(position.from, currentOut, fromNode.out[position.from], fromNode.xIndex, fromNode.yIndex, titleHeight, config, calculatedConfig);
|
|
393
|
+
const inPoint = this.calculatePoint(position.to, currentIn, toNode.in[position.to], toNode.xIndex, toNode.yIndex, titleHeight, config, calculatedConfig);
|
|
394
|
+
const textPoint = this.calculateTextPoint(outPoint, inPoint);
|
|
395
|
+
let type = `seq_dia_protocol_${0 !== connection.type.length ? connection.type : 'unknown'}`;
|
|
396
|
+
if('part' === connection.connectionType || 'part-bi-directional' === connection.connectionType) {
|
|
397
|
+
type += ' seq_message_part';
|
|
398
|
+
}
|
|
399
|
+
let line = <line className={type} x1={outPoint.x} y1={outPoint.y} x2={inPoint.x} y2= {inPoint.y} style={{strokeWidth:2}} />;
|
|
400
|
+
const slope = undefined === connection.slope || true === connection.slope;
|
|
401
|
+
if(!slope) {
|
|
402
|
+
line = this.renderNoneSlopeLines(outPoint, inPoint, fromNode.xIndex, toNode.xIndex, fromNode.yIndex, toNode.yIndex, position, config, calculatedConfig, type);
|
|
403
|
+
}
|
|
404
|
+
return (
|
|
405
|
+
<g key={`key_${fromNode.xIndex}_${fromNode.yIndex}_${toNode.xIndex}_${toNode.yIndex}_${currentIn}_${currentOut}`}>
|
|
406
|
+
{line}
|
|
407
|
+
<text x={textPoint.x} y={textPoint.y} style={{fontSize:'12px',fontWeight:'bold',textAnchor:'middle'}}>
|
|
408
|
+
{connection.data}
|
|
409
|
+
</text>
|
|
410
|
+
{this.renderConnectionStart(connection, outPoint)}
|
|
411
|
+
{this.renderConnectionEnd(connection, inPoint, position.to, slope)}
|
|
412
|
+
</g>
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
renderConnections(connections, nodeMap, titleHeight, config) {
|
|
417
|
+
const halfNodeWidth = config.nodeWidth / 2;
|
|
418
|
+
const halfNodeHeight = config.nodeHeight / 2;
|
|
419
|
+
const halfNodeWidthBetween = config.nodeWidthBetween / 2;
|
|
420
|
+
const halfNodeHeightBetween = config.nodeHeightBetween / 2;
|
|
421
|
+
const calculatedConfig = {
|
|
422
|
+
positionX: [halfNodeWidth, config.nodeWidth, halfNodeWidth, 0],
|
|
423
|
+
positionY: [0, halfNodeHeight, config.nodeHeight, halfNodeHeight],
|
|
424
|
+
halfNodeWidthBetween: halfNodeWidthBetween,
|
|
425
|
+
halfNodeHeightBetween: halfNodeHeightBetween
|
|
426
|
+
};
|
|
427
|
+
connections.forEach((connection) => {
|
|
428
|
+
const fromNode = nodeMap.get(connection.fromNodeName);
|
|
429
|
+
const toNode = nodeMap.get(connection.toNodeName);
|
|
430
|
+
const position = this.calculatePosition(connection, fromNode, toNode);
|
|
431
|
+
++fromNode.out[position.from];
|
|
432
|
+
++toNode.in[position.to];
|
|
433
|
+
});
|
|
434
|
+
return connections.map((connection) => {
|
|
435
|
+
const fromNode = nodeMap.get(connection.fromNodeName);
|
|
436
|
+
const toNode = nodeMap.get(connection.toNodeName);
|
|
437
|
+
return this.renderConnection(connection, fromNode, toNode, titleHeight, config, calculatedConfig);
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
renderXml(xml) {
|
|
442
|
+
return (
|
|
443
|
+
<g dangerouslySetInnerHTML={{__html: xml}} />
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
render() {
|
|
448
|
+
const title = this.props.nodeDiagram.title;
|
|
449
|
+
const nodeRows = this.props.nodeDiagram.nodeRows;
|
|
450
|
+
const connections = this.props.nodeDiagram.connections;
|
|
451
|
+
const config = this.props.nodeDiagram.dataNodeDiagramConfig;
|
|
452
|
+
const groups = this.props.nodeDiagram.groups;
|
|
453
|
+
const xml = this.props.nodeDiagram.xml;
|
|
454
|
+
let columns = 0;
|
|
455
|
+
const nodeMap = new Map();
|
|
456
|
+
nodeRows.forEach((nodes, yIndex) => {
|
|
457
|
+
nodes.forEach((node, xIndex) => {
|
|
458
|
+
nodeMap.set(node.name, {
|
|
459
|
+
xIndex: xIndex,
|
|
460
|
+
yIndex: yIndex,
|
|
461
|
+
in: [0, 0, 0, 0],
|
|
462
|
+
out: [0, 0, 0, 0],
|
|
463
|
+
currentIn: [0, 0, 0, 0],
|
|
464
|
+
currentOut: [0, 0, 0, 0]
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
if(nodes.length > columns) {
|
|
468
|
+
columns = nodes.length;
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
const titleHeight = ('' !== title && undefined !== title) ? ComponentImageNodeDiagram.TITLE_HEIGHT : 0;
|
|
472
|
+
const nodeHeight = config.heightBias + nodeRows.length * config.nodeHeight + (nodeRows.length - 1) * config.nodeHeightBetween;
|
|
473
|
+
const svgHeight = titleHeight + nodeHeight + config.heightBias;
|
|
474
|
+
const svgWidth = 2 * config.widthBias + columns * config.nodeWidth + (columns - 1) * config.nodeWidthBetween;
|
|
475
|
+
const viewBox = [0, 0, svgWidth, svgHeight].join(' ');
|
|
476
|
+
const style = {};
|
|
477
|
+
if(!config.border) {
|
|
478
|
+
style.border = '0px';
|
|
479
|
+
}
|
|
480
|
+
if('default' !== config.backgroundColor) {
|
|
481
|
+
style.backgroundColor = config.backgroundColor;
|
|
482
|
+
}
|
|
483
|
+
return (
|
|
484
|
+
<svg className="markup_node" width={svgWidth} height={svgHeight} viewBox={viewBox} style={style}>
|
|
485
|
+
{this.renderTitle(title, svgWidth / 2)}
|
|
486
|
+
{this.renderGroups(groups, titleHeight, config)}
|
|
487
|
+
{this.renderNodes(nodeRows, titleHeight, config)}
|
|
488
|
+
{this.renderConnections(connections, nodeMap, titleHeight, config)}
|
|
489
|
+
{this.renderXml(xml)}
|
|
490
|
+
</svg>
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
ComponentImageNodeDiagram.TITLE_HEIGHT = 60;
|
|
496
|
+
ComponentImageNodeDiagram.TITLE_FONT_SIZE = 20;
|
|
497
|
+
ComponentImageNodeDiagram.TITLE_TOP = ComponentImageNodeDiagram.TITLE_FONT_SIZE + (ComponentImageNodeDiagram.TITLE_HEIGHT - ComponentImageNodeDiagram.TITLE_FONT_SIZE) / 2;
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
ComponentImageNodeDiagram.TOP = 0;
|
|
501
|
+
ComponentImageNodeDiagram.RIGHT = 1;
|
|
502
|
+
ComponentImageNodeDiagram.BOTTOM = 2;
|
|
503
|
+
ComponentImageNodeDiagram.LEFT = 3;
|
|
504
|
+
|
|
505
|
+
ComponentImageNodeDiagram.TEXT_BIAS_Y = 10;
|
|
506
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
import ReactComponentBase from 'z-abs-corelayer-client/client/react-component/react-component-base';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ComponentImageResult extends ReactComponentBase {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
shouldUpdate(nextProps, nextState) {
|
|
14
|
+
return !this.shallowCompare(this.props, nextProps);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
render() {
|
|
18
|
+
return <div>this.props.values</div>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = ComponentImageResult;
|