├── .gitignore ├── .profile ├── LICENSE ├── README.md ├── binder ├── postBuild └── requirements.txt ├── geojson-extension.geojson └── index.ipynb /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | -------------------------------------------------------------------------------- /.profile: -------------------------------------------------------------------------------- 1 | # ~/.profile: executed by the command interpreter for login shells. 2 | # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login 3 | # exists. 4 | # see /usr/share/doc/bash/examples/startup-files for examples. 5 | # the files are located in the bash-doc package. 6 | 7 | # the default umask is set in /etc/profile; for setting the umask 8 | # for ssh logins, install and configure the libpam-umask package. 9 | #umask 022 10 | 11 | # if running bash 12 | if [ -n "$BASH_VERSION" ]; then 13 | # include .bashrc if it exists 14 | if [ -f "$HOME/.bashrc" ]; then 15 | . "$HOME/.bashrc" 16 | fi 17 | fi 18 | 19 | # set PATH so it includes user's private bin if it exists 20 | if [ -d "$HOME/bin" ] ; then 21 | PATH="$HOME/bin:$PATH" 22 | fi 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2019, Binder Project 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JupyterLab + Binder 2 | 3 | [![Binder](http://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/binder-examples/jupyterlab/master?urlpath=lab/tree/index.ipynb) 4 | 5 | JupyterLab is packaged with Binder repositories by default. In order to 6 | run a JupyterLab session, you have two options: 7 | 8 | ## Start JupyterLab after you start your Binder 9 | 10 | Do the following: 11 | 12 | 1. Launch a Binder instance (e.g., by clicking the Binder badge) 13 | 2. Replace `tree` at the end of your URL with `lab`. 14 | 3. That's it! 15 | 16 | ## Create a Binder link that points to JupyterLab 17 | 18 | You can also create a Binder link that points to JupyterLab by adding the following 19 | to the end of your link: 20 | 21 | `?urlpath=lab` 22 | 23 | You can point to a specific file using JupterLab by including a file path 24 | beginning with `tree/` to the end of `urlpath`, like so: 25 | 26 | `?urlpath=lab/tree/path/to/my/notebook.ipynb` 27 | 28 | For example, the Binder badge above goes to the following URL: 29 | 30 | `http://mybinder.org/v2/gh/binder-examples/jupyterlab/master?urlpath=lab/tree/index.ipynb` 31 | 32 | Note: this repository also installs several JupyterLab extensions via a `postBuild` script, allowing 33 | you to use JupyterLab's extensions and widgets functionality. 34 | 35 | For a more complete demo of JupyterLab using Binder, see the 36 | [JupyterLab Demo](https://github.com/jupyterlab/jupyterlab-demo). 37 | 38 | -------------------------------------------------------------------------------- /binder/postBuild: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install a JupyterLab extension for demonstration purposes 4 | jupyter labextension install @jupyterlab/geojson-extension jupyterlab-drawio 5 | -------------------------------------------------------------------------------- /binder/requirements.txt: -------------------------------------------------------------------------------- 1 | traitlets>=4.3.1 2 | ipython 3 | pandas 4 | vdom 5 | jupyterlab_launcher>=0.5.0 6 | -------------------------------------------------------------------------------- /geojson-extension.geojson: -------------------------------------------------------------------------------- 1 | { 2 | "type": "Feature", 3 | "geometry": { 4 | "type": "Point", 5 | "coordinates": [-118.4563712, 34.0163116] 6 | }, 7 | "properties": { 8 | "name": "Clover Park" 9 | } 10 | } -------------------------------------------------------------------------------- /index.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# geojson-extension" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## GeoJSON(data: dict)" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 1, 20 | "metadata": { 21 | "collapsed": true 22 | }, 23 | "outputs": [ 24 | { 25 | "data": { 26 | "application/geo+json": { 27 | "geometry": { 28 | "coordinates": [ 29 | -118.4563712, 30 | 34.0163116 31 | ], 32 | "type": "Point" 33 | }, 34 | "type": "Feature" 35 | }, 36 | "text/plain": [ 37 | "" 38 | ] 39 | }, 40 | "metadata": { 41 | "application/geo+json": { 42 | "expanded": false 43 | } 44 | }, 45 | "output_type": "display_data" 46 | } 47 | ], 48 | "source": [ 49 | "from IPython.display import GeoJSON\n", 50 | "\n", 51 | "GeoJSON({\n", 52 | " \"type\": \"Feature\",\n", 53 | " \"geometry\": {\n", 54 | " \"type\": \"Point\",\n", 55 | " \"coordinates\": [-118.4563712, 34.0163116]\n", 56 | " }\n", 57 | "})" 58 | ] 59 | }, 60 | { 61 | "cell_type": "markdown", 62 | "metadata": {}, 63 | "source": [ 64 | "## GeoJSON(data: dict, url_template=string, layer_options=dict)" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": 2, 70 | "metadata": {}, 71 | "outputs": [ 72 | { 73 | "data": { 74 | "application/geo+json": { 75 | "geometry": { 76 | "coordinates": [ 77 | -118.4563712, 78 | 34.0163116 79 | ], 80 | "type": "Point" 81 | }, 82 | "type": "Feature" 83 | }, 84 | "text/plain": [ 85 | "" 86 | ] 87 | }, 88 | "metadata": { 89 | "application/geo+json": { 90 | "expanded": false, 91 | "layer_options": { 92 | "attribution": "© OpenStreetMap", 93 | "id": "mapbox.streets" 94 | }, 95 | "url_template": "https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1Ijoic2Vub3JuZXN0b3IiLCJhIjoiY2l4MHU4MWJsMDIwcjJ0cGwybWQzbnhpeiJ9.beQ7B_WHe3K7_YMUJ684yg" 96 | } 97 | }, 98 | "output_type": "display_data" 99 | } 100 | ], 101 | "source": [ 102 | "GeoJSON(data={\n", 103 | " \"type\": \"Feature\",\n", 104 | " \"geometry\": {\n", 105 | " \"type\": \"Point\",\n", 106 | " \"coordinates\": [-118.4563712, 34.0163116]\n", 107 | " }\n", 108 | "}, url_template=\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1Ijoic2Vub3JuZXN0b3IiLCJhIjoiY2l4MHU4MWJsMDIwcjJ0cGwybWQzbnhpeiJ9.beQ7B_WHe3K7_YMUJ684yg\", \n", 109 | "layer_options={\n", 110 | " \"id\": \"mapbox.streets\",\n", 111 | " \"attribution\" : '© OpenStreetMap'\n", 112 | "})" 113 | ] 114 | }, 115 | { 116 | "cell_type": "code", 117 | "execution_count": 3, 118 | "metadata": {}, 119 | "outputs": [ 120 | { 121 | "data": { 122 | "application/geo+json": { 123 | "geometry": { 124 | "coordinates": [ 125 | 11.8, 126 | -45.04 127 | ], 128 | "type": "Point" 129 | }, 130 | "type": "Feature" 131 | }, 132 | "text/plain": [ 133 | "" 134 | ] 135 | }, 136 | "metadata": { 137 | "application/geo+json": { 138 | "expanded": false, 139 | "layer_options": { 140 | "attribution": "Celestia/praesepe", 141 | "basemap_id": "celestia_mars-shaded-16k_global", 142 | "maxZoom": 5, 143 | "minZoom": 0, 144 | "tms": true 145 | }, 146 | "url_template": "http://s3-eu-west-1.amazonaws.com/whereonmars.cartodb.net/{basemap_id}/{z}/{x}/{y}.png" 147 | } 148 | }, 149 | "output_type": "display_data" 150 | } 151 | ], 152 | "source": [ 153 | "GeoJSON(data={\n", 154 | " \"type\": \"Feature\",\n", 155 | " \"geometry\": {\n", 156 | " \"type\": \"Point\",\n", 157 | " \"coordinates\": [11.8, -45.04]\n", 158 | " }\n", 159 | "}, url_template=\"http://s3-eu-west-1.amazonaws.com/whereonmars.cartodb.net/{basemap_id}/{z}/{x}/{y}.png\", \n", 160 | "layer_options={\n", 161 | " \"basemap_id\": \"celestia_mars-shaded-16k_global\",\n", 162 | " \"attribution\" : \"Celestia/praesepe\",\n", 163 | " \"tms\": True,\n", 164 | " \"minZoom\" : 0,\n", 165 | " \"maxZoom\" : 5\n", 166 | "})" 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": null, 172 | "metadata": {}, 173 | "outputs": [], 174 | "source": [] 175 | } 176 | ], 177 | "metadata": { 178 | "kernelspec": { 179 | "display_name": "Python 3", 180 | "language": "python", 181 | "name": "python3" 182 | }, 183 | "language_info": { 184 | "codemirror_mode": { 185 | "name": "ipython", 186 | "version": 3 187 | }, 188 | "file_extension": ".py", 189 | "mimetype": "text/x-python", 190 | "name": "python", 191 | "nbconvert_exporter": "python", 192 | "pygments_lexer": "ipython3", 193 | "version": "3.6.2" 194 | }, 195 | "widgets": { 196 | "application/vnd.jupyter.widget-state+json": { 197 | "state": {}, 198 | "version_major": 1, 199 | "version_minor": 0 200 | } 201 | } 202 | }, 203 | "nbformat": 4, 204 | "nbformat_minor": 2 205 | } 206 | --------------------------------------------------------------------------------