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

Refactor Repeat as a Macro? #4947

Closed
domoritz opened this issue May 12, 2019 · 7 comments · Fixed by #6002
Closed

Refactor Repeat as a Macro? #4947

domoritz opened this issue May 12, 2019 · 7 comments · Fixed by #6002
Assignees
Labels
Area - Refactor 🏗️ P3 Should be fixed at some point RFC / Discussion 💬 For discussing proposed changes

Comments

@domoritz
Copy link
Member

domoritz commented May 12, 2019

Our repeat should have the same behavior as using fold (unpivot) and then facet into row/column. We should investigate whether it makes sense to clean up the implementation and implement repeat as a macro.

@kanitw
Copy link
Member

kanitw commented May 13, 2019

Implementing repeat as a macro of concat (not facet) might be reasonable.

However, making repeat = pivot + facet is extremely unintuitive and would produce unnecessary data transforms, so it definitely should NOT be done.

Also, I don't think this is a "help wanted" issue since it's not even clear that it should be done. It's also not an "enhancement" to the language, but rather internal refactor.

@domoritz
Copy link
Member Author

However, making repeat = pivot + facet is extremely unintuitive and would produce unnecessary data transforms, so it definitely should NOT be done.

I don't know how bad the produced code would be. Therefore I'm not sure I agree.

@domoritz
Copy link
Member Author

A related enhancement of Vega-Lite would be having something like repeat but for layering. The idea would be that you can make for example a multi-series line chart with three lines (A to C) for a dataset with columns time, A, B, and C. @tvst was asking for something like this in Altair.

@jheer
Copy link
Member

jheer commented May 14, 2019

Though I find the notion of repeat = fold + facet conceptually appealing (I don't think you mean pivot?), I should point out that using Vega's current implementation such an approach might induce a lot of additional, unnecessary processing and memory overhead.

@kanitw
Copy link
Member

kanitw commented May 14, 2019

A related enhancement of Vega-Lite would be having something like repeat but for layering. The idea would be that you can make for example a multi-series line chart with three lines (A to C) for a dataset with columns time, A, B, and C. @tvst was asking for something like this in Altair.

See #1274 and #1552 for existing issues.

@domoritz
Copy link
Member Author

I don't think you mean pivot?

You are right, I meant unpivot or fold.

@domoritz domoritz changed the title Implement Repeat with Pivot + Facet Implement Repeat with Fold + Facet May 14, 2019
@kanitw kanitw changed the title Implement Repeat with Fold + Facet Refactor Repeat as a Macro? May 14, 2019
@kanitw kanitw added the RFC / Discussion 💬 For discussing proposed changes label May 14, 2019
@kanitw kanitw added the P3 Should be fixed at some point label Jun 9, 2019
@kanitw kanitw removed this from the Build System & Refactor milestone Dec 4, 2019
@kanitw
Copy link
Member

kanitw commented Mar 16, 2020

pretty much done in #6002, pending a few minor issues left.

@kanitw kanitw closed this as completed Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - Refactor 🏗️ P3 Should be fixed at some point RFC / Discussion 💬 For discussing proposed changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants