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
Adding support for events back #20
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @brightxml !
I love it! Thanks for prototyping and testing this, this is fabulous.
I have small nitpicks and then ready to merge and release ;)
EDIT: reference to issue #19
@@ -54,6 +54,7 @@ const EchartsChart = (props: ComponentProps) => { | |||
let match = funcReg.exec(v) | |||
if (match) { | |||
const funcStr = match[1] | |||
// eslint-disable-next-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange, my eslint does not tell me anything here, what warning do you get when you remove this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is when I run npm start, the terminal ouput this, tell me to add this line. but When I run this at home, it disappear...I guess it's because VS environment I set up.
@@ -73,12 +74,33 @@ const EchartsChart = (props: ComponentProps) => { | |||
const cleanTheme = registerTheme(theme) | |||
|
|||
if (isObject(map)) { | |||
echarts.registerMap(map.mapName, map.geoJson, map.specialAreas) | |||
echarts.registerMap(map.mapName, map.geoJson, map.specialAreas) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your IDE was not configured to use prettier because you have 4 spaces instead of 2..
Could you try running npx prettier --write .\src\EchartsChart.tsx
from the streamlit_echarts/frontend
folder when you're done with your edits?
*/ | ||
const keys=Object.keys(cleanOnEvents) | ||
const getReturnOfcleanOnEvents:any={} | ||
keys.forEach( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can write Object.keys(cleanOnEvents).forEach(function (key) {
directly :) I think it's clear enough
PS: aaah sorry for the merge conflict. Normally if you just put your code before the useEffect I just pushed it should be all good. |
I'll repush. |
1 similar comment
I'll repush. |
hi,
I tried several code on adding support for events back to python. without API interface changing.
usage like this
on python side:
add return statements after other js code.
and s is the value when designated events triggered.
please help taking a look.
thx
Bright Xie