added method to create a graph from JSON representation