-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
Example:
This is the example of event usage in the tutorial
click_handler_method = "alert(JSON.stringify(event.data));"
click_handler = click_chart.on("click", click_handler_method)Which will generate something like this in JS:
click_handler_method = event => { alert(JSON.stringify(event.data)); }
click_handler = chart.on("click", click_handler_method)The same could be supported with Python syntax:
click_handler_method = "js.alert(json.dumps(event.data))"
click_handler = click_chart.on("click", click_handler_method)Which would generate something like this in JS:
<script src="https://cdn.jsdelivr.net/pyodide/v0.22.1/full/pyodide.js"></script>let pyodide = await loadPyodide();
let click_handler_method = (event) => {
let handler = pyodide.runPython(`
def handler(x):
js.alert(json.dumps(event.data))
handler
`);
handler(event);
};
click_handler = click_chart.on("click", click_handler_method)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels