-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Plot update refactor (prototype) #4550
base: master
Are you sure you want to change the base?
Conversation
If we're doing this - is it possible for the backend to know about the change and recreate a plot / scene when some setting (transform_func dimensionality, scene lighting, etc) changes? |
Updates that affect shader compilation (e.g. NoShading vs FastShading vs MultiLightShading, converted dimensionality, ...) will continue to not work. We may even double down and use some of this information to pin down types for better performance. If the update doesn't affect the shader I don't see why it shouldn't work. I.e. updates to |
This will probably make plots easier to detach so maybe we can do something like this in the future: detach!(plot) # remove from parent scene, destroy renderobject, destroy update routine
plot.shading = MultiLightShading
attach!(scene, plot) # add to new scene, create new renderobject + update routine |
Yeah, the trend is to make the backend plot type stricter and less dynamic, while improving the tools for Makie itself to just re-create a plot for type changes. |
Description
Prototype for #4360, implementing a mostly Observable-free way of propagating updates to backends. This is an attempt to implement scatter top to bottom in GLMakie.
In this Prototype updates go through a few stages:
update!(plot, attributes...)
adds all given attribute names toplot.updated_inputs
, marking them as updated. Then it sets all the attribute values as given. Then it triggers an update ofplot.updated_inputs
for the backend to react to.resolve_updates!(plot)
goes through allplot.updated_inputs
to apply Makie level conversions and calculations. The results are written toplot.computed
and marked inplot.updated_outputs
. This step is called by the backend, allowing it to be push-based (on(plot.updated_inputs)) or pull based (call if needed in renderloop)plot.computed
. Redundant updates can be avoided by checkingplot.updated_outputs
.Problems: (need solution)
Need generic name for args to handle them generically (and thus doWe're going withupdate!(plot; kwargs...)
generically)update!(plot, arg1 = ..., arg2 = ...)
for now.Shortcuts taken: (probably rework)
Notes (probably fine)
on(v -> update(plot, name = v), obs)
plot.computed
for caching some values (e.g. positions before GPU upload for reuse)Benefits:
Potential benefits:
parent_scene(plot)
, allowing the scene to be a runtime variablescene.plots
of updates, allowing plots to a runtime variableupdate!(plot, ...)
marks outdated inputs andresolve_updates!(plot)
only updates outputs which have outdated inputs. To make this more usable we may need to register update functions per plot like in my earlier prototypeType of change
Delete options that do not apply:
Checklist