-
Notifications
You must be signed in to change notification settings - Fork 39
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
New syntax #69
New syntax #69
Conversation
… into new_syntax
… into new_syntax
I like a lot of things there, and I also still like a lot of things about the previous approach. I guess I'm as undecided as to what a good API would look like as ever ;) I had also worked on a bit of a redesign of the API here. It is very incomplete and while I like some things over there, there is a lot to dislike also. Here are some random thoughts on all of that, entirely unstructured, and probably self contradictory...
I had played with a couple of additional things in my branch:
I just (literally five minutes ago) had another thought: what about a @vlplot {
mark=:bar,
encoding={
x="sum(foo):q",
y=:bar,
color={
field=:foo2
}
}
} I'll try to play with this branch in the next couple of days, right now my reaction is purely theoretical, and one probably really needs to try it out. I had one final thought: I kind of feel we are at a point where the underlying displaying, piping data in, saving figures, and the In any case, very glad you are back on this! I'm still very optimistic that this can be the best plotting story for a lot of situations! |
Alright, I've merged this into |
Thank you for merging ! I agree that it could be tagged in its current state. |
This is the implementation of a new syntax for creating plots. Main principles are :
|>
operator to build plots incrementally and switch to a more julian style using nested functions calls. The|>
operator is maintained only for the data source (i.e.dataframe |> plot(...)
) to play nicely with processes that generate iterable tables such as Query.Dict
orNameduples
inside theplot()
to provide a straightforward translation from the JSON format of Vega-Lite :Note : the awkward
@NT
for defining NamedTuples should disappear with julia 0.7mark
andencoding
arguments. The previous definition would become :note that the first argument of
enc.
is always the field name (or:*
for aggregation such as:count
), or the value for encodings that take value instead of a field (e.g.enc.color.value(:green)
)? VegaLite.vlconfig
for example. This keeps all the VegaLite help reachable without having to import 60+ functions into the Main module, at the price of a few additional keystrokes.I have been able to make this syntax work with every examples I tested it with, including maps, query widgets, brushes some of which are not working with the current syntax. The changes proposed seem to be consistent with our previous discussion on the subject.
What do you think ?