Skip to content

support calling back to the Python kernel from events #223

@simzer

Description

@simzer

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)})`));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions