include view definitions for a layercharts containing a repeat + toplevel selection parameter #3031
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.
Fix #2849.
LayerChartthe params of the subcharts are combined, see: https://github.com/altair-viz/altair/blob/master/altair/vegalite/v5/api.py#L2978viewfor these params is populated here: https://github.com/altair-viz/altair/blob/master/altair/vegalite/v5/api.py#L3272. Around here is a loop on thesubcharts, as far as I can see, they are not aware of being in aRepeatChart.RepeatChart, we are aware that it is aLayerChart, see: https://github.com/altair-viz/altair/blob/master/altair/vegalite/v5/api.py#L2664.With this PR we include the
specas argument in the function_repeat_names()and_extend_view_name(). If the instance ofspecisChart, the code functions as usual, but whenspecis an instance ofLayerChartwe now also will enter the function_repeat_names(). And within theextend_view_name()theview_<no>should be placed at the end of theview-name instead (vs start for a non-layered repeat chart).I included the interactive crossfilter as test, and tested it locally.
I think this works as expected, agree @ChristopherDavisUCI?