🗾 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
This is a Boids Simulation, written in Python with Pygame.

PyNBoids A Python Boids Simulation This is a Boids simulation, written in Python3, with Pygame2 and NumPy. To use: Save the pynboids_sp.py file (and n

Nik 17 Dec 18, 2022
Alternative layout visualizer for ZSA Moonlander keyboard

General info This is a keyboard layout visualizer for ZSA Moonlander keyboard (because I didn't find their Oryx or their training tool particularly us

10 Jul 19, 2022
A script written in Python that generate output custom color (HEX or RGB input to x1b hexadecimal)

ColorShell ─ 1.5 Planned for v2: setup.sh for setup alias This script converts HEX and RGB code to x1b x1b is code for colorize outputs, works on ou

Riley 4 Oct 31, 2021
Productivity Tools for Plotly + Pandas

Cufflinks This library binds the power of plotly with the flexibility of pandas for easy plotting. This library is available on https://github.com/san

Jorge Santos 2.7k Dec 30, 2022
又一个云探针

ServerStatus-Murasame 感谢ServerStatus-Hotaru,又一个云探针诞生了(大雾 本项目在ServerStatus-Hotaru的基础上使用fastapi重构了服务端,部分修改了客户端与前端 项目还在非常原始的阶段,可能存在严重的问题 演示站:https://stat

6 Oct 19, 2021
Tidy data structures, summaries, and visualisations for missing data

naniar naniar provides principled, tidy ways to summarise, visualise, and manipulate missing data with minimal deviations from the workflows in ggplot

Nicholas Tierney 611 Dec 22, 2022
LinkedIn connections analyzer

LinkedIn Connections Analyzer 🔗 https://linkedin-analzyer.herokuapp.com Hey hey 👋 , welcome to my LinkedIn connections analyzer. I recently found ou

Okkar Min 5 Sep 13, 2022
Statistics and Visualization of acceptance rate, main keyword of CVPR 2021 accepted papers for the main Computer Vision conference (CVPR)

Statistics and Visualization of acceptance rate, main keyword of CVPR 2021 accepted papers for the main Computer Vision conference (CVPR)

Hoseong Lee 78 Aug 23, 2022
With Holoviews, your data visualizes itself.

HoloViews Stop plotting your data - annotate your data and let it visualize itself. HoloViews is an open-source Python library designed to make data a

HoloViz 2.3k Jan 02, 2023
Python toolkit for defining+simulating+visualizing+analyzing attractors, dynamical systems, iterated function systems, roulette curves, and more

Attractors A small module that provides functions and classes for very efficient simulation and rendering of iterated function systems; dynamical syst

1 Aug 04, 2021
Parse Robinhood 1099 Tax Document from PDF into CSV

Robinhood 1099 Parser This project converts Robinhood Securities 1099 tax document from PDF to CSV file. This tool will be helpful for those who need

Keun Tae (Kevin) Park 52 Jun 10, 2022
A streamlit component for bi-directional communication with bokeh plots.

Streamlit Bokeh Events A streamlit component for bi-directional communication with bokeh plots. Its just a workaround till streamlit team releases sup

Ashish Shukla 123 Dec 25, 2022
Automate the case review on legal case documents and find the most critical cases using network analysis

Automation on Legal Court Cases Review This project is to automate the case review on legal case documents and find the most critical cases using netw

Yi Yin 7 Dec 28, 2022
Project coded in Python using Pandas to look at changes in chase% for batters facing a pitcher first time through the order vs. thrid time

Project coded in Python using Pandas to look at changes in chase% for batters facing a pitcher first time through the order vs. thrid time

Jason Kraynak 1 Jan 07, 2022
Handout for the tutorial "Creating publication-quality figures with matplotlib"

Handout for the tutorial "Creating publication-quality figures with matplotlib"

JB Mouret 1.9k Jan 02, 2023
Python package to Create, Read, Write, Edit, and Visualize GSFLOW models

pygsflow pyGSFLOW is a python package to Create, Read, Write, Edit, and Visualize GSFLOW models API Documentation pyGSFLOW API documentation can be fo

pyGSFLOW 21 Dec 14, 2022
Debugging, monitoring and visualization for Python Machine Learning and Data Science

Welcome to TensorWatch TensorWatch is a debugging and visualization tool designed for data science, deep learning and reinforcement learning from Micr

Microsoft 3.3k Dec 27, 2022
a plottling library for python, based on D3

Hello August 2013 Hello! Maybe you're looking for a nice Python interface to build interactive, javascript based plots that look as nice as all those

Mike Dewar 1.4k Dec 28, 2022
Monochromatic colorscheme for matplotlib with opinionated sensible default

Monochromatic colorscheme for matplotlib with opinionated sensible default If you need a simple monochromatic colorscheme for your matplotlib figures,

Aria Ghora Prabono 2 May 06, 2022
Visualise Ansible execution time across playbooks, tasks, and hosts.

ansible-trace Visualise where time is spent in your Ansible playbooks: what tasks, and what hosts, so you can find where to optimise and decrease play

Mark Hansen 81 Dec 15, 2022