Remarks
A common popover is a tooltip, which is a popover with behavior PopoverBehavior.HINT. There can typically be only a single tooltip that will dismiss automatically when the user interacts with the pointer or hits escape. There are also popovers with behavior PopoverBehavior.AUTO, which can be interacted with. They can coexist with hints, but there can also be only ever one auto popover. PopoverBehavior.MANUAL can coexist and be interacted with. They do not close automatically.
All these elements can show content and they are anchored to some world coordinate. Their placement is determined by an offset and relative to their size (ratios). A popover either closes automatically or can be closed anytime.
See Also
Developer's Guide
API
- PopoverManager, open, ToolTipInputMode
Members
Constructors
Properties
Gets or sets the anchor location of the popover in world-coordinates.
Sample Graphs
Placing the popover in the top-left corner of a node can be achieved with the following parameter values:
anchor: (nodeLayoutX, nodeLayoutY) // Top-left corner of the node
offset: (0, 0) // No offset from the corner
ratios: (0, 0) // Ratios point is at the top-leftIn this case both the anchor and the top-left corner of the popover coincide, placing it in the top-left corner of the node.
See Also
Gets or sets the displaying behavior of the popover.
The behavior affects the way the content is displayed and its behavior with regard to other active popovers.
May only be set before the popover is displayed, otherwise an InvalidOperationError is thrown.
The default is PopoverBehavior.MANUAL.
Throws
- Exception ({ name: 'InvalidOperationError' })
See Also
Developer's Guide
If a non-null value is set, that value will be displayed as content.
The content will be wrapped in an HTML container with the cssClass as CSS class.
String content will be set as innerHTML of the container. In strict environments, consider using the Trusted Types API to protect against cross-site scripting attacks. For more details, check the developer's guide section Secure Content with Trusted Types .
Property Value
null if no popover should be displayed.See Also
Developer's Guide
Gets the element that holds the popover content.
null if the popover is not yet displayed.By default .yfiles-popover is used as CSS class.
May only be set before the popover is displayed, otherwise an InvalidOperationError is thrown.
Throws
- Exception ({ name: 'InvalidOperationError' })
Gets or sets the duration for which the popover should be displayed.
Gets or sets the offset of the popover from its anchor, which is added to the anchor location after the conversion to view coordinates.
Sample Graphs
Placing the popover in the top-left corner of a node can be achieved with the following parameter values:
anchor: (nodeLayoutX, nodeLayoutY) // Top-left corner of the node
offset: (0, 0) // No offset from the corner
ratios: (0, 0) // Ratios point is at the top-leftIn this case both the anchor and the top-left corner of the popover coincide, placing it in the top-left corner of the node.
See Also
Gets or sets a custom parent element to which the popover is added as a child in the DOM.
By default, this property is null, which means that the popover is added to the element specified by PopoverManager.defaultParentElement.
When specifying some other element as parent, it must be assured that the element is currently visible (i.e., has no style with property display: none).
See Also
Developer's Guide
API
- defaultParentElement
Gets or sets the ratios of the popover content rectangle.
Sample Graphs
Placing the popover in the top-left corner of a node can be achieved with the following parameter values:
anchor: (nodeLayoutX, nodeLayoutY) // Top-left corner of the node
offset: (0, 0) // No offset from the corner
ratios: (0, 0) // Ratios point is at the top-leftIn this case both the anchor and the top-left corner of the popover coincide, placing it in the top-left corner of the node.
See Also
Methods
Parameters
- type: string
- A string which represents the type of the event to register as listed in events.
- listener: function(evt:EventArgs, sender:this): void
- The function which will be invoked when the event is raised.
- options?: ListenerOptions
- Options which specify how the listener will be invoked.
Closes this popover and removes it from its manager's PopoverManager.openPopovers.
Parameters
- type: string
- A string which represents the type of the event to register as listed in events.
- listener: function(evt:EventArgs, sender:this): void
- The function which will be invoked when the event is raised.
- options?: ListenerOptions
- Options which specify how the listener will be invoked.
Events
Occurs for different PopoverUpdateReasons while the popover is being displayed, for example, when the pointer is moved or the viewport changes.
Properties of UpdatePopoverEventArgs
- content: anyfinalwritable
- Gets or sets the content to use.
- context: IInputModeContextfinal
- Gets the context for the current event.
- handled: booleanfinalwritable
- Gets or sets a value indicating whether this QueryToolTipEventArgs has been handled.
- popover: PopoverDescriptorfinal
- Gets the popover descriptor.
- queryLocation: Pointfinal
- Gets the most recent query location in world coordinates.
- reason: PopoverUpdateReasonfinal
- Gets the reason why the PopoverDescriptor.update event was raised.
- showPopover: booleanfinalwritable
- Gets or sets whether the popover should be open/closed after the event.
See Also
Developer's Guide