-
-
Notifications
You must be signed in to change notification settings - Fork 510
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
Events support for Panel Echarts #2147
Comments
One thing is that you could turn this into a feature request for events support for the Panel Echarts pane :-) Additional ContextRegarding the api for adding support for events inspiration could be drawn from the panel-highcharts package I recently made. There are lots of event but I setup a "clever" mechanism to subscribe to the ones I need. For example for the Network example you subscribe using and get something like shown here |
Hi @MarcSkovMadsen thank you. panel-highcharts is really nice, I didn't see it on awesome-panel webpage before, but learned now to follow you on twitter for such news :-). Line 18 in cc15485
that Panel Echarts pane is using pyecharts, but now (awake!) I see it is not and I really like your subscription mechanism. WIll have some time hopefully over the weekend to look in details to panel-highcharts and Panel Echarts pane to see if I can build a minimal demo following the mechanism. |
I checked panel-highcharts - really nice @MarcSkovMadsen - can't use it for the current project, but sure I will find a good use for one of the next projects. For events in panel.Echarts happy to try to implement something similar, but I am a liitle stuck with panel model logic (see below), so currently I use a workaround inspired by @nghenzi from: #1883 Workaround
WORKS, but not really nice. Understanding echarts in Panel
|
Hi @JackDapid I took a look at the Echarts Events. My suggestion to get this start would be start a PR called Echarts PaneIn the ECharts pane add two parameters
Would configure the events. For example setting chart.event_config = {
'click': None,
'legendselectchanged: None,
'click': 'series.line',
'mouseover', {'seriesIndex': 1, 'name': 'xx'},
} would correspond to myChart.on('click', function (params) {
console.log(params);
});
myChart.on('legendselectchanged', function (params) {
console.log(params);
});
chart.on('click', 'series.line', function (params) {
console.log(params);
});
chart.on('mouseover', {seriesIndex: 1, name: 'xx'}, function (params) {
console.log(params);
});
This would be where the events are output in Python/ on the server. ECharts Python Bokeh ModelIn the ECharts Bokeh Model add the corresponding properties event_config=Dict(String, Any)
event=Dict(String,Any) ECharts TypeScript Bokeh ModelIn the ECharts TypeScript Bokeh Model start from the bottom by adding the When done try to test that you can You will then need to handle creating and reacting to events via the If you push your PR and ask questions there it will be very easy to help out. Sending back the
|
Hi @MarcSkovMadsen, thanks and will start like that. I think we have been talking about two different things - maybe due to my naive assumption? I was expecting that the 'Panel Echarts Pane' was transforming the data object at some point fully into JS, pretty much like pyecharts
and:
I think I understood now what you mean by "clever" way, that fully allows to interact with events on the python level and not just allowing to add some JS functions to the JS on the server side. like below. But I am certain that I now understand better what you meant and agree that makes sense to concentrate on that as the initial first step I had in mind of enriching with client side JS only would not add functionality more than what
|
Hi @MarcSkovMadsen, Ok I have a first minimal version, working now on that one can also create some JS handlers only. Was really stupid of me to miss the line Line 33 in c84ee56
I would have expected something more complicated (e.g. some parsing, or True->true, etc), so I guess I was scanning too fast over it. Ready to push and create a PR. I guess I would need some rights to push a new branch and request a PR for it? Sorry switched to GitLab quite some time ago, so sorry if I missed that there is another way. |
Following your event_config logic I implemented two pure JS events:
I hope that use_cases and notation are obvious, but happy if there are some improvement proposals. |
Sounds great. Regarding how to open the PR. I would follow the steps in https://jarv.is/notes/how-to-pull-request-fork-github/. |
Thanks, than I propose updating: https://panel.holoviz.org/developer_guide/index.html#cloning-the-repository as it explicitly mentions cloning from the original repo and not the own forked for contributing, can make a proposal for that. Move now communication to the PR
|
Just for the archives setting up the development environment not so easy on OS X 10.15.7 as described here: https://panel.holoviz.org/developer_guide/index.html due to often described nodejs older version issue as well as a messed up? or just used for many (too many dependencies?) projects before conda base environment that with YES, the double last command is no mistake as it fails the first time with:
So here I get it working:
|
I don't know how many users are preferring echarts. but I believe it is easy to create nice dashboard with echarts. if we can add this feature to echarts, it will be great. |
This was implemented in #2174 |
As a big fan of https://awesome-panel.org/echarts by @MarcSkovMadsen and https://panel.holoviz.org/reference/panes/ECharts.html I am using echarts a lot and got frustrated that they seemed to have dropped events / JS callback support from pyecharts? - see pyecharts/pyecharts#1671
Without 'interactivity" the nice echarts are only half useful.
Clearly forking an pyecharts with bringing in that support is a n option, but I am looking for a discussion if there are some other ideas that could benefit other Panel echarts users.
The text was updated successfully, but these errors were encountered: