|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
5 | | - "id": "722020df", |
| 5 | + "id": "8948530e", |
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | 8 | "# Dash\n", |
9 | 9 | "\n", |
10 | | - "ITables includes a Dash component since v2.3.0.\n", |
11 | | - "\n", |
12 | | - "## Displaying a DataFrame\n", |
13 | | - "\n", |
14 | 10 | "If you wish to display a DataFrame which content is fixed (not reacting to the other controls in the application), you just need to import `ITable` from `itables.dash` and add it to your layout like here:\n", |
15 | 11 | "\n", |
16 | | - "```{include} ../apps/dash/1_display_only.py\n", |
| 12 | + "```{include} ../../apps/dash/1_display_only.py\n", |
17 | 13 | ":code: python\n", |
18 | 14 | "```\n", |
19 | 15 | "\n", |
20 | 16 | "## Selected rows\n", |
21 | 17 | "\n", |
22 | 18 | "Listening to the selected rows is simply done by adding `select=True` to the `ITable` call, and then implementing a callback on `Input(\"my_dataframe\", \"selected_rows\")`.\n", |
23 | 19 | "\n", |
24 | | - "```{include} ../apps/dash/2_selected_rows.py\n", |
| 20 | + "```{include} ../../apps/dash/2_selected_rows.py\n", |
25 | 21 | ":code: python\n", |
26 | 22 | "```\n", |
27 | 23 | "\n", |
28 | 24 | "## Updating the DataFrame\n", |
29 | 25 | "\n", |
30 | | - "The `ITable` component has many properties. These properties (data, columns, selected rows etc) need to be updated in a consistent way. Therefore we recommend that you list the outputs with `ITableOutputs(\"my_dataframe\")` in your callback, and update them with `updated_itable_outputs` which takes the same arguments as `show`, e.g. `df`, `caption`, `selected_rows`, etc, like in the below (extracted from this [example app](https://github.com/mwouts/itables/tree/main/apps/dash/3_update_table.py)):\n", |
| 26 | + "The `ITable` component has many properties. These properties (table content, selected rows etc) need to be updated in a consistent way. Therefore we recommend that you list the outputs with `ITableOutputs(\"my_dataframe\")` in your callback, and update them with `updated_itable_outputs` which takes the same arguments as `show`, e.g. `df`, `caption`, `selected_rows`, etc, like in the below (extracted from this [example app](https://github.com/mwouts/itables/tree/main/apps/dash/3_update_table.py)):\n", |
31 | 27 | "\n", |
32 | 28 | "```python\n", |
33 | 29 | "from itables.dash import ITable, ITableOutputs, updated_itable_outputs\n", |
|
60 | 56 | " return updated_itable_outputs(\n", |
61 | 57 | " caption=caption, selected_rows=selected_rows, current_dt_args=dt_args, **kwargs\n", |
62 | 58 | " )\n", |
63 | | - "```\n", |
64 | | - "\n", |
65 | | - "## Limitations\n", |
66 | | - "\n", |
67 | | - "Compared to `show`, the `ITable` component has the same limitations as the [Jupyter Widget](widget.md#limitations)\n", |
68 | | - "or the [Streamlit component](streamlit.md#limitations),\n", |
69 | | - "e.g. structured headers are not available, you can't pass JavaScript callback, etc." |
| 59 | + "```" |
70 | 60 | ] |
71 | 61 | } |
72 | 62 | ], |
|
0 commit comments