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

Give warning if overwrite sub-component of spec #77

Open
AliciaSchep opened this issue Feb 1, 2022 · 0 comments
Open

Give warning if overwrite sub-component of spec #77

AliciaSchep opened this issue Feb 1, 2022 · 0 comments

Comments

@AliciaSchep
Copy link
Collaborator

Example:

vl_chart() %>%
    vl_add_data(url = "https://vega.github.io/vega-editor/app/data/population.json") %>%
    vl_calculate(calculate = "datum.sex == 2 ? 'Female' : 'Male'", 
                 as = "gender") %>%
    vl_filter("datum.year == 2000") %>%
    vl_encode(x = "age:O", y = "people:Q", color = "gender:N") %>%
    vl_stack_y("normalize") %>%
    vl_aggregate_y("sum") %>%
    vl_axis_y(title = "population") %>%
    vl_mark_bar() %>% 
    vl_axis_y(labelAngle = 90)

If you call something (like vl_axis_y in this case) twice, you overwrite the y axis definition. Should it potentially merge instead? At minimum, should give a warning!

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