Skip to main content

A custom streamlit component to return echarts events values to streamlit

Project description

Streamlit Echarts Events

a bi-directional streamlit components with pyecharts plots

return event value from js-side to python-side。if no events designed, just display a chart.

Installation

pip install streamlit-ehcarts-events

Usage

only three steps using it , generate a pyecharts object, passing interested events and parameters

inputs:

chart: pyecharts object events: list , echarts events, eg. ['click','dblclick'] params: list , events value for echarts events,declared in echarts API DOC, eg. ['name','data','value']

outputs:

return status and values. status 0: get a value -1: get no value or an error occurs. return_data python dictionary, key is params,value is value for params.

Example

from pyecharts.charts import Bar
from st_echarts_events import st_echarts_events

bar = Bar()
bar.add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"])
bar.add_yaxis("商家A", [5, 20, 36, 10, 75, 90])

import streamlit as st
st.header("Pyecharts Events Feedback Test")    
chart=bar
events=['click']   
params=['name','value','data']
status,return_data = st_echarts_events(chart=chart,events=events,params=params)    
st.markdown("Return data : %s " % return_data)

if you want test the package, deploy environment like this:streamlit template

Notes:

if no data. return 'no data.' if error, return error message. map are not working well so far, need further implement.

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

st-echarts-events-1.0.0.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

st_echarts_events-1.0.0-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

File details

Details for the file st-echarts-events-1.0.0.tar.gz.

File metadata

  • Download URL: st-echarts-events-1.0.0.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.2

File hashes

Hashes for st-echarts-events-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ec8720bb8fe0999d461374162d18a9bf0287716330442e11f7f247d4bc963a39
MD5 50a706930164d467f1d616ca3ee0b1b4
BLAKE2b-256 a1832e0602561b63ad96f610137da0c80d74e180837a37fbd6e53958c01565d7

See more details on using hashes here.

File details

Details for the file st_echarts_events-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: st_echarts_events-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.2

File hashes

Hashes for st_echarts_events-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55d79981966de923e8313c85995011fde7232bb1d97b4e189c2392e0d0bd301c
MD5 399eace1be9ac2896795efbf27b39a4f
BLAKE2b-256 43020747d8c18ee8d7a2d7a5b5b9fe7cb1879a3cc0d928440492952fecdb1af7

See more details on using hashes here.

Supported by

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