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

Idea: Add .sql and .data() methods to MosaicWidget #449

Open
manzt opened this issue Jul 5, 2024 · 0 comments
Open

Idea: Add .sql and .data() methods to MosaicWidget #449

manzt opened this issue Jul 5, 2024 · 0 comments

Comments

@manzt
Copy link
Collaborator

manzt commented Jul 5, 2024

It would be useful to have a convenient API to materialize the SQL for a current vgplot in Python. For example:

widget = MosaicWidget(spec, data={"weather": df})
widget # interact with the widget, (i.e., cross filter some points)
widget.sql # access the current sql string
widget.data() # materialize the sql in Python

I've implemented something like this for a custom data table client I've been working on, and was looking to maybe upstream a PR to mosaic up following a conversation with @domoritz today.

However, it's not totally clear what .sql would point to for a given spec. In the case where this is just one data source, you could apply all the selections and params as filters to that source. Or something named like:

widget.data("weather") # applies active selections/params

If there are multiple sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant