Skip to content
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

support calling back to the Python kernel from events #223

Open
simzer opened this issue Mar 23, 2023 · 0 comments
Open

support calling back to the Python kernel from events #223

simzer opened this issue Mar 23, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@simzer
Copy link
Member

simzer commented Mar 23, 2023

It would be a common use-case to handle Vizzu's click event from the Python side. E.g. for triggering another animation. Example code:

def filter(event):
    filter1 = Data.filter("record['Joy factors'] === event.marker.categories['Joy factors']")
    chart.animate(filter1)

chart.on('click', filter)

chart.animate(
    Config.column(
        {
            "x": "Joy factors",
            "y": "Value 2 (+)",
            "title": "Column Chart",
        }
    )
)

In the background we would need to do something like this in the Javascript side:

chart.on('click', event => IPython.notebook.kernel.execute(`filter(${JSON.serialize(event)})`));
@veghdev veghdev changed the title Support calling back to the Python kernel from events python development: support calling back to the Python kernel from events Mar 28, 2023
@veghdev veghdev added enhancement New feature or request good first issue Good for newcomers and removed good first issue Good for newcomers labels Mar 28, 2023
@schaumb schaumb removed the enhancement New feature or request label Jul 3, 2023
@veghdev veghdev changed the title python development: support calling back to the Python kernel from events support calling back to the Python kernel from events Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants