Accessing plotly figure_factory figure properties on client-side

Hmm,

I think I’ve gotten somewhere here. If we take the curve number as the index of the traces in the data, this seems to work in terms of verifying the corresponding traces in the data.

# standard Anvil click event callback for the plot
def update_point(self, **event_args):
    
 ind=event_args['points'][0]['curve_number']

 # seems to print what I've clicked on
 print(self.plot_1.data[ind]['y'], self.plot_1.data[ind]['x'])

Based on this you should be able to simply reassign new values to the clicked traces as you see fit (I’ve shown an example of updating the data and redrawing the plot above).

Here is what it could look like just so you get a basic idea (I parsed the date strings and added to the month value each time a given trace is clicked).

1 Like