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

feat: Add new forceActionsMenu embed option #1242

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

vdonato
Copy link
Contributor

@vdonato vdonato commented Sep 15, 2023

This PR adds a new forceActionsMenu embed option that can be used to force vega-embed
to display actions in a details menu rather than in links even when defaultStyle is set to false.
If defaultStyle is not false or if actions is false, the option has no effect.

This is useful in cases where the parent application of an embedded vega chart wants to be able to
style the actions menu itself rather than having vega inline a <style/> tag to do so (see #1214 for
details as to why this might be desired). Currently, applications that want to do this have to use a small
hack of setting defaultStyles to an empty string rather than false so that vega still adds the menu
(see this code in the streamlit codebase for an example). This change doesn't really change anything
functionally but allows applications to write code that's a bit more clear.

@vdonato
Copy link
Contributor Author

vdonato commented Sep 22, 2023

Hey @domoritz, heads up that I made this small change to fix a small issue that I came across in a change to the Streamlit OS lib. We're currently addressing this using a workaround, but it would be nice to have a less hacky solution (see the link in the PR description). Let me know if you have any other ideas for equivalent ways of improving this.

@domoritz domoritz merged commit fbbcd9e into vega:main Sep 28, 2023
3 checks passed
@domoritz
Copy link
Member

Thank you for the feature

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

Successfully merging this pull request may close these issues.

2 participants