Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

docs: update keplergl-jupyter docs for v0.4.0 (#3431)

Copilotf00fd208b938
diff --git a/SUMMARY.md b/SUMMARY.md
index 40c11a7e6..d96fa7f4d 100644
--- a/SUMMARY.md
+++ b/SUMMARY.md
@@ -67,6 +67,13 @@
* [Custom theme](docs/api-reference/custom-theme/README.md)
* [Localization](docs/api-reference/localization/README.md)
* [Jupyter Notebook](docs/keplergl-jupyter/README.md)
+ * [Installation](docs/keplergl-jupyter/install.md)
+ * [Widget API](docs/keplergl-jupyter/widget-api.md)
+ * [Data Formats](docs/keplergl-jupyter/data-formats.md)
+ * [Map Customization](docs/keplergl-jupyter/map-customization.md)
+ * [Save and Load Config](docs/keplergl-jupyter/config.md)
+ * [Save and Export Map](docs/keplergl-jupyter/save-and-export.md)
+ * [FAQ & Troubleshoot](docs/keplergl-jupyter/faq.md)
* [Examples](examples/README.md)
* [Node/Express](examples/node-app/README.md)
* [Demo App](examples/demo-app/README.md)
diff --git a/bindings/python/README.md b/bindings/python/README.md
index a59ba827e..9fbb80d05 100644
--- a/bindings/python/README.md
+++ b/bindings/python/README.md
@@ -32,10 +32,55 @@ map.add_data(data=df, name='my_data')
map
```
+## Features
+
+- **Multiple data formats**: Load CSV, GeoJSON, Pandas DataFrame, and GeoPandas GeoDataFrame
+- **GeoArrow support**: Use `use_arrow=True` for faster data loading and rendering with large datasets
+- **GeoDataFrame datetime support**: GeoDataFrames with `datetime` columns are serialized automatically — no manual conversion needed
+- **Empty geometry handling**: GeoDataFrames with empty or all-null geometry columns are handled gracefully
+- **Theme customization**: Set the UI theme to `"light"`, `"dark"`, or `"base"` via the `theme` parameter
+- **App name customization**: Set a custom application name with `app_name` — displayed in the side panel header and used as the HTML `<title>` when exporting
+- **HTML export**: Export maps to standalone HTML files with `save_to_html()`, supporting custom themes, app names, and a configurable JSON encoder for non-native types
+
## Documentation
For full documentation, visit [https://docs.kepler.gl/docs/keplergl-jupyter](https://docs.kepler.gl/docs/keplergl-jupyter).
+## AI Assistant Skill Setup
+
+If you use AI coding assistants, add your project skill/instructions file in this directory:
+
+- **Claude Code**: `CLAUDE.md`
+- **Codex-compatible tools**:
+ - `AGENTS.md` for workspace-wide instructions
+ - `.agents/skills/<skill-name>/SKILL.md` for reusable Codex skills
+
+You can keep `CLAUDE.md` and `AGENTS.md` content aligned so both tools use the same project guidance.
+
+For Codex skills, a minimal structure is:
+
+```text
+.agents/skills/keplergl-python/
+├── SKILL.md
+├── assets/
+│ ├── keplergl-icon-small.svg
+│ └── keplergl-icon-large.png
+└── agents/
+ └── openai.yaml
+```
+
+You can source icon assets from existing repository art, for example:
+
+- `website/src/static/favicon.png`
+
+And reference them in `.agents/skills/<skill-name>/agents/openai.yaml`:
+
+```yaml
+interface:
+ icon_small: "../assets/keplergl-icon-small.svg"
+ icon_large: "../assets/keplergl-icon-large.png"
+```
+
## License
MIT
diff --git a/docs/keplergl-jupyter/README.md b/docs/keplergl-jupyter/README.md
index 9825cf762..a281ce711 100644
--- a/docs/keplergl-jupyter/README.md
+++ b/docs/keplergl-jupyter/README.md
@@ -1,4 +1,4 @@
-# Jupyter Notebook
+# kepler.gl for Jupyter
> **Upgrading from v0.3.x?**
> `keplergl` v0.4 switched to [anywidget](https://anywidget.dev/) — no JupyterLab extension install is needed anymore. Just `pip install keplergl` and go.
@@ -10,385 +10,33 @@
> ```
> JupyterLab 1–3 with Node > 10 was required. The old docs are preserved in [git history](https://github.com/keplergl/kepler.gl/blob/a54aef56/docs/keplergl-jupyter/README.md).
-## kepler.gl for Jupyter User Guide
+kepler.gl for Jupyter is an advanced geospatial visualization widget for rendering large-scale interactive maps in Jupyter Notebook and JupyterLab.
-### Table of contents
-- [Install](#install)
-- [1. Load kepler.gl Map](#1-load-keplergl-map)
- - [`KeplerGl()`](#keplergl)
-- [2. Add Data](#2-add-data)
- - [`.add_data()`](#add_data)
- - [`.data`](#data)
-- [3. Data Format](#3-data-format)
- - [`CSV`](#csv)
- - [`GeoJSON`](#geojson)
- - [`DataFrame`](#dataframe)
- - [`GeoDataFrame`](#geodataframe)
- - [`WKT`](#wkt)
-- [4. Customize the map](#4-customize-the-map)
-- [5. Save and load config](#5-save-and-load-config)
- - [`.config`](#config)
-- [6. Match config with data](#6-match-config-with-data)
-- [7. Save Map](#7-save-map)
- - [`.save_to_html()`](#save_to_html)
-- [Demo Notebooks](#demo-notebooks)
-- [FAQ & Troubleshoot](#faq--troubleshoot)
+## Documentation
+- [Installation](install.md) – Prerequisites and install instructions
+- [Widget API](widget-api.md) – `KeplerGl()`, `.add_data()`, `.data`
+- [Data Formats](data-formats.md) – CSV, GeoJSON, DataFrame, GeoDataFrame, WKT
+- [Map Customization](map-customization.md) – Theme, app name, and interactive customization
+- [Save and Load Config](config.md) – `.config`, match config with data
+- [Save and Export Map](save-and-export.md) – `.save_to_html()`
+- [FAQ & Troubleshoot](faq.md) – Common issues and demo notebooks
-## Install
-
-### Prerequisites
-
-- Python >= 3.9
-- JupyterLab >= 4.0 or Notebook >= 7.0
-
-To install use pip:
-```bash
-pip install keplergl
-```
-
-No additional JupyterLab extension installation is required. The widget uses [anywidget](https://anywidget.dev/) which works out of the box in JupyterLab, classic Notebook, and VS Code Jupyter.
-
-## 1. Load keplergl map
-### `KeplerGl()`
-
-- Input:
- - __`height`__ _optional_ default: `400`
-
- Height of the map display
-
- - __`data`__ `dict` _optional_
-
- Datasets as a dictionary, key is the name of the dataset. Read more on [Accepted data format][data_format]
-
- - __`config`__ `dict` _optional_
-
- Map config as a dictionary. The `dataId` in the layer and filter settings should match the `name` of the dataset they are created under
-
- - __`use_arrow`__ `bool` _optional_ default: `False`
-
- Serialize DataFrames and GeoDataFrames as Arrow IPC for better performance on large datasets
-
- - __`mapbox_token`__ `str` _optional_ default: `""`
-
- Mapbox API access token. Required for Mapbox basemap styles (e.g. "Dark", "Muted Light"). Leave empty to use free MapLibre styles.
-
- - __`theme`__ `str` _optional_ default: `""`
-
- UI theme. Accepted values: `"light"`, `"dark"`, `"base"`, or `""` (default dark theme).
-
- - __`app_name`__ `str` _optional_ default: `"kepler.gl"`
-
- Application name shown in the side panel header and used as the HTML `<title>` when exporting.
-
- - __`show_docs`__ `bool` _optional_ default: `False`
-
- Deprecated, kept for backwards compatibility. Has no effect.
-
-The following command will load kepler.gl widget below a cell.
-**The map object created here is `map_1` it will be used throughout the code example in this doc.**
-
-
-```python
-# Load an empty map
-from keplergl import KeplerGl
-map_1 = KeplerGl()
-map_1
-```
-
-![empty map][empty_map]
-
-
-You can also create the map and pass in the data or data and config at the same time. Follow the instruction to [match config with data][match-config-w-data]
+## Quick Start
```python
-# Load a map with data and config and height
from keplergl import KeplerGl
-map_2 = KeplerGl(height=400, data={"data_1": my_df}, config=config)
-map_2
-```
-
-![Load map with data and config][load_map_w_data]
-
-## 2. Add Data
-### `.add_data()`
-- Inputs
- - __`data`__ _required_ CSV, GeoJSON or DataFrame. Read more on [Accepted data format][data_format]
- - __`name`__ _required_ Name of the data entry.
- - __`use_arrow`__ _optional_ Serialize this dataset as Arrow IPC. Overrides the widget-level `use_arrow` setting for this call.
-
-`name` of the dataset will be the saved to the `dataId` property of each `layer`, `filter` and `interactionConfig` in the config.
-
-kepler.gl expected the data to be **CSV**, **GeoJSON**, **DataFrame** or **GeoDataFrame**. You can call __`add_data`__ multiple times to add multiple datasets to kepler.gl
-
-```python
-# DataFrame
-df = pd.read_csv('hex-data.csv')
-map_1.add_data(data=df, name='data_1')
-
-# CSV
-with open('csv-data.csv', 'r') as f:
- csvData = f.read()
-map_1.add_data(data=csvData, name='data_2')
-
-# GeoJSON as string
-with open('sf_zip_geo.json', 'r') as f:
- geojson = f.read()
-
-map_1.add_data(data=geojson, name='geojson')
-```
-
-![Add data to map][map_add_data]
-
-### `.data`
-Print the current data added to the map. As a `Dict`
-
-```python
-map_1.data
-# {'data_1': 'hex_id,value\n89283082c2fffff,64\n8928308288fffff,73\n89283082c07ffff,65\n89283082817ffff,74\n89283082c3bffff,66\n8...`,
-# 'data_3': 'location, lat, lng, name\n..',
-# 'data_3': '{"type": "FeatureCollecti...'}
-```
-
-## 3. Data Format
-kepler.gl supports **CSV**, **GeoJSON**, Pandas **DataFrame** or GeoPandas **GeoDataFrame**.
-
-### `CSV`
-You can create a `CSV` string by reading from a CSV file.
-```python
-with open('csv-data.csv', 'r') as f:
- csvData = f.read()
-# csvData = "hex_id,value\n89283082c2fffff,64\n8928308288fffff,73\n89283082c07ffff,65\n89283082817ffff,74\n89283082c3bffff,66\n8..."
-map_1.add_data(data=csvData, name='data_2')
-```
-
-### `GeoJSON`
-According to [GeoJSON Specification (RFC 7946)][geojson]: GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a region of space (a `Geometry`), a spatially bounded entity (a Feature), or a list of Features (a `FeatureCollection`). GeoJSON supports the following geometry types: `Point`, `LineString`, `Polygon`, `MultiPoint`, `MultiLineString`, `MultiPolygon`, and `GeometryCollection`. Features in GeoJSON contain a Geometry object and additional properties, and a FeatureCollection contains a list of Features.
-
-kepler.gl supports all the GeoJSON types above excepts `GeometryCollection`. You can pass in either a single [`Feature`][features] or a [`FeatureCollection`][feature_collection]. You can format the `GeoJSON` either as a `string` or a `dict` type
-
-
-```python
-feature = {
- "type": "Feature",
- "properties": {"name": "Coors Field"},
- "geometry": {"type": "Point", "coordinates": [-104.99404, 39.75621]}
-}
-
-featureCollection = {
- "type": "FeatureCollection",
- "features": [{
- "type": "Feature",
- "geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
- "properties": {"prop0": "value0"}
- }]
-}
-
-map_1.add_data(data=feature, name="feature")
-map_1.add_data(data=featureCollection, name="feature_collection")
-```
-
-Geometries (Polygons, LindStrings) can be embedded into CSV or DataFrame with a [`GeoJSON`][geojson] Json string. Use the `geometry` property of a [`Feature`][features], which includes `type` and `coordinates`.
-
-```python
-# GeoJson Feature geometry
-geometryString = {
- 'type': 'Polygon',
- 'coordinates': [[[-74.158491,40.835947],[-74.148473,40.834522],[-74.142598,40.833128],[-74.151923,40.832074],[-74.158491,40.835947]]]
-}
-# create json string
-json_str = json.dumps(geometryString)
-
-# create data frame
-df_with_geometry = pd.DataFrame({
- 'id': [1],
- 'geometry_string': [json_str]
-})
-
-# add to map
-map_1.add_data(df_with_geometry, "df_with_geometry")
-```
-
-### `DataFrame`
-kepler.gl accepts [pandas.DataFrame][data_frame]
-```python
-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]})
-
-w1.add_data(data=df, name='cities')
-```
-
-### `GeoDataFrame`
-kepler.gl accepts [geopandas.GeoDataFrame][geo_data_frame]. Geometries are serialized using GeoArrow and re-projected to latitude and longitude (EPSG:4326) if the active `geometry` column is in a different projection.
-```python
-url = 'http://eric.clst.org/assets/wiki/uploads/Stuff/gz_2010_us_040_00_500k.json'
-country_gdf = geopandas.read_file(url)
-w1.add_data(data=country_gdf, name="state")
-```
-
-![US state][geodataframe_map]
-
-### `WKT`
-
-You can embed geometries (Polygon, LineStrings etc) into CSV or DataFrame using [`WKT`][wkt]
-
-```python
-# WKT
-wkt_str = 'POLYGON ((-74.158491 40.835947, -74.130031 40.819962, -74.148818 40.830916, -74.151923 40.832074, -74.158491 40.835947))'
-
-df_w_wkt = pd.DataFrame({
- 'id': [1],
- 'wkt_string': [wkt_str]
+# Create a map with some data
+import pandas as pd
+df = pd.DataFrame({
+ 'City': ['Buenos Aires', 'Brasilia', 'Santiago'],
+ 'Latitude': [-34.58, -15.78, -33.45],
+ 'Longitude': [-58.66, -47.91, -70.66]
})
-map_1.add_data(df_w_wkt, "df_w_wkt")
-```
-
-## 4. Customize the map
-
-Interact with kepler.gl and customize layers and filters. Map data and config will be stored locally to the widget state. To make sure the map state is saved, select `Widgets > Save Notebook Widget State`, before shutting down the kernel.
-
-![Map interaction][map_interaction]
-
-## 5. Save and load config
-
-### `.config`
-you can print your current map configuration at any time in the notebook
-```python
-map_1.config
-## {u'config': {u'mapState': {u'bearing': 2.6192893401015205,
-# u'dragRotate': True,
-# u'isSplit': False,
-# u'latitude': 37.76209132041332,
-# u'longitude': -122.42590232651203,
-```
-
-When the map is final, you can copy this config and load it later to reproduce the same map. Follow the instruction to [match config with data][match-config-w-data].
-
-#### Apply config to a map:
-
- 1. Directly apply config to the map.
-```python
-config = {
- 'version': 'v1',
- 'config': {
- 'mapState': {
- 'latitude': 37.76209132041332,
- 'longitude': -122.42590232651203,
- 'zoom': 12.32053899007826
- }
- ...
- }
-},
-map_1.add_data(data=df, name='data_1')
-map_1.config = config
-```
- 2. Load it when creating the map
-```python
-map_1 = KeplerGl(height=400, data={'data_1': my_df}, config=config)
-```
+map_1 = KeplerGl(height=400, data={'cities': df})
-If want to load the map next time with this saved config, the easiest way to do is to save the it to a file and use the magic command **%run** to load it w/o cluttering up your notebook.
-```python
-# Save map_1 config to a file
-with open('hex_config.py', 'w') as f:
- f.write('config = {}'.format(map_1.config))
-
-# load the config
-%run hex_config.py
-```
-
-## 6. Match config with data
-All layers, filters and tooltips are associated with a specific dataset. Therefore the `data` and `config` in the map has to be able to match each other. The `name` of the dataset is assigned to:
-
- - `dataId` of `layer.config`,
- - `dataId` of `filter`
- - key in `interactionConfig.tooltip.fieldToShow`.
-
-![Connect data and config][connect_data_config]
-
-You can use the same config on another dataset with the same name and schema.
-
-## 7. Save Map
-
-When you click in the map and change settings, config is saved to widget state. Closing the notebook and reopen it will reload current map. However, you need to manually select `Widget > Save Notebook Widget State` before shut downing the kernel to make sure it will be reloaded.
-
-![Save Widget State][save_widget_state]
-
-### `.save_to_html()`
-
-- input
- - **`file_name`**: _optional_ the html file name, default is `keplergl_map.html`
- - **`data`**: _optional_ A data dictionary `{"name": data}`, if not provided, will use current map data
- - **`config`**: _optional_ map config dictionary, if not provided, will use current map config
- - **`read_only`**: _optional_ if `True`, hide side panel to disable map customization
- - **`center_map`**: _optional_ default `True` — fit map bounds to the data on export
- - **`mapbox_token`**: _optional_ Mapbox access token for Mapbox basemap styles. Falls back to the token set on the widget.
- - **`app_name`**: _optional_ overrides the widget-level `app_name` for this export
- - **`theme`**: _optional_ overrides the widget-level `theme` for this export
-
-You can export your current map as an interactive html file.
-
-```python
-# this will save current map
-map_1.save_to_html(file_name='first_map.html')
-
-# this will save map with provided data and config
-map_1.save_to_html(data={'data_1': df}, config=config, file_name='first_map.html')
-
-# this will save map with the interaction panel disabled
-map_1.save_to_html(file_name='first_map.html', read_only=True)
-
-# export with a custom theme and app name
-map_1.save_to_html(file_name='light_map.html', theme='light', app_name='My Map')
-```
-
-# Demo Notebooks
-- [Load kepler.gl](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/Load%20kepler.gl.ipynb): Load kepler.gl widget, add data and config
-- [GeoJSON](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/GeoJSON.ipynb): Load GeoJSON to kepler.gl
-- [DataFrame](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/DataFrame.ipynb): Load DataFrame to kepler.gl
-- [GeoDataFrame](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/GeoDataFrame.ipynb): Load GeoDataFrame to kepler.gl
-- [GeoDataFrame with Datetime](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/GeoDataFrame%20with%20Datetime.ipynb): Load GeoDataFrame with datetime columns
-- [Empty GeoDataFrame](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/Empty%20GeoDataFrame.ipynb): Handle empty GeoDataFrames
-- [Theme and App Name](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/Theme%20and%20App%20Name.ipynb): Customize theme and app name
-
-# FAQ & Troubleshoot
-
-#### 1. What about Microsoft Windows?
-keplergl is published to PyPI and works on Windows. If you encounter install issues, check [this issue](https://github.com/keplergl/kepler.gl/issues/557).
-
-#### 2. The widget doesn't display in JupyterLab / Notebook
-
-Make sure you are using JupyterLab >= 4.0 or Notebook >= 7.0. The new `keplergl` package uses [anywidget](https://anywidget.dev/) and does **not** require installing a separate JupyterLab extension — no `jupyter labextension install` step is needed.
-
-If the widget shows as a plain text object (`KeplerGl(...)`) instead of rendering, try restarting the kernel and re-running the cell.
-
-#### 3. What's your python env
-
-```text
-python >= 3.9
-jupyterlab >= 4.0 (or notebook >= 7.0)
-keplergl >= 0.4.0
+# Display the map
+map_1
```
-
-[jupyter_widget]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_widget.png
-[empty_map]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_empty_map.png
-[geodataframe_map]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_geodataframe.png
-[map_interaction]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_custom_map.gif
-[load_map_w_data]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_widget.png
-[map_add_data]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_add_data.png
-[connect_data_config]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_connect_data_w_config.png
-[save_widget_state]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_save_state.png
-
-[wkt]: https://dev.mysql.com/doc/refman/5.7/en/gis-data-formats.html#gis-wkt-format
-[geojson]: https://tools.ietf.org/html/rfc7946
-[feature_collection]: https://tools.ietf.org/html/rfc7946#section-3.3
-[features]: https://tools.ietf.org/html/rfc7946#section-3.2
-[data_frame]: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html
-[geo_data_frame]: https://geopandas.readthedocs.io/en/latest/data_structures.html#geodataframe
-
-[match-config-w-data]: #6-match-config-with-data
-[data_format]: #3-data-format
diff --git a/docs/keplergl-jupyter/config.md b/docs/keplergl-jupyter/config.md
new file mode 100644
index 000000000..b7f113cf1
--- /dev/null
+++ b/docs/keplergl-jupyter/config.md
@@ -0,0 +1,67 @@
+# Save and Load Config
+
+## `.config`
+
+You can print your current map configuration at any time in the notebook.
+
+```python
+map_1.config
+## {'config': {'mapState': {'bearing': 2.6192893401015205,
+# 'dragRotate': True,
+# 'isSplit': False,
+# 'latitude': 37.76209132041332,
+# 'longitude': -122.42590232651203,
+```
+
+When the map is final, you can copy this config and load it later to reproduce the same map. Follow the instruction to [match config with data](#match-config-with-data).
+
+### Apply config to a map
+
+1. Directly apply config to the map.
+
+```python
+config = {
+ 'version': 'v1',
+ 'config': {
+ 'mapState': {
+ 'latitude': 37.76209132041332,
+ 'longitude': -122.42590232651203,
+ 'zoom': 12.32053899007826
+ },
+ # ...other config options
+ }
+}
+map_1.add_data(data=df, name='data_1')
+map_1.config = config
+```
+
+2. Load it when creating the map.
+
+```python
+map_1 = KeplerGl(height=400, data={'data_1': my_df}, config=config)
+```
+
+If you want to load the map next time with this saved config, the easiest way is to save it to a file and use the magic command **%run** to load it without cluttering up your notebook.
+
+```python
+# Save map_1 config to a file
+with open('hex_config.py', 'w') as f:
+ f.write('config = {}'.format(map_1.config))
+
+# load the config
+%run hex_config.py
+```
+
+## Match config with data
+
+All layers, filters and tooltips are associated with a specific dataset. Therefore the `data` and `config` in the map have to be able to match each other. The `name` of the dataset is assigned to:
+
+- `dataId` of `layer.config`,
+- `dataId` of `filter`
+- key in `interactionConfig.tooltip.fieldToShow`.
+
+![Connect data and config][connect_data_config]
+
+You can use the same config on another dataset with the same name and schema.
+
+[connect_data_config]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_connect_data_w_config.png
diff --git a/docs/keplergl-jupyter/data-formats.md b/docs/keplergl-jupyter/data-formats.md
new file mode 100644
index 000000000..88a29776a
--- /dev/null
+++ b/docs/keplergl-jupyter/data-formats.md
@@ -0,0 +1,146 @@
+# Data Formats
+
+kepler.gl supports **CSV**, **GeoJSON**, Pandas **DataFrame** or GeoPandas **GeoDataFrame**.
+
+## CSV
+
+You can create a `CSV` string by reading from a CSV file.
+
+```python
+with open('csv-data.csv', 'r') as f:
+ csvData = f.read()
+# csvData = "hex_id,value\n89283082c2fffff,64\n8928308288fffff,73\n89283082c07ffff,65\n89283082817ffff,74\n89283082c3bffff,66\n8..."
+map_1.add_data(data=csvData, name='data_2')
+```
+
+## GeoJSON
+
+According to [GeoJSON Specification (RFC 7946)][geojson]: GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a region of space (a `Geometry`), a spatially bounded entity (a Feature), or a list of Features (a `FeatureCollection`). GeoJSON supports the following geometry types: `Point`, `LineString`, `Polygon`, `MultiPoint`, `MultiLineString`, `MultiPolygon`, and `GeometryCollection`. Features in GeoJSON contain a Geometry object and additional properties, and a FeatureCollection contains a list of Features.
+
+kepler.gl supports all the GeoJSON types above except `GeometryCollection`. You can pass in either a single [`Feature`][features] or a [`FeatureCollection`][feature_collection]. You can format the `GeoJSON` either as a `string` or a `dict` type.
+
+```python
+feature = {
+ "type": "Feature",
+ "properties": {"name": "Coors Field"},
+ "geometry": {"type": "Point", "coordinates": [-104.99404, 39.75621]}
+}
+
+featureCollection = {
+ "type": "FeatureCollection",
+ "features": [{
+ "type": "Feature",
+ "geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
+ "properties": {"prop0": "value0"}
+ }]
+}
+
+map_1.add_data(data=feature, name="feature")
+map_1.add_data(data=featureCollection, name="feature_collection")
+```
+
+Geometries (Polygons, LineStrings) can be embedded into CSV or DataFrame with a [`GeoJSON`][geojson] JSON string. Use the `geometry` property of a [`Feature`][features], which includes `type` and `coordinates`.
+
+```python
+# GeoJson Feature geometry
+geometryString = {
+ 'type': 'Polygon',
+ 'coordinates': [[[-74.158491,40.835947],[-74.148473,40.834522],[-74.142598,40.833128],[-74.151923,40.832074],[-74.158491,40.835947]]]
+}
+
+# create json string
+import json
+json_str = json.dumps(geometryString)
+
+# create data frame
+import pandas as pd
+df_with_geometry = pd.DataFrame({
+ 'id': [1],
+ 'geometry_string': [json_str]
+})
+
+# add to map
+map_1.add_data(df_with_geometry, "df_with_geometry")
+```
+
+## DataFrame
+
+kepler.gl accepts [pandas.DataFrame][data_frame].
+
+```python
+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')
+```
+
+## GeoDataFrame
+
+kepler.gl accepts [geopandas.GeoDataFrame][geo_data_frame]. In the live Jupyter widget, GeoDataFrames are serialized via [GeoArrow](https://geoarrow.org/) which preserves geometry types and coordinate reference systems as-is (no reprojection). When exporting to HTML with `.save_to_html()`, GeoDataFrames are reprojected to latitude/longitude (EPSG:4326) if the active `geometry` column uses a different CRS.
+
+```python
+import geopandas as gpd
+
+url = 'http://eric.clst.org/assets/wiki/uploads/Stuff/gz_2010_us_040_00_500k.json'
+country_gdf = gpd.read_file(url)
+map_1.add_data(data=country_gdf, name="state")
+```
+
+![US state][geodataframe_map]
+
+### GeoDataFrame with datetime columns
+
+GeoDataFrames that contain `datetime` columns (or other non-JSON-native types) are supported out of the box. In the live widget, GeoArrow serialization preserves Arrow timestamp types natively. During HTML export (`.save_to_html()`), the default `json_encoder=str` fallback converts these values to strings automatically, so no manual pre-processing is needed in either case.
+
+```python
+import geopandas as gpd
+from shapely.geometry import Point
+import pandas as pd
+
+gdf = gpd.GeoDataFrame({
+ 'name': ['A', 'B'],
+ 'timestamp': pd.to_datetime(['2024-01-01', '2024-06-15']),
+ 'geometry': [Point(-73.99, 40.73), Point(-118.24, 34.05)]
+})
+
+map_1.add_data(data=gdf, name='events')
+```
+
+### Empty or all-null geometries
+
+GeoDataFrames with empty or all-null geometry columns are handled gracefully. The widget will not raise an error when adding such data.
+
+```python
+gdf_empty = gpd.GeoDataFrame({
+ 'id': [1, 2],
+ 'geometry': [None, None]
+})
+
+map_1.add_data(data=gdf_empty, name='empty_geom')
+```
+
+## WKT
+
+You can embed geometries (Polygon, LineStrings etc) into CSV or DataFrame using [`WKT`][wkt].
+
+```python
+# WKT
+wkt_str = 'POLYGON ((-74.158491 40.835947, -74.130031 40.819962, -74.148818 40.830916, -74.151923 40.832074, -74.158491 40.835947))'
+
+df_w_wkt = pd.DataFrame({
+ 'id': [1],
+ 'wkt_string': [wkt_str]
+})
+
+map_1.add_data(df_w_wkt, "df_w_wkt")
+```
+
+[geodataframe_map]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_geodataframe.png
+[wkt]: https://dev.mysql.com/doc/refman/5.7/en/gis-data-formats.html#gis-wkt-format
+[geojson]: https://tools.ietf.org/html/rfc7946
+[feature_collection]: https://tools.ietf.org/html/rfc7946#section-3.3
+[features]: https://tools.ietf.org/html/rfc7946#section-3.2
+[data_frame]: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html
+[geo_data_frame]: https://geopandas.readthedocs.io/en/latest/data_structures.html#geodataframe
diff --git a/docs/keplergl-jupyter/faq.md b/docs/keplergl-jupyter/faq.md
new file mode 100644
index 000000000..698256c80
--- /dev/null
+++ b/docs/keplergl-jupyter/faq.md
@@ -0,0 +1,25 @@
+# FAQ & Troubleshoot
+
+## 1. Widget not rendering in JupyterLab or Notebook?
+
+Make sure you are using JupyterLab >= 4.0 or Notebook >= 7.0 with Python >= 3.9. The widget is built on [anywidget](https://anywidget.dev/) which is supported out of the box in modern Jupyter environments — no extra `nbextension` or `labextension` install steps are needed.
+
+If the widget still does not render, try restarting the kernel and re-running the cell.
+
+## 2. What's your recommended Python environment?
+
+```text
+python>=3.9
+jupyterlab>=4.0
+notebook>=7.0
+```
+
+## Demo Notebooks
+
+- [Load kepler.gl](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/Load%20kepler.gl.ipynb): Load kepler.gl widget, add data and config
+- [GeoJSON](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/GeoJSON.ipynb): Load GeoJSON to kepler.gl
+- [DataFrame](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/DataFrame.ipynb): Load DataFrame to kepler.gl
+- [GeoDataFrame](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/GeoDataFrame.ipynb): Load GeoDataFrame to kepler.gl
+- [GeoDataFrame with Datetime](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/GeoDataFrame%20with%20Datetime.ipynb): Load GeoDataFrame with datetime columns
+- [Empty GeoDataFrame](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/Empty%20GeoDataFrame.ipynb): Handle empty or all-null geometries
+- [Theme and App Name](https://github.com/keplergl/kepler.gl/blob/master/bindings/python/notebooks/Theme%20and%20App%20Name.ipynb): Customize theme and app name
diff --git a/docs/keplergl-jupyter/install.md b/docs/keplergl-jupyter/install.md
new file mode 100644
index 000000000..bab1f3413
--- /dev/null
+++ b/docs/keplergl-jupyter/install.md
@@ -0,0 +1,14 @@
+# Installation
+
+## Prerequisites
+
+- Python >= 3.9
+- JupyterLab >= 4.0 or Notebook >= 7.0
+
+## Install with pip
+
+```bash
+$ pip install keplergl
+```
+
+The widget is built on [anywidget](https://anywidget.dev/) and works out of the box in modern Jupyter environments — no extra `nbextension` or `labextension` install steps are needed.
diff --git a/docs/keplergl-jupyter/map-customization.md b/docs/keplergl-jupyter/map-customization.md
new file mode 100644
index 000000000..dcad3bc43
--- /dev/null
+++ b/docs/keplergl-jupyter/map-customization.md
@@ -0,0 +1,40 @@
+# Map Customization
+
+## Interact with the map
+
+Interact with kepler.gl and customize layers and filters. Map data and config will be stored locally to the widget state. To make sure the map state is saved, select `Widgets > Save Notebook Widget State`, before shutting down the kernel.
+
+![Map interaction][map_interaction]
+
+## Theme
+
+The `theme` parameter controls the visual appearance of the map UI. Accepted values:
+
+- `"dark"` – Dark theme
+- `"light"` – Light theme
+- `"base"` – Base theme
+- `""` (empty string) – Uses the default dark theme
+
+```python
+# Create a map with light theme
+map_1 = KeplerGl(height=400, data={'data_1': df}, theme='light')
+map_1
+```
+
+## App Name
+
+The `app_name` parameter sets the application name displayed in the side panel header. It is also used as the HTML `<title>` when exporting.
+
+```python
+# Create a map with a custom app name
+map_1 = KeplerGl(height=400, data={'data_1': df}, app_name='My Geospatial App')
+map_1
+```
+
+Both `theme` and `app_name` can also be passed to [`save_to_html()`](save-and-export.md#save_to_html) to override the widget-level settings for the exported file:
+
+```python
+map_1.save_to_html(file_name='my_map.html', theme='light', app_name='My Map Export')
+```
+
+[map_interaction]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_custom_map.gif
diff --git a/docs/keplergl-jupyter/save-and-export.md b/docs/keplergl-jupyter/save-and-export.md
new file mode 100644
index 000000000..1f5b79992
--- /dev/null
+++ b/docs/keplergl-jupyter/save-and-export.md
@@ -0,0 +1,39 @@
+# Save and Export Map
+
+When you click in the map and change settings, config is saved to widget state. Closing the notebook and reopening it will reload the current map. However, you need to manually select `Widgets > Save Notebook Widget State` before shutting down the kernel to make sure it will be reloaded.
+
+![Save Widget State][save_widget_state]
+
+## `.save_to_html()`
+
+Export the map to a standalone HTML file.
+
+### Parameters
+
+- **`file_name`**: _optional_ The HTML file name, default is `keplergl_map.html`.
+- **`data`**: _optional_ A data dictionary `{"name": data}`. If not provided, will use current map data.
+- **`config`**: _optional_ Map config dictionary. If not provided, will use current map config.
+- **`read_only`**: _optional_ If `True`, hide side panel to disable map customization.
+- **`center_map`**: _optional_ If `True`, fit map bounds to the data (default: `True`).
+- **`mapbox_token`**: _optional_ Mapbox access token. Required for Mapbox basemap styles (e.g. "Dark", "Muted Light"). Leave empty for free MapLibre styles.
+- **`json_encoder`**: _optional_ Fallback function passed as `default` when JSON-serializing GeoDataFrame data. Defaults to `str` so that `datetime` and other non-native JSON types are converted automatically. Pass `None` to disable (will raise on non-serializable types).
+- **`app_name`**: _optional_ Application name shown in the side panel header and used as HTML `<title>`. If `None`, uses the value set at widget creation (default `"kepler.gl"`).
+- **`theme`**: _optional_ UI theme for the kepler.gl component (`"light"`, `"dark"`, `"base"`, or `""`). If `None`, uses the value set at widget creation.
+
+### Examples
+
+```python
+# this will save current map
+map_1.save_to_html(file_name='first_map.html')
+
+# this will save map with provided data and config
+map_1.save_to_html(data={'data_1': df}, config=config, file_name='first_map.html')
+
+# this will save map with the interaction panel disabled
+map_1.save_to_html(file_name='first_map.html', read_only=True)
+
+# this will save map with a custom theme and app name
+map_1.save_to_html(file_name='first_map.html', theme='light', app_name='My Map App')
+```
+
+[save_widget_state]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_save_state.png
diff --git a/docs/keplergl-jupyter/widget-api.md b/docs/keplergl-jupyter/widget-api.md
new file mode 100644
index 000000000..8b1f459c2
--- /dev/null
+++ b/docs/keplergl-jupyter/widget-api.md
@@ -0,0 +1,113 @@
+# Widget API
+
+## `KeplerGl()`
+
+Create a kepler.gl map widget.
+
+### Parameters
+
+- __`height`__ `int` _optional_ default: `400`
+
+ Height of the map display in pixels.
+
+- __`data`__ `dict` _optional_
+
+ Datasets as a dictionary, key is the name of the dataset. Read more on [Accepted data formats](data-formats.md).
+
+- __`mapbox_token`__ `str` _optional_ default: `""`
+
+ Mapbox API access token. Required for Mapbox basemap styles (e.g. "Dark", "Muted Light"). Leave empty to use free MapLibre styles.
+
+- __`use_arrow`__ `bool` _optional_ default: `False`
+
+ If `True`, serialize DataFrames as Arrow IPC for better performance on large datasets. Has no effect on GeoDataFrames, which always use GeoArrow serialization.
+
+- __`config`__ `dict` _optional_
+
+ Map config as a dictionary. The `dataId` in the layer and filter settings should match the `name` of the dataset they are created under.
+
+- __`show_docs`__ `bool` _optional_
+
+ Deprecated, kept for backward compatibility.
+
+- __`theme`__ `str` _optional_ default: `""`
+
+ UI theme for the map. Accepted values are `"light"`, `"dark"`, `"base"`, or `""` (default dark theme). See [Map Customization](map-customization.md) for details.
+
+- __`app_name`__ `str` _optional_ default: `"kepler.gl"`
+
+ Application name shown in the side panel header and used as the HTML `<title>` when exporting. See [Map Customization](map-customization.md) for details.
+
+### Examples
+
+```python
+# Load an empty map
+from keplergl import KeplerGl
+map_1 = KeplerGl()
+map_1
+```
+
+![empty map][empty_map]
+
+You can also create the map and pass in the data or data and config at the same time. Follow the instruction to [match config with data](config.md#match-config-with-data).
+
+```python
+# Load a map with data and config and height
+from keplergl import KeplerGl
+map_2 = KeplerGl(height=400, data={"data_1": my_df}, config=config)
+map_2
+```
+
+![Load map with data and config][load_map_w_data]
+
+---
+
+## `.add_data()`
+
+Add data to an existing map.
+
+### Parameters
+
+- __`data`__ _required_ CSV, GeoJSON, DataFrame or GeoDataFrame. Read more on [Accepted data formats](data-formats.md).
+- __`name`__ _optional_ default: `"data"`. Name of the data entry.
+- __`use_arrow`__ _optional_ If `True`, serialize DataFrame as Arrow IPC. If `None` (default), falls back to the widget-level `use_arrow` setting.
+
+`name` of the dataset will be saved to the `dataId` property of each `layer`, `filter` and `interactionConfig` in the config.
+
+kepler.gl expects the data to be **CSV**, **GeoJSON**, **DataFrame** or **GeoDataFrame**. You can call `add_data` multiple times to add multiple datasets to kepler.gl.
+
+```python
+# DataFrame
+df = pd.read_csv('hex-data.csv')
+map_1.add_data(data=df, name='data_1')
+
+# CSV
+with open('csv-data.csv', 'r') as f:
+ csvData = f.read()
+map_1.add_data(data=csvData, name='data_2')
+
+# GeoJSON as string
+with open('sf_zip_geo.json', 'r') as f:
+ geojson = f.read()
+
+map_1.add_data(data=geojson, name='geojson')
+```
+
+![Add data to map][map_add_data]
+
+---
+
+## `.data`
+
+Print the current data added to the map. Returns a `dict`.
+
+```python
+map_1.data
+# {'data_1': 'hex_id,value\n89283082c2fffff,64\n8928308288fffff,73\n89283082c07ffff,65\n89283082817ffff,74\n89283082c3bffff,66\n8...`,
+# 'data_2': 'location, lat, lng, name\n..',
+# 'data_3': '{"type": "FeatureCollection...'}
+```
+
+[empty_map]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_empty_map.png
+[load_map_w_data]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_widget.png
+[map_add_data]: https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/jupyter_add_data.png
diff --git a/docs/table-of-contents.json b/docs/table-of-contents.json
index 7ca85ecc8..13786438c 100644
--- a/docs/table-of-contents.json
+++ b/docs/table-of-contents.json
@@ -118,7 +118,14 @@
{
"title": "Python Bindings",
"entries": [
- {"entry": "docs/keplergl-jupyter/user-guide"}
+ {"entry": "docs/keplergl-jupyter"},
+ {"entry": "docs/keplergl-jupyter/install"},
+ {"entry": "docs/keplergl-jupyter/widget-api"},
+ {"entry": "docs/keplergl-jupyter/data-formats"},
+ {"entry": "docs/keplergl-jupyter/map-customization"},
+ {"entry": "docs/keplergl-jupyter/config"},
+ {"entry": "docs/keplergl-jupyter/save-and-export"},
+ {"entry": "docs/keplergl-jupyter/faq"}
]
}
]