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

include underscore after view #3030

Merged
merged 1 commit into from
Apr 23, 2023
Merged

include underscore after view #3030

merged 1 commit into from
Apr 23, 2023

Conversation

mattijn
Copy link
Contributor

@mattijn mattijn commented Apr 23, 2023

Fix for #3024.

Now the following spec:

import altair as alt
from vega_datasets import data
iris = data.iris.url

alt.Chart(iris).mark_point().encode(
    alt.X(alt.repeat("column"), type='quantitative'),
    alt.Y(alt.repeat("row"), type='quantitative'),
    color='species:N'
).properties(
    width=200,
    height=200
).repeat(
    row=['petalLength', 'petalWidth'],
    column=['sepalLength', 'sepalWidth']
).interactive().to_dict()

Returns

{'config': {'view': {'continuousWidth': 300, 'continuousHeight': 300}},
 'repeat': {'column': ['sepalLength', 'sepalWidth'],
  'row': ['petalLength', 'petalWidth']},
 'spec': {'data': {'url': 'https://cdn.jsdelivr.net/npm/vega-datasets@v1.29.0/data/iris.json'},
  'mark': {'type': 'point'},
  'encoding': {'color': {'field': 'species', 'type': 'nominal'},
   'x': {'field': {'repeat': 'column'}, 'type': 'quantitative'},
   'y': {'field': {'repeat': 'row'}, 'type': 'quantitative'}},
  'height': 200,
  'name': 'view_1',
  'width': 200},
 'params': [{'name': 'param_1',
   'select': {'type': 'interval', 'encodings': ['x', 'y']},
   'bind': 'scales',
   'views': ['view_1_child__row_petalLengthcolumn_sepalLength',
    'view_1_child__row_petalLengthcolumn_sepalWidth',
    'view_1_child__row_petalWidthcolumn_sepalLength',
    'view_1_child__row_petalWidthcolumn_sepalWidth']}],
 '$schema': 'https://vega.github.io/schema/vega-lite/v5.7.1.json'}

Focus on:

'view_1_child__row_petalWidthcolumn_sepalLength'

@mattijn
Copy link
Contributor Author

mattijn commented Apr 23, 2023

Tests pass, merging.

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.

1 participant