在mxgraph中有泳道示例,但它不是自动的.所以我把graphlayout示例作为基础代替,并做了一些改动:
以下是我创建泳道的方法:
var lane1 = graph.insertVertex(parent, null, 'Lane 1', 0, 0, 1000, 100, 'swimlane');
var lane2 = graph.insertVertex(parent, null, 'Lane 2', 0, 100, 1000, 100, 'swimlane');
// use as parent...
var v1 = graph.insertVertex(lane1, null, 'A', 0, 0, w, h);
Run Code Online (Sandbox Code Playgroud)
并执行布局:
layout.orientation = mxConstants.DIRECTION_WEST;
layout.resizeParent = true;
layout.execute(parent, [lane1, lane2]);
Run Code Online (Sandbox Code Playgroud)
这是测试页面.
现在,这里有两个问题:
小智 5
远非完美,但不知何故有所改进:
我已经添加:
layout.execute(lane1, [v1,v2,v3,v4]);
layout.execute(lane2, [v5,v6,v7,v8]);
Run Code Online (Sandbox Code Playgroud)
并更改resizeParent为false,看起来车道受到尊重,但看起来仍然不愉快。
| 归档时间: |
|
| 查看次数: |
984 次 |
| 最近记录: |