Add support for Orientation change

The graph will auto relayout itself on orientation change.