diff --git a/about_ui.ipynb b/about_ui.ipynb new file mode 100644 index 0000000..8b1cff3 --- /dev/null +++ b/about_ui.ipynb @@ -0,0 +1,59 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sepal_ui import sepalwidgets as sw\n", + "\n", + "#create the Html body of your about section \n", + "ig_about = sw.TileAbout('README.md')\n", + "\n", + "#create a disclaimer\n", + "ig_disclaimer = sw.TileDisclaimer()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#will only be displayed if voila is launch from this tile\n", + "ig_about" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ig_disclaimer" + ] + } + ], + "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.6.9" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/aoi_selector_ui.ipynb b/aoi_selector_ui.ipynb new file mode 100644 index 0000000..f003eea --- /dev/null +++ b/aoi_selector_ui.ipynb @@ -0,0 +1,43 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sepal_ui import aoi as sw\n", + "\n", + "#create the asset variables object \n", + "ig_aoi_io = sw.Aoi_io()\n", + "\n", + "#create the tile \n", + "ig_aoi = sw.TileAoi(ig_aoi_io, methods = ['Draw a shape', 'Upload file', 'Use points file'])\n", + "\n", + "#this tile will only be displayed if voila is launch from this notebook \n", + "ig_aoi" + ] + } + ], + "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.6.9" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/no_ui.ipynb b/no_ui.ipynb new file mode 100644 index 0000000..2f5280d --- /dev/null +++ b/no_ui.ipynb @@ -0,0 +1,85 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Introduction\n", + "This notebook is intented for the users that experience difficulties executing the voila dashboard contained in UI.ipynb. It provides the same fonctionalities that you can run and use by clicking on : \n", + "```\n", + "Kernel -> Restart & Run All\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%capture\n", + "import sys\n", + "!{sys.executable} -m pip install --upgrade sepal-ui" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#add all the tiles\n", + "%run 'aoi_selector_ui.ipynb'\n", + "%run 'about_ui.ipynb'" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ig_aoi" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ig_about" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ig_disclaimer" + ] + } + ], + "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.6.9" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/ui.ipynb b/ui.ipynb new file mode 100644 index 0000000..03db33e --- /dev/null +++ b/ui.ipynb @@ -0,0 +1,140 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%capture\n", + "import sys\n", + "!{sys.executable} -m pip install --upgrade sepal-ui" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%capture\n", + "#prevent a rasterIo bug \n", + "%set_env PROJ_LIB=/usr/share/proj" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sepal_ui import sepalwidgets as sw" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#create an appBar \n", + "ig_appBar = sw.AppBar('Import to Google Earth Engine')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#create a footer \n", + "ig_footer = sw.Footer()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#add tiles \n", + "%run 'aoi_selector_ui.ipynb'\n", + "%run 'about_ui.ipynb'\n", + "\n", + "ig_content = [\n", + " ig_aoi,\n", + " ig_about,\n", + " ig_disclaimer\n", + "]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#create a drawer \n", + "item_aoi = sw.DrawerItem('AOI selection', 'mdi-map-marker-check', card=\"aoi_widget\").display_tile(ig_content)\n", + "item_about = sw.DrawerItem('About', 'mdi-help-circle', card=\"about_widget\").display_tile(ig_content)\n", + "\n", + "code_link = \"https://github.com/12rambau/import_to_gee\"\n", + "wiki_link = \"https://github.com/12rambau/import_to_gee/blob/master/README.md\"\n", + "issue_link = \"https://github.com/12rambau/import_to_gee/issues/new\"\n", + "\n", + "items = [\n", + " item_aoi,\n", + " item_about\n", + "]\n", + "\n", + "ig_drawer = sw.NavDrawer(items, code = code_link, wiki = wiki_link, issue = issue_link).display_drawer(ig_appBar.toggle_button)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#build the app \n", + "ig_app = sw.App(\n", + " tiles=ig_content, \n", + " appBar=ig_appBar, \n", + " footer=ig_footer, \n", + " navDrawer=ig_drawer\n", + ").show_tile('aoi_widget')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#display the app\n", + "ig_app" + ] + } + ], + "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.6.9" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}