pict-section-flow 0.0.1 → 0.0.2
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/docs/README.md +19 -0
- package/{example_application → example_applications/simple_cards}/html/index.html +2 -2
- package/example_applications/simple_cards/package.json +43 -0
- package/example_applications/simple_cards/source/Pict-Application-FlowExample.js +434 -0
- package/example_applications/simple_cards/source/cards/FlowCard-Each.js +36 -0
- package/example_applications/simple_cards/source/cards/FlowCard-FileRead.js +54 -0
- package/example_applications/simple_cards/source/cards/FlowCard-FileWrite.js +48 -0
- package/example_applications/simple_cards/source/cards/FlowCard-GetValue.js +35 -0
- package/example_applications/simple_cards/source/cards/FlowCard-IfThenElse.js +47 -0
- package/example_applications/simple_cards/source/cards/FlowCard-LogValues.js +53 -0
- package/example_applications/simple_cards/source/cards/FlowCard-SetValue.js +95 -0
- package/example_applications/simple_cards/source/cards/FlowCard-Switch.js +37 -0
- package/example_applications/simple_cards/source/views/PictView-FlowExample-FileWriteInfo.js +59 -0
- package/{example_application → example_applications/simple_cards}/source/views/PictView-FlowExample-Layout.js +5 -1
- package/example_applications/simple_cards/source/views/PictView-FlowExample-MainWorkspace.js +312 -0
- package/package.json +6 -6
- package/source/Pict-Section-Flow.js +19 -0
- package/source/PictFlowCard.js +207 -0
- package/source/PictFlowCardPropertiesPanel.js +105 -0
- package/source/panels/FlowCardPropertiesPanel-Form.js +174 -0
- package/source/panels/FlowCardPropertiesPanel-Markdown.js +148 -0
- package/source/panels/FlowCardPropertiesPanel-Template.js +88 -0
- package/source/panels/FlowCardPropertiesPanel-View.js +114 -0
- package/source/providers/PictProvider-Flow-EventHandler.js +19 -8
- package/source/providers/PictProvider-Flow-Geometry.js +64 -0
- package/source/providers/PictProvider-Flow-Layouts.js +284 -0
- package/source/providers/PictProvider-Flow-NodeTypes.js +70 -0
- package/source/providers/PictProvider-Flow-PanelChrome.js +72 -0
- package/source/providers/PictProvider-Flow-SVGHelpers.js +30 -0
- package/source/services/PictService-Flow-ConnectionRenderer.js +324 -66
- package/source/services/PictService-Flow-InteractionManager.js +399 -75
- package/source/services/PictService-Flow-Layout.js +159 -0
- package/source/services/PictService-Flow-PathGenerator.js +199 -0
- package/source/services/PictService-Flow-Tether.js +544 -0
- package/source/views/PictView-Flow-Node.js +95 -18
- package/source/views/PictView-Flow-PropertiesPanel.js +435 -0
- package/source/views/PictView-Flow-Toolbar.js +491 -5
- package/source/views/PictView-Flow.js +830 -8
- package/example_application/package.json +0 -41
- package/example_application/source/Pict-Application-FlowExample.js +0 -241
- package/example_application/source/views/PictView-FlowExample-MainWorkspace.js +0 -191
- /package/{example_application → example_applications/simple_cards}/css/flowexample.css +0 -0
- /package/{example_application → example_applications/simple_cards}/source/Pict-Application-FlowExample-Configuration.json +0 -0
- /package/{example_application → example_applications/simple_cards}/source/providers/PictRouter-FlowExample-Configuration.json +0 -0
- /package/{example_application → example_applications/simple_cards}/source/views/PictView-FlowExample-About.js +0 -0
- /package/{example_application → example_applications/simple_cards}/source/views/PictView-FlowExample-BottomBar.js +0 -0
- /package/{example_application → example_applications/simple_cards}/source/views/PictView-FlowExample-Documentation.js +0 -0
- /package/{example_application → example_applications/simple_cards}/source/views/PictView-FlowExample-TopBar.js +0 -0
package/docs/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Pict Section Flow Diagram
|
|
2
|
+
|
|
3
|
+
A Pict section view for rendering flow diagrams. Provides views, providers, and services for visual flow-based layouts within Pict applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install pict-section-flow
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Building
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx quack build
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## License
|
|
18
|
+
|
|
19
|
+
MIT
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<!-- Bootstrap the Application -->
|
|
19
19
|
<script type="text/javascript">
|
|
20
20
|
//<![CDATA[
|
|
21
|
-
Pict.safeOnDocumentReady(() => { Pict.safeLoadPictApplication(
|
|
21
|
+
Pict.safeOnDocumentReady(() => { Pict.safeLoadPictApplication(PictSectionFlowExampleSimpleCards, 2)});
|
|
22
22
|
//]]>
|
|
23
23
|
</script>
|
|
24
24
|
</head>
|
|
@@ -27,6 +27,6 @@
|
|
|
27
27
|
<div id="FlowExample-Application-Container"></div>
|
|
28
28
|
|
|
29
29
|
<!-- Load the FlowExample PICT Application Bundle -->
|
|
30
|
-
<script src="./pict-section-flow-example.compatible.min.js" type="text/javascript"></script>
|
|
30
|
+
<script src="./pict-section-flow-example-simple-cards.compatible.min.js" type="text/javascript"></script>
|
|
31
31
|
</body>
|
|
32
32
|
</html>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pict-section-flow-example-simple-cards",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Pict Section Flow - Simple Cards Example Application",
|
|
5
|
+
"main": "source/Pict-Application-FlowExample.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "node source/Pict-Application-FlowExample.js",
|
|
8
|
+
"build": "npx quack build && npx quack copy",
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 0"
|
|
10
|
+
},
|
|
11
|
+
"author": "steven velozo <steven@velozo.com>",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"pict": "^1.0.343",
|
|
15
|
+
"pict-application": "^1.0.28",
|
|
16
|
+
"pict-router": "^1.0.4",
|
|
17
|
+
"pict-view": "^1.0.64",
|
|
18
|
+
"pict-provider": "^1.0.3",
|
|
19
|
+
"pict-section-content": "^0.0.6",
|
|
20
|
+
"pict-section-form": "^1.0.192",
|
|
21
|
+
"pict-section-flow": "file:../../"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"quackage": "^1.0.58"
|
|
25
|
+
},
|
|
26
|
+
"copyFilesSettings": {
|
|
27
|
+
"whenFileExists": "overwrite"
|
|
28
|
+
},
|
|
29
|
+
"copyFiles": [
|
|
30
|
+
{
|
|
31
|
+
"from": "./html/*",
|
|
32
|
+
"to": "./dist/"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"from": "./css/**",
|
|
36
|
+
"to": "./dist/css/"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"from": "./node_modules/pict/dist/*",
|
|
40
|
+
"to": "./dist/js/"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
const libPictApplication = require('pict-application');
|
|
2
|
+
const libPictRouter = require('pict-router');
|
|
3
|
+
const libPictSectionForm = require('pict-section-form');
|
|
4
|
+
const libPictSectionContent = require('pict-section-content');
|
|
5
|
+
|
|
6
|
+
// Views
|
|
7
|
+
const libViewLayout = require('./views/PictView-FlowExample-Layout.js');
|
|
8
|
+
const libViewTopBar = require('./views/PictView-FlowExample-TopBar.js');
|
|
9
|
+
const libViewBottomBar = require('./views/PictView-FlowExample-BottomBar.js');
|
|
10
|
+
const libViewMainWorkspace = require('./views/PictView-FlowExample-MainWorkspace.js');
|
|
11
|
+
const libViewAbout = require('./views/PictView-FlowExample-About.js');
|
|
12
|
+
const libViewDocumentation = require('./views/PictView-FlowExample-Documentation.js');
|
|
13
|
+
const libViewFileWriteInfo = require('./views/PictView-FlowExample-FileWriteInfo.js');
|
|
14
|
+
|
|
15
|
+
class FlowExampleApplication extends libPictApplication
|
|
16
|
+
{
|
|
17
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
18
|
+
{
|
|
19
|
+
super(pFable, pOptions, pServiceHash);
|
|
20
|
+
|
|
21
|
+
// Add the router provider with routes
|
|
22
|
+
this.pict.addProvider('PictRouter', require('./providers/PictRouter-FlowExample-Configuration.json'), libPictRouter);
|
|
23
|
+
|
|
24
|
+
// Add the layout view (the shell that contains top bar, workspace, bottom bar)
|
|
25
|
+
this.pict.addView('FlowExample-Layout', libViewLayout.default_configuration, libViewLayout);
|
|
26
|
+
|
|
27
|
+
// Add the top bar and bottom bar views
|
|
28
|
+
this.pict.addView('FlowExample-TopBar', libViewTopBar.default_configuration, libViewTopBar);
|
|
29
|
+
this.pict.addView('FlowExample-BottomBar', libViewBottomBar.default_configuration, libViewBottomBar);
|
|
30
|
+
|
|
31
|
+
// Add the main content workspace view
|
|
32
|
+
this.pict.addView('FlowExample-MainWorkspace', libViewMainWorkspace.default_configuration, libViewMainWorkspace);
|
|
33
|
+
|
|
34
|
+
// Add the about page view
|
|
35
|
+
this.pict.addView('FlowExample-About', libViewAbout.default_configuration, libViewAbout);
|
|
36
|
+
|
|
37
|
+
// Add the documentation page view
|
|
38
|
+
this.pict.addView('FlowExample-Documentation', libViewDocumentation.default_configuration, libViewDocumentation);
|
|
39
|
+
|
|
40
|
+
// Add the file write info view (used by the View panel type example)
|
|
41
|
+
this.pict.addView('FlowExample-FileWriteInfo', libViewFileWriteInfo.default_configuration, libViewFileWriteInfo);
|
|
42
|
+
|
|
43
|
+
// Register pict-section-form service types so Form panels can use them
|
|
44
|
+
this.pict.addServiceType('PictFormMetacontroller', libPictSectionForm.PictFormMetacontroller);
|
|
45
|
+
|
|
46
|
+
// Register pict-section-content service types so Markdown panels can render content
|
|
47
|
+
this.pict.addServiceType('PictContentProvider', libPictSectionContent.PictContentProvider);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
onAfterInitializeAsync(fCallback)
|
|
51
|
+
{
|
|
52
|
+
// Initialize application state
|
|
53
|
+
this.pict.AppData.FlowExample =
|
|
54
|
+
{
|
|
55
|
+
CurrentRoute: 'home'
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Initialize sample flow data using FlowCard types.
|
|
59
|
+
// Includes one of every node type for easy smoke testing:
|
|
60
|
+
// start, FREAD, ITE, EACH, GET, SET, SW, LOG (x2), FWRITE, end
|
|
61
|
+
this.pict.AppData.FlowExample.SampleFlow =
|
|
62
|
+
{
|
|
63
|
+
Nodes:
|
|
64
|
+
[
|
|
65
|
+
// ── Entry ──────────────────────────────────────────────
|
|
66
|
+
{
|
|
67
|
+
Hash: 'node-start',
|
|
68
|
+
Type: 'start',
|
|
69
|
+
X: 50,
|
|
70
|
+
Y: 180,
|
|
71
|
+
Width: 140,
|
|
72
|
+
Height: 80,
|
|
73
|
+
Title: 'Start',
|
|
74
|
+
Ports:
|
|
75
|
+
[
|
|
76
|
+
{ Hash: 'port-start-out', Direction: 'output', Side: 'right', Label: 'Out' }
|
|
77
|
+
],
|
|
78
|
+
Data: {}
|
|
79
|
+
},
|
|
80
|
+
// ── I/O: File Read (Template panel) ────────────────────
|
|
81
|
+
{
|
|
82
|
+
Hash: 'node-fread',
|
|
83
|
+
Type: 'FREAD',
|
|
84
|
+
X: 270,
|
|
85
|
+
Y: 160,
|
|
86
|
+
Width: 180,
|
|
87
|
+
Height: 80,
|
|
88
|
+
Title: 'Read Config',
|
|
89
|
+
Ports:
|
|
90
|
+
[
|
|
91
|
+
{ Hash: 'port-fread-in', Direction: 'input', Side: 'left', Label: 'Path' },
|
|
92
|
+
{ Hash: 'port-fread-data', Direction: 'output', Side: 'right', Label: 'Data' },
|
|
93
|
+
{ Hash: 'port-fread-err', Direction: 'output', Side: 'bottom', Label: 'Error' }
|
|
94
|
+
],
|
|
95
|
+
Data: {}
|
|
96
|
+
},
|
|
97
|
+
// ── Control: If-Then-Else (Markdown panel) ─────────────
|
|
98
|
+
{
|
|
99
|
+
Hash: 'node-check',
|
|
100
|
+
Type: 'ITE',
|
|
101
|
+
X: 530,
|
|
102
|
+
Y: 140,
|
|
103
|
+
Width: 200,
|
|
104
|
+
Height: 100,
|
|
105
|
+
Title: 'Has Items?',
|
|
106
|
+
Ports:
|
|
107
|
+
[
|
|
108
|
+
{ Hash: 'port-check-in', Direction: 'input', Side: 'left', Label: 'In' },
|
|
109
|
+
{ Hash: 'port-check-then', Direction: 'output', Side: 'right', Label: 'Then' },
|
|
110
|
+
{ Hash: 'port-check-else', Direction: 'output', Side: 'bottom', Label: 'Else' }
|
|
111
|
+
],
|
|
112
|
+
Data: {}
|
|
113
|
+
},
|
|
114
|
+
// ── Control: Each (no panel) ───────────────────────────
|
|
115
|
+
{
|
|
116
|
+
Hash: 'node-each',
|
|
117
|
+
Type: 'EACH',
|
|
118
|
+
X: 810,
|
|
119
|
+
Y: 120,
|
|
120
|
+
Width: 200,
|
|
121
|
+
Height: 100,
|
|
122
|
+
Title: 'Process Items',
|
|
123
|
+
Ports:
|
|
124
|
+
[
|
|
125
|
+
{ Hash: 'port-each-in', Direction: 'input', Side: 'left', Label: 'Collection' },
|
|
126
|
+
{ Hash: 'port-each-item', Direction: 'output', Side: 'right', Label: 'Item' },
|
|
127
|
+
{ Hash: 'port-each-done', Direction: 'output', Side: 'bottom', Label: 'Done' }
|
|
128
|
+
],
|
|
129
|
+
Data: {}
|
|
130
|
+
},
|
|
131
|
+
// ── Data: Get Value (no panel) ─────────────────────────
|
|
132
|
+
{
|
|
133
|
+
Hash: 'node-get',
|
|
134
|
+
Type: 'GET',
|
|
135
|
+
X: 1090,
|
|
136
|
+
Y: 110,
|
|
137
|
+
Width: 170,
|
|
138
|
+
Height: 80,
|
|
139
|
+
Title: 'Read Item',
|
|
140
|
+
Ports:
|
|
141
|
+
[
|
|
142
|
+
{ Hash: 'port-get-in', Direction: 'input', Side: 'left', Label: 'In' },
|
|
143
|
+
{ Hash: 'port-get-value', Direction: 'output', Side: 'right', Label: 'Value' }
|
|
144
|
+
],
|
|
145
|
+
Data: {}
|
|
146
|
+
},
|
|
147
|
+
// ── Data: Set Value (Form panel) ───────────────────────
|
|
148
|
+
{
|
|
149
|
+
Hash: 'node-set',
|
|
150
|
+
Type: 'SET',
|
|
151
|
+
X: 1340,
|
|
152
|
+
Y: 110,
|
|
153
|
+
Width: 170,
|
|
154
|
+
Height: 80,
|
|
155
|
+
Title: 'Transform',
|
|
156
|
+
Ports:
|
|
157
|
+
[
|
|
158
|
+
{ Hash: 'port-set-in', Direction: 'input', Side: 'left', Label: 'In' },
|
|
159
|
+
{ Hash: 'port-set-out', Direction: 'output', Side: 'right', Label: 'Out' }
|
|
160
|
+
],
|
|
161
|
+
Data: {}
|
|
162
|
+
},
|
|
163
|
+
// ── Control: Switch (no panel) ─────────────────────────
|
|
164
|
+
{
|
|
165
|
+
Hash: 'node-switch',
|
|
166
|
+
Type: 'SW',
|
|
167
|
+
X: 1590,
|
|
168
|
+
Y: 100,
|
|
169
|
+
Width: 200,
|
|
170
|
+
Height: 120,
|
|
171
|
+
Title: 'Route Output',
|
|
172
|
+
Ports:
|
|
173
|
+
[
|
|
174
|
+
{ Hash: 'port-sw-in', Direction: 'input', Side: 'left', Label: 'In' },
|
|
175
|
+
{ Hash: 'port-sw-a', Direction: 'output', Side: 'right', Label: 'Case A' },
|
|
176
|
+
{ Hash: 'port-sw-b', Direction: 'output', Side: 'right', Label: 'Case B' },
|
|
177
|
+
{ Hash: 'port-sw-default', Direction: 'output', Side: 'bottom', Label: 'Default' }
|
|
178
|
+
],
|
|
179
|
+
Data: {}
|
|
180
|
+
},
|
|
181
|
+
// ── Debug: Log Values (Template panel) ─────────────────
|
|
182
|
+
{
|
|
183
|
+
Hash: 'node-log',
|
|
184
|
+
Type: 'LOG',
|
|
185
|
+
X: 1590,
|
|
186
|
+
Y: 310,
|
|
187
|
+
Width: 160,
|
|
188
|
+
Height: 80,
|
|
189
|
+
Title: 'Log Results',
|
|
190
|
+
Ports:
|
|
191
|
+
[
|
|
192
|
+
{ Hash: 'port-log-in', Direction: 'input', Side: 'left', Label: 'Values' },
|
|
193
|
+
{ Hash: 'port-log-out', Direction: 'output', Side: 'right', Label: 'Pass' }
|
|
194
|
+
],
|
|
195
|
+
Data: {}
|
|
196
|
+
},
|
|
197
|
+
// ── I/O: File Write (View panel) ───────────────────────
|
|
198
|
+
{
|
|
199
|
+
Hash: 'node-fwrite',
|
|
200
|
+
Type: 'FWRITE',
|
|
201
|
+
X: 1870,
|
|
202
|
+
Y: 160,
|
|
203
|
+
Width: 180,
|
|
204
|
+
Height: 80,
|
|
205
|
+
Title: 'Write Output',
|
|
206
|
+
Ports:
|
|
207
|
+
[
|
|
208
|
+
{ Hash: 'port-fwrite-path', Direction: 'input', Side: 'left', Label: 'Path' },
|
|
209
|
+
{ Hash: 'port-fwrite-data', Direction: 'input', Side: 'left', Label: 'Data' },
|
|
210
|
+
{ Hash: 'port-fwrite-done', Direction: 'output', Side: 'right', Label: 'Done' },
|
|
211
|
+
{ Hash: 'port-fwrite-err', Direction: 'output', Side: 'bottom', Label: 'Error' }
|
|
212
|
+
],
|
|
213
|
+
Data: {}
|
|
214
|
+
},
|
|
215
|
+
// ── Exit ───────────────────────────────────────────────
|
|
216
|
+
{
|
|
217
|
+
Hash: 'node-end',
|
|
218
|
+
Type: 'end',
|
|
219
|
+
X: 2130,
|
|
220
|
+
Y: 180,
|
|
221
|
+
Width: 140,
|
|
222
|
+
Height: 80,
|
|
223
|
+
Title: 'End',
|
|
224
|
+
Ports:
|
|
225
|
+
[
|
|
226
|
+
{ Hash: 'port-end-in', Direction: 'input', Side: 'left', Label: 'In' }
|
|
227
|
+
],
|
|
228
|
+
Data: {}
|
|
229
|
+
},
|
|
230
|
+
// ── Debug: Log Error (Template panel, error branch) ────
|
|
231
|
+
{
|
|
232
|
+
Hash: 'node-log-err',
|
|
233
|
+
Type: 'LOG',
|
|
234
|
+
X: 530,
|
|
235
|
+
Y: 380,
|
|
236
|
+
Width: 160,
|
|
237
|
+
Height: 80,
|
|
238
|
+
Title: 'Log Error',
|
|
239
|
+
Ports:
|
|
240
|
+
[
|
|
241
|
+
{ Hash: 'port-logerr-in', Direction: 'input', Side: 'left', Label: 'Values' },
|
|
242
|
+
{ Hash: 'port-logerr-out', Direction: 'output', Side: 'right', Label: 'Pass' }
|
|
243
|
+
],
|
|
244
|
+
Data: {}
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
Connections:
|
|
248
|
+
[
|
|
249
|
+
// Main flow: Start → Read Config
|
|
250
|
+
{
|
|
251
|
+
Hash: 'conn-1',
|
|
252
|
+
SourceNodeHash: 'node-start',
|
|
253
|
+
SourcePortHash: 'port-start-out',
|
|
254
|
+
TargetNodeHash: 'node-fread',
|
|
255
|
+
TargetPortHash: 'port-fread-in',
|
|
256
|
+
Data: {}
|
|
257
|
+
},
|
|
258
|
+
// Read Config → Has Items?
|
|
259
|
+
{
|
|
260
|
+
Hash: 'conn-2',
|
|
261
|
+
SourceNodeHash: 'node-fread',
|
|
262
|
+
SourcePortHash: 'port-fread-data',
|
|
263
|
+
TargetNodeHash: 'node-check',
|
|
264
|
+
TargetPortHash: 'port-check-in',
|
|
265
|
+
Data: {}
|
|
266
|
+
},
|
|
267
|
+
// Has Items? (Then) → Process Items
|
|
268
|
+
{
|
|
269
|
+
Hash: 'conn-3',
|
|
270
|
+
SourceNodeHash: 'node-check',
|
|
271
|
+
SourcePortHash: 'port-check-then',
|
|
272
|
+
TargetNodeHash: 'node-each',
|
|
273
|
+
TargetPortHash: 'port-each-in',
|
|
274
|
+
Data: {}
|
|
275
|
+
},
|
|
276
|
+
// Process Items (Item) → Read Item (GET)
|
|
277
|
+
{
|
|
278
|
+
Hash: 'conn-4',
|
|
279
|
+
SourceNodeHash: 'node-each',
|
|
280
|
+
SourcePortHash: 'port-each-item',
|
|
281
|
+
TargetNodeHash: 'node-get',
|
|
282
|
+
TargetPortHash: 'port-get-in',
|
|
283
|
+
Data: {}
|
|
284
|
+
},
|
|
285
|
+
// Read Item (GET) → Transform (SET)
|
|
286
|
+
{
|
|
287
|
+
Hash: 'conn-5',
|
|
288
|
+
SourceNodeHash: 'node-get',
|
|
289
|
+
SourcePortHash: 'port-get-value',
|
|
290
|
+
TargetNodeHash: 'node-set',
|
|
291
|
+
TargetPortHash: 'port-set-in',
|
|
292
|
+
Data: {}
|
|
293
|
+
},
|
|
294
|
+
// Transform (SET) → Route Output (SW)
|
|
295
|
+
{
|
|
296
|
+
Hash: 'conn-6',
|
|
297
|
+
SourceNodeHash: 'node-set',
|
|
298
|
+
SourcePortHash: 'port-set-out',
|
|
299
|
+
TargetNodeHash: 'node-switch',
|
|
300
|
+
TargetPortHash: 'port-sw-in',
|
|
301
|
+
Data: {}
|
|
302
|
+
},
|
|
303
|
+
// Route Output (SW Case A) → Write Output (data)
|
|
304
|
+
{
|
|
305
|
+
Hash: 'conn-7',
|
|
306
|
+
SourceNodeHash: 'node-switch',
|
|
307
|
+
SourcePortHash: 'port-sw-a',
|
|
308
|
+
TargetNodeHash: 'node-fwrite',
|
|
309
|
+
TargetPortHash: 'port-fwrite-data',
|
|
310
|
+
Data: {}
|
|
311
|
+
},
|
|
312
|
+
// Route Output (SW Case B) → Log Results
|
|
313
|
+
{
|
|
314
|
+
Hash: 'conn-8',
|
|
315
|
+
SourceNodeHash: 'node-switch',
|
|
316
|
+
SourcePortHash: 'port-sw-b',
|
|
317
|
+
TargetNodeHash: 'node-log',
|
|
318
|
+
TargetPortHash: 'port-log-in',
|
|
319
|
+
Data: {}
|
|
320
|
+
},
|
|
321
|
+
// Route Output (SW Default) → Log Error
|
|
322
|
+
{
|
|
323
|
+
Hash: 'conn-9',
|
|
324
|
+
SourceNodeHash: 'node-switch',
|
|
325
|
+
SourcePortHash: 'port-sw-default',
|
|
326
|
+
TargetNodeHash: 'node-log-err',
|
|
327
|
+
TargetPortHash: 'port-logerr-in',
|
|
328
|
+
Data: {}
|
|
329
|
+
},
|
|
330
|
+
// Process Items (Done) → Log Results
|
|
331
|
+
{
|
|
332
|
+
Hash: 'conn-10',
|
|
333
|
+
SourceNodeHash: 'node-each',
|
|
334
|
+
SourcePortHash: 'port-each-done',
|
|
335
|
+
TargetNodeHash: 'node-log',
|
|
336
|
+
TargetPortHash: 'port-log-in',
|
|
337
|
+
Data: {}
|
|
338
|
+
},
|
|
339
|
+
// Log Results → Write Output (path)
|
|
340
|
+
{
|
|
341
|
+
Hash: 'conn-11',
|
|
342
|
+
SourceNodeHash: 'node-log',
|
|
343
|
+
SourcePortHash: 'port-log-out',
|
|
344
|
+
TargetNodeHash: 'node-fwrite',
|
|
345
|
+
TargetPortHash: 'port-fwrite-path',
|
|
346
|
+
Data: {}
|
|
347
|
+
},
|
|
348
|
+
// Write Output → End
|
|
349
|
+
{
|
|
350
|
+
Hash: 'conn-12',
|
|
351
|
+
SourceNodeHash: 'node-fwrite',
|
|
352
|
+
SourcePortHash: 'port-fwrite-done',
|
|
353
|
+
TargetNodeHash: 'node-end',
|
|
354
|
+
TargetPortHash: 'port-end-in',
|
|
355
|
+
Data: {}
|
|
356
|
+
},
|
|
357
|
+
// Error branch: Read Config (Error) → Log Error
|
|
358
|
+
{
|
|
359
|
+
Hash: 'conn-13',
|
|
360
|
+
SourceNodeHash: 'node-fread',
|
|
361
|
+
SourcePortHash: 'port-fread-err',
|
|
362
|
+
TargetNodeHash: 'node-log-err',
|
|
363
|
+
TargetPortHash: 'port-logerr-in',
|
|
364
|
+
Data: {}
|
|
365
|
+
},
|
|
366
|
+
// Error branch: Has Items? (Else) → Log Error
|
|
367
|
+
{
|
|
368
|
+
Hash: 'conn-14',
|
|
369
|
+
SourceNodeHash: 'node-check',
|
|
370
|
+
SourcePortHash: 'port-check-else',
|
|
371
|
+
TargetNodeHash: 'node-log-err',
|
|
372
|
+
TargetPortHash: 'port-logerr-in',
|
|
373
|
+
Data: {}
|
|
374
|
+
},
|
|
375
|
+
// Error branch: Log Error → End
|
|
376
|
+
{
|
|
377
|
+
Hash: 'conn-15',
|
|
378
|
+
SourceNodeHash: 'node-log-err',
|
|
379
|
+
SourcePortHash: 'port-logerr-out',
|
|
380
|
+
TargetNodeHash: 'node-end',
|
|
381
|
+
TargetPortHash: 'port-end-in',
|
|
382
|
+
Data: {}
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
ViewState:
|
|
386
|
+
{
|
|
387
|
+
PanX: 0,
|
|
388
|
+
PanY: 0,
|
|
389
|
+
Zoom: 1,
|
|
390
|
+
SelectedNodeHash: null,
|
|
391
|
+
SelectedConnectionHash: null
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
// Render the layout shell first, then the initial content
|
|
396
|
+
this.pict.views['FlowExample-Layout'].render();
|
|
397
|
+
|
|
398
|
+
return super.onAfterInitializeAsync(fCallback);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Navigate to a route using the pict-router.
|
|
403
|
+
*
|
|
404
|
+
* @param {string} pRoute - The route path to navigate to (e.g. '/About')
|
|
405
|
+
*/
|
|
406
|
+
navigateTo(pRoute)
|
|
407
|
+
{
|
|
408
|
+
this.pict.providers.PictRouter.navigate(pRoute);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Render a specific content view into the main workspace area.
|
|
413
|
+
* This is called by the router when a route is matched.
|
|
414
|
+
*
|
|
415
|
+
* @param {string} pViewIdentifier - The view identifier to render
|
|
416
|
+
*/
|
|
417
|
+
showView(pViewIdentifier)
|
|
418
|
+
{
|
|
419
|
+
if (pViewIdentifier in this.pict.views)
|
|
420
|
+
{
|
|
421
|
+
this.pict.AppData.FlowExample.CurrentRoute = pViewIdentifier;
|
|
422
|
+
this.pict.views[pViewIdentifier].render();
|
|
423
|
+
}
|
|
424
|
+
else
|
|
425
|
+
{
|
|
426
|
+
this.pict.log.warn(`View [${pViewIdentifier}] not found; falling back to main workspace.`);
|
|
427
|
+
this.pict.views['FlowExample-MainWorkspace'].render();
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
module.exports = FlowExampleApplication;
|
|
433
|
+
|
|
434
|
+
module.exports.default_configuration = require('./Pict-Application-FlowExample-Configuration.json');
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const libPictFlowCard = require('pict-section-flow').PictFlowCard;
|
|
2
|
+
|
|
3
|
+
class FlowCardEach extends libPictFlowCard
|
|
4
|
+
{
|
|
5
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
6
|
+
{
|
|
7
|
+
super(pFable, Object.assign(
|
|
8
|
+
{},
|
|
9
|
+
{
|
|
10
|
+
Title: 'Each',
|
|
11
|
+
Name: 'Loop Iterator',
|
|
12
|
+
Code: 'EACH',
|
|
13
|
+
Description: 'Iterates over a collection, executing the body for each item.',
|
|
14
|
+
Icon: '\uD83D\uDD01',
|
|
15
|
+
Tooltip: 'Each: Iterate over items in a collection',
|
|
16
|
+
Category: 'Control Flow',
|
|
17
|
+
TitleBarColor: '#8e44ad',
|
|
18
|
+
BodyStyle: { fill: '#f5eef8', stroke: '#8e44ad' },
|
|
19
|
+
Width: 200,
|
|
20
|
+
Height: 100,
|
|
21
|
+
Inputs:
|
|
22
|
+
[
|
|
23
|
+
{ Name: 'Collection', Side: 'left', MinimumInputCount: 1, MaximumInputCount: 1 }
|
|
24
|
+
],
|
|
25
|
+
Outputs:
|
|
26
|
+
[
|
|
27
|
+
{ Name: 'Item', Side: 'right' },
|
|
28
|
+
{ Name: 'Done', Side: 'bottom' }
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
pOptions),
|
|
32
|
+
pServiceHash);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = FlowCardEach;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const libPictFlowCard = require('pict-section-flow').PictFlowCard;
|
|
2
|
+
|
|
3
|
+
class FlowCardFileRead extends libPictFlowCard
|
|
4
|
+
{
|
|
5
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
6
|
+
{
|
|
7
|
+
super(pFable, Object.assign(
|
|
8
|
+
{},
|
|
9
|
+
{
|
|
10
|
+
Title: 'File Read',
|
|
11
|
+
Name: 'Read File',
|
|
12
|
+
Code: 'FREAD',
|
|
13
|
+
Description: 'Reads the contents of a file from the filesystem.',
|
|
14
|
+
Icon: '\uD83D\uDCC4',
|
|
15
|
+
Tooltip: 'File Read: Read data from a file',
|
|
16
|
+
Category: 'I/O',
|
|
17
|
+
TitleBarColor: '#2980b9',
|
|
18
|
+
BodyStyle: { fill: '#eaf2f8', stroke: '#2980b9' },
|
|
19
|
+
Width: 180,
|
|
20
|
+
Height: 80,
|
|
21
|
+
Inputs:
|
|
22
|
+
[
|
|
23
|
+
{ Name: 'Path', Side: 'left', MinimumInputCount: 1, MaximumInputCount: 1 }
|
|
24
|
+
],
|
|
25
|
+
Outputs:
|
|
26
|
+
[
|
|
27
|
+
{ Name: 'Data', Side: 'right' },
|
|
28
|
+
{ Name: 'Error', Side: 'bottom' }
|
|
29
|
+
],
|
|
30
|
+
PropertiesPanel:
|
|
31
|
+
{
|
|
32
|
+
PanelType: 'Template',
|
|
33
|
+
DefaultWidth: 280,
|
|
34
|
+
DefaultHeight: 160,
|
|
35
|
+
Title: 'File Read Settings',
|
|
36
|
+
Configuration:
|
|
37
|
+
{
|
|
38
|
+
Templates:
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
Hash: 'flow-card-file-read-panel',
|
|
42
|
+
Template: '<div style="padding:4px"><label style="font-size:11px;color:#7f8c8d">File Path</label><div style="font-size:12px;padding:4px 0">{~D:Record.Data.FilePath~}</div><label style="font-size:11px;color:#7f8c8d">Encoding</label><div style="font-size:12px;padding:4px 0">{~D:Record.Data.Encoding~}</div></div>'
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
TemplateHash: 'flow-card-file-read-panel'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
pOptions),
|
|
50
|
+
pServiceHash);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
module.exports = FlowCardFileRead;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const libPictFlowCard = require('pict-section-flow').PictFlowCard;
|
|
2
|
+
|
|
3
|
+
class FlowCardFileWrite extends libPictFlowCard
|
|
4
|
+
{
|
|
5
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
6
|
+
{
|
|
7
|
+
super(pFable, Object.assign(
|
|
8
|
+
{},
|
|
9
|
+
{
|
|
10
|
+
Title: 'File Write',
|
|
11
|
+
Name: 'Write File',
|
|
12
|
+
Code: 'FWRITE',
|
|
13
|
+
Description: 'Writes data to a file on the filesystem.',
|
|
14
|
+
Icon: '\uD83D\uDCBE',
|
|
15
|
+
Tooltip: 'File Write: Write data to a file',
|
|
16
|
+
Category: 'I/O',
|
|
17
|
+
TitleBarColor: '#27ae60',
|
|
18
|
+
BodyStyle: { fill: '#eafaf1', stroke: '#27ae60' },
|
|
19
|
+
Width: 180,
|
|
20
|
+
Height: 80,
|
|
21
|
+
Inputs:
|
|
22
|
+
[
|
|
23
|
+
{ Name: 'Path', Side: 'left', MinimumInputCount: 1, MaximumInputCount: 1 },
|
|
24
|
+
{ Name: 'Data', Side: 'left', MinimumInputCount: 1, MaximumInputCount: 1 }
|
|
25
|
+
],
|
|
26
|
+
Outputs:
|
|
27
|
+
[
|
|
28
|
+
{ Name: 'Done', Side: 'right' },
|
|
29
|
+
{ Name: 'Error', Side: 'bottom' }
|
|
30
|
+
],
|
|
31
|
+
PropertiesPanel:
|
|
32
|
+
{
|
|
33
|
+
PanelType: 'View',
|
|
34
|
+
DefaultWidth: 260,
|
|
35
|
+
DefaultHeight: 180,
|
|
36
|
+
Title: 'File Write Info',
|
|
37
|
+
Configuration:
|
|
38
|
+
{
|
|
39
|
+
ViewHash: 'FlowExample-FileWriteInfo'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
pOptions),
|
|
44
|
+
pServiceHash);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
module.exports = FlowCardFileWrite;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const libPictFlowCard = require('pict-section-flow').PictFlowCard;
|
|
2
|
+
|
|
3
|
+
class FlowCardGetValue extends libPictFlowCard
|
|
4
|
+
{
|
|
5
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
6
|
+
{
|
|
7
|
+
super(pFable, Object.assign(
|
|
8
|
+
{},
|
|
9
|
+
{
|
|
10
|
+
Title: 'Get Value',
|
|
11
|
+
Name: 'Read Value',
|
|
12
|
+
Code: 'GET',
|
|
13
|
+
Description: 'Retrieves a named value from the flow context.',
|
|
14
|
+
Icon: '\uD83D\uDD0D',
|
|
15
|
+
Tooltip: 'Get Value: Read a value from the context',
|
|
16
|
+
Category: 'Data',
|
|
17
|
+
TitleBarColor: '#2c3e50',
|
|
18
|
+
BodyStyle: { fill: '#ebedef', stroke: '#2c3e50' },
|
|
19
|
+
Width: 170,
|
|
20
|
+
Height: 80,
|
|
21
|
+
Inputs:
|
|
22
|
+
[
|
|
23
|
+
{ Name: 'In', Side: 'left', MinimumInputCount: 1, MaximumInputCount: 1 }
|
|
24
|
+
],
|
|
25
|
+
Outputs:
|
|
26
|
+
[
|
|
27
|
+
{ Name: 'Value', Side: 'right' }
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
pOptions),
|
|
31
|
+
pServiceHash);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
module.exports = FlowCardGetValue;
|