Implement undo-redo for graph layout command