cylc/cylc — pull request #163 by benfitzpatrick (2012-10-25 08:53:45+00:00)
Title: gcontrol reduce graph redraw

This improves the stability of the graph view ('jumping' behaviour) - it's now only allowed to properly redraw when the structure is changed (nodes added/removed) or the view options change - e.g. filtering is applied or landscape mode is selected.

I added a bit of dirty code in cylc_xdot.py to switch off xdot's auto-re-centre behaviour, which otherwise destroys the panning. I think it's relatively harmless.

Every `update_graph` stores the graph edges, the extra ids, and some viewing options in a tuple (using `self.get_graph_id`). This is then compared to the last `update_graph`'s tuple. If the tuples are different (any of the properties are different), the graph is refreshed and jumps as it should. If not, only the node colours will change depending on state.

I've tested it under the viewing options for cycling and non-cycling suites, but there may be an 'edge' case I've missed - ha ha.