🗾 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
Apache Superset is a Data Visualization and Data Exploration Platform

Superset A modern, enterprise-ready business intelligence web application. Why Superset? | Supported Databases | Installation and Configuration | Rele

The Apache Software Foundation 50k Jan 06, 2023
Create artistic visualisations with your exercise data (Python version)

strava_py Create artistic visualisations with your exercise data (Python version). This is a port of the R strava package to Python. Examples Facets A

Marcus Volz 53 Dec 28, 2022
A blender import/export system for Defold

defold-blender-export A Blender export system for the Defold game engine. Setup Notes There are no exhaustive documents for this tool yet. Its just no

David Lannan 27 Dec 30, 2022
🐍PyNode Next allows you to easily create beautiful graph visualisations and animations

PyNode Next A complete rewrite of PyNode for the modern era. Up to five times faster than the original PyNode. PyNode Next allows you to easily create

ehne 3 Feb 12, 2022
Some problems of SSLC ( High School ) before outputs and after outputs

Some problems of SSLC ( High School ) before outputs and after outputs 1] A Python program and its output (output1) while running the program is given

Fayas Noushad 3 Dec 01, 2021
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
Decision Border Visualizer for Classification Algorithms

dbv Decision Border Visualizer for Classification Algorithms Project description A python package for Machine Learning Engineers who want to visualize

Sven Eschlbeck 1 Nov 01, 2021
Simple addon for snapping active object to mesh ground

Snap to Ground Simple addon for snapping active object to mesh ground How to install: install the Python file as an addon use shortcut "D" in 3D view

Iyad Ahmed 12 Nov 07, 2022
Jupyter Notebook extension leveraging pandas DataFrames by integrating DataTables and ChartJS.

Jupyter DataTables Jupyter Notebook extension to leverage pandas DataFrames by integrating DataTables JS. About Data scientists and in fact many devel

Marek Čermák 142 Dec 28, 2022
Comparing USD and GBP Exchange Rates

Currency Data Visualization Comparing USD and GBP Exchange Rates This is a bar graph comparing GBP and USD exchange rates. I chose blue for the UK bec

5 Oct 28, 2021
Learn Data Science with focus on adding value with the most efficient tech stack.

DataScienceWithPython Get started with Data Science with Python An engaging journey to become a Data Scientist with Python TL;DR Download all Jupyter

Learn Python with Rune 110 Dec 22, 2022
Eulera Dashboard is an easy and intuitive way to get a quick feel of what’s happening on the world’s market.

an easy and intuitive way to get a quick feel of what’s happening on the world’s market ! Eulera dashboard is a tool allows you to monitor historical

Salah Eddine LABIAD 4 Nov 25, 2022
DataVisualization - The evolution of my arduino and python journey. New level of competence achieved

DataVisualization - The evolution of my arduino and python journey. New level of competence achieved

1 Jan 03, 2022
A grammar of graphics for Python

plotnine Latest Release License DOI Build Status Coverage Documentation plotnine is an implementation of a grammar of graphics in Python, it is based

Hassan Kibirige 3.3k Jan 01, 2023
Interactive Dashboard for Visualizing OSM Data Change

Dashboard and intuitive data downloader for more interactive experience with interpreting osm change data.

1 Feb 20, 2022
AB-test-analyzer - Python class to perform AB test analysis

AB-test-analyzer Python class to perform AB test analysis Overview This repo con

13 Jul 16, 2022
D-Analyst : High Performance Visualization Tool

D-Analyst : High Performance Visualization Tool D-Analyst is a high performance data visualization built with python and based on OpenGL. It allows to

4 Apr 14, 2022
Arras.io Highest Scores Over Time Bar Chart Race

Arras.io Highest Scores Over Time Bar Chart Race This repo contains a python script (make_racing_bar_chart.py) that can generate a csv file which can

Road 2 Jan 16, 2022
An automatic prover for tautologies in Metamath

completeness An automatic prover for tautologies in Metamath This program implements the constructive proof of the Completeness Theorem for propositio

Scott Fenton 2 Dec 15, 2021
📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)

📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)

wq framework 1.2k Jan 01, 2023