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

Change behaviour of getindex/getproperty for plotobjects #1779

Closed
SimonDanisch opened this issue Mar 22, 2022 · 0 comments
Closed

Change behaviour of getindex/getproperty for plotobjects #1779

SimonDanisch opened this issue Mar 22, 2022 · 0 comments
Labels
Attributes Plot, Block and Scene Attributes enhancement Feature requests and enhancements Makie Backend independent issues (Makie core) maybe outdated/fixed TODO: review planning For discussion and planning development plot Related to plot object

Comments

@SimonDanisch
Copy link
Member

To break up #1085, I want to start changing the behaviour of getindex/getproperty, without getting into the huge refactor of also changing the planned internal implementation of the plot objects.
The plan is to, change plot.attribute_name to:

  • return the fully converted value. So p = plot!(..., color=:red); p.color will return RGBAf(...). This will help to get rid of lots of Observable indirection and double conversions.
  • p.color = :red will still work and convert immediately
  • if one really needs an observable, one can call observe(p, :color)
  • no p[1] anymore.. We may want to keep p.args[1] for backward compatability, though
  • We may need p.kw_args to make it possible to access the plot attributes the way the kw arguments allow. E.g., I want to convert colormaps + colorrange to a new object, that will sit at plot.color (idea not yet final). So, p = plot!(..., color=x, colorrange=...); p.color will not return x but instead some kind of color sampler object, which can be annoying. So the proposal would be to allow p.kw_args.color == x; p.kw_args.color = new_x, which also opens up the possibility to allow for some magic keyword args.

This all will help a lot with type stability and getting rid of lots of Observable indirections, which are slow to compile and run.
It aims to also make the API cleaner and easier to work with.

@ffreyer ffreyer added enhancement Feature requests and enhancements planning For discussion and planning development Makie Backend independent issues (Makie core) plot Related to plot object Attributes Plot, Block and Scene Attributes maybe outdated/fixed TODO: review labels Aug 23, 2024
@MakieOrg MakieOrg locked and limited conversation to collaborators Aug 23, 2024
@ffreyer ffreyer converted this issue into discussion #4212 Aug 23, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Attributes Plot, Block and Scene Attributes enhancement Feature requests and enhancements Makie Backend independent issues (Makie core) maybe outdated/fixed TODO: review planning For discussion and planning development plot Related to plot object
Projects
None yet
Development

No branches or pull requests

2 participants