-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Echarts API #4
Comments
Hi @mazenbesher ! This component is basically a wrapper around ECharts for React, so features implemented there can be easily ported to this Component. import random
from pyecharts.charts import Bar
from streamlit_echarts import st_pyecharts
b = (
Bar()
.add_xaxis(["Microsoft", "Amazon", "IBM", "Oracle", "Google", "Alibaba"])
.add_yaxis(
"2017-2018 Revenue in (billion $)", random.sample(range(100), 10)
)
.set_global_opts(
title_opts=opts.TitleOpts(
title="Top cloud providers 2018", subtitle="2017-2018 Revenue"
),
toolbox_opts=opts.ToolboxOpts(),
)
)
st_pyecharts(
b, key="echarts"
) # Add key argument to not remount component at every Streamlit run
st.button("Randomize data") Maybe I'm not used to eCharts yet, so diggin in the docs :
What kind of behavior would you like to see prioritzed with the eCharts instance so we can draft a pseudocode example of how Python will interact with the echarts Instance on the React side ? We have access to the ECharts instance so it's looking for the best way to call JS functions from Python. |
Thanks a lot for your thorough response ... sorry, if this was a silly request, I not an expert in the field and only use it from the python side 😓 |
Hey @mazenbesher :) I'm also not very familiar with the eCharts API so I'm very open to any new use case !
Hey, that seems like a moderately hard thing to do, I'll look into it and come back to you ! Fanilo |
Comment from @liunux4odoo that I don't want to lose #10 (comment)
|
It would be really helpful if somehow the API for some instance can be called from python to update the chart dynamically for instance.
The text was updated successfully, but these errors were encountered: