Makie Dynamic
Use Makie (not a specific backend) for all plotting. Assume all features are available.
Reactivity with Observables
- •Use
Observablevalues as the single source of truth for dynamic state. - •Prefer
liftor@liftto derive dependent data reactively. - •After in-place mutation of an observable value (e.g.
obs[] .= ...), callnotify(obs). - •Use
on(obs)for side effects andliftfor pure transformations.
Animations and Recording
- •For recording, use
record(fig, "out.mp4", iterator) do frame ... endand update observables inside the loop. - •Avoid manual
sleeploops or@asynctimers for animation. - •Use
events(fig).tickfor frame-aligned updates in interactive sessions.
UI Widgets
- •Sliders: bind
slider.valueto observables; use@liftto connect to plot data. - •Buttons: use
on(button.clicks)for actions (play/pause, reset, step). - •Toggles: gate updates by
toggle.active[]to enable/disable behavior. - •Menus/Textboxes: use
selectionorvalueobservables to drive state.
Events and Interaction
- •Use
events(fig)orevents(ax)for mouse/keyboard/scroll events. - •If needed, return
Consume(true)to stop lower-priority handlers.
Dashboards and Structure
- •Keep dashboard state in a small set of observables (or a struct holding them).
- •Split UI and plot construction into functions that accept
GridPositionorAxis. - •For larger dashboards, consider using
Makie.SpecApito build declarative layouts.
Performance Notes
- •Update plot data in-place when possible, and notify explicitly.
- •Avoid rebuilding axes/plots each frame; update existing plot objects.
- •For heavy pipelines, evaluate whether Makie’s compute pipeline tools are appropriate.