VegaLite.jl
VegaLite.jl copied to clipboard
Alternative functional composition
Replying to https://github.com/queryverse/VegaLite.jl/pull/227#issuecomment-569450659
This made me wonder if it makes sense to use
Tuple{Any,NamedTuple}
for this.Hm, but that adds another level of parenthesis, and I'm trying hard to reduce those...
Does it? ("age:o", (scale = (rangeStep = 17,),))
has as many parentheses as vlfrag("age:o", (scale = (rangeStep = 17,),))
.
But you can do vlfrag("age:o", scale = (rangeStep = 17,))
, which is one less level of parentheses, right?
Ah, yes, I forgot that.
Hi, new here. I'm very naive, but I'm wondering why it can't be functions with keywords and let the type system sort it out. Something like this
vlplot(
bar(),
x("month(date):o", axis(title="Month of the year")),
y("count()"),
color(:weather,
scale(domain=["sun","fog","drizzle","rain","snow"],
range=["#e7ba52","#c7c7c7","#aec7e8","#1f77b4","#9467bd"]
),
legend(title="Weather type")
)
)
I think that was actually how VegaLite.jl was designed many years ago :) One problem is that we now have to create all these functions, and many of them have names that we really don't want in the global namespace (a function called x
seems like a bad idea).