You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to control as many aspects of the plot widget as possible from inside the Plot::show method to allow deciding whether to allow dragging or zooming based on the pointer position in the plot (and the event state, but that is already accessible from the PlotUi::ctx). See my original comment on this here: emilk/egui#759 (comment)
I have added allow_drag to the PlotUi structure which seems to be working good (although I need to test it more thoroughly for what I am wanting to do). I will look into adding the other viable control functions to it as well (e.g., allow_zoom, show_x, show_y, show_background, etc.), I am thinking that anything that is used after the call to the build_fn in the Plot::show method should be made available for consistency and flexibility. I will make a pull request when I've got everything added, cleaned up, and tested.
@emilk@EmbersArc Do you have any particular design input on this? The simplest non-breaking API change I can see is to just add each of the fields such as allow_drag, allow_zoom, etc. to the PlotUi structure (and add associated methods to mutate them), and default their values to match the fields on the Plot structure (so if they are only set on the Plot structure then it is honored), then in the build_fn they can be updated. This is somewhat awkward since there are then duplicate methods used to control the plot (one for the Plot structure and one for the PlotUi structure), would it be better to just move the fields and methods so they are only on the PlotUi structure (API breaking change)? Or maybe there's another better way to get at what I'm wanting to add?
The text was updated successfully, but these errors were encountered:
I would like to be able to control as many aspects of the plot widget as possible from inside the
Plot::show
method to allow deciding whether to allow dragging or zooming based on the pointer position in the plot (and the event state, but that is already accessible from thePlotUi::ctx
). See my original comment on this here: emilk/egui#759 (comment)I have added
allow_drag
to thePlotUi
structure which seems to be working good (although I need to test it more thoroughly for what I am wanting to do). I will look into adding the other viable control functions to it as well (e.g.,allow_zoom
,show_x
,show_y
,show_background
, etc.), I am thinking that anything that is used after the call to thebuild_fn
in thePlot::show
method should be made available for consistency and flexibility. I will make a pull request when I've got everything added, cleaned up, and tested.@emilk @EmbersArc Do you have any particular design input on this? The simplest non-breaking API change I can see is to just add each of the fields such as
allow_drag
,allow_zoom
, etc. to thePlotUi
structure (and add associated methods to mutate them), and default their values to match the fields on thePlot
structure (so if they are only set on the Plot structure then it is honored), then in thebuild_fn
they can be updated. This is somewhat awkward since there are then duplicate methods used to control the plot (one for thePlot
structure and one for thePlotUi
structure), would it be better to just move the fields and methods so they are only on thePlotUi
structure (API breaking change)? Or maybe there's another better way to get at what I'm wanting to add?The text was updated successfully, but these errors were encountered: