Kepler.gl: Publish kepler.gl for jupyter notebook

Created on 16 Jan 2019  路  14Comments  路  Source: keplergl/kepler.gl

Feature
Publish a kepler.gl for jupyter python package to load kepler.gl inside jupyter notebook

screen shot 2018-11-16 at 2 06 51 pm

Solution
kepler gl jupyter notebook

  • Create a kepler.gl build to embed js and css into a single html
  • Create a jupyter notebook python package to load keplergl.html inside an iframe
  • Publish kepler.gl for jupyter
  • Allow adding data and config via python API

Appendix

Kepler.gl Jupyter Integration Slides

feature jupyter rfc roadmap item

Most helpful comment

to-do:
1) publish to the code base

Launch Plan:
1) medium post
2) Share the medium post url through linkedin, twitter
3) demo notebooks

All 14 comments

May i ask any notebook template or example for this feature?

This work is still in progress

1) user testing
2) need marketing plan for the release
3) medium post/ marketing release (TBD)

Target release date: next sprint

to-do:
1) publish to the code base

Launch Plan:
1) medium post
2) Share the medium post url through linkedin, twitter
3) demo notebooks

Any date for release ?

Any update about the release date?

Hi Briantcl, any update on the launch plan ?

Are there plans to support Jupyter lab? I am able to test it with jupyter notebook and it works. :)

FYI - https://medium.com/vis-gl/introducing-kepler-gl-for-jupyter-f72d41659fbf - I hadn't seen this and was thinking it wasn't released yet. Very exciting! Thank you!

I have hacked together some JupyterLab support. There is currently a JuptyerLab plugin in this repo, but it isn't being built currently, as far as I can tell.

To use this with JupyterLab 1.0:

conda create -n kepler-jupyterlab -c conda-forge jupyterlab=1.0.0
conda activate kepler-jupyterlab
pip install ipywidgets keplergl
jupyter labextension install @jupyter-widgets/jupyterlab-manager
git clone [email protected]:saulshanabrook/kepler.gl.git
cd kepler.gl/bindings/kepler.gl-jupyter/js
yarn
env MapboxAccessTokenJupyter=<YOUR_TOKEN> npx babel lib --out-dir babel
jupyter labextension install .

It seems to work OK:

from keplergl import KeplerGl 
map_1 = KeplerGl(height=500)
map_1

# new cell
import pandas as pd
df = pd.DataFrame(
    {'City': ['Buenos Aires', 'Brasilia', 'Santiago', 'Bogota', 'Caracas'],
     'Latitude': [-34.58, -15.78, -33.45, 4.60, 10.48],
     'Longitude': [-58.66, -47.91, -70.66, -74.08, -66.86]})

map_1.add_data(data=df, name='cities')

Screen Shot 2019-07-02 at 1 34 20 PM

The changes I made were:

  • Build version of JS files that doesn't include JSX syntax, using babel. Also turn off some of babels plugins, so that ES6 imports are preserved
  • Change some imports so they build properly with JL
  • Update the @jupyter-widgets/base dependency so it matches the one in JL. There are probably breaking changes in here, but I am not sure if they matter for this use case.

@saulshanabrook Thank you so much for this!! I will implement your changes and test it

keplergl==0.1.0 and [email protected] can now be installed on jupyter Labs
(Python 3 tested)

https://github.com/keplergl/kepler.gl/pull/764

Add installation instruction for Jupyter Lab
https://github.com/keplergl/kepler.gl/tree/master/bindings/kepler.gl-jupyter#installation
Close this for now 馃

Was this page helpful?
0 / 5 - 0 ratings