ELK,是Eclipse Layout Kernel的简写形式,它不是单指一个具体的布局算法,是一系列布局算法的组合,比较常用的两个算法是Layered和Mr.Tree,ELK不做渲染层的事情,不render the drawing but only computes positions and possibly dimensions。鉴于ELK的配置选项比较多并且目前没有中文文档,所以我会有一系列相关的文章记录一下ELK配置选项的学习过程。 ELK中的配置都是通过一个叫identifier(标识符)来做的,每一个算法名字,或者每一个配置选项都有一个唯一的identifier,作为一个一线开发者主要的工作就是正确配置这些identifier.
Mr.Tree的算法的key是mrtree,这个算法是基于树的算法,computes a spanning tree of the input graph and arranges all nodes according to the resulting parent-children hierarchy. 这个算法布局由于是基于树的,所以效果是很漂亮的。
- Supported Options:
- Aspect Ratio
- Debug Mode
- Direction, 方向
- Edge End Texture Length
- Edge Node Spacing
- Edge Routing Spacing
- Fixed Graph Size
- Interactive
- Interactive Layout
- Node Label Placement
- Node Size Minimum
- Node Size Options
- Node Spacing
- Omit Node Micro Layout
- Padding
- Port Label Placement
- Position Constraint
- Search Order
- Separate Connected Components
- Topdown Hierarchical Node Aspect Ratio
- Topdown Hierarchical Node Width
- Topdown Layout
- Topdown Node Type
- Topdown Scale Factor
- Tree Level
- Weighting of Nodes
关于一些diagram相关的一些术语:
- ports: edges' attachment points on the corresponding nodes' borders
- diagram editors: 图编辑器
- diagram viewers: 图阅读器