Event argument that can be used to query the text to display when the mouse hovers over the given point in world coordinate space.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.ToolTipQueryEventArgs
See Also
Constructors
Initializes a new instance of the ToolTipQueryEventArgs class.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context of the query.
- queryLocation - Point
- The query location.
Properties
Gets the context for the current event.
Defined in
Gets or sets a value indicating whether this ToolTipQueryEventArgs has been handled.
Remarks
If this property is set to true
, the content of the toolTip property will be displayed as tooltip. Otherwise, the input mode will continue determining the tooltip contents, typically by querying for the content with another graph item at the current queryLocation.
Handlers which handle this ToolTipQueryEventArgs should always test first, whether this property is set to true
and, if so, exit without doing anything.
This property is automatically set to true
if the toolTip has been assigned a value.
Gets the query location in world coordinates.
Gets or sets the tooltip content to use.
Remarks
The content can be either a string, any HTML element or a Promise providing the same.
Setting this property will set the handled property to true
.
// For example, set a string as tooltip
eventArgs.toolTip = 'Tooltip for Item'
// or set an HTML element as tooltip
const div = document.createElement('div')
div.innerHTML = 'Tooltip for Item'
eventArgs.toolTip = div
// or set a Promise as tooltip, whose resolve value will be displayed
// note that the tooltip must be set synchronous in the event handler, thus awaiting it here won't work
eventArgs.toolTip = fetch('something.txt').then((response) => response.text())