🗾 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
Fastest Gephi's ForceAtlas2 graph layout algorithm implemented for Python and NetworkX

ForceAtlas2 for Python A port of Gephi's Force Atlas 2 layout algorithm to Python 2 and Python 3 (with a wrapper for NetworkX and igraph). This is the

Bhargav Chippada 227 Jan 05, 2023
kyle's vision of how datadog's python client should look

kyle's datadog python vision/proposal not for production use See examples/comprehensive.py for a mostly working example of the proposed API. 📈 🐶 ❤️

Kyle Verhoog 2 Nov 21, 2021
Joyplots in Python with matplotlib & pandas :chart_with_upwards_trend:

JoyPy JoyPy is a one-function Python package based on matplotlib + pandas with a single purpose: drawing joyplots (a.k.a. ridgeline plots). The code f

Leonardo Taccari 462 Jan 02, 2023
Runtime analysis of code with plotting

Runtime analysis of code with plotting A quick comparison among Python, Cython, and the C languages A Programming Assignment regarding the Programming

Cena Ashoori 2 Dec 24, 2021
Uniform Manifold Approximation and Projection

UMAP Uniform Manifold Approximation and Projection (UMAP) is a dimension reduction technique that can be used for visualisation similarly to t-SNE, bu

Leland McInnes 6k Jan 08, 2023
Bcc2telegraf: An integration that sends ebpf-based bcc histogram metrics to telegraf daemon

bcc2telegraf bcc2telegraf is an integration that sends ebpf-based bcc histogram

Peter Bobrov 2 Feb 17, 2022
A simple python script using Numpy and Matplotlib library to plot a Mohr's Circle when given a two-dimensional state of stress.

Mohr's Circle Calculator This is a really small personal project done for Department of Civil Engineering, Delhi Technological University (formerly, D

Agyeya Mishra 0 Jul 17, 2021
erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes

erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes. Diagrams are rendered using the venerable Graphviz library.

DrivenData 129 Jan 04, 2023
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
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 set of three functions, useful in geographical calculations of different sorts

GreatCircle A set of three functions, useful in geographical calculations of different sorts. Available for PHP, Python, Javascript and Ruby. Live dem

72 Sep 30, 2022
2D maze path solver visualizer implemented with python

2D maze path solver visualizer implemented with python

SS 14 Dec 21, 2022
The official colors of the FAU as matplotlib/seaborn colormaps

FAU - Colors The official colors of Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU) as matplotlib / seaborn colormaps. We support the old colo

Machine Learning and Data Analytics Lab FAU 9 Sep 05, 2022
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
Simple Inkscape Scripting

Simple Inkscape Scripting Description In the Inkscape vector-drawing program, how would you go about drawing 100 diamonds, each with a random color an

Scott Pakin 140 Dec 27, 2022
Domain Connectivity Analysis Tools to analyze aggregate connectivity patterns across a set of domains during security investigations

DomainCAT (Domain Connectivity Analysis Tool) Domain Connectivity Analysis Tool is used to analyze aggregate connectivity patterns across a set of dom

DomainTools 34 Dec 09, 2022
nptsne is a numpy compatible python binary package that offers a number of APIs for fast tSNE calculation.

nptsne nptsne is a numpy compatible python binary package that offers a number of APIs for fast tSNE calculation and HSNE modelling. For more detail s

Biomedical Visual Analytics Unit LUMC - TU Delft 29 Jul 05, 2022
A Python-based non-fungible token (NFT) generator built using Samilla and Matplotlib

PyNFT A Pythonic NF (non-fungible token) generator built using Samilla and Matplotlib Use python pynft.py [amount] The intention behind this generato

Ayush Gundawar 6 Feb 07, 2022
Machine learning beginner to Kaggle competitor in 30 days. Non-coders welcome. The program starts Monday, August 2, and lasts four weeks. It's designed for people who want to learn machine learning.

30-Days-of-ML-Kaggle 🔥 About the Hands On Program 💻 Machine learning beginner → Kaggle competitor in 30 days. Non-coders welcome The program starts

Roja Achary 145 Jan 01, 2023
Resources for teaching & learning practical data visualization with python.

Practical Data Visualization with Python Overview All views expressed on this site are my own and do not represent the opinions of any entity with whi

Paul Jeffries 98 Sep 24, 2022