Skip to main content

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.

Metadata

Release files for st-echarts-events 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for st-echarts-events 1.0.0
File Size Uploaded
st-echarts-events-1.0.0.tar.gz 2.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for st-echarts-events 1.0.0
File Interpreter ABI Platform
st_echarts_events-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.4 MB

Release files / st-echarts-events-1.0.0.tar.gz

Download URL st-echarts-events-1.0.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
ec8720bb8fe0999d461374162d18a9bf0287716330442e11f7f247d4bc963a39
BLAKE2b-256 checksum
How to use checksums
a1832e0602561b63ad96f610137da0c80d74e180837a37fbd6e53958c01565d7
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / st_echarts_events-1.0.0-py3-none-any.whl

Download URL st_echarts_events-1.0.0-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
55d79981966de923e8313c85995011fde7232bb1d97b4e189c2392e0d0bd301c
BLAKE2b-256 checksum
How to use checksums
43020747d8c18ee8d7a2d7a5b5b9fe7cb1879a3cc0d928440492952fecdb1af7
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page