C

PopoverDescriptor

Represents the configuration and behavior of a popover, which is a transient UI element that can display additional information anchored to a specific location on the screen.
Inheritance Hierarchy

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

Show:

Constructors

Creates a new descriptor for configuring the properties and behavior of a popover.

Parameters

Properties

Gets or sets the anchor location of the popover in world-coordinates.
The popover is positioned so that the location in world coordinates appears behind the location on the popover that is determined by the ratios, taking into account the offset
conversionfinal

Sample Graphs

Shown Setting:

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-left

In 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

Developer's Guide
API
ratios, offset
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.

conversionfinal

Throws

Exception ({ name: 'InvalidOperationError' })

See Also

Developer's Guide
Gets or sets the content for this popover.

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 .

final

Property Value

The popover content or null if no popover should be displayed.

See Also

Developer's Guide
Gets the element that holds the popover content.
This is null if the popover is not yet displayed.
readonlyfinal
Gets or sets the CSS class of the parent element to which the popover content is added.

By default .yfiles-popover is used as CSS class.

May only be set before the popover is displayed, otherwise an InvalidOperationError is thrown.

final

Throws

Exception ({ name: 'InvalidOperationError' })
Gets or sets the duration for which the popover should be displayed.
If the popover is already displayed, the remaining display time is returned.
conversionfinal
Gets whether the popover is currently displayed.
readonlyfinal
Gets or sets the offset of the popover from its anchor, which is added to the anchor location after the conversion to view coordinates.
This value is interpreted in view coordinates and added to the corresponding spot in the view coordinates that represents the anchor world coordinates. The resulting location is matched to coincide with the location on the popover. The default is (0,0).
conversionfinal

Sample Graphs

Shown Setting:

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-left

In 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

API
ratios, anchor
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).

final

See Also

Developer's Guide
API
defaultParentElement
Gets or sets the ratios of the popover content rectangle.
The ratios span from (0,0) which describes the top-left corner of the popup layout to (1,1) which describes the bottom-right corner. The default is (0,0).
conversionfinal

Sample Graphs

Shown Setting:

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-left

In 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

API
anchor, offset

Methods

Adds an event handler for a given event type.
final

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.
final
Called when the popover was closed.
This implementation does nothing.
protected
Adds an event handler for a given event type.
final

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 when the popover was closed.

Properties of EventArgs

Occurs for different PopoverUpdateReasons while the popover is being displayed, for example, when the pointer is moved or the viewport changes.
Handlers can set the UpdatePopoverEventArgs.showPopover property to explicitly control the popover's open state or use the QueryToolTipEventArgs.popover to update the popover's properties. Note that typically you do not need to unregister the event handler, as the descriptor will get garbage collected when it closed.

Properties of UpdatePopoverEventArgs

content: any
finalwritable
Gets or sets the content to use.
context: IInputModeContext
final
Gets the context for the current event.
handled: boolean
finalwritable
Gets or sets a value indicating whether this QueryToolTipEventArgs has been handled.
popover: PopoverDescriptor
final
Gets the popover descriptor.
queryLocation: Point
final
Gets the most recent query location in world coordinates.
reason: PopoverUpdateReason
final
Gets the reason why the PopoverDescriptor.update event was raised.
showPopover: boolean
finalwritable
Gets or sets whether the popover should be open/closed after the event.

See Also

Developer's Guide