{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " \n", " \n", " \n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Plotly\n", "\n", "\n", "Chart from Plotly.JS [component](00_components.ipynb) in Epyk will be using the property plotly from the ui.charts 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", "## Available Charts\n", "\n", "### 2D Charts\n", "\n", "- [Line Chart](./plotly/plotly_line.ipynb)\n", "- [Bar Chart](./plotly/plotly_bar.ipynb)\n", "- [Horizontal Bar Chart](./plotly/plotly_h_bar.ipynb)\n", "- [Scatter Chart](./plotly/plotly_scatter.ipynb))\n", "- [Timeseries Chart](./plotly/plotly_timseries.ipynb)\n", "- [Scatter GL Chart](./plotly/plotly_scattergl.ipynb)\n", "- [Historgram Chart](./plotly/plotly_histogram.ipynb)\n", "- [Pie Chart](./plotly/plotly_pie.ipynb)\n", "- [Area Chart](./plotly/plotly_area.ipynb)\n", "- [Bubble Chart](./plotly/plotly_bubble.ipynb)\n", "- [Donut Chart](./plotly/plotly_donut.ipynb)\n", "- [Gauge Chart](./plotly/plotly_gauge.ipynb)\n", "- [Scatter Polar Chart](./plotly/plotly_scatter_polar.ipynb)\n", "- [Candle Stick Chart](./plotly/plotly_scatter_candle_stick.ipynb)\n", "\n", "### Indicators\n", "- [Number](./plotly/plotly_number.ipynb)\n", "- [Number Delta](./plotly/plotly_number_delta.ipynb)\n", "\n", "\n", "## Example of Charts" ] }, { "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", "rptObj = Report()\n", "\n", "data = rptObj.py.requests.csv(data_urls.PLOTLY_WEBGL_POLAR)\n", "sc = rptObj.ui.charts.plotly.scatterpolar(data, r_columns=['trial_1_r'], theta_axis='trial_1_theta')\n", "\n", "rptObj.outs.jupyter()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\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 !" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "\n", "rptObj = Report()\n", "\n", "line = rptObj.ui.charts.plotly.line()\n", "line.data.x = [19097, 18601, 15595, 13546, 12026, 7434, 5419]\n", "line.data.y = [43, 47, 56, 80, 86, 93, 80]\n", "line.data.mode = 'markers'\n", "line.data.type = 'scatter'\n", "line.layout.no_grid()\n", "line.layout.no_background()\n", "\n", "rptObj.outs.jupyter()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "\n", "rptObj = Report()\n", "bar = rptObj.ui.charts.plotly.bar()\n", "bar.layout.no_background()\n", "bar.layout.grid_colors('grey')\n", "bar.layout.axis_colors('white')\n", "bar.data.x = ['giraffes', 'orangutans', 'monkeys']\n", "bar.data.y = [12, 18, 29]\n", "bar.data.name = 'LA Zoo'\n", "bar.data.type = 'bar'\n", "bar.layout.barmode = 'stack'\n", "\n", "\n", "rptObj.outs.jupyter()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "from epyk.tests import data_urls\n", "\n", "rptObj = Report()\n", "\n", "data = rptObj.py.requests.csv(data_urls.PLOTLY_APPLE_PRICES)\n", "\n", "ts = rptObj.ui.charts.plotly.timeseries(data, y_columns=['AAPL.Open', 'AAPL.High', 'AAPL.Low'], x_axis=\"Date\")\n", "\n", "rptObj.outs.jupyter()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Go back to the Chart Home 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": 4 }