-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Recipes #9
Comments
I agree with your suggestion to just play around freely. If this package is ever to replace Plots, of course, it needs to also be compatible with existing recipes everywhere in the package ecosystem. |
Sure, that's pretty important! And it's luckily an orthogonal issue and is hopefully just about implementing the right replacements! |
If you do end up suggesting a change of these dynamics I think that will definitely elicit lots of discussion and opinions. |
Well the macro example above doesn't really show why the macro is useful. It really is the nested |
Yeah, obviously, which is why I called the above a light version of a recipe ;) |
Also, of course, |
On the other hand, this is something that we also do at times: there are several functions in RecipesBase only defined as placeholders so that any package can extend them depending only on RecipesBase. Maybe that approach would work here? |
I don't doubt that. Personally I am neither pro- nor anti-macro. I just made that comment to stress that many more complex visualizations can be realized by composing a number of simple series blocks. So a low degree of verbosity per series seems quite important. for example this is done with the recipe linked below:
https://github.com/Evizero/RigidBodyRLEnvironments.jl/blob/master/src/cartpole/cartpole_recipe.jl |
That's the cutest plot! I'm not sure whether I'm pro or anti macro either: the current syntax for hard and default values is just too good but OTOH I remember that there was at times a bit too much magic, which made things harder to debug in case something didn't work. My preference would probably be for a macro free verbose way of defining a series with the |
That's the plan. I will try to push for a non macro based approach, and if it gets too cluttered, I will add some macro sugar on top of it ;) |
The function defines a clear interface for everyone, while the macro is pretty opaque and one needs to read through the whole code to figure out what magic it does ;) Of course, whatever will replace something like RecipeBase (AbstractPlots?) has to be as minimal as possible as well ;) |
As I understand the code in |
Great. Of course if you do choose a completely different system from Plots recipes it may not make sense in the long run to merge MakiE into Plots, but rather keep them as alternative packages. But let's cross that bridge when we reach it. |
Not sure why, as long as it's a strict improvement? |
Clearly there shouldn't be any problem if it's a strict improvement :-) It is also clear that there are different tastes - I love the current recipe syntax but it's also very possible what you have in mind will be even better. |
I guess it's really hard to say anything sensible before it's more advanced. It's just that you often talk very critically about Plots and I feel inclined to defend it. |
Fair enough! I just try to not waste any time on politeness, and just assume everyone knows that I have a lot of respect for Plots.jl! I know very well where the current shortcomings are coming from and I don't think it was because any developer that worked on Plots.jl was doing a bad job! But I think we do now have a better perspective on things (including myself, who helped creating these short comings and technical debts in a lot of places!) And I also hope, that when I'm missing the point and criticize something great about Plots.jl for the wrong reasons, that people will point that out quickly. For that to work, I try to do my criticism as publicly and direct as possible, so that people have a chance to step in and correct me. So I'm really relying on sensible feedback - and of course, if Makie is not a strict improvement I might as well stop working on it - this is pretty much the one and only premise of the whole project! |
👍 to sensible feedback, and to say things directly. I don't think being very public about it helps, as there are probably only 5-6 people in the world who can tell you anything about Plots you didn't know already, and we're all (except the main man) very easy to reach here 😄 . I guess it also feels a little bit unfair because all of us actively engage in supporting the positive hype around MakiE - we want to see this become a great success as much as you do! |
Appreciated! :)
Well I just mean by opening this issue and pinging the 5-6 people ;) |
I am very much for making it dispatches instead of a macro-based interface. I think that will make it much easier to debug, and it'll be much easier to introspect. |
In a weakly related topic, I'd like to share a limitation of recipe macros that could probably be solved by Makie.jl? The recipe macros currently don't allow things such as splatting as pointed out by @ChrisRackauckas. For example: using RecipesBase
@userplot FooPlot
@recipe function f(fp::FooPlot; a=1, b=2, kwargs...)
# SKIP
end
Also, I would like to vote +1 to @Evizero's comment on the usefulness of |
make updates via observables work
This is outdated |
I don't want to derail any further JuliaPlots/Plots.jl#392.
Let's use this issue to collect feedback about various ways to make recipes.
This version of MakiE recipe:
is implemented as
@mkborregard thinks:
Not sure why the last bit is important. I just think, that the recipe macro is less generic, doesn't compose that well and is unnecessarily opaque. A well known generic construct like overloading a method seems to me much more trustworthy and future proof.
E.g. you can compose them like this:
This works, since
to_colormap
falls back toto_color.(array)
. Similarly this can be used in other situations. I'm actually already heavily using this kind of composition internally!Anyways, I don't think that the details are very important right now.
What I plan to do is rethink these concepts freely, and when we do the refactor, I want to reevaluate my solutions and the ones in Plots.jl - and hopefully get a ton of unbiased feedback! :)
Based on that we can decide what we should keep! So it would be best if we just have people open mindedly play around with MakiE, and then just write down what isn't working for them! I will do my best to document those features, so that people trying thinks out have an easy start!
The text was updated successfully, but these errors were encountered: