πŸ—Ύ 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
Color maps for POV-Ray v3.7 from the Plasma, Inferno, Magma and Viridis color maps in Python's Matplotlib

POV-Ray-color-maps Color maps for POV-Ray v3.7 from the Plasma, Inferno, Magma and Viridis color maps in Python's Matplotlib. The include file Color_M

Tor Olav Kristensen 1 Apr 5, 2022
Streamlit component for Let's-Plot visualization library

streamlit-letsplot This is a work-in-progress, providing a convenience function to plot charts from the Lets-Plot visualization library. Example usage

Randy Zwitch 9 Nov 3, 2022
This component provides a wrapper to display SHAP plots in Streamlit.

streamlit-shap This component provides a wrapper to display SHAP plots in Streamlit.

Snehan Kekre 30 Dec 10, 2022
A shimmer pre-load component for Plotly Dash

dash-loading-shimmer A shimmer pre-load component for Plotly Dash Installation Get it with pip: pip install dash-loading-extras Or maybe you prefer Pi

Lucas Durand 4 Oct 12, 2022
UNMAINTAINED! Renders beautiful SVG maps in Python.

Kartograph is not maintained anymore As you probably already guessed from the commit history in this repo, Kartograph.py is not maintained, which mean

null 1k Dec 9, 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
Python Data. Leaflet.js Maps.

folium Python Data, Leaflet.js Maps folium builds on the data wrangling strengths of the Python ecosystem and the mapping strengths of the Leaflet.js

null 6k Jan 2, 2023
Easily convert matplotlib plots from Python into interactive Leaflet web maps.

mplleaflet mplleaflet is a Python library that converts a matplotlib plot into a webpage containing a pannable, zoomable Leaflet map. It can also embe

Jacob Wasserman 502 Dec 28, 2022
A package for plotting maps in R with ggplot2

Attention! Google has recently changed its API requirements, and ggmap users are now required to register with Google. From a user’s perspective, ther

David Kahle 719 Jan 4, 2023
Visualize data of Vietnam's regions with interactive maps.

Plotting Vietnam Development Map This is my personal project that I use plotly to analyse and visualize data of Vietnam's regions with interactive map

null 1 Jun 26, 2022
Simple implementation of Self Organizing Maps (SOMs) with rectangular and hexagonal grid topologies

py-self-organizing-map Simple implementation of Self Organizing Maps (SOMs) with rectangular and hexagonal grid topologies. A SOM is a simple unsuperv

Jonas Grebe 1 Feb 10, 2022
Implementation of SOMs (Self-Organizing Maps) with neighborhood-based map topologies.

py-self-organizing-maps Simple implementation of self-organizing maps (SOMs) A SOM is an unsupervised method for learning a mapping from a discrete ne

Jonas Grebe 6 Nov 22, 2022
Python module for drawing and rendering beautiful atoms and molecules using Blender.

Batoms is a Python package for editing and rendering atoms and molecules objects using blender. A Python interface that allows for automating workflows.

Xing Wang 1 Jul 6, 2022
This is simply repo for line drawing rendering using freestyle in Blender.

blender_freestyle_line_drawing This is simply repo for line drawing rendering using freestyle in Blender. how to use blender2935 --background --python

MaxLin 3 Jul 2, 2022
Streamlit dashboard examples - Twitter cashtags, StockTwits, WSB, Charts, SQL Pattern Scanner

streamlit-dashboards Streamlit dashboard examples - Twitter cashtags, StockTwits, WSB, Charts, SQL Pattern Scanner Tutorial Video https://ww

null 122 Dec 21, 2022
A deceptively simple plotting library for Streamlit

?? Plost A deceptively simple plotting library for Streamlit. Because you've been writing plots wrong all this time. Getting started pip install plost

Thiago Teixeira 192 Dec 29, 2022
Wikipedia WordCloud App generate Wikipedia word cloud art created using python's streamlit, matplotlib, wikipedia and wordcloud packages

Wikipedia WordCloud App Wikipedia WordCloud App generate Wikipedia word cloud art created using python's streamlit, matplotlib, wikipedia and wordclou

Siva Prakash 5 Jan 2, 2022
OpenStats is a library built on top of streamlit that extracts data from the Github API and shows the main KPIs

Open Stats Discover and share the KPIs of your OpenSource project. OpenStats is a library built on top of streamlit that extracts data from the Github

Pere Miquel Brull 4 Apr 3, 2022
A simple Streamlit Component to compare images in Streamlit apps. It integrates Knightlab's JuxtaposeJS

streamlit-image-juxtapose A simple Streamlit Component to compare images in Streamlit apps using Knightlab's JuxtaposeJS. The images are saved to the

Robin 30 Dec 31, 2022
Streamlit component to display topics from Streamlit's community forum related to any exception.

streamlit-forum Streamlit component to display topics from Streamlit's community forum related to any exception. Installation pip install streamlit-fo

Snehan Kekre 7 Jul 15, 2022