Getting Started with Kepler.gl in Jupyter Notebook: Installation, Basic Usage, and Export
This guide introduces Uber's open‑source Kepler.gl library for geospatial visualization in Jupyter notebooks, covering installation via pip, a simple map example, adding CSV or DataFrame data, customizing through the UI, retrieving configurations, and exporting the map to an HTML file.
Kepler.gl is an open‑source geospatial data visualization tool from Uber that can be used directly in Jupyter notebooks.
Installation – install via pip and, for notebook versions ≥5.3 on macOS, optionally run the nbextension commands.
pip install keplergl jupyter nbextension install --py --sys-prefix keplergl
jupyter nbextension enable --py --sys-prefix keplerglSimple example – creating a KeplerGl object and displaying an empty map.
from keplergl import KeplerGl
map_1 = KeplerGl(height=500)
map_1Adding data – Kepler.gl accepts CSV, GeoJSON, or DataFrame. Example loads a CSV with pandas and adds it to the map.
import pandas as pd
df = pd.read_csv('rocket_launch_site_elevation_2019-10-27.csv')
map_2 = KeplerGl(height=600)
map_2.add_data(name='rocket', data=df)
map_2Customizing charts – most visual settings are handled through the UI, unlike libraries such as pyecharts or matplotlib.
Getting configuration – the current map configuration can be retrieved with .config and reused.
config = map_2.configExporting the map – use .save_to_html() to export the map to an HTML file, optionally setting the file name and read‑only flag.
map_3.save_to_html(file_name='kepler_example.html')Overall, Kepler.gl provides an easy‑to‑use, UI‑driven way to create attractive geospatial visualizations without writing extensive configuration code.
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.