pub struct Graph { /* private fields */ }Expand description
The main interface for the Graph widget.
Implementations§
Source§impl Graph
impl Graph
Sourcepub const DEFAULT_ZOOM_RANGE: Rangef
pub const DEFAULT_ZOOM_RANGE: Rangef
The default zoom range.
Allows zooming out 4x, but does not allow zooming in past the pixel-perfect default level.
pub const DEFAULT_CENTER_VIEW: bool = false
Sourcepub fn from_id(id: Id) -> Self
pub fn from_id(id: Id) -> Self
The same as Graph::new, but allows providing an egui::Id directly.
Sourcepub fn background(self, show: bool) -> Self
pub fn background(self, show: bool) -> Self
Whether or not to fill the background. Default is true.
Sourcepub fn dot_grid(self, show: bool) -> Self
pub fn dot_grid(self, show: bool) -> Self
Whether or not to show the dot grid. Default is true.
Sourcepub fn zoom_range(self, zoom_range: impl Into<Rangef>) -> Self
pub fn zoom_range(self, zoom_range: impl Into<Rangef>) -> Self
Set the allowed zoom range.
A zoom < 1.0 zooms out, while a zoom > 1.0 zooms in.
Default: Graph::DEFAULT_ZOOM_RANGE.
Sourcepub fn max_inner_size(self, max_inner_size: impl Into<Vec2>) -> Self
pub fn max_inner_size(self, max_inner_size: impl Into<Vec2>) -> Self
Set the maximum size of the scene’s inner [Ui] that will be created.
Sourcepub fn center_view(self, center_view: bool) -> Self
pub fn center_view(self, center_view: bool) -> Self
Whether or not to center the view around the content of the graph.
Default: Self::DEFAULT_CENTER_VIEW.
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnwindSafe for Graph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more