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**
19
20
20
-
[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 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.
21
22
22
23
<palign="center">
23
24
<a href="#readme">
@@ -54,11 +55,11 @@ To **add dynamic resampling** to your plotly Figure
54
55
2. output the `FigureWidgetResampler` instance in a cell
55
56
56
57
> **Note**:
57
-
> Any plotly Figure can be wrapped with FigureResampler and FigureWidgetResampler! 🎉
58
+
> Any plotly Figure can be wrapped with `FigureResampler` and `FigureWidgetResampler`! 🎉
58
59
> But, (obviously) only the scatter traces will be resampled.
59
60
60
61
> **Tip** 💡:
61
-
> For significant faster initial loading of the Figure, we advise to wrap the constructor of the plotly Figure with `FigureResampler`and add the trace data as `hf_x` and `hf_y`
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`
62
63
63
64
### Minimal example
64
65
@@ -69,7 +70,7 @@ from plotly_resampler import FigureResampler, FigureWidgetResampler
* just add the `FigureResampler` decorator around a plotly Figure and call `.show_dash()`
93
+
* just add either
94
+
*`FigureResampler` decorator around a plotly Figure and call `.show_dash()`
95
+
*`FigureWidgetResampler` decorator around a plotly Figure and output the instance in a cell
93
96
* allows all other plotly figure construction flexibility to be used!
94
97
***Environment-independent**
95
98
* can be used in Jupyter, vscode-notebooks, Pycharm-notebooks, Google Colab, and even as application (on a server)
@@ -100,9 +103,10 @@ fig
100
103
### Important considerations & tips
101
104
102
105
* When running the code on a server, you should forward the port of the `FigureResampler.show_dash()` method to your local machine.<br>
103
-
**note** that you can add dynamic aggregation to plotly figures with the `FigureWidgetResampler` wrapper.
106
+
**Note** that you can add dynamic aggregation to plotly figures with the `FigureWidgetResampler` wrapper without needing to forward a port!
104
107
* In general, when using downsampling one should be aware of (possible) [aliasing](https://en.wikipedia.org/wiki/Aliasing) effects.
105
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.
109
+
106
110
## Future work 🔨
107
111
108
112
* Support `.add_traces()` (currently only `.add_trace` is supported)
Copy file name to clipboardExpand all lines: docs/sphinx/getting_started.rst
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Getting started 🚀
7
7
``plotly-resampler`` serves two main **modules**:
8
8
9
9
* :py:mod:`figure_resampler <plotly_resampler.figure_resampler>`: a wrapper for *plotly.graph\_objects Figures*, coupling the dynamic resampling functionality to the *Figure*.
10
-
* :py:mod:`aggregation <plotly_resampler.aggregation>`: a module withholds various data aggregation methods.
10
+
* :py:mod:`aggregation <plotly_resampler.aggregation>`: a module that withholds various data aggregation methods.
11
11
12
12
Installation ⚙️
13
13
---------------
@@ -42,11 +42,11 @@ Dynamic resampling callbacks are realized with either:
42
42
43
43
To **add dynamic resampling** using a **FigureWidget**, you should:
44
44
1. wrap your plotly Figure (can be a ``go.Figure``) with :class:`FigureWidgetResampler <plotly_resampler.figure_resampler.FigureWidgetResampler>`
45
-
2. Create a cell output for the ``FigureWidgetResampler`` instance
45
+
2. output the ```FigureWidgetResampler`` instance in a cell
46
46
47
47
.. tip::
48
48
49
-
For **significant faster initial loading** of the Figure, we advise to wrap the constructor of the plotly Figure with :class:`FigureResampler <plotly_resampler.figure_resampler.FigureResampler>` and add the trace data as ``hf_x`` and ``hf_y``
49
+
For **significant faster initial loading** of the Figure, we advise to wrap the constructor of the plotly Figure with either :class:`FigureResampler <plotly_resampler.figure_resampler.FigureResampler>` or :class:`FigureWidgetResampler <plotly_resampler.figure_resampler.FigureWidgetResampler>` and add the trace data as ``hf_x`` and ``hf_y``
0 commit comments