connecting GUI to graph