Grid - modelint/flatland-model-diagram-editor GitHub Wiki
Positioning nodes in a drawing tool typically involves pixel level placement which is overkill for most types of model drawings. To get straight lines you need to fidget the pixel level position and alignment. Some tools let you snap to a grid, but the grid is usually fine grained to make it possible to position the node connectors.
In Flatland, we use a single Grid laid out across a Canvas like a spreadsheet. Rows and Columns in the Grid can be any width, but are generally small, medium or large node-sized. In a class diagram, for example, each Column is roughly the size of one class-width and each Row is roughly the height of a single class-height. This makes it easy to specify position using a text markup language. Each Node is placed at a grid coordinate with a default or specified alignment. For particularly large nodes, you can position them on a single Cell of the Grid and then have them span multiple Rows or Columns.
So the Grid defines a coordinate system for the cplace of Nodes.
It starts out empty, with no Rows or Columns and only an origin. Each loaded Node specifies a desired grid coordinate. The Grid then extends by the necessary (if any) Rows and Columns to create a place to position the Node.
Identifiers
- ID
Attributes
Cell padding
Distances from cell to drawn node boundaries
Type: Padding
Cell alignment
Default alignment for any placed node (can be overidden locally by node
Type: Alignment