{ "cells": [ { "cell_type": "markdown", "id": "1d944591", "metadata": {}, "source": [ "# Search Panes\n", "\n", "[SearchPanes](https://datatables.net/extensions/searchpanes/) is an extension that lets you select rows based on unique values. In the example below we have activated the cascade filtering through the [`searchPanes.cascadePanes`](https://datatables.net/extensions/searchpanes/examples/initialisation/cascadePanes.html) argument.\n", "\n", "Note that, in Jupyter, the [`searchPanes.layout`](https://datatables.net/extensions/searchpanes/layout) argument is required (otherwise the search panes are too wide)." ] }, { "cell_type": "code", "execution_count": 1, "id": "14852b98", "metadata": { "tags": [ "full-width" ] }, "outputs": [ { "data": { "text/html": [ "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", " \n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", "\n", " Loading ITables v2.4.0rc1 from the init_notebook_mode cell...\n", " (need help?)
\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import itables\n", "\n", "itables.init_notebook_mode()\n", "\n", "df = itables.sample_dfs.get_countries(html=False, climate_zone=True)\n", "\n", "itables.show(\n", " df.reset_index(),\n", " layout={\"top1\": \"searchPanes\"},\n", " searchPanes={\"layout\": \"columns-3\", \"cascadePanes\": True, \"columns\": [1, 6, 7]},\n", ")" ] }, { "cell_type": "markdown", "id": "86ab6a54", "metadata": {}, "source": [ "```{warning}\n", "When searching, please keep in mind that ITables will [downsample](../downsampling.md) your table if it is larger than `maxBytes`, so you might not see the full dataset - pay attention to the downsampling message at the bottom left of the table.\n", "```" ] } ], "metadata": { "jupytext": { "formats": "md:myst", "notebook_metadata_filter": "-jupytext.text_representation.jupytext_version", "text_representation": { "extension": ".md", "format_name": "myst", "format_version": 0.13 } }, "kernelspec": { "display_name": "itables", "language": "python", "name": "itables" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.12" }, "source_map": [ 13, 21, 35 ] }, "nbformat": 4, "nbformat_minor": 5 }