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
Copy file name to clipboardExpand all lines: README.md
+114-52
Original file line number
Diff line number
Diff line change
@@ -18,15 +18,12 @@
18
18
19
19
> `plotly_resampler`: visualize large sequential data by **adding resampling functionality to Plotly figures**
20
20
21
-
[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.
21
+
[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.

28
24
29
-
In [this Plotly-Resampler demo](https://github.com/predict-idlab/plotly-resampler/blob/main/examples/basic_example.ipynb) over `110,000,000` data points are visualized!
25
+
26
+
In [this Plotly-Resampler demo](https://github.com/predict-idlab/plotly-resampler/blob/main/examples/basic_example.ipynb) over `110,000,000` data points are visualized!
30
27
31
28
<!-- These dynamic aggregation callbacks are realized with: -->
32
29
<!-- * [Dash](https://github.com/plotly/dash) when a `go.Figure` object is wrapped with dynamic aggregation functionality, see example ⬆️. -->
@@ -39,79 +36,144 @@ In [this Plotly-Resampler demo](https://github.com/predict-idlab/plotly-resample
# auto mode: when working in an IPython environment, this will automatically be a
69
+
# FigureWidgetResampler else, this will be an FigureResampler
70
+
f = go.Figure()
71
+
f.add_trace({"y": noisy_sin +2, "name": "yp2"})
72
+
f
73
+
```
74
+
75
+
>**Note**: This wraps **all** plotly graph object figures with a
76
+
>`FigureResampler`|`FigureWidgetResampler`. This can thus also be
77
+
> used for the `plotly.express` interface. 🎉
60
78
61
-
> **Tip** 💡:
62
-
> For significant faster initial loading of the Figure, we advise to wrap the constructor of the plotly Figure and add the trace data as `hf_x` and `hf_y`
79
+
</details>
63
80
64
-
### Minimal example
81
+
* 👷 <b>Manually</b> _(higher data aggregation configurability, more speedup possibilities)_:
82
+
<details>
83
+
<summary>Within a <b><i>jupyter</i></b> environment without creating a <i>web application</i></summary>
84
+
<br>
65
85
66
-
```python
67
-
import plotly.graph_objects as go; import numpy as np
68
-
from plotly_resampler import FigureResampler, FigureWidgetResampler
86
+
1. wrap the plotly Figure with`FigureWidgetResampler`
87
+
2. output the `FigureWidgetResampler` instance in a cell
* ability to develop or select your preferred sequence aggregation method
155
+
</details>
102
156
103
157
### Important considerations & tips
104
158
105
159
* When running the code on a server, you should forward the port of the `FigureResampler.show_dash()` method to your local machine.<br>
106
160
**Note** that you can add dynamic aggregation to plotly figures with the `FigureWidgetResampler` wrapper without needing to forward a port!
107
-
* In general, when using downsampling one should be aware of (possible) [aliasing](https://en.wikipedia.org/wiki/Aliasing) effects.
108
-
The <b><astyle="color:orange">[R]</a></b> in the legend indicates when the corresponding trace is being resampled (and thus possibly distorted) or not. Additionally, the `~<range>` suffix represent the mean aggregation bin size in terms of the sequence index.
161
+
* In general, when using downsampling one should be aware of (possible) [aliasing](https://en.wikipedia.org/wiki/Aliasing) effects.
162
+
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.
109
163
* 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).
110
164
165
+
<!--## Cite
166
+
167
+
```latex
168
+
{
169
+
}
170
+
``` -->
111
171
112
172
## Future work 🔨
113
173
114
-
* Support `.add_traces()` (currently only `.add_trace` is supported)
174
+
- [x] Support `.add_traces()` (currently only `.add_trace`is supported)
175
+
- [ ] Support `hf_color`and`hf_markersize`, see [#50](https://github.com/predict-idlab/plotly-resampler/pull/50)
176
+
- [ ] Create C bindings for our EfficientLTTB algorithm.
0 commit comments