Skip to main content

Render G2 charts in Streamlit

Project description

Streamlit G2

G2 is a visualization grammar for dashboard building, data exploration and storytelling.

This project was created to allow us to render G2 charts in streamlit. Live Demo.

examples

PyPI version Build Status Coverage Status npm Version npm Download npm License

Installation

pip install streamlit-g2 

Usage

import streamlit as st
from streamlit_g2 import g2

options = {
    "type": "interval",
    "data": [
        { "genre": 'Sports', "sold": 275 },
        { "genre": 'Strategy', "sold": 115 },
        { "genre": 'Action', "sold": 120 },
        { "genre": 'Shooter', "sold": 350 },
        { "genre": 'Other', "sold": 150 },
    ],
    "encode": {
        "x": "genre",
        "y": "sold",
        "color": "genre",
    }
}

g2(options=options, style=None, key="streamlit_g2")
example

API

Now, There is only one API for streamlit-g2, named g2, see the options in G2 Spec API.

Property Description Type Default
options the options for the visualization, say chart.options(options) G2options | null -
style the style of the container CSSProperties -

Development

  • Building frontend code by running npm run start in fold streamlit_g2/frontend.
  • Run the example by running streamlit run streamlit_g2/__init__.py with _RELEASE = False.

License

MIT@hustcc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit-g2-0.1.1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

streamlit_g2-0.1.1-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file streamlit-g2-0.1.1.tar.gz.

File metadata

  • Download URL: streamlit-g2-0.1.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for streamlit-g2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d7a52fc6844c7be39bab9dce4d138eff7d9942ce4472de1d7bdca154ddb30bbf
MD5 24629fbdd75ba6c77ca0ea40e5bcf647
BLAKE2b-256 839d969730c25fa3a9b1647d1a03b86ce068e89d71b8d07d4e4ced146d68e85b

See more details on using hashes here.

File details

Details for the file streamlit_g2-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_g2-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ccee14cc8bad14c5c76b19bafbafd00d6c9107f9e899d57a506b4a67b9d80f4
MD5 e7c009ba7492c9717e36c8b4fdb7560e
BLAKE2b-256 0ae5c89d0a5efc83c7410dcfe9b98d911a6a5980eb75c5289893475ce406dee8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page