{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " \n", " \n", " \n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Plotly\n", "\n", "Table from Plotly.JS [component](../components/00_components.ipynb) in Epyk will be using the property plotly from the **ui.tables** property.\n", "\n", "the ui entry point will give you access to all the registered components.\n", "Different flavour of buttons are available in the framework.\n", "\n", "More information about this chart [here](https://plotly.com/javascript/table/)\n", "\n", "\n", "## Available Tables" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "from epyk.tests import data_urls\n", "\n", "# Create a basic report object\n", "rptObj = Report()\n", "\n", "data_rest_1 = rptObj.py.requests.csv(data_urls.DC_QUAKES)\n", "tb = rptObj.ui.tables.plotlys.table(data_rest_1, ['agency', 'origintime'], ['longitude', 'latitude'])\n", "\n", "\n", "rptObj.outs.jupyter()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "from epyk.tests import data_urls\n", "from epyk.core.css import Colors\n", "\n", "# Create a basic report object\n", "rptObj = Report()\n", "\n", "data_rest_1 = rptObj.py.requests.csv(data_urls.DC_QUAKES)\n", "tb2 = rptObj.ui.tables.plotlys.table(data_rest_1, ['status', 'phases', 'origin_geom'], ['longitude', 'latitude', 'depth'])\n", "\n", "# Change the color of the first column\n", "# and remove the background for the other columns\n", "tb2.columns_color([\"red\", Colors.RgbColors.TRANSPARENT])\n", "\n", "# Change the header color\n", "tb2.headers_color(['black'])\n", "tb2.headers_font_color(['white'])\n", "\n", "rptObj.outs.jupyter()" ] } ], "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 }