sky-uk / anticipy

A Python library for time series forecasting
BSD 3-Clause "New" or "Revised" License
82 stars 13 forks source link

When generating plotly plots, reduce file size #99

Closed capelastegui closed 5 years ago

capelastegui commented 5 years ago

When we save a plotly plot as a file, the plotly javascript library is embedded by default. This increases file size significantly. A new feature of plotly lets us replace this with a link to download the library, resulting in much smaller files. We should use this.

In forecast_plot, replace:

            py.offline.plot(fig, filename=path, show_link=False,
                            auto_open=auto_open, include_plotlyjs=True)

with

            py.offline.plot(fig, filename=path, show_link=False,
                            auto_open=auto_open, include_plotlyjs='cdn')
capelastegui commented 5 years ago

New feature tested successfully - in the test scenarios, with small input datasets, file size is actually smaller for plotly than .png.