🗾 Streamlit Component for rendering kepler.gl maps

Overview

streamlit-keplergl

Open in Streamlit PyPi

🗾 Streamlit Component for rendering kepler.gl maps in a streamlit app.


🎈 Live Demo 🎈


Installation

pip install streamlit-keplergl

How to use it

import streamlit as st
from streamlit_keplergl import keplergl_static
from keplergl import KeplerGl

st.write("This is a kepler.gl map in streamlit")

map_1 = KeplerGl(height=400)
keplergl_static(map_1)

Options

fig: keplergl.KeplerGl map figure.
height: Height of result. If height is set on the keplergl.KeplerGl object,
        that value supersedes the values set with the keyword arguments of this
        function.
width: Width of result.
Comments
  • Map does not locate on data

    Map does not locate on data

    I created a demo app to load a geojson and can display fine, but the map always loads over San Fransisco. I think it may be because the dataframe is not passed using the data attribute? Unsure.

    import streamlit as st
    from streamlit_keplergl import keplergl_static
    from keplergl import KeplerGl
    import geopandas as gpd
    
    infile = 'data/my.json'
    
    df = gpd.read_file(infile)
    map_1 = KeplerGl(height=800)
    map_1.add_data(df, 'data_1')
    keplergl_static(map_1)
    
    # Show data table
    st.dataframe(df.drop(columns=['geometry']))
    
    opened by robmarkcole 7
  • Keplergl problem in Streamlit

    Keplergl problem in Streamlit

    I can't deploy keplergl map in Streamlit when I use geopandas and movingpandas in my dataframe. When I only use original dataframe, with latitude and longitude data, works well, but when I use these libraries to analysis stop points and trajectories, I get an error.

    Obs.: I used Jupyter to test and visualize the map, but the app is .py file made in VS Code.

    20210727_225154

    opened by mcharles96 4
  • Width does not update

    Width does not update

    Passing the height parameter achieved the desired result, but width does not.

    Also raised on https://discuss.streamlit.io/t/adapt-container-streamlit-keplergl/14821

    opened by robmarkcole 3
  • Can not add data on the map

    Can not add data on the map

    Hi! Using streamlit-keplergl, it works like the demo but when I add new data from a csv file, it does not show on the map. here is part of the code:

    with open(CONFIG, 'r') as stream:
      config = yaml.safe_load(stream)
    
    data = pd.read_csv( 'file.csv')
    st.dataframe(data.head())
    # Build map finally
    map = KeplerGl(height=800, data={NAME: data}, config=config)
    

    note: this works on other environments like google colab and Jupiter. am I doing sth wrong?

    opened by d-shiri 1
  • New version did not work for me (windows user), map did not plot the data

    New version did not work for me (windows user), map did not plot the data

    Hi there,

    Just wanted to give you a heads up in case other people face the same issue. For some reason when I created a new virtual env in Anaconda and streamlit-keplergl was upgraded to the new version 0.2.0 my streamlit app stopped plotting the data altogether, but when reverted to 0.1.0 it started working as per usual. I have no idea why though as I am still pretty new to python/streamlit/kepler.

    Cheeers,

    Cole

    opened by Cole-Narfason 1
  • Object of type Timestamp is not JSON serializable`

    Object of type Timestamp is not JSON serializable`

        keplergl_static(map)
      File "/opt/anaconda3/lib/python3.8/site-packages/streamlit_keplergl/__init__.py", line 29, in keplergl_static
        html = fig._repr_html_()
      File "/opt/anaconda3/lib/python3.8/site-packages/keplergl/keplergl.py", line 170, in _repr_html_
        keplergl_data = json.dumps({"config": config_to_add, "data": data_to_add, "options": {"readOnly": read_only, "centerMap": center_map}})
      File "/opt/anaconda3/lib/python3.8/json/__init__.py", line 231, in dumps
        return _default_encoder.encode(obj)
      File "/opt/anaconda3/lib/python3.8/json/encoder.py", line 199, in encode
        chunks = self.iterencode(o, _one_shot=True)
      File "/opt/anaconda3/lib/python3.8/json/encoder.py", line 257, in iterencode
        return _iterencode(o, 0)
      File "/opt/anaconda3/lib/python3.8/json/encoder.py", line 179, in default
        raise TypeError(f'Object of type {o.__class__.__name__} '
    TypeError: Object of type Timestamp is not JSON serializable```
    
    Here are all of the types in my GeoDataFrame:
    
    ```TimeUTC           datetime64[ns]
    AeroscopeID               string
    DroneType                 string
    Callsign                  string
    FlightID                  string
    Latitude                 float64
    Longitude                float64
    Altitude                 float64
    HomeLongitude            float64
    HomeLatitude             float64
    PilotLongitude           float64
    PilotLatitude            float64
    geometry                geometry
    dtype: object```
    
    There is no "Timestamp" column.
    
    I tried duplicating TimeUTC and converting it to a string with no luck.
    
    opened by kovar-ursa 1
  • Add visualization parameter explictly, remove kwargs

    Add visualization parameter explictly, remove kwargs

    Improves the control of the map visualization by adding center_map and read_only arguments. Removes scrolling argument which was added in https://github.com/chrieke/streamlit-keplergl/pull/8 (not required, https://github.com/chrieke/streamlit-keplergl/issues/7 is fixed by removing the kwargs argument).

    opened by chrieke 0
  • Adjust width height use

    Adjust width height use

    • Adjusts use of width and height parameters based on feedback e.g. https://github.com/chrieke/streamlit-keplergl/issues/3
    • Removes forced defaults for width & height parameters
    • height parameter now correctly supersedes the keplergl figure object setting
    • Adds better explanation and more examples
    • Removes st component scrolling parameter as had no effect
    opened by chrieke 0
  • Map won't render with specified configuration

    Map won't render with specified configuration

    Hi, I am trying to load a GeoJson dataset onto the map and I am able to do so successfully and view in a streamlit dashboard however when I specify a config in the KeplerGl() function call keplergl_static(my_map) nothing renders on the dashboard. I can run the same code in a Jupyter notebook and specify the config and the map renders as expected.

    opened by davisgiles 1
  • Keplergl creashes when using interaction>Geocoder

    Keplergl creashes when using interaction>Geocoder

    When toogleing the geocoder functionality (sidebar, interaction), the kepler-gl window becomes black. Checked in Jupter notebook and this does not happen. Only happens with the geocoder button, the others are fine.

    Also couldn't find relevant issue upstream, muste be something streamlit component related.

    Originally posted by @lennonzheng in https://github.com/chrieke/streamlit-keplergl/issues/4#issuecomment-1179437719

    opened by chrieke 0
Releases(0.3.0)
  • 0.3.0(Jun 5, 2022)

  • 0.2.0(Feb 19, 2022)

    • Adjusts use of width and height parameters based on feedback e.g. https://github.com/chrieke/streamlit-keplergl/issues/3
    • Removes forced defaults for width & height parameters
    • height parameter now correctly supersedes the keplergl figure object setting
    • Adds better explanation and more examples
    • Removes st component scrolling parameter as had no effect
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Jun 19, 2021)

Owner
Christoph Rieke
Geospatial Engineer
Christoph Rieke
Generating interfaces(CLI, Qt GUI, Dash web app) from a Python function.

oneFace is a Python library for automatically generating multiple interfaces(CLI, GUI, WebGUI) from a callable Python object. oneFace is an easy way t

NaNg 31 Oct 21, 2022
A research of IT labor market based especially on hh.ru. Salaries, rate of technologies and etc.

hh_ru_research Проект реализован в учебных целях анализа рынка труда, в особенности по hh.ru Input data В качестве входных данных используются сериали

3 Sep 07, 2022
Manim is an animation engine for explanatory math videos.

A community-maintained Python framework for creating mathematical animations.

12.4k Dec 30, 2022
Massively parallel self-organizing maps: accelerate training on multicore CPUs, GPUs, and clusters

Somoclu Somoclu is a massively parallel implementation of self-organizing maps. It exploits multicore CPUs, it is able to rely on MPI for distributing

Peter Wittek 239 Nov 10, 2022
cqMore is a CadQuery plugin based on CadQuery 2.1.

cqMore (under construction) cqMore is a CadQuery plugin based on CadQuery 2.1. Installation Please use conda to install CadQuery and its dependencies

Justin Lin 36 Dec 21, 2022
哔咔漫画window客户端,界面使用PySide2,已实现分类、搜索、收藏夹、下载、在线观看、waifu2x等功能。

picacomic-windows 哔咔漫画window客户端,界面使用PySide2,已实现分类、搜索、收藏夹、下载、在线观看等功能。 功能介绍 登陆分流,还原安卓端的三个分流入口 分类,搜索,排行,收藏夹使用同一的逻辑,滚轮下滑自动加载下一页,双击打开 漫画详情,章节列表和评论列表 下载功能,目

1.8k Dec 31, 2022
A comprehensive tutorial for plotting focal mechanism

Focal_Mechanisms_Demo A comprehensive tutorial for plotting focal mechanism "beach-balls" using the PyGMT package for Python. (Resulting map of this d

3 Dec 13, 2022
Collection of data visualizing projects through Tableau, Data Wrapper, and Power BI

Data-Visualization-Projects Collection of data visualizing projects through Tableau, Data Wrapper, and Power BI Indigenous-Brands-Social-Movements Pyt

Jinwoo(Roy) Yoon 1 Feb 05, 2022
paintable GitHub contribute table

githeart paintable github contribute table how to use: Functions key color select 1,2,3,4,5 clear c drawing mode mode on turn off e print paint matrix

Bahadır Araz 27 Nov 24, 2022
Dimensionality reduction in very large datasets using Siamese Networks

ivis Implementation of the ivis algorithm as described in the paper Structure-preserving visualisation of high dimensional single-cell datasets. Ivis

beringresearch 284 Jan 01, 2023
A minimal Python package that produces slice plots through h5m DAGMC geometry files

A minimal Python package that produces slice plots through h5m DAGMC geometry files Installation pip install dagmc_geometry_slice_plotter Python API U

Fusion Energy 4 Dec 02, 2022
Using SQLite within Python to create database and analyze Starcraft 2 units data (Pandas also used)

SQLite python Starcraft 2 English This project shows the usage of SQLite with python. To create, modify and communicate with the SQLite database from

1 Dec 30, 2021
Simple spectra visualization tool for astronomers

SpecViewer A simple visualization tool for astronomers. Dependencies Python = 3.7.4 PyQt5 = 5.15.4 pyqtgraph == 0.10.0 numpy = 1.19.4 How to use py

5 Oct 07, 2021
A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.

Visdom A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Python. Overview Concepts Setup Usage API To

FOSSASIA 9.4k Jan 07, 2023
The Timescale NFT Starter Kit is a step-by-step guide to get up and running with collecting, storing, analyzing and visualizing NFT data from OpenSea, using PostgreSQL and TimescaleDB.

Timescale NFT Starter Kit The Timescale NFT Starter Kit is a step-by-step guide to get up and running with collecting, storing, analyzing and visualiz

Timescale 102 Dec 24, 2022
a simple REPL display lib for circuitpython

Circuitpython-termio-lib a simple REPL display lib for circuitpython Fonctions cls clear terminal screen and set cursor on top left : coords 0,0 usage

BeBoXoS 1 Nov 17, 2021
A Python Library for Self Organizing Map (SOM)

SOMPY A Python Library for Self Organizing Map (SOM) As much as possible, the structure of SOM is similar to somtoolbox in Matlab. It has the followin

Vahid Moosavi 497 Dec 29, 2022
Data Visualizer for Super Mario Kart (SNES)

Data Visualizer for Super Mario Kart (SNES)

MrL314 21 Nov 20, 2022
An application that allows you to design and test your own stock trading algorithms in an attempt to beat the market.

StockBot is a Python application for designing and testing your own daily stock trading algorithms. Installation Use the

Ryan Cullen 280 Dec 19, 2022
An XLSX spreadsheet renderer for Django REST Framework.

drf-renderer-xlsx provides an XLSX renderer for Django REST Framework. It uses OpenPyXL to create the spreadsheet and returns the data.

The Wharton School 166 Dec 01, 2022