You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> `plotly_resampler`: visualize large sequential data by **adding resampling functionality to Plotly figures**
21
19
22
-
[Plotly](https://github.com/plotly/plotly.py) is an awesome interactive visualization library, however it can get pretty slow when a lot of data points are visualized (100 000+ datapoints). This library solves this by downsampling (aggregating) the data respective to the view and then plotting the aggregated points. When you interact with the plot (panning, zooming, ...), callbacks are used to aggregate data and update the figure.
20
+
`plotly-resampler` improves the scalability of [Plotly](https://github.com/plotly/plotly.py) for visualizing large time series datasets. Specifically, our library _dynamically_**aggregates time-series data respective to the current graph view**, ensuring efficient and responsive updates during user interactions like panning or zooming via callbacks.
21
+
22
+
This core aggregation functionality is achieved by utilizing by _time-series data point selection algorithms_, for which `plotly-resampler` leverages the highly optimized implementations available in [tsdownsample](https://github.com/predict-idlab/tsdownsample). Our default data aggregation method is `MinMaxLTTB` (and selects 1000 data points for plotting). For a deeper understanding of this method, you can consult to the algorithm's dedicated [MinMaxLTTB repository](https://github.com/predict-idlab/MinMaxLTTB) and the associated [research paper](https://arxiv.org/abs/2305.00332).
23
23
24
24

25
25
@@ -34,32 +34,31 @@ In [this Plotly-Resampler demo](https://github.com/predict-idlab/plotly-resample
<details><summary><b>What is the difference between plotly-resampler figures and plain plotly figures?</b></summary>
44
+
<details><summary><b>👀 What is the difference between plotly-resampler figures and plain plotly figures?</b></summary>
45
45
46
46
`plotly-resampler` can be thought of as wrapper around plain plotly figures which adds visualization scalability to line-charts by dynamically aggregating the data w.r.t. the front-end view. `plotly-resampler` thus adds dynamic aggregation functionality to plain plotly figures.
47
47
48
-
**Important to know**:
48
+
**❗ Important to know**:
49
49
50
-
*``show``*always*returns a static html view of the figure, i.e., no dynamic aggregation can be performed on that view.
50
+
*``show``*always*generates a static HTML view of the figure, prohibiting dynamic aggregation.
51
51
* To have dynamic aggregation:
52
-
53
-
* with ``FigureResampler``, you need to call ``show_dash`` (or output the object in a cell via ``IPython.display``) -> which spawns a dash-web app, and the dynamic aggregation is realized with dash callback.
54
-
* with ``FigureWidgetResampler``, you need to use ``IPython.display`` on the object, which uses widget-events to realize dynamic aggregation (via the running IPython kernel).
52
+
* Use `show_dash` with `FigureResampler` to initiate a **Dash** app to realize the dynamic aggregation with **callbacks**.<br>(or output the object in a cell via ``IPython.display``), which will also spawn a dash-web app
53
+
* with ``FigureWidgetResampler``, you need to use ``IPython.display`` on the object, which uses widget-events to realize dynamic aggregation (via the running **IPython kernel**).
55
54
56
55
**Other changes of plotly-resampler figures w.r.t. vanilla plotly**:
57
56
58
57
***double-clicking** within a line-chart area **does not Reset Axes**, as it results in an “Autoscale” event. We decided to implement an Autoscale event as updating your y-range such that it shows all the data that is in your x-range.
59
58
***Note**: vanilla Plotly figures their Autoscale result in Reset Axes behavior, in our opinion this did not make a lot of sense. It is therefore that we have overriden this behavior in plotly-resampler.
60
59
</details><br>
61
60
62
-
### Features :tada:
61
+
### 📋 Features
63
62
64
63
***Convenient** to use:
65
64
* just add either
@@ -72,7 +71,7 @@ In [this Plotly-Resampler demo](https://github.com/predict-idlab/plotly-resample
72
71
* Interface for **various aggregation algorithms**:
73
72
* ability to develop or select your preferred sequence aggregation method
74
73
75
-
## Usage
74
+
## 🚀 Usage
76
75
77
76
**Add dynamic aggregation** to your plotly Figure _(unfold your fitting use case)_
@@ -149,9 +148,9 @@ In [this Plotly-Resampler demo](https://github.com/predict-idlab/plotly-resample
149
148
150
149
>**Note**:
151
150
> Any plotly Figure can be wrapped with`FigureResampler`and`FigureWidgetResampler`! 🎉
152
-
> But, (obviously) only the scatter traces will be resampled.
151
+
> But**only** the `go.Scatter`/`go.Scattergl`**traces are resampled**.
153
152
154
-
## Important considerations & tips
153
+
## 💭 Important considerations & tips
155
154
156
155
* When running the code on a server, you should forward the port of the `FigureResampler.show_dash()` method to your local machine.<br>
157
156
**Note** that you can add dynamic aggregation to plotly figures with the `FigureWidgetResampler` wrapper without needing to forward a port!
@@ -160,9 +159,10 @@ In [this Plotly-Resampler demo](https://github.com/predict-idlab/plotly-resample
160
159
The <b style="color:orange">[R]</b>in the legend indicates when the corresponding trace is being resampled (and thus possibly distorted) ornot. Additionally, the `~<range>` suffix represent the mean aggregation bin size in terms of the sequence index.
161
160
* The plotly **autoscale** event (triggered by the autoscale button or a double-click within the graph), **does not reset the axes but autoscales the current graph-view** of plotly-resampler figures. This design choice was made as it seemed more intuitive for the developers to support this behavior with double-click than the default axes-reset behavior. The graph axes can ofcourse be resetted by using the `reset_axis` button. If you want to give feedback and discuss this further with the developers, see issue [#49](https://github.com/predict-idlab/plotly-resampler/issues/49).
162
161
163
-
## Citation and papers
162
+
## 📜 Citation and papers
164
163
165
164
The paper about the plotly-resampler toolkit itself (preprint): https://arxiv.org/abs/2206.08703
165
+
166
166
```bibtex
167
167
@inproceedings{van2022plotly,
168
168
title={Plotly-resampler: Effective visual analytics for large time series},
0 commit comments