Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Full support of recipes with MakieCore (lift, legendelements, ATTRIBUTES...) #2295

Closed
BambOoxX opened this issue Sep 22, 2022 · 12 comments
Closed
Labels
enhancement Feature requests and enhancements Integration with other packages Makie Backend independent issues (Makie core) planning For discussion and planning development

Comments

@BambOoxX
Copy link

Unless I am mistaken, MakieCore is aimed at being the lightweight dependency package developpers should rely on when implementing specific recipes for their packages. Something alike RecipesBase for Plots.jl.

While trying to switch from Makie to MakieCore as a dependency, I got an error showing that @lift is not defined in MakieCore, making use of observables surprinsingly impossible when relying on MakieCore.

A quick and dirty idefined(MakieCore,lift) returns a false, while the same on Makie is true.

Is there something I'm missing here ?

I'm on julia 1.8.0 using Makie v0.17.13 and MakieCore v0.4.0

@SimonDanisch
Copy link
Member

Well, since it's lightweight, lots has been left out..Although I guess @lift could be added...

@BambOoxX
Copy link
Author

@SimonDanisch BTW, I just checked the code in MakieCore and it seems that some comments refer to a solution involving lift e.g. here

function Base.setindex!(x::Attributes, value::Observable, key::Symbol)
if haskey(x, key)
# error("You're trying to update an attribute Observable with a new Observable. This is not supported right now.
# You can do this manually like this:
# lift(val-> attributes[$key] = val, Observable::$(typeof(value)))
# ")
return x.attributes[key] = node_any(value)
else
#TODO make this error. Attributes should be sort of immutable
return x.attributes[key] = node_any(value)
end
return x
end

Does this mean that lift alone, not the macro, should work ?

@BambOoxX
Copy link
Author

BambOoxX commented Nov 1, 2022

@SimonDanisch While testing things around recipes, it seems that the ATTRIBUTES string lies in Makie, as well as legendelements. To me it feels like both could be good additions to MakieCore, but I may have missed equivalent stuff in there.
What is your opinion on this ?

@BambOoxX
Copy link
Author

BambOoxX commented Dec 5, 2022

@SimonDanisch I just checked the code a bit for lift. Do you think solving this would just require to move the src/interaction to MakieCore and reexport this in Makie ?

@BambOoxX
Copy link
Author

Light Bump ! 👍

@SimonDanisch
Copy link
Member

We can definitely move const lift = map to MakieCore!
I personally try to avoid @lift and now that we have lift(f, scene/plot, observables...) to bind the observable life time to a scene/plot object, which @lift doesn't support, I've been removing @lift from quite a few places.
So, I'm leaning against moving it to MakieCore ;)

@BambOoxX
Copy link
Author

BambOoxX commented Mar 22, 2023

@SimonDanisch I think we can afford the const lift=map indeed ! What about ATTRIBUTES which are super handy for recipes (so MakieCore scope) and legendelements (since it feels weird to be able to write a recipe but not its legend, though its seems a more complicated modification) ?

@asinghvi17
Copy link
Member

ATTRIBUTES pulls in DocStringExtensions.jl, which we may not want.

@BambOoxX
Copy link
Author

Sure, if it is pulling another dependency, that is not good, although basic recipes like arrows use ATTRIBUTES. So if this is not the proper way to make the help section for a recipe we are either missing a piece of code here or it should be in MakieCore shouldn't it ?

@BambOoxX BambOoxX changed the title @lift in MakieCore recipe fails ? Full support of recipes with MakieCore (lift, legendelements, ATTRIBUTES...) Mar 27, 2023
@BambOoxX
Copy link
Author

We can definitely move const lift = map to MakieCore! I personally try to avoid @lift and now that we have lift(f, scene/plot, observables...) to bind the observable life time to a scene/plot object, which @lift doesn't support, I've been removing @lift from quite a few places. So, I'm leaning against moving it to MakieCore ;)

@SimonDanisch Do you have an example of this in the documentation ? I could not find one

@BambOoxX
Copy link
Author

Hi @SimonDanisch I read somewhere on the discourse I think, that you are close to updating things regarding recipes. Is there any news regarding this issue ?

@SimonDanisch
Copy link
Member

Well, the new plotspec API is one part of the puzzle, another one will be the axis converts in #442 .
If that's all done I hope to clean up the missing bits and finally document everything nicely!

@ffreyer ffreyer added enhancement Feature requests and enhancements planning For discussion and planning development Makie Backend independent issues (Makie core) Integration with other packages labels Aug 23, 2024
@MakieOrg MakieOrg locked and limited conversation to collaborators Aug 23, 2024
@ffreyer ffreyer converted this issue into discussion #4221 Aug 23, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement Feature requests and enhancements Integration with other packages Makie Backend independent issues (Makie core) planning For discussion and planning development
Projects
Status: Done
Development

No branches or pull requests

4 participants