{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " \n", " \n", " \n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Pivot Table\n", "\n", "Open-source Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop. More details about this component [here](https://pivottable.js.org/examples/).\n", "\n", "This component and its various extensions is integrated to the framework and some examples are available in the [tables](./../tables/pivotTable.ipynb) section." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "\n", "# Create a basic report object\n", "rptObj = Report()\n", "\n", "languages = [\n", " {\"name\": 'C', 'type': 'code', 'rating': 17.07, 'change': 12.82},\n", " {\"name\": 'Java', 'type': 'code', 'rating': 16.28, 'change': 0.28},\n", " {\"name\": 'Python', 'type': 'script', 'rating': 9.12, 'change': 1.29},\n", " {\"name\": 'C++', 'type': 'code', 'rating': 6.13, 'change': -1.97},\n", " {\"name\": 'C#', 'type': 'code', 'rating': 4.29, 'change': 0.3},\n", " {\"name\": 'Visual Basic', 'type': 'script', 'rating': 4.18, 'change': -1.01},\n", " {\"name\": 'JavaScript', 'type': 'script', 'rating': 2.68, 'change': -0.01},\n", " {\"name\": 'PHP', 'type': 'script', 'rating': 2.49, 'change': 0},\n", " {\"name\": 'SQL', 'type': 'script', 'rating': 2.09, 'change': -0.47},\n", " {\"name\": 'R', 'type': 'script', 'rating': 1.85, 'change': 0.90},\n", "]\n", "\n", "\n", "# Create a table\n", "tb = rptObj.ui.tables.pivot(languages, ['name'], ['type'])\n", "\n", "rptObj.outs.jupyter()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Go back to the tutorials page\n", "
\n", "Do not forget that this is a collaborative framework so do not hesitate to give feedbacks and like the different repository to get more visbility.\n", "\n", "Also any help is more than welcome !" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.8.2" } }, "nbformat": 4, "nbformat_minor": 2 }