Prevent label overlapping in DAG #651

Merged
merged 7 commits into from Jan 26, 2017

Conversation

Projects
None yet
2 participants
@laerreal
Contributor

laerreal commented Jan 25, 2017

The patch series improves DAG laying out algorithm to prevent label overlapping with commits and other labels. It introduces row distribution technique and embeds it into column distribution algorithm.

The difference could be easy seen by adding tags to left branch commits of parallel branches.

before
after

First patch fixes incorrect DAG scrolling. If bottom commit generation is zero then it is hidden below bottom edge of the widget. The issue could be reproduced by showing whole the graph.

scrolling bug

laerreal added some commits Jan 20, 2017

dag: invert y coordinate offset sign in node laying out
Incorrect offset sign causes bottom nodes be placed below bottom of graph view.
Because bottom node generation may not be 0, the issue was missed. Full graph
drawing reproduces the issue.

Signed-off-by: Efimov Vasily <real@ispras.ru>
dag: clearify y coordinate offset sign
The graph grows in negative y direction. So, y offset should be negative
preventing layout algorithm misunderstanding.

Signed-off-by: Efimov Vasily <real@ispras.ru>
dag: use row instead of commit generation during node laying out
Signed-off-by: Efimov Vasily <real@ispras.ru>
dag: add 'row' attribute to Commit
Signed-off-by: Efimov Vasily <real@ispras.ru>
dag: add cell distribution halpers to GraphView
reset_rows, declare_column, alloc_cell and propagate_frontier methods do
implement row distribution algorithm primitives. The algorithm is described in
commets.

Signed-off-by: Efimov Vasily <real@ispras.ru>
dag: embed row distribution in column recomputation algorithm
Signed-off-by: Efimov Vasily <real@ispras.ru>
dag: rename recompute_columns to recompute_grid
The recompute_columns method is actually recomputes rows too. Hence it
recomputes all the grid.

Signed-off-by: Efimov Vasily <real@ispras.ru>

davvid added a commit to davvid/git-cola that referenced this pull request Jan 26, 2017

Merge pull request #651 from laerreal/prevent_tag_overlapping
Enhance the DAG layout algorithm to prevent overlapping tags.

* laerreal/prevent_tag_overlapping:
  dag: rename recompute_columns to recompute_grid
  dag: use row instead of commit generation during node laying out
  dag: embed row distribution in column recomputation algorithm
  dag: add cell distribution halpers to GraphView
  dag: add 'row' attribute to Commit
  dag: clearify y coordinate offset sign
  dag: invert y coordinate offset sign in node laying out

Signed-off-by: David Aguilar <davvid@gmail.com>

@davvid davvid merged commit 943bcbb into git-cola:master Jan 26, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment