pict-section-flow 1.4.0 → 2.0.1
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/package.json +7 -2
- package/source/Pict-Section-Flow.js +20 -14
- package/source/providers/PictProvider-Flow-Background.js +303 -0
- package/source/providers/PictProvider-Flow-CSS.js +73 -7
- package/source/providers/PictProvider-Flow-Geometry.js +11 -421
- package/source/providers/PictProvider-Flow-Icons.js +12 -0
- package/source/providers/PictProvider-Flow-Layouts.js +107 -0
- package/source/services/PictService-Flow-ConnectionRenderer.js +1 -1
- package/source/services/PictService-Flow-CursorManager.js +113 -0
- package/source/services/PictService-Flow-InteractionManager.js +439 -59
- package/source/services/PictService-Flow-Layout.js +21 -16
- package/source/services/PictService-Flow-PathGenerator.js +30 -417
- package/source/services/PictService-Flow-RenderManager.js +23 -3
- package/source/services/PictService-Flow-ViewportManager.js +102 -0
- package/source/views/PictView-Flow-FloatingToolbar.js +5 -1
- package/source/views/PictView-Flow-Node.js +29 -0
- package/source/views/PictView-Flow-Toolbar.js +50 -3
- package/source/views/PictView-Flow.js +591 -2
- package/.claude/launch.json +0 -11
- package/docs/.nojekyll +0 -0
- package/docs/Architecture.md +0 -163
- package/docs/Custom-Styling.md +0 -275
- package/docs/Data_Model.md +0 -149
- package/docs/Event_System.md +0 -156
- package/docs/Getting_Started.md +0 -237
- package/docs/Implementation_Reference.md +0 -528
- package/docs/Layout_Persistence.md +0 -117
- package/docs/README.md +0 -103
- package/docs/Theme_Integration.md +0 -150
- package/docs/_brand.json +0 -18
- package/docs/_cover.md +0 -17
- package/docs/_playground.json +0 -24
- package/docs/_sidebar.md +0 -57
- package/docs/_topbar.md +0 -8
- package/docs/_version.json +0 -7
- package/docs/api/PictFlowCard.md +0 -216
- package/docs/api/PictFlowCardPropertiesPanel.md +0 -235
- package/docs/api/addConnection.md +0 -101
- package/docs/api/addNode.md +0 -137
- package/docs/api/autoLayout.md +0 -77
- package/docs/api/getFlowData.md +0 -112
- package/docs/api/marshalToView.md +0 -95
- package/docs/api/openPanel.md +0 -128
- package/docs/api/registerHandler.md +0 -174
- package/docs/api/registerNodeType.md +0 -142
- package/docs/api/removeConnection.md +0 -57
- package/docs/api/removeNode.md +0 -80
- package/docs/api/saveLayout.md +0 -152
- package/docs/api/screenToSVGCoords.md +0 -68
- package/docs/api/selectNode.md +0 -116
- package/docs/api/setTheme.md +0 -168
- package/docs/api/setZoom.md +0 -97
- package/docs/api/toggleFullscreen.md +0 -68
- package/docs/card-help/EACH.md +0 -19
- package/docs/card-help/FREAD.md +0 -24
- package/docs/card-help/FWRITE.md +0 -24
- package/docs/card-help/GET.md +0 -22
- package/docs/card-help/ITE.md +0 -23
- package/docs/card-help/LOG.md +0 -23
- package/docs/card-help/NOTE.md +0 -17
- package/docs/card-help/PREV.md +0 -18
- package/docs/card-help/SET.md +0 -27
- package/docs/card-help/SPKL.md +0 -22
- package/docs/card-help/STAT.md +0 -23
- package/docs/card-help/SW.md +0 -25
- package/docs/diagrams/architecture-at-a-glance.excalidraw +0 -4270
- package/docs/diagrams/architecture-at-a-glance.mmd +0 -30
- package/docs/diagrams/architecture-at-a-glance.svg +0 -2
- package/docs/diagrams/data-flow.excalidraw +0 -1451
- package/docs/diagrams/data-flow.mmd +0 -17
- package/docs/diagrams/data-flow.svg +0 -2
- package/docs/diagrams/high-level-design.excalidraw +0 -5767
- package/docs/diagrams/high-level-design.mmd +0 -86
- package/docs/diagrams/high-level-design.svg +0 -2
- package/docs/diagrams/relationships.excalidraw +0 -3852
- package/docs/diagrams/relationships.mmd +0 -9
- package/docs/diagrams/relationships.svg +0 -2
- package/docs/diagrams/service-initialization-sequence.excalidraw +0 -1466
- package/docs/diagrams/service-initialization-sequence.mmd +0 -19
- package/docs/diagrams/service-initialization-sequence.svg +0 -2
- package/docs/diagrams/svg-layer-structure.excalidraw +0 -1060
- package/docs/diagrams/svg-layer-structure.mmd +0 -18
- package/docs/diagrams/svg-layer-structure.svg +0 -2
- package/docs/examples/README.md +0 -9
- package/docs/examples/simple_cards/README.md +0 -677
- package/docs/examples/simple_cards/css/flowexample.css +0 -65
- package/docs/examples/simple_cards/index.html +0 -32
- package/docs/examples/simple_cards/js/pict.min.js +0 -12
- package/docs/examples/simple_cards/pict-section-flow-example-simple-cards.compatible.min.js +0 -1
- package/docs/index.html +0 -38
- package/docs/playground/app.json +0 -6
- package/docs/playground/appdata.json +0 -85
- package/docs/playground/application.js +0 -23
- package/docs/playground/pict.json +0 -17
- package/docs/playground/runtime/pict-application.min.js +0 -2
- package/docs/playground/runtime/pict-section-flow.min.js +0 -2
- package/docs/playground/runtime/pict-section-modal.min.js +0 -2
- package/docs/playground/runtime/pict.min.js +0 -12
- package/docs/retold-catalog.json +0 -244
- package/docs/retold-keyword-index.json +0 -26028
- package/example_applications/simple_cards/css/flowexample.css +0 -65
- package/example_applications/simple_cards/html/index.html +0 -32
- package/example_applications/simple_cards/package.json +0 -52
- package/example_applications/simple_cards/source/Pict-Application-FlowExample-Configuration.json +0 -15
- package/example_applications/simple_cards/source/Pict-Application-FlowExample.js +0 -539
- package/example_applications/simple_cards/source/card-help-content.js +0 -16
- package/example_applications/simple_cards/source/cards/FlowCard-Comment.js +0 -38
- package/example_applications/simple_cards/source/cards/FlowCard-DataPreview.js +0 -44
- package/example_applications/simple_cards/source/cards/FlowCard-Each.js +0 -38
- package/example_applications/simple_cards/source/cards/FlowCard-FileRead.js +0 -56
- package/example_applications/simple_cards/source/cards/FlowCard-FileWrite.js +0 -50
- package/example_applications/simple_cards/source/cards/FlowCard-GetValue.js +0 -37
- package/example_applications/simple_cards/source/cards/FlowCard-IfThenElse.js +0 -49
- package/example_applications/simple_cards/source/cards/FlowCard-LogValues.js +0 -55
- package/example_applications/simple_cards/source/cards/FlowCard-SetValue.js +0 -97
- package/example_applications/simple_cards/source/cards/FlowCard-Sparkline.js +0 -100
- package/example_applications/simple_cards/source/cards/FlowCard-StatusMonitor.js +0 -46
- package/example_applications/simple_cards/source/cards/FlowCard-Switch.js +0 -39
- package/example_applications/simple_cards/source/providers/PictRouter-FlowExample-Configuration.json +0 -22
- package/example_applications/simple_cards/source/sample-flows.js +0 -410
- package/example_applications/simple_cards/source/views/PictView-FlowExample-About.js +0 -184
- package/example_applications/simple_cards/source/views/PictView-FlowExample-BottomBar.js +0 -77
- package/example_applications/simple_cards/source/views/PictView-FlowExample-Documentation.js +0 -325
- package/example_applications/simple_cards/source/views/PictView-FlowExample-FileWriteInfo.js +0 -59
- package/example_applications/simple_cards/source/views/PictView-FlowExample-Layout.js +0 -90
- package/example_applications/simple_cards/source/views/PictView-FlowExample-MainWorkspace.js +0 -453
- package/example_applications/simple_cards/source/views/PictView-FlowExample-TopBar.js +0 -95
- package/scripts/generate-card-help.js +0 -214
- package/source/providers/edges/Edge-Bezier.js +0 -41
- package/source/providers/edges/Edge-Orthogonal.js +0 -37
- package/source/providers/edges/Edge-OrthogonalSnap.js +0 -72
- package/source/providers/edges/Edge-Perimeter-Linear.js +0 -31
- package/source/providers/edges/Edge-Perimeter-Orthogonal.js +0 -39
- package/source/providers/edges/Edge-Perimeter.js +0 -48
- package/source/providers/edges/Edge-PerimeterMath.js +0 -92
- package/source/providers/edges/Edge-Straight.js +0 -24
- package/source/providers/layouts/Layout-Circular.js +0 -203
- package/source/providers/layouts/Layout-Coerce.js +0 -40
- package/source/providers/layouts/Layout-Columnar.js +0 -134
- package/source/providers/layouts/Layout-Custom.js +0 -27
- package/source/providers/layouts/Layout-ForcedFromCenter.js +0 -256
- package/source/providers/layouts/Layout-Grid.js +0 -134
- package/source/providers/layouts/Layout-Layered.js +0 -155
- package/source/providers/layouts/Layout-Rank.js +0 -141
- package/source/providers/layouts/Layout-Staggered.js +0 -131
- package/source/providers/layouts/Layout-Tabular.js +0 -94
- package/test/CardPalette_tests.js +0 -43
- package/test/ConnectionHandleManager_tests.js +0 -717
- package/test/ConnectionRenderer_tests.js +0 -591
- package/test/ConnectionStyle_tests.js +0 -90
- package/test/DataManager_tests.js +0 -859
- package/test/Geometry_tests.js +0 -767
- package/test/InteractionManager_tests.js +0 -279
- package/test/Layout_tests.js +0 -1604
- package/test/NodeView_tests.js +0 -66
- package/test/PanelManager_tests.js +0 -172
- package/test/PathGenerator_tests.js +0 -978
- package/test/PortRenderer_tests.js +0 -376
- package/test/RenderManager_tests.js +0 -756
- package/test/Renderer_tests.js +0 -133
- package/test/SelectionManager_tests.js +0 -185
- package/test/StylePresets_tests.js +0 -153
- package/test/ToolbarExtraButtons_tests.js +0 -138
- package/test/UndirectedConnections_tests.js +0 -70
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
const libFable = require('fable');
|
|
2
|
-
const libChai = require('chai');
|
|
3
|
-
const libExpect = libChai.expect;
|
|
4
|
-
|
|
5
|
-
const libPortRenderer = require('../source/services/PictService-Flow-PortRenderer.js');
|
|
6
|
-
const libGeometry = require('../source/providers/PictProvider-Flow-Geometry.js');
|
|
7
|
-
|
|
8
|
-
suite
|
|
9
|
-
(
|
|
10
|
-
'PictService-Flow-PortRenderer',
|
|
11
|
-
function ()
|
|
12
|
-
{
|
|
13
|
-
let _Fable;
|
|
14
|
-
let _PortRenderer;
|
|
15
|
-
let _GeometryProvider;
|
|
16
|
-
let _MockFlowView;
|
|
17
|
-
|
|
18
|
-
// Simple mock SVG element for testing
|
|
19
|
-
function createMockSVGElement()
|
|
20
|
-
{
|
|
21
|
-
let tmpSelf =
|
|
22
|
-
{
|
|
23
|
-
_tag: '',
|
|
24
|
-
_attrs: {},
|
|
25
|
-
_children: [],
|
|
26
|
-
textContent: '',
|
|
27
|
-
setAttribute: function (pKey, pVal)
|
|
28
|
-
{
|
|
29
|
-
tmpSelf._attrs[pKey] = pVal;
|
|
30
|
-
},
|
|
31
|
-
getAttribute: function (pKey)
|
|
32
|
-
{
|
|
33
|
-
return tmpSelf._attrs[pKey] || null;
|
|
34
|
-
},
|
|
35
|
-
appendChild: function (pChild)
|
|
36
|
-
{
|
|
37
|
-
tmpSelf._children.push(pChild);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
return tmpSelf;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
setup
|
|
44
|
-
(
|
|
45
|
-
function ()
|
|
46
|
-
{
|
|
47
|
-
_Fable = new libFable({});
|
|
48
|
-
|
|
49
|
-
_GeometryProvider = new libGeometry(_Fable, {}, 'Geometry-Test');
|
|
50
|
-
|
|
51
|
-
_MockFlowView =
|
|
52
|
-
{
|
|
53
|
-
_GeometryProvider: _GeometryProvider,
|
|
54
|
-
_ConnectorShapesProvider: null,
|
|
55
|
-
_SVGHelperProvider:
|
|
56
|
-
{
|
|
57
|
-
createSVGElement: function (pTag)
|
|
58
|
-
{
|
|
59
|
-
let tmpEl = createMockSVGElement();
|
|
60
|
-
tmpEl._tag = pTag;
|
|
61
|
-
return tmpEl;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
_PortRenderer = new libPortRenderer(
|
|
67
|
-
_Fable, { FlowView: _MockFlowView }, 'PortRend-Test');
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
// ---- Constructor ----
|
|
72
|
-
|
|
73
|
-
suite
|
|
74
|
-
(
|
|
75
|
-
'Constructor',
|
|
76
|
-
function ()
|
|
77
|
-
{
|
|
78
|
-
test
|
|
79
|
-
(
|
|
80
|
-
'should instantiate with correct serviceType',
|
|
81
|
-
function (fDone)
|
|
82
|
-
{
|
|
83
|
-
libExpect(_PortRenderer.serviceType).to.equal('PictServiceFlowPortRenderer');
|
|
84
|
-
fDone();
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
test
|
|
89
|
-
(
|
|
90
|
-
'should store FlowView reference',
|
|
91
|
-
function (fDone)
|
|
92
|
-
{
|
|
93
|
-
libExpect(_PortRenderer._FlowView).to.equal(_MockFlowView);
|
|
94
|
-
fDone();
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
test
|
|
99
|
-
(
|
|
100
|
-
'should handle missing FlowView',
|
|
101
|
-
function (fDone)
|
|
102
|
-
{
|
|
103
|
-
let tmpRenderer = new libPortRenderer(_Fable, {}, 'NoView');
|
|
104
|
-
libExpect(tmpRenderer._FlowView).to.be.null;
|
|
105
|
-
fDone();
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
// ---- renderPorts ----
|
|
112
|
-
|
|
113
|
-
suite
|
|
114
|
-
(
|
|
115
|
-
'renderPorts',
|
|
116
|
-
function ()
|
|
117
|
-
{
|
|
118
|
-
test
|
|
119
|
-
(
|
|
120
|
-
'should render port circles into the group',
|
|
121
|
-
function (fDone)
|
|
122
|
-
{
|
|
123
|
-
let tmpGroup = createMockSVGElement();
|
|
124
|
-
let tmpNodeData =
|
|
125
|
-
{
|
|
126
|
-
Hash: 'node-1',
|
|
127
|
-
Ports:
|
|
128
|
-
[
|
|
129
|
-
{ Hash: 'p1', Direction: 'input', Label: null },
|
|
130
|
-
{ Hash: 'p2', Direction: 'output', Label: null }
|
|
131
|
-
]
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
_PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
|
|
135
|
-
|
|
136
|
-
// Should have appended port circle elements
|
|
137
|
-
libExpect(tmpGroup._children.length).to.be.at.least(2);
|
|
138
|
-
|
|
139
|
-
// Verify at least one circle element was created
|
|
140
|
-
let tmpCircles = tmpGroup._children.filter(function (pChild)
|
|
141
|
-
{
|
|
142
|
-
return pChild._tag === 'circle';
|
|
143
|
-
});
|
|
144
|
-
libExpect(tmpCircles.length).to.equal(2);
|
|
145
|
-
fDone();
|
|
146
|
-
}
|
|
147
|
-
);
|
|
148
|
-
|
|
149
|
-
test
|
|
150
|
-
(
|
|
151
|
-
'should render port labels when Label is set',
|
|
152
|
-
function (fDone)
|
|
153
|
-
{
|
|
154
|
-
let tmpGroup = createMockSVGElement();
|
|
155
|
-
let tmpNodeData =
|
|
156
|
-
{
|
|
157
|
-
Hash: 'node-2',
|
|
158
|
-
Ports:
|
|
159
|
-
[
|
|
160
|
-
{ Hash: 'p1', Direction: 'input', Label: 'Trigger' }
|
|
161
|
-
]
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
_PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
|
|
165
|
-
|
|
166
|
-
// Direct children: badge wrapper <g> (containing bg + border + stripe),
|
|
167
|
-
// port circle, text label = 3 elements.
|
|
168
|
-
libExpect(tmpGroup._children.length).to.equal(3);
|
|
169
|
-
|
|
170
|
-
// The badge wrapper itself contains the 3 sub-elements.
|
|
171
|
-
let tmpBadgeGroups = tmpGroup._children.filter(function (pChild)
|
|
172
|
-
{
|
|
173
|
-
return pChild._tag === 'g';
|
|
174
|
-
});
|
|
175
|
-
libExpect(tmpBadgeGroups.length).to.equal(1);
|
|
176
|
-
libExpect(tmpBadgeGroups[0]._children.length).to.equal(3);
|
|
177
|
-
|
|
178
|
-
// Verify text element exists with correct content
|
|
179
|
-
let tmpTextEls = tmpGroup._children.filter(function (pChild)
|
|
180
|
-
{
|
|
181
|
-
return pChild._tag === 'text';
|
|
182
|
-
});
|
|
183
|
-
libExpect(tmpTextEls.length).to.equal(1);
|
|
184
|
-
libExpect(tmpTextEls[0].textContent).to.equal('Trigger');
|
|
185
|
-
fDone();
|
|
186
|
-
}
|
|
187
|
-
);
|
|
188
|
-
|
|
189
|
-
test
|
|
190
|
-
(
|
|
191
|
-
'should do nothing for empty ports array',
|
|
192
|
-
function (fDone)
|
|
193
|
-
{
|
|
194
|
-
let tmpGroup = createMockSVGElement();
|
|
195
|
-
let tmpNodeData = { Hash: 'node-3', Ports: [] };
|
|
196
|
-
|
|
197
|
-
_PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
|
|
198
|
-
|
|
199
|
-
libExpect(tmpGroup._children.length).to.equal(0);
|
|
200
|
-
fDone();
|
|
201
|
-
}
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
test
|
|
205
|
-
(
|
|
206
|
-
'should do nothing when Ports is missing',
|
|
207
|
-
function (fDone)
|
|
208
|
-
{
|
|
209
|
-
let tmpGroup = createMockSVGElement();
|
|
210
|
-
let tmpNodeData = { Hash: 'node-4' };
|
|
211
|
-
|
|
212
|
-
_PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
|
|
213
|
-
|
|
214
|
-
libExpect(tmpGroup._children.length).to.equal(0);
|
|
215
|
-
fDone();
|
|
216
|
-
}
|
|
217
|
-
);
|
|
218
|
-
|
|
219
|
-
test
|
|
220
|
-
(
|
|
221
|
-
'should do nothing when no FlowView',
|
|
222
|
-
function (fDone)
|
|
223
|
-
{
|
|
224
|
-
let tmpRenderer = new libPortRenderer(_Fable, {}, 'NoView');
|
|
225
|
-
let tmpGroup = createMockSVGElement();
|
|
226
|
-
let tmpNodeData =
|
|
227
|
-
{
|
|
228
|
-
Hash: 'node-5',
|
|
229
|
-
Ports: [{ Hash: 'p1', Direction: 'input' }]
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
tmpRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
|
|
233
|
-
libExpect(tmpGroup._children.length).to.equal(0);
|
|
234
|
-
fDone();
|
|
235
|
-
}
|
|
236
|
-
);
|
|
237
|
-
|
|
238
|
-
test
|
|
239
|
-
(
|
|
240
|
-
'should use ConnectorShapesProvider when available',
|
|
241
|
-
function (fDone)
|
|
242
|
-
{
|
|
243
|
-
let tmpCreatePortCalled = false;
|
|
244
|
-
_MockFlowView._ConnectorShapesProvider =
|
|
245
|
-
{
|
|
246
|
-
createPortElement: function (pPort, pPos, pNodeHash)
|
|
247
|
-
{
|
|
248
|
-
tmpCreatePortCalled = true;
|
|
249
|
-
let tmpEl = createMockSVGElement();
|
|
250
|
-
tmpEl._tag = 'circle';
|
|
251
|
-
return tmpEl;
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
let tmpGroup = createMockSVGElement();
|
|
256
|
-
let tmpNodeData =
|
|
257
|
-
{
|
|
258
|
-
Hash: 'node-6',
|
|
259
|
-
Ports: [{ Hash: 'p1', Direction: 'input' }]
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
_PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
|
|
263
|
-
libExpect(tmpCreatePortCalled).to.be.true;
|
|
264
|
-
|
|
265
|
-
// Clean up
|
|
266
|
-
_MockFlowView._ConnectorShapesProvider = null;
|
|
267
|
-
fDone();
|
|
268
|
-
}
|
|
269
|
-
);
|
|
270
|
-
|
|
271
|
-
test
|
|
272
|
-
(
|
|
273
|
-
'should set port-type data attribute when PortType is set',
|
|
274
|
-
function (fDone)
|
|
275
|
-
{
|
|
276
|
-
let tmpGroup = createMockSVGElement();
|
|
277
|
-
let tmpNodeData =
|
|
278
|
-
{
|
|
279
|
-
Hash: 'node-7',
|
|
280
|
-
Ports:
|
|
281
|
-
[
|
|
282
|
-
{ Hash: 'p1', Direction: 'input', PortType: 'event-in' }
|
|
283
|
-
]
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
_PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
|
|
287
|
-
|
|
288
|
-
let tmpCircles = tmpGroup._children.filter(function (pChild)
|
|
289
|
-
{
|
|
290
|
-
return pChild._tag === 'circle';
|
|
291
|
-
});
|
|
292
|
-
libExpect(tmpCircles.length).to.equal(1);
|
|
293
|
-
libExpect(tmpCircles[0]._attrs['data-port-type']).to.equal('event-in');
|
|
294
|
-
fDone();
|
|
295
|
-
}
|
|
296
|
-
);
|
|
297
|
-
|
|
298
|
-
test
|
|
299
|
-
(
|
|
300
|
-
'should group ports by Side value',
|
|
301
|
-
function (fDone)
|
|
302
|
-
{
|
|
303
|
-
let tmpGroup = createMockSVGElement();
|
|
304
|
-
let tmpNodeData =
|
|
305
|
-
{
|
|
306
|
-
Hash: 'node-8',
|
|
307
|
-
Ports:
|
|
308
|
-
[
|
|
309
|
-
{ Hash: 'p1', Direction: 'input', Side: 'left' },
|
|
310
|
-
{ Hash: 'p2', Direction: 'input', Side: 'left' },
|
|
311
|
-
{ Hash: 'p3', Direction: 'output', Side: 'right' },
|
|
312
|
-
{ Hash: 'p4', Direction: 'output', Side: 'bottom' }
|
|
313
|
-
]
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
_PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
|
|
317
|
-
|
|
318
|
-
let tmpCircles = tmpGroup._children.filter(function (pChild)
|
|
319
|
-
{
|
|
320
|
-
return pChild._tag === 'circle';
|
|
321
|
-
});
|
|
322
|
-
libExpect(tmpCircles.length).to.equal(4);
|
|
323
|
-
fDone();
|
|
324
|
-
}
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
|
-
);
|
|
328
|
-
|
|
329
|
-
// ---- getPortLocalPosition ----
|
|
330
|
-
|
|
331
|
-
suite
|
|
332
|
-
(
|
|
333
|
-
'getPortLocalPosition',
|
|
334
|
-
function ()
|
|
335
|
-
{
|
|
336
|
-
test
|
|
337
|
-
(
|
|
338
|
-
'should delegate to GeometryProvider',
|
|
339
|
-
function (fDone)
|
|
340
|
-
{
|
|
341
|
-
let tmpPos = _PortRenderer.getPortLocalPosition('left', 0, 1, 180, 80, 22, {});
|
|
342
|
-
|
|
343
|
-
libExpect(tmpPos).to.have.property('x');
|
|
344
|
-
libExpect(tmpPos).to.have.property('y');
|
|
345
|
-
libExpect(tmpPos.x).to.equal(0); // left edge
|
|
346
|
-
fDone();
|
|
347
|
-
}
|
|
348
|
-
);
|
|
349
|
-
|
|
350
|
-
test
|
|
351
|
-
(
|
|
352
|
-
'should return right edge position',
|
|
353
|
-
function (fDone)
|
|
354
|
-
{
|
|
355
|
-
let tmpPos = _PortRenderer.getPortLocalPosition('right', 0, 1, 180, 80, 22, {});
|
|
356
|
-
|
|
357
|
-
libExpect(tmpPos.x).to.equal(180); // right edge
|
|
358
|
-
fDone();
|
|
359
|
-
}
|
|
360
|
-
);
|
|
361
|
-
|
|
362
|
-
test
|
|
363
|
-
(
|
|
364
|
-
'should pass title bar height correctly',
|
|
365
|
-
function (fDone)
|
|
366
|
-
{
|
|
367
|
-
// Port should be below the title bar
|
|
368
|
-
let tmpPos = _PortRenderer.getPortLocalPosition('left', 0, 1, 180, 80, 22, {});
|
|
369
|
-
libExpect(tmpPos.y).to.be.greaterThan(22);
|
|
370
|
-
fDone();
|
|
371
|
-
}
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
);
|
|
375
|
-
}
|
|
376
|
-
);
|