Retrieve state of graph after legend update

@chriddyp
Is there anyway to get the state of the graph (data set in the graph) component after I filter the graph using the legend? so that I can use the filtered data behind the scenes using callbacks to store it in the database.