{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " \n", " \n", " \n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Data API\n", "\n", "Data is essential in any report and this is why there are dedicated entry points to manage the data.\n", "\n", "Data can be created from different way either if we want to attach it from to a report or if it should be created as a JavaScript object.\n", "\n", "Data we be considered different if it is coming from Python (from any library or framework) and then passed to the JavaScript world or if it is coming directly from the JavaScript word as JsData and then visible only as a reference in the Python world.\n", "\n", "Considering the fact that the two layers of codes will not be executed at the same time it is obviously not possible to read then in both worlds.\n", "\n", "\n", "## Data Sources\n", "\n", "This is for the Python data management. Those entry points will retrieve data in the Python layer from different ways." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "## Data Flow\n", "\n", "This is considering the transformation from Python object to pure Javascritp object. This is materialised by the .js property which will then consider pure JavaScript code. Indeed the Python written in this section will be transpiled to Javascript to then be executed in a browser.\n", "\n", "In order to make teh transformation easy to write and this framework is relying on [underscode.js](https://underscorejs.org/).\n", "The documentation will refer to this module but do not hestaite to have a look at it to get more familiar wiht it.\n", "\n", "\n", "### Example of data Transformation\n", "\n", "\n", "## JavaScript primitives\n", "\n", "Only few primitives are used for the tranpilation from Python to JavaScript. The main objects are listed below:\n", "- [Array or List](./data/list.ipynb)\n", "- [Boolean](./data/boolean.ipynb)\n", "- [Number](./data/number.ipynb)\n", "- [Object](./data/object.ipynb)\n", "- [Objects](./data/objects.ipynb)\n", "- [String](./data/string.ipynb)\n", "\n", "Those are the main category wrapped on the Python side and they can be used to then manage data and pipes on the JavaScript side\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Records and Filters" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### clearFilter" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### filterGroup" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### cleafFilterGroup" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### clearFilters" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "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 repositories 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 }