pub struct NodeOverlayProps {
pub anchor: OverlayAnchor,
pub side: OverlaySide,
pub align: OverlayAlign,
pub offset: f64,
pub keep_in_view: bool,
pub track_anchor: bool,
pub backdrop: bool,
pub on_dismiss: Option<Callback<()>>,
pub style: Option<String>,
pub children: ChildrenFn,
}Expand description
Props for the NodeOverlay component.
A panel anchored to a node (or to an element inside one), rendered at the graph-pane level so it escapes the node’s clipping and the canvas transform.
Mount it to open and unmount it to close — there is no open prop, so the
caller keeps full control (and the children’s reactive owner is only alive
while the panel is). on_dismiss fires on a pointerdown outside the panel
and on Escape; acting on it is the caller’s choice.
See the module docs for why this exists.
§Required Props
- children:
ChildrenFn
§Optional Props
- anchor:
OverlayAnchor- What to position against. Defaults to the enclosing node.
- side:
OverlaySide - align:
OverlayAlign - offset:
f64- Gap between anchor and panel, in unscaled pixels.
- keep_in_view:
bool- Flip to the opposite side when the panel doesn’t fit, then shift it to stay inside the pane.
- track_anchor:
bool- Re-place every frame, so the panel follows its anchor through node drags and content reflow. Pan and zoom are tracked either way.
- backdrop:
bool- Render a transparent click-catching backdrop over the pane, which fires
on_dismisswhen clicked.
- Render a transparent click-catching backdrop over the pane, which fires
- on_dismiss:
impl Into<Callback<()>>- Fired on a pointerdown outside the panel, and on Escape.
- style:
impl Into<String>- Extra style on the panel wrapper (e.g.
"width: 320px;").
- Extra style on the panel wrapper (e.g.
Fields§
§anchor: OverlayAnchorWhat to position against. Defaults to the enclosing node.
side: OverlaySide§align: OverlayAlign§offset: f64Gap between anchor and panel, in unscaled pixels.
keep_in_view: boolFlip to the opposite side when the panel doesn’t fit, then shift it to stay inside the pane.
track_anchor: boolRe-place every frame, so the panel follows its anchor through node drags and content reflow. Pan and zoom are tracked either way.
backdrop: boolRender a transparent click-catching backdrop over the pane, which fires
on_dismiss when clicked.
on_dismiss: Option<Callback<()>>Fired on a pointerdown outside the panel, and on Escape.
style: Option<String>Extra style on the panel wrapper (e.g. "width: 320px;").
children: ChildrenFnImplementations§
Source§impl NodeOverlayProps
impl NodeOverlayProps
Sourcepub fn builder() -> NodeOverlayPropsBuilder<((), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> NodeOverlayPropsBuilder<((), (), (), (), (), (), (), (), (), ())>
Create a builder for building NodeOverlayProps.
On the builder, call .anchor(...)(optional), .side(...)(optional), .align(...)(optional), .offset(...)(optional), .keep_in_view(...)(optional), .track_anchor(...)(optional), .backdrop(...)(optional), .on_dismiss(...)(optional), .style(...)(optional), .children(...) to set the values of the fields.
Finally, call .build() to create the instance of NodeOverlayProps.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for NodeOverlayProps
impl !UnwindSafe for NodeOverlayProps
impl Freeze for NodeOverlayProps
impl Send for NodeOverlayProps
impl Sync for NodeOverlayProps
impl Unpin for NodeOverlayProps
impl UnsafeUnpin for NodeOverlayProps
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more