pict-section-flow 1.1.0 → 1.3.0
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 +1 -1
- package/source/providers/PictProvider-Flow-CSS.js +23 -0
- package/source/providers/layouts/Layout-Layered.js +25 -79
- package/source/providers/layouts/Layout-Rank.js +141 -0
- package/source/providers/layouts/Layout-Staggered.js +131 -0
- package/source/services/PictService-Flow-DataManager.js +1 -1
- package/source/services/PictService-Flow-InteractionManager.js +354 -22
- package/source/services/PictService-Flow-Layout.js +2 -0
- package/source/services/PictService-Flow-RenderManager.js +3 -1
- package/source/services/PictService-Flow-SelectionManager.js +86 -5
- package/source/views/PictView-Flow-Node.js +90 -6
- package/source/views/PictView-Flow.js +48 -8
- package/test/InteractionManager_tests.js +279 -0
- package/test/Layout_tests.js +208 -4
- package/test/NodeView_tests.js +66 -0
- package/test/SelectionManager_tests.js +185 -0
package/package.json
CHANGED
|
@@ -270,6 +270,29 @@ class PictProviderFlowCSS extends libFableServiceProviderBase
|
|
|
270
270
|
.pict-flow-node-title-bar-bottom {
|
|
271
271
|
fill: var(--pf-node-title-bar-color);
|
|
272
272
|
}
|
|
273
|
+
.pict-flow-node-resize-handle {
|
|
274
|
+
fill: var(--theme-color-brand-primary, #2880a6);
|
|
275
|
+
stroke: var(--theme-color-background-panel, #ffffff);
|
|
276
|
+
stroke-width: 1.5;
|
|
277
|
+
cursor: nwse-resize;
|
|
278
|
+
opacity: 0.85;
|
|
279
|
+
}
|
|
280
|
+
.pict-flow-node-resize-handle:hover { opacity: 1; }
|
|
281
|
+
.pict-flow-marquee {
|
|
282
|
+
fill: var(--theme-color-brand-primary, #2880a6);
|
|
283
|
+
fill-opacity: 0.10;
|
|
284
|
+
stroke: var(--theme-color-brand-primary, #2880a6);
|
|
285
|
+
stroke-width: 1;
|
|
286
|
+
stroke-dasharray: 4 3;
|
|
287
|
+
pointer-events: none;
|
|
288
|
+
}
|
|
289
|
+
.pict-flow-align-guide {
|
|
290
|
+
stroke: #e5397f;
|
|
291
|
+
stroke-width: 1;
|
|
292
|
+
stroke-dasharray: 3 2;
|
|
293
|
+
pointer-events: none;
|
|
294
|
+
shape-rendering: crispEdges;
|
|
295
|
+
}
|
|
273
296
|
.pict-flow-node-title {
|
|
274
297
|
fill: var(--pf-node-title-fill);
|
|
275
298
|
font-size: var(--pf-node-title-size);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
const libCoerce = require('./Layout-Coerce.js');
|
|
2
|
+
const libRank = require('./Layout-Rank.js');
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Layout-Layered
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
+
* Cycle-tolerant left-to-right layered layout.
|
|
7
8
|
*
|
|
8
9
|
* This is the original `autoLayout` behavior of pict-section-flow,
|
|
9
10
|
* extracted into a layout-algorithm descriptor. Calling
|
|
@@ -34,100 +35,45 @@ module.exports =
|
|
|
34
35
|
|
|
35
36
|
let tmpConnections = Array.isArray(pConnections) ? pConnections : [];
|
|
36
37
|
|
|
37
|
-
// Build adjacency information
|
|
38
38
|
let tmpNodeMap = {};
|
|
39
|
-
let tmpInDegree = {};
|
|
40
|
-
let tmpOutEdges = {};
|
|
41
|
-
|
|
42
39
|
for (let i = 0; i < pNodes.length; i++)
|
|
43
40
|
{
|
|
44
|
-
|
|
45
|
-
tmpNodeMap[tmpNode.Hash] = tmpNode;
|
|
46
|
-
tmpInDegree[tmpNode.Hash] = 0;
|
|
47
|
-
tmpOutEdges[tmpNode.Hash] = [];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
for (let i = 0; i < tmpConnections.length; i++)
|
|
51
|
-
{
|
|
52
|
-
let tmpConn = tmpConnections[i];
|
|
53
|
-
if (tmpInDegree.hasOwnProperty(tmpConn.TargetNodeHash))
|
|
54
|
-
{
|
|
55
|
-
tmpInDegree[tmpConn.TargetNodeHash]++;
|
|
56
|
-
}
|
|
57
|
-
if (tmpOutEdges.hasOwnProperty(tmpConn.SourceNodeHash))
|
|
58
|
-
{
|
|
59
|
-
tmpOutEdges[tmpConn.SourceNodeHash].push(tmpConn.TargetNodeHash);
|
|
60
|
-
}
|
|
41
|
+
tmpNodeMap[pNodes[i].Hash] = pNodes[i];
|
|
61
42
|
}
|
|
62
43
|
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
44
|
+
// Rank the nodes into layers, left to right, with cycle breaking. The
|
|
45
|
+
// shared ranker keeps back-edged graphs (workflows, state machines) from
|
|
46
|
+
// collapsing into one tall column the way plain Kahn's topological sort
|
|
47
|
+
// would. See Layout-Rank.js.
|
|
48
|
+
let tmpLayers = libRank.toRanks(pNodes, tmpConnections);
|
|
49
|
+
|
|
50
|
+
// Measure each layer's stacked height so layers can be centered on one
|
|
51
|
+
// shared horizontal axis. Without centering every layer top-aligns at
|
|
52
|
+
// StartY, so a one-node layer beside a five-node layer reads as a
|
|
53
|
+
// diagonal drift down the page instead of a balanced band.
|
|
54
|
+
let tmpLayerHeights = [];
|
|
55
|
+
let tmpMaxLayerHeight = 0;
|
|
56
|
+
for (let l = 0; l < tmpLayers.length; l++)
|
|
69
57
|
{
|
|
70
|
-
|
|
58
|
+
let tmpHeight = 0;
|
|
59
|
+
for (let i = 0; i < tmpLayers[l].length; i++)
|
|
71
60
|
{
|
|
72
|
-
|
|
61
|
+
let tmpNode = tmpNodeMap[tmpLayers[l][i]];
|
|
62
|
+
tmpHeight += (tmpNode && tmpNode.Height) ? tmpNode.Height : 80;
|
|
63
|
+
if (i > 0) tmpHeight += tmpVerticalSpacing;
|
|
73
64
|
}
|
|
65
|
+
tmpLayerHeights.push(tmpHeight);
|
|
66
|
+
if (tmpHeight > tmpMaxLayerHeight) tmpMaxLayerHeight = tmpHeight;
|
|
74
67
|
}
|
|
75
68
|
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
let tmpCurrentLayer = [];
|
|
79
|
-
let tmpNextQueue = [];
|
|
80
|
-
|
|
81
|
-
for (let i = 0; i < tmpQueue.length; i++)
|
|
82
|
-
{
|
|
83
|
-
let tmpNodeHash = tmpQueue[i];
|
|
84
|
-
if (tmpAssigned[tmpNodeHash]) continue;
|
|
85
|
-
|
|
86
|
-
tmpAssigned[tmpNodeHash] = true;
|
|
87
|
-
tmpCurrentLayer.push(tmpNodeHash);
|
|
88
|
-
|
|
89
|
-
let tmpEdges = tmpOutEdges[tmpNodeHash] || [];
|
|
90
|
-
for (let j = 0; j < tmpEdges.length; j++)
|
|
91
|
-
{
|
|
92
|
-
let tmpTargetHash = tmpEdges[j];
|
|
93
|
-
tmpInDegree[tmpTargetHash]--;
|
|
94
|
-
if (tmpInDegree[tmpTargetHash] <= 0 && !tmpAssigned[tmpTargetHash])
|
|
95
|
-
{
|
|
96
|
-
tmpNextQueue.push(tmpTargetHash);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (tmpCurrentLayer.length > 0)
|
|
102
|
-
{
|
|
103
|
-
tmpLayers.push(tmpCurrentLayer);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
tmpQueue = tmpNextQueue;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// Handle cycles or disconnected nodes
|
|
110
|
-
let tmpRemainingNodes = [];
|
|
111
|
-
for (let i = 0; i < pNodes.length; i++)
|
|
112
|
-
{
|
|
113
|
-
if (!tmpAssigned[pNodes[i].Hash])
|
|
114
|
-
{
|
|
115
|
-
tmpRemainingNodes.push(pNodes[i].Hash);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (tmpRemainingNodes.length > 0)
|
|
119
|
-
{
|
|
120
|
-
tmpLayers.push(tmpRemainingNodes);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Assign positions based on layers
|
|
69
|
+
// Assign positions: one column per layer, each layer vertically centered.
|
|
124
70
|
let tmpCurrentX = tmpStartX;
|
|
125
71
|
|
|
126
72
|
for (let tmpLayerIndex = 0; tmpLayerIndex < tmpLayers.length; tmpLayerIndex++)
|
|
127
73
|
{
|
|
128
74
|
let tmpLayer = tmpLayers[tmpLayerIndex];
|
|
129
75
|
let tmpMaxWidth = 0;
|
|
130
|
-
let tmpCurrentY = tmpStartY;
|
|
76
|
+
let tmpCurrentY = tmpStartY + ((tmpMaxLayerHeight - tmpLayerHeights[tmpLayerIndex]) / 2);
|
|
131
77
|
|
|
132
78
|
for (let i = 0; i < tmpLayer.length; i++)
|
|
133
79
|
{
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout-Rank
|
|
3
|
+
*
|
|
4
|
+
* Shared cycle-tolerant topological ranking for the directed layouts
|
|
5
|
+
* (Layered, Staggered).
|
|
6
|
+
*
|
|
7
|
+
* Plain Kahn's topological sort drops every node that participates in a cycle
|
|
8
|
+
* into a single trailing rank. Any graph with back-edges (workflows, state
|
|
9
|
+
* machines: rejections, retries, "send back") therefore collapses into one
|
|
10
|
+
* tall stripe of unranked nodes, which is the historical "auto-layout bunches
|
|
11
|
+
* everything together and is useless" behavior.
|
|
12
|
+
*
|
|
13
|
+
* `toRanks` instead breaks each cycle at its most-resolved node: when a round
|
|
14
|
+
* finds nothing dependency-free but nodes remain, it forces the unassigned
|
|
15
|
+
* node with the fewest unmet predecessors into the next rank and continues.
|
|
16
|
+
* Cyclic graphs then rank left to right the same way a DAG does.
|
|
17
|
+
*
|
|
18
|
+
* Returns an array of ranks; each rank is an array of node Hashes in stable
|
|
19
|
+
* source order. Self-loops are ignored for ranking (they cannot define an
|
|
20
|
+
* order). Callers map Hashes back to node objects themselves.
|
|
21
|
+
*/
|
|
22
|
+
function toRanks(pNodes, pConnections)
|
|
23
|
+
{
|
|
24
|
+
let tmpRanks = [];
|
|
25
|
+
if (!pNodes || pNodes.length === 0)
|
|
26
|
+
{
|
|
27
|
+
return tmpRanks;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let tmpConnections = Array.isArray(pConnections) ? pConnections : [];
|
|
31
|
+
|
|
32
|
+
let tmpInDegree = {};
|
|
33
|
+
let tmpOutEdges = {};
|
|
34
|
+
for (let i = 0; i < pNodes.length; i++)
|
|
35
|
+
{
|
|
36
|
+
tmpInDegree[pNodes[i].Hash] = 0;
|
|
37
|
+
tmpOutEdges[pNodes[i].Hash] = [];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
for (let i = 0; i < tmpConnections.length; i++)
|
|
41
|
+
{
|
|
42
|
+
let tmpConn = tmpConnections[i];
|
|
43
|
+
// A self-loop cannot define a rank order; skip it.
|
|
44
|
+
if (tmpConn.SourceNodeHash === tmpConn.TargetNodeHash)
|
|
45
|
+
{
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (tmpInDegree.hasOwnProperty(tmpConn.TargetNodeHash))
|
|
49
|
+
{
|
|
50
|
+
tmpInDegree[tmpConn.TargetNodeHash]++;
|
|
51
|
+
}
|
|
52
|
+
if (tmpOutEdges.hasOwnProperty(tmpConn.SourceNodeHash))
|
|
53
|
+
{
|
|
54
|
+
tmpOutEdges[tmpConn.SourceNodeHash].push(tmpConn.TargetNodeHash);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
let tmpAssigned = {};
|
|
59
|
+
let tmpAssignedCount = 0;
|
|
60
|
+
|
|
61
|
+
while (tmpAssignedCount < pNodes.length)
|
|
62
|
+
{
|
|
63
|
+
let tmpRank = [];
|
|
64
|
+
|
|
65
|
+
for (let i = 0; i < pNodes.length; i++)
|
|
66
|
+
{
|
|
67
|
+
let tmpHash = pNodes[i].Hash;
|
|
68
|
+
if (!tmpAssigned[tmpHash] && tmpInDegree[tmpHash] <= 0)
|
|
69
|
+
{
|
|
70
|
+
tmpRank.push(tmpHash);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (tmpRank.length === 0)
|
|
75
|
+
{
|
|
76
|
+
// Cycle break: nothing is dependency-free, so force the unassigned
|
|
77
|
+
// node with the fewest remaining predecessors (ties keep source
|
|
78
|
+
// order, which keeps the result stable across runs).
|
|
79
|
+
let tmpMinDegree = Infinity;
|
|
80
|
+
let tmpPick = null;
|
|
81
|
+
for (let i = 0; i < pNodes.length; i++)
|
|
82
|
+
{
|
|
83
|
+
let tmpHash = pNodes[i].Hash;
|
|
84
|
+
if (!tmpAssigned[tmpHash] && tmpInDegree[tmpHash] < tmpMinDegree)
|
|
85
|
+
{
|
|
86
|
+
tmpMinDegree = tmpInDegree[tmpHash];
|
|
87
|
+
tmpPick = tmpHash;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (tmpPick === null)
|
|
91
|
+
{
|
|
92
|
+
break; // safety; every node is already assigned
|
|
93
|
+
}
|
|
94
|
+
tmpRank.push(tmpPick);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Commit the whole rank, then relax its out-edges so the next round
|
|
98
|
+
// sees the successors it just freed.
|
|
99
|
+
for (let i = 0; i < tmpRank.length; i++)
|
|
100
|
+
{
|
|
101
|
+
tmpAssigned[tmpRank[i]] = true;
|
|
102
|
+
tmpAssignedCount++;
|
|
103
|
+
}
|
|
104
|
+
for (let i = 0; i < tmpRank.length; i++)
|
|
105
|
+
{
|
|
106
|
+
let tmpEdges = tmpOutEdges[tmpRank[i]] || [];
|
|
107
|
+
for (let j = 0; j < tmpEdges.length; j++)
|
|
108
|
+
{
|
|
109
|
+
tmpInDegree[tmpEdges[j]]--;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
tmpRanks.push(tmpRank);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return tmpRanks;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Flatten ranks to a single ordered list of node Hashes (rank by rank, source
|
|
121
|
+
* order within a rank). Convenience for layouts that walk one sequence.
|
|
122
|
+
*/
|
|
123
|
+
function toOrder(pNodes, pConnections)
|
|
124
|
+
{
|
|
125
|
+
let tmpRanks = toRanks(pNodes, pConnections);
|
|
126
|
+
let tmpOrder = [];
|
|
127
|
+
for (let i = 0; i < tmpRanks.length; i++)
|
|
128
|
+
{
|
|
129
|
+
for (let j = 0; j < tmpRanks[i].length; j++)
|
|
130
|
+
{
|
|
131
|
+
tmpOrder.push(tmpRanks[i][j]);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return tmpOrder;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
module.exports =
|
|
138
|
+
{
|
|
139
|
+
toRanks: toRanks,
|
|
140
|
+
toOrder: toOrder
|
|
141
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
const libCoerce = require('./Layout-Coerce.js');
|
|
2
|
+
const libRank = require('./Layout-Rank.js');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Layout-Staggered
|
|
6
|
+
*
|
|
7
|
+
* Serpentine "stairstep" layout for directed graphs. It ranks the nodes left
|
|
8
|
+
* to right by connection topology (the same cycle-tolerant ranking the Layered
|
|
9
|
+
* layout uses), then walks that ordered sequence along a band that steps down a
|
|
10
|
+
* few rows and back up, advancing horizontally at every node.
|
|
11
|
+
*
|
|
12
|
+
* The point is vertical-space efficiency: a long directed chain (a workflow, a
|
|
13
|
+
* delivery pipeline, a state machine) laid out purely left to right runs off
|
|
14
|
+
* the right edge of the canvas. Folding it into a stairstep band keeps the
|
|
15
|
+
* left-to-right reading order while using the height of the viewport, so the
|
|
16
|
+
* whole graph frames at a usable zoom.
|
|
17
|
+
*
|
|
18
|
+
* `Rows` sets how deep the band steps before folding back: 2 is a simple
|
|
19
|
+
* zigzag (odd nodes high, even nodes low); 3+ is a deeper stairstep. The row
|
|
20
|
+
* index follows a triangle wave so the band descends and then climbs rather
|
|
21
|
+
* than snapping back to the top between runs.
|
|
22
|
+
*
|
|
23
|
+
* Numeric parameters are typed `PreciseNumber` so they survive ExpressionParser
|
|
24
|
+
* solver chains; Layout-Coerce converts them back to JS floats at entry.
|
|
25
|
+
*/
|
|
26
|
+
module.exports =
|
|
27
|
+
{
|
|
28
|
+
Name: 'Staggered',
|
|
29
|
+
Label: 'Staggered (Stairstep)',
|
|
30
|
+
Description: 'Topological order folded along a serpentine stairstep band.',
|
|
31
|
+
DefaultEdgeTheme: 'Perimeter',
|
|
32
|
+
|
|
33
|
+
Apply: function (pNodes, pConnections, pParameters)
|
|
34
|
+
{
|
|
35
|
+
if (!pNodes || pNodes.length === 0) return;
|
|
36
|
+
|
|
37
|
+
let tmpParams = pParameters || {};
|
|
38
|
+
let tmpSpacing = libCoerce.toFloat(tmpParams.Spacing, 1.0);
|
|
39
|
+
let tmpRows = Math.max(1, libCoerce.toInt(tmpParams.Rows, 2));
|
|
40
|
+
let tmpColumnSpacing = libCoerce.toFloat(tmpParams.ColumnSpacing, 80) * tmpSpacing;
|
|
41
|
+
let tmpRowOffset = libCoerce.toFloat(tmpParams.RowOffset, 150) * tmpSpacing;
|
|
42
|
+
let tmpStartX = libCoerce.toFloat(tmpParams.StartX, 80);
|
|
43
|
+
let tmpStartY = libCoerce.toFloat(tmpParams.StartY, 80);
|
|
44
|
+
|
|
45
|
+
let tmpConnections = Array.isArray(pConnections) ? pConnections : [];
|
|
46
|
+
|
|
47
|
+
let tmpNodeMap = {};
|
|
48
|
+
for (let i = 0; i < pNodes.length; i++)
|
|
49
|
+
{
|
|
50
|
+
tmpNodeMap[pNodes[i].Hash] = pNodes[i];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let tmpOrder = libRank.toOrder(pNodes, tmpConnections);
|
|
54
|
+
|
|
55
|
+
// A uniform column pitch (the widest node plus the spacing) keeps the
|
|
56
|
+
// stairstep diagonal even regardless of individual node widths.
|
|
57
|
+
let tmpMaxWidth = 0;
|
|
58
|
+
for (let i = 0; i < pNodes.length; i++)
|
|
59
|
+
{
|
|
60
|
+
tmpMaxWidth = Math.max(tmpMaxWidth, pNodes[i].Width || 180);
|
|
61
|
+
}
|
|
62
|
+
let tmpColumnPitch = tmpMaxWidth + tmpColumnSpacing;
|
|
63
|
+
|
|
64
|
+
// Triangle wave: descend (Rows - 1) steps, then climb (Rows - 1) steps.
|
|
65
|
+
let tmpPeriod = (tmpRows > 1) ? (2 * (tmpRows - 1)) : 1;
|
|
66
|
+
|
|
67
|
+
for (let i = 0; i < tmpOrder.length; i++)
|
|
68
|
+
{
|
|
69
|
+
let tmpNode = tmpNodeMap[tmpOrder[i]];
|
|
70
|
+
if (!tmpNode) continue;
|
|
71
|
+
|
|
72
|
+
let tmpRow;
|
|
73
|
+
if (tmpRows <= 1)
|
|
74
|
+
{
|
|
75
|
+
tmpRow = 0;
|
|
76
|
+
}
|
|
77
|
+
else
|
|
78
|
+
{
|
|
79
|
+
let tmpPhase = i % tmpPeriod;
|
|
80
|
+
tmpRow = (tmpPhase < tmpRows) ? tmpPhase : (tmpPeriod - tmpPhase);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
tmpNode.X = tmpStartX + (i * tmpColumnPitch);
|
|
84
|
+
tmpNode.Y = tmpStartY + (tmpRow * tmpRowOffset);
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
DefaultParameters:
|
|
89
|
+
{
|
|
90
|
+
Spacing: 1.0,
|
|
91
|
+
Rows: 2,
|
|
92
|
+
ColumnSpacing: 80,
|
|
93
|
+
RowOffset: 150,
|
|
94
|
+
StartX: 80,
|
|
95
|
+
StartY: 80
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
ParameterSchema:
|
|
99
|
+
{
|
|
100
|
+
Spacing: { Type: 'PreciseNumber', Label: 'Spacing (multiplier)', Default: 1.0, Min: 0.1, Max: 5 },
|
|
101
|
+
Rows: { Type: 'Number', Label: 'Rows', Default: 2, Min: 1, Max: 12 },
|
|
102
|
+
ColumnSpacing: { Type: 'PreciseNumber', Label: 'Column spacing', Default: 80, Min: 0, Max: 1000 },
|
|
103
|
+
RowOffset: { Type: 'PreciseNumber', Label: 'Row offset', Default: 150, Min: 0, Max: 1000 },
|
|
104
|
+
StartX: { Type: 'PreciseNumber', Label: 'Start X', Default: 80, Min: -10000, Max: 10000 },
|
|
105
|
+
StartY: { Type: 'PreciseNumber', Label: 'Start Y', Default: 80, Min: -10000, Max: 10000 }
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
ParameterManifest:
|
|
109
|
+
{
|
|
110
|
+
Scope: 'PictFlowLayout-Staggered',
|
|
111
|
+
Sections:
|
|
112
|
+
[
|
|
113
|
+
{ Name: 'Staggered Parameters', Hash: 'PFLStaggeredSection', Groups: [{ Name: 'Defaults', Hash: 'PFLStaggeredGroup' }] }
|
|
114
|
+
],
|
|
115
|
+
Descriptors:
|
|
116
|
+
{
|
|
117
|
+
'PictFlowLayoutEditor.Parameters.Spacing':
|
|
118
|
+
{ Name: 'Spacing (multiplier)', Hash: 'Spacing', DataType: 'PreciseNumber', Default: 1.0, PictForm: { Section: 'PFLStaggeredSection', Group: 'PFLStaggeredGroup', Row: 0, Width: 6, Min: 0.1, Max: 5 } },
|
|
119
|
+
'PictFlowLayoutEditor.Parameters.Rows':
|
|
120
|
+
{ Name: 'Rows', Hash: 'Rows', DataType: 'Number', Default: 2, PictForm: { Section: 'PFLStaggeredSection', Group: 'PFLStaggeredGroup', Row: 0, Width: 6, Min: 1, Max: 12 } },
|
|
121
|
+
'PictFlowLayoutEditor.Parameters.ColumnSpacing':
|
|
122
|
+
{ Name: 'Column spacing', Hash: 'ColumnSpacing', DataType: 'PreciseNumber', Default: 80, PictForm: { Section: 'PFLStaggeredSection', Group: 'PFLStaggeredGroup', Row: 1, Width: 6, Min: 0, Max: 1000 } },
|
|
123
|
+
'PictFlowLayoutEditor.Parameters.RowOffset':
|
|
124
|
+
{ Name: 'Row offset', Hash: 'RowOffset', DataType: 'PreciseNumber', Default: 150, PictForm: { Section: 'PFLStaggeredSection', Group: 'PFLStaggeredGroup', Row: 1, Width: 6, Min: 0, Max: 1000 } },
|
|
125
|
+
'PictFlowLayoutEditor.Parameters.StartX':
|
|
126
|
+
{ Name: 'Start X', Hash: 'StartX', DataType: 'PreciseNumber', Default: 80, PictForm: { Section: 'PFLStaggeredSection', Group: 'PFLStaggeredGroup', Row: 2, Width: 6, Min: -10000, Max: 10000 } },
|
|
127
|
+
'PictFlowLayoutEditor.Parameters.StartY':
|
|
128
|
+
{ Name: 'Start Y', Hash: 'StartY', DataType: 'PreciseNumber', Default: 80, PictForm: { Section: 'PFLStaggeredSection', Group: 'PFLStaggeredGroup', Row: 2, Width: 6, Min: -10000, Max: 10000 } }
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
@@ -106,7 +106,7 @@ class PictServiceFlowDataManager extends libFableServiceProviderBase
|
|
|
106
106
|
OpenPanels: Array.isArray(pFlowData.OpenPanels) ? pFlowData.OpenPanels : [],
|
|
107
107
|
SavedLayouts: Array.isArray(pFlowData.SavedLayouts) ? pFlowData.SavedLayouts : [],
|
|
108
108
|
ViewState: Object.assign(
|
|
109
|
-
{ PanX: 0, PanY: 0, Zoom: 1, SelectedNodeHash: null, SelectedConnectionHash: null, SelectedTetherHash: null },
|
|
109
|
+
{ PanX: 0, PanY: 0, Zoom: 1, SelectedNodeHash: null, SelectedNodeHashes: [], SelectedConnectionHash: null, SelectedTetherHash: null },
|
|
110
110
|
pFlowData.ViewState || {}
|
|
111
111
|
),
|
|
112
112
|
LayoutAlgorithm: (typeof pFlowData.LayoutAlgorithm === 'string' && pFlowData.LayoutAlgorithm !== '') ? pFlowData.LayoutAlgorithm : tmpDefaultAlgorithm,
|