The `.interactive` API enhances the API of data analysis libraries like Pandas, Dask, and Xarray, by allowing to replace in a pipeline static values by dynamic widgets. When displayed, an interactive pipeline will incorporate the dynamic widgets that control it, as long as its n
| 155 | |
| 156 | |
| 157 | class Interactive: |
| 158 | """ |
| 159 | The `.interactive` API enhances the API of data analysis libraries |
| 160 | like Pandas, Dask, and Xarray, by allowing to replace in a pipeline |
| 161 | static values by dynamic widgets. When displayed, an interactive |
| 162 | pipeline will incorporate the dynamic widgets that control it, as long |
| 163 | as its normal output that will automatically be updated as soon as a |
| 164 | widget value is changed. |
| 165 | |
| 166 | `Interactive` can be instantiated with an object. However the recommended |
| 167 | approach is to instantiate it via the `.interactive` accessor that is |
| 168 | available on a data structure when it has been patched, e.g. after |
| 169 | executing `import hvplot.pandas`. The accessor can also be called which |
| 170 | allows to pass down kwargs. |
| 171 | |
| 172 | A pipeline can then be created from this object, the pipeline will render |
| 173 | with its widgets and its interactive output. |
| 174 | |
| 175 | Reference: https://hvplot.holoviz.org/user_guide/Interactive.html |
| 176 | |
| 177 | Parameters |
| 178 | ---------- |
| 179 | obj: DataFrame, Series, DataArray, DataSet |
| 180 | A supported data structure object |
| 181 | loc : str, optional |
| 182 | Widget(s) location, one of 'bottom_left', 'bottom_right', 'right' |
| 183 | 'top-right', 'top-left' and 'left'. By default 'top_left' |
| 184 | center : bool, optional |
| 185 | Whether to center to pipeline output, by default False |
| 186 | max_rows : int, optional |
| 187 | Maximum number of rows displayed, only used when the output is a |
| 188 | dataframe, by default 100 |
| 189 | kwargs: optional |
| 190 | Optional kwargs that are passed down to customize the displayed |
| 191 | object. E.g. if the output is a DataFrame `width=200` will set |
| 192 | the size of the DataFrame Pane that renders it. |
| 193 | |
| 194 | Examples |
| 195 | -------- |
| 196 | Instantiate it from an object: |
| 197 | >>> dfi = Interactive(df) |
| 198 | |
| 199 | Or with the `.interactive` accessor when the object is patched: |
| 200 | >>> import hvplot.pandas |
| 201 | >>> dfi = df.interactive |
| 202 | >>> dfi = df.interactive(width=200) |
| 203 | |
| 204 | Create interactive pipelines from the `Interactive` object: |
| 205 | >>> widget = panel.widgets.IntSlider(value=1, start=1, end=5) |
| 206 | >>> dfi.head(widget) |
| 207 | """ |
| 208 | |
| 209 | # TODO: Why? |
| 210 | __metaclass__ = abc.ABCMeta |
| 211 | |
| 212 | # Hackery to support calls to the classic `.plot` API, see `_get_ax_fn` |
| 213 | # for more hacks! |
| 214 | _fig = None |
no outgoing calls
searching dependent graphs…