Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR can be tested using the following npm-test package
Further section is copied from: vega/altair#2867
Let me try to break this down.
Within Vega-Lite it is possible to define a fixed width and a container width. Altair uses Vega-Embed for rendering and if we like to support both the fixed width and container width in Altair then there are some changes required to the existing Vega-Embed css by overruling them.
The question is if these changes can be safely overruled or should they be made in Vega-Embed itself. What do you think @domoritz?
The breakdown is made by the following specification,
width="container"
(see gist) andwidth=200
(see gist)Without changes to the
.vega-embed
CSS (before this PR) the charts will look like this:No width defined on parent, so chart width becomes 0.
Renders fine. Action button placed correctly
Defining
.vega-embed
to a width of 100%:Results in:
Responsive to the full width, but the open dialog of the action menu is to close to the right browser edge.
Chart renders fine on left-side, but the action button is placed on the right-side.
Overruling the following default css from Vega-embed (this PR):
With:
Results in:
Responsive width and action button on the right side, where the dialog is opened with a buffer on the right side.
Renders fine. Action button placed correctly