posit-dev / posit-dev/py-shiny

Using pyecharts?

Open
#465 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.8k
Forks
135
Avg merge
2d 18h
Merged PRs (30d)
21

Description

PyEcharts is a comprehensive interactive chart library built on Echarts which is open source and perfect for Shiny interactivity (I use R package echarts4r which wraps Echarts for R Shiny).

https://github.com/pyecharts/pyecharts
https://pyecharts.org/#/en-us/

I've tried using it with Shiny for python with no success as a plot, ui and ipywidget. Below is one attempt which isn't working.

from shiny import App, render, ui
from pyecharts.charts import Bar
from pyecharts import options as opts
from shinywidgets import output_widget, render_widget

app_ui = ui.page_fluid(
    ui.layout_sidebar(
        ui.panel_sidebar(
        ), 
        ui.panel_main(            
            ui.output_ui("echart_test"),  #guessing here
        )
    )
)


def server(input, output, session):

    @output
    @render.ui
    def echart_test():
        bar = (
            Bar()
            .add_xaxis(["衬衫", "毛衣", "领带", "裤子", "风衣", "高跟鞋", "袜子"])
            .add_yaxis("商家A", [114, 55, 27, 101, 125, 27, 105])
            .add_yaxis("商家B", [57, 134, 137, 129, 145, 60, 49])
            .set_global_opts(title_opts=opts.TitleOpts(title="某商场销售情况"))
        )
        return bar.render() #guessing here too

app = App(app_ui, server)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided App, output, render.ui, shinywidgets, and render_widget reproducer, then compare its pyecharts usage with the linked pyecharts documentation. No repository file or test is named; done would require a defined, working integration path or a documented limitation for pyecharts with Shiny for Python.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.