@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,389 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
import Link from 'z-abs-complayer-router-client/client/react-component/link';
|
|
5
|
+
import ReactComponentBase from 'z-abs-corelayer-client/client/react-component/react-component-base';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export default class ComponentImageFlowchart extends ReactComponentBase {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
this.BIAS = new Map([
|
|
13
|
+
['decision', {x:30, y:3, textHX:0, textHY:-5, textVX:20, textVY:-5}],
|
|
14
|
+
['action', {x:20, y:-5, textHX:0, textHY:-5, textVX:0, textVY:0}],
|
|
15
|
+
['start', {x:0, y:-5, textHX:0, textHY:-5, textVX:20, textVY:0}],
|
|
16
|
+
['end', {x:0, y:-5, textHX:0, textHY:-5, textVX:20, textVY:0}],
|
|
17
|
+
['connector-end', {x:0, y:-10, textHX:0, textHY:-5, textVX:0, textVY:0}],
|
|
18
|
+
['connector-start', {x:0, y:-10, textHX:0, textHY:-5, textVX:0, textVY:0}]
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
shouldUpdate(nextProps, nextState) {
|
|
23
|
+
return !this.shallowCompare(this.props, nextProps);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
renderTitle(title, x) {
|
|
27
|
+
if(0 !== title) {
|
|
28
|
+
return (
|
|
29
|
+
<text x={x} y={ComponentImageFlowchart.TITLE_TOP} textAnchor="middle" style={{fontSize:ComponentImageFlowchart.TITLE_FONT_SIZE,fontWeight:'bold'}}>
|
|
30
|
+
{title}
|
|
31
|
+
</text>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
calculatePoint(position, block, titleHeight) {
|
|
37
|
+
const left = ComponentImageFlowchart.WIDTH_BIAS + block.xIndex * (ComponentImageFlowchart.WIDTH_BETWEEN_BLOCKS + ComponentImageFlowchart.BLOCK_WIDTH);
|
|
38
|
+
const top = titleHeight + ComponentImageFlowchart.HEIGHT_BIAS + block.yIndex * (ComponentImageFlowchart.BLOCK_HEIGHT + ComponentImageFlowchart.HEIGHT_BETWEEN_BLOCKS);
|
|
39
|
+
const bias = this.BIAS.get(block.type);
|
|
40
|
+
if(ComponentImageFlowchart.RIGHT === position) {
|
|
41
|
+
return {
|
|
42
|
+
x: left + ComponentImageFlowchart.POSITION_X[position] + bias.x,
|
|
43
|
+
y: top + ComponentImageFlowchart.POSITION_Y[position],
|
|
44
|
+
xO: left + ComponentImageFlowchart.POSITION_X[position],
|
|
45
|
+
yO: top + ComponentImageFlowchart.POSITION_Y[position]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if(ComponentImageFlowchart.LEFT === position) {
|
|
49
|
+
return {
|
|
50
|
+
x: left + ComponentImageFlowchart.POSITION_X[position] - bias.x,
|
|
51
|
+
y: top + ComponentImageFlowchart.POSITION_Y[position],
|
|
52
|
+
xO: left + ComponentImageFlowchart.POSITION_X[position],
|
|
53
|
+
yO: top + ComponentImageFlowchart.POSITION_Y[position]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else if(ComponentImageFlowchart.TOP === position) {
|
|
57
|
+
return {
|
|
58
|
+
x: left + ComponentImageFlowchart.POSITION_X[position],
|
|
59
|
+
y: top + ComponentImageFlowchart.POSITION_Y[position] - bias.y,
|
|
60
|
+
xO: left + ComponentImageFlowchart.POSITION_X[position],
|
|
61
|
+
yO: top + ComponentImageFlowchart.POSITION_Y[position]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if(ComponentImageFlowchart.BOTTOM === position) {
|
|
65
|
+
return {
|
|
66
|
+
x: left + ComponentImageFlowchart.POSITION_X[position],
|
|
67
|
+
y: top + ComponentImageFlowchart.POSITION_Y[position] + bias.y,
|
|
68
|
+
xO: left + ComponentImageFlowchart.POSITION_X[position],
|
|
69
|
+
yO: top + ComponentImageFlowchart.POSITION_Y[position]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return {
|
|
74
|
+
x: left + ComponentImageFlowchart.POSITION_X[position],
|
|
75
|
+
y: top + ComponentImageFlowchart.POSITION_Y[position],
|
|
76
|
+
xO: left + ComponentImageFlowchart.POSITION_X[position],
|
|
77
|
+
yO: top + ComponentImageFlowchart.POSITION_Y[position]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
calculatePosition(fromBlock, toBlock) {
|
|
83
|
+
const position = {
|
|
84
|
+
from: -1,
|
|
85
|
+
to: -1,
|
|
86
|
+
direction: -1
|
|
87
|
+
};
|
|
88
|
+
const xDiff = fromBlock.xIndex - toBlock.xIndex;
|
|
89
|
+
const yDiff = fromBlock.yIndex - toBlock.yIndex;
|
|
90
|
+
if(xDiff < 0) {
|
|
91
|
+
if(yDiff < 0) {
|
|
92
|
+
position.from = ComponentImageFlowchart.RIGHT;
|
|
93
|
+
position.to = ComponentImageFlowchart.TOP;
|
|
94
|
+
position.direction = ComponentImageFlowchart.SOUTH;
|
|
95
|
+
}
|
|
96
|
+
else if(yDiff > 0) {
|
|
97
|
+
position.from = ComponentImageFlowchart.RIGHT;
|
|
98
|
+
position.to = ComponentImageFlowchart.BOTTOM;
|
|
99
|
+
position.direction = ComponentImageFlowchart.NORTH;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
position.from = ComponentImageFlowchart.RIGHT;
|
|
103
|
+
position.to = ComponentImageFlowchart.LEFT;
|
|
104
|
+
position.direction = ComponentImageFlowchart.WEST;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else if(xDiff > 0) {
|
|
108
|
+
if(yDiff < 0) {
|
|
109
|
+
position.from = ComponentImageFlowchart.LEFT;
|
|
110
|
+
position.to = ComponentImageFlowchart.TOP;
|
|
111
|
+
position.direction = ComponentImageFlowchart.SOUTH;
|
|
112
|
+
}
|
|
113
|
+
else if(yDiff > 0) {
|
|
114
|
+
position.from = ComponentImageFlowchart.LEFT;
|
|
115
|
+
position.to = ComponentImageFlowchart.BOTTOM;
|
|
116
|
+
position.direction = ComponentImageFlowchart.NORTH;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
position.from = ComponentImageFlowchart.TOP;
|
|
120
|
+
position.to = ComponentImageFlowchart.BOTTOM;
|
|
121
|
+
position.direction = ComponentImageFlowchart.EAST;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
if(yDiff < 0) {
|
|
126
|
+
position.from = ComponentImageFlowchart.BOTTOM;
|
|
127
|
+
position.to = ComponentImageFlowchart.TOP;
|
|
128
|
+
position.direction = ComponentImageFlowchart.SOUTH;
|
|
129
|
+
}
|
|
130
|
+
else if(yDiff > 0) {
|
|
131
|
+
position.from = ComponentImageFlowchart.TOP;
|
|
132
|
+
position.to = ComponentImageFlowchart.BOTTOM;
|
|
133
|
+
position.direction = ComponentImageFlowchart.NORTH;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
position.from = ComponentImageFlowchart.TOP;
|
|
137
|
+
position.to = ComponentImageFlowchart.BOTTOM;
|
|
138
|
+
position.direction = ComponentImageFlowchart.NORTH;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return position;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
calculateTextPoint(outPoint, inPoint) {
|
|
145
|
+
return {
|
|
146
|
+
x: (outPoint.xO + inPoint.xO) / 2,
|
|
147
|
+
y: (outPoint.yO + inPoint.yO) / 2
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
renderArrow(x, y, direction) {
|
|
152
|
+
if(ComponentImageFlowchart.SOUTH === direction) {
|
|
153
|
+
return (<polygon className="" points={`${x+4},${y-8}, ${x-4},${y-8},${x},${y}`} />);
|
|
154
|
+
}
|
|
155
|
+
else if(ComponentImageFlowchart.WEST === direction) {
|
|
156
|
+
return (<polygon className="" points={`${x+8},${y+4}, ${x+8},${y-4},${x},${y}`} />);
|
|
157
|
+
}
|
|
158
|
+
else if(ComponentImageFlowchart.EAST === direction) {
|
|
159
|
+
return (<polygon className="" points={`${x-8},${y+4}, ${x-8},${y-4},${x},${y}`} />);
|
|
160
|
+
}
|
|
161
|
+
else if(ComponentImageFlowchart.NORTH === direction) {
|
|
162
|
+
return (<polygon className="" points={`${x+4},${y+8}, ${x-4},${y+8},${x},${y}`} />);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
renderConnection(connection, fromBlock, toBlock, titleHeight) {
|
|
167
|
+
const position = this.calculatePosition(fromBlock, toBlock);
|
|
168
|
+
const currentOut = fromBlock.currentOut++;
|
|
169
|
+
const currentIn = toBlock.currentIn++;
|
|
170
|
+
const outPoint = this.calculatePoint(position.from, fromBlock, titleHeight);
|
|
171
|
+
const inPoint = this.calculatePoint(position.to, toBlock, titleHeight);
|
|
172
|
+
let type = `flowchart_line_${connection.type}`;
|
|
173
|
+
if('part' === connection.connectionType || 'part-bi-directional' === connection.connectionType) {
|
|
174
|
+
type += ' seq_message_part';
|
|
175
|
+
}
|
|
176
|
+
const bias = this.BIAS.get(fromBlock.type);
|
|
177
|
+
if(outPoint.x === inPoint.x) {
|
|
178
|
+
const textPoint = this.calculateTextPoint(outPoint, inPoint);
|
|
179
|
+
return (
|
|
180
|
+
<g key={`key_${fromBlock.xIndex}_${fromBlock.xIndex}_${toBlock.yIndex}_${toBlock.yIndex}_${currentOut}_${currentIn}`}>
|
|
181
|
+
<line className={type} x1={outPoint.x} y1={outPoint.y} x2={inPoint.x} y2= {inPoint.y} style={{strokeWidth:2}} />
|
|
182
|
+
{this.renderArrow(inPoint.x, inPoint.y, position.direction)}
|
|
183
|
+
<text x={textPoint.x + bias.textVX} y={textPoint.y + bias.textVY} style={{fontSize:'12px',fontWeight:'bold',textAnchor:'middle'}}>
|
|
184
|
+
{connection.data}
|
|
185
|
+
</text>
|
|
186
|
+
</g>
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
const textPoint = this.calculateTextPoint(outPoint, {xO:inPoint.xO, yO:outPoint.yO});
|
|
191
|
+
return (
|
|
192
|
+
<g key={`key_${fromBlock.xIndex}_${fromBlock.xIndex}_${toBlock.yIndex}_${toBlock.yIndex}_${currentOut}_${currentIn}`}>
|
|
193
|
+
<line className={type} x1={outPoint.x} y1={outPoint.y} x2={inPoint.x} y2= {outPoint.y} style={{strokeWidth:2}} />
|
|
194
|
+
<line className={type} x1={inPoint.x} y1={outPoint.y} x2={inPoint.x} y2= {inPoint.y} style={{strokeWidth:2}} />
|
|
195
|
+
{this.renderArrow(inPoint.x, inPoint.y, position.direction)}
|
|
196
|
+
<text x={textPoint.x + bias.textHX} y={textPoint.y + bias.textHY} style={{fontSize:'12px',fontWeight:'bold',textAnchor:'middle'}}>
|
|
197
|
+
{connection.data}
|
|
198
|
+
</text>
|
|
199
|
+
</g>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
renderConnections(connections, blockMap, titleHeight) {
|
|
205
|
+
return connections.map((connection) => {
|
|
206
|
+
if('' !== connection.fromBlockName && '' !== connection.toBlockName) {
|
|
207
|
+
const fromBlock = blockMap.get(connection.fromBlockName);
|
|
208
|
+
const toBlock = blockMap.get(connection.toBlockName);
|
|
209
|
+
return this.renderConnection(connection, fromBlock, toBlock, titleHeight);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
renderStartEnd(block, titleHeight, text) {
|
|
215
|
+
const bias = this.BIAS.get(block.type);
|
|
216
|
+
const left = ComponentImageFlowchart.WIDTH_BIAS + block.xIndex * (ComponentImageFlowchart.WIDTH_BETWEEN_BLOCKS + ComponentImageFlowchart.BLOCK_WIDTH);
|
|
217
|
+
const top = titleHeight + ComponentImageFlowchart.HEIGHT_BIAS + block.yIndex * (ComponentImageFlowchart.BLOCK_HEIGHT + ComponentImageFlowchart.HEIGHT_BETWEEN_BLOCKS);
|
|
218
|
+
return (
|
|
219
|
+
<g key={`block_${block.xIndex}_${block.yIndex}`}>
|
|
220
|
+
<rect className="flowchart_block_start_end" x={left - bias.x} y={top - bias.y} rx={ComponentImageFlowchart.BLOCK_HEIGHT_HALF} ry={ComponentImageFlowchart.BLOCK_HEIGHT_HALF} width={ComponentImageFlowchart.BLOCK_WIDTH + bias.x + bias.x} height={ComponentImageFlowchart.BLOCK_HEIGHT + bias.y + bias.y} style={block.css ? {fill: block.css} : {}} />
|
|
221
|
+
<text x={left + ComponentImageFlowchart.BLOCK_WIDTH_HALF} y={top + ComponentImageFlowchart.BLOCK_HEIGHT_HALF + 4} style={{fontSize:'10px',fontWeight:'bold',textAnchor:'middle'}}>
|
|
222
|
+
{block.data ? block.data : text}
|
|
223
|
+
</text>
|
|
224
|
+
</g>
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
renderDecision(block, titleHeight) {
|
|
229
|
+
const bias = this.BIAS.get(block.type);
|
|
230
|
+
const left = ComponentImageFlowchart.WIDTH_BIAS + block.xIndex * (ComponentImageFlowchart.WIDTH_BETWEEN_BLOCKS + ComponentImageFlowchart.BLOCK_WIDTH);
|
|
231
|
+
const top = titleHeight + ComponentImageFlowchart.HEIGHT_BIAS + block.yIndex * (ComponentImageFlowchart.BLOCK_HEIGHT + ComponentImageFlowchart.HEIGHT_BETWEEN_BLOCKS);
|
|
232
|
+
return (
|
|
233
|
+
<g key={`block_${block.xIndex}_${block.yIndex}`}>
|
|
234
|
+
<polygon className="flowchart_block_decision" points={`${left - bias.x},${top + ComponentImageFlowchart.BLOCK_HEIGHT_HALF}, ${left + ComponentImageFlowchart.BLOCK_WIDTH_HALF},${top - bias.y} ${left + bias.x + ComponentImageFlowchart.BLOCK_WIDTH},${top + ComponentImageFlowchart.BLOCK_HEIGHT_HALF}, ${left + ComponentImageFlowchart.BLOCK_WIDTH_HALF},${top + bias.y + ComponentImageFlowchart.BLOCK_HEIGHT}`} style={block.css ? {fill: block.css} : {}} />
|
|
235
|
+
<text x={left + ComponentImageFlowchart.BLOCK_WIDTH_HALF} y={top + ComponentImageFlowchart.BLOCK_HEIGHT_HALF + 4} style={{fontSize:'10px',fontWeight:'bold',textAnchor:'middle'}}>
|
|
236
|
+
{block.data ? block.data : ''}
|
|
237
|
+
</text>
|
|
238
|
+
</g>
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
renderActionBlockInnerText(left, top, block, inner = false) {
|
|
243
|
+
return (
|
|
244
|
+
<text className={!inner ? 'flowchart_block_action_text' : ''} x={left + ComponentImageFlowchart.BLOCK_WIDTH_HALF} y={top + ComponentImageFlowchart.BLOCK_HEIGHT_HALF + 4}>
|
|
245
|
+
{block.data ? block.data : ''}
|
|
246
|
+
</text>
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
renderActionBlockText(left, top, block) {
|
|
251
|
+
if(undefined === block.link || '' === block.link) {
|
|
252
|
+
return this.renderActionBlockInnerText(left, top, block);
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
return (
|
|
256
|
+
<Link className="flowchart_block_action_text" href={block.link}>
|
|
257
|
+
{this.renderActionBlockInnerText(left, top, block, true)}
|
|
258
|
+
</Link>
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
renderActionBlock(block, titleHeight) {
|
|
264
|
+
const bias = this.BIAS.get(block.type);
|
|
265
|
+
const left = ComponentImageFlowchart.WIDTH_BIAS + block.xIndex * (ComponentImageFlowchart.WIDTH_BETWEEN_BLOCKS + ComponentImageFlowchart.BLOCK_WIDTH);
|
|
266
|
+
const top = titleHeight + ComponentImageFlowchart.HEIGHT_BIAS + block.yIndex * (ComponentImageFlowchart.BLOCK_HEIGHT + ComponentImageFlowchart.HEIGHT_BETWEEN_BLOCKS);
|
|
267
|
+
return (
|
|
268
|
+
<g key={`block_${block.xIndex}_${block.yIndex}`}>
|
|
269
|
+
<rect className="flowchart_block_action" x={left - bias.x} y={top - bias.y} rx="2" ry="2" width={ComponentImageFlowchart.BLOCK_WIDTH + bias.x + bias.x} height={ComponentImageFlowchart.BLOCK_HEIGHT + bias.y + bias.y} style={block.css ? {fill: block.css} : {}} />
|
|
270
|
+
{this.renderActionBlockText(left, top, block)}
|
|
271
|
+
</g>
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
renderConnector(block, titleHeight) {
|
|
276
|
+
const bias = this.BIAS.get(block.type);
|
|
277
|
+
const left = ComponentImageFlowchart.WIDTH_BIAS + block.xIndex * (ComponentImageFlowchart.WIDTH_BETWEEN_BLOCKS + ComponentImageFlowchart.BLOCK_WIDTH);
|
|
278
|
+
const top = titleHeight + ComponentImageFlowchart.HEIGHT_BIAS + block.yIndex * (ComponentImageFlowchart.BLOCK_HEIGHT + ComponentImageFlowchart.HEIGHT_BETWEEN_BLOCKS);
|
|
279
|
+
return (
|
|
280
|
+
<g key={`block_${block.xIndex}_${block.yIndex}`}>
|
|
281
|
+
<circle className="flowchart_block_connector" cx={left + ComponentImageFlowchart.BLOCK_WIDTH_HALF} cy={top + ComponentImageFlowchart.BLOCK_HEIGHT_HALF} r={ComponentImageFlowchart.BLOCK_HEIGHT_HALF + bias.y} style={block.css ? {fill: block.css} : {}} />
|
|
282
|
+
<text x={left + ComponentImageFlowchart.BLOCK_WIDTH_HALF} y={top + ComponentImageFlowchart.BLOCK_HEIGHT_HALF + 4} style={{fontSize:'10px',fontWeight:'bold',textAnchor:'middle'}}>
|
|
283
|
+
{block.data ? block.data : ''}
|
|
284
|
+
</text>
|
|
285
|
+
</g>
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
renderBlock(block, titleHeight) {
|
|
290
|
+
if('' === block.name) {
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
|
+
if(undefined !== block.type) {
|
|
294
|
+
switch(block.type.toLowerCase()) {
|
|
295
|
+
case 'decision':
|
|
296
|
+
return this.renderDecision(block, titleHeight);
|
|
297
|
+
case 'action':
|
|
298
|
+
return this.renderActionBlock(block, titleHeight);
|
|
299
|
+
case 'start':
|
|
300
|
+
return this.renderStartEnd(block, titleHeight, 'Start');
|
|
301
|
+
case 'end':
|
|
302
|
+
return this.renderStartEnd(block, titleHeight, 'End');
|
|
303
|
+
case 'connector-end':
|
|
304
|
+
return this.renderConnector(block, titleHeight);
|
|
305
|
+
case 'connector-start':
|
|
306
|
+
return this.renderConnector(block, titleHeight);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
return this.renderActionBlock(block, titleHeight);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
renderBlocks(blockRows, titleHeight) {
|
|
315
|
+
const svgBlocks = blockRows.map((blocks, yIndex) => {
|
|
316
|
+
return blocks.map((block, xIndex) => {
|
|
317
|
+
return this.renderBlock(block, titleHeight);
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
return (
|
|
321
|
+
<g>
|
|
322
|
+
{svgBlocks}
|
|
323
|
+
</g>
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
render() {
|
|
328
|
+
const title = this.props.flowchart.title;
|
|
329
|
+
const blockRows = this.props.flowchart.blockRows;
|
|
330
|
+
const connections = this.props.flowchart.connections;
|
|
331
|
+
let columns = 0;
|
|
332
|
+
const blockMap = new Map();
|
|
333
|
+
blockRows.forEach((blocks, yIndex) => {
|
|
334
|
+
blocks.forEach((block, xIndex) => {
|
|
335
|
+
blockMap.set(block.name, {
|
|
336
|
+
xIndex: xIndex,
|
|
337
|
+
yIndex: yIndex,
|
|
338
|
+
in: block.in,
|
|
339
|
+
out: block.out,
|
|
340
|
+
currentIn: 0,
|
|
341
|
+
currentOut: 0,
|
|
342
|
+
type: block.type
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
if(blocks.length > columns) {
|
|
346
|
+
columns = blocks.length;
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
const titleHeight = ('' !== title && undefined !== title) ? ComponentImageFlowchart.TITLE_HEIGHT : 0;
|
|
350
|
+
const blockHeight = ComponentImageFlowchart.HEIGHT_BIAS + blockRows.length * ComponentImageFlowchart.BLOCK_HEIGHT + (blockRows.length - 1) * ComponentImageFlowchart.HEIGHT_BETWEEN_BLOCKS;
|
|
351
|
+
const svgHeight = titleHeight + blockHeight + ComponentImageFlowchart.HEIGHT_BIAS;
|
|
352
|
+
const svgWidth = 2 * ComponentImageFlowchart.WIDTH_BIAS + columns * ComponentImageFlowchart.BLOCK_WIDTH + (columns - 1) * ComponentImageFlowchart.WIDTH_BETWEEN_BLOCKS;
|
|
353
|
+
const viewBox = [0, 0, svgWidth, svgHeight].join(' ');
|
|
354
|
+
return (
|
|
355
|
+
<svg className="markup_flow" width={svgWidth} height={svgHeight} viewBox={viewBox}>
|
|
356
|
+
{this.renderTitle(title, svgWidth / 2)}
|
|
357
|
+
{this.renderBlocks(blockRows, titleHeight)}
|
|
358
|
+
{this.renderConnections(connections, blockMap, titleHeight)}
|
|
359
|
+
</svg>
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
ComponentImageFlowchart.TITLE_HEIGHT = 40;
|
|
365
|
+
ComponentImageFlowchart.TITLE_FONT_SIZE = 20;
|
|
366
|
+
ComponentImageFlowchart.TITLE_TOP = ComponentImageFlowchart.TITLE_FONT_SIZE + (ComponentImageFlowchart.TITLE_HEIGHT - ComponentImageFlowchart.TITLE_FONT_SIZE) / 2;
|
|
367
|
+
ComponentImageFlowchart.WIDTH_BIAS = 30;
|
|
368
|
+
ComponentImageFlowchart.HEIGHT_BIAS = 10;
|
|
369
|
+
ComponentImageFlowchart.BLOCK_HEIGHT = 40;
|
|
370
|
+
ComponentImageFlowchart.BLOCK_HEIGHT_HALF = ComponentImageFlowchart.BLOCK_HEIGHT / 2;
|
|
371
|
+
ComponentImageFlowchart.HEIGHT_BETWEEN_BLOCKS = -ComponentImageFlowchart.BLOCK_HEIGHT_HALF + 15;
|
|
372
|
+
ComponentImageFlowchart.BLOCK_WIDTH = 80;
|
|
373
|
+
ComponentImageFlowchart.BLOCK_WIDTH_HALF = ComponentImageFlowchart.BLOCK_WIDTH / 2;
|
|
374
|
+
ComponentImageFlowchart.WIDTH_BETWEEN_BLOCKS = ComponentImageFlowchart.BLOCK_WIDTH;
|
|
375
|
+
|
|
376
|
+
ComponentImageFlowchart.TOP = 0;
|
|
377
|
+
ComponentImageFlowchart.RIGHT = 1;
|
|
378
|
+
ComponentImageFlowchart.BOTTOM = 2;
|
|
379
|
+
ComponentImageFlowchart.LEFT = 3;
|
|
380
|
+
ComponentImageFlowchart.POSITION_X = [ComponentImageFlowchart.BLOCK_WIDTH_HALF, ComponentImageFlowchart.BLOCK_WIDTH, ComponentImageFlowchart.BLOCK_WIDTH_HALF, 0];
|
|
381
|
+
ComponentImageFlowchart.POSITION_Y = [0, ComponentImageFlowchart.BLOCK_HEIGHT_HALF, ComponentImageFlowchart.BLOCK_HEIGHT, ComponentImageFlowchart.BLOCK_HEIGHT_HALF];
|
|
382
|
+
|
|
383
|
+
ComponentImageFlowchart.NORTH = 0;
|
|
384
|
+
ComponentImageFlowchart.EAST = 1;
|
|
385
|
+
ComponentImageFlowchart.SOUTH = 2;
|
|
386
|
+
ComponentImageFlowchart.WEST = 3;
|
|
387
|
+
|
|
388
|
+
ComponentImageFlowchart.TEXT_BIAS_Y = 10;
|
|
389
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
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 ComponentImageImage 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
|
+
const keys = Object.keys(this.props.data);
|
|
19
|
+
const style = {};
|
|
20
|
+
keys.forEach((key) => {
|
|
21
|
+
if('src' !== key) {
|
|
22
|
+
style[key] = this.props.data[key];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return (
|
|
26
|
+
<img className="markup_image" src={this.props.data.src} style={style}
|
|
27
|
+
onClick={(e) => {
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|