aazuspan / sankee

Visualize classified time series data with interactive Sankey plots in Google Earth Engine
https://sankee.readthedocs.io/en/latest/index.html
MIT License
100 stars 15 forks source link

Store dataframe to avoid re-generating unnecessarily (#36) #37

Closed aazuspan closed 2 years ago

aazuspan commented 2 years ago

The SankeyPlot object now has a df attribute that's initialized with the object and updated whenever generate_plot is called. By using this attribute we can avoid a bunch of unnecessary regenerations of the dataframe.

This technically cuts the generate_gui time at least in half (85ms -> 43ms for a plot with 4 classes, 344ms -> 107ms for a plot with 17 classes), although that may not be noticeable since most of the time is spent waiting for Earth Engine data.

Close #36