Class: Tooltip

PSV.components~Tooltip

new Tooltip (psv, size)

Tooltip class

Name Type Description
psv PSV.Viewer
size Object

Extends

Members

arrow HTMLElement packagereadonly

Tooltip arrow

children Array.<PSV.components.AbstractComponent> packagereadonly inherited overrides

All child components

container HTMLElement readonly inherited overrides

prop Object protected inherited overrides

Internal properties

Properties:
Name Type Description
arrow number
offset number
width number
height number
pos string
state string
data *

Reference to main controller

Methods

destroy () protected inherited overrides

Destroys the component

hide () overrides

Hides the tooltip

Fires:
  • PSV.event:hide-tooltip

isVisible ()boolean inherited overrides

Check if the component is visible

Returns:
Type Description
boolean

move (config)

Moves the tooltip to a new position

Name Type Description
config PSV.components.Tooltip.Position
Throws:

when the configuration is incorrect

Type
PSV.PSVError

refreshUi () package inherited overrides

Refresh UI

Must be be a very lightweight operation

show (config) package overrides

Displays the tooltip on the viewer Do not call this method directly, use PSV.services.TooltipRenderer instead.

Name Type Description
config PSV.components.Tooltip.Config
Fires:
  • PSV.event:show-tooltip
Throws:

when the configuration is incorrect

Type
PSV.PSVError

toggle () inherited overrides

Displays or hides the component

Type Definitions

PSV.components.Tooltip.Config PSV.components.Tooltip.Position

Object defining the tooltip configuration

Properties:
Name Type Argument Description
content string

HTML content of the tooltip

className string <optional>

Additional CSS class added to the tooltip

data * <optional>

Userdata associated to the tooltip

PSV.components.Tooltip.Position Object

Object defining the tooltip position

Properties:
Name Type Argument Default Description
top number

Position of the tip of the arrow of the tooltip, in pixels

left number

Position of the tip of the arrow of the tooltip, in pixels

position string | Array.<string> <optional>
'top center'

Tooltip position toward it's arrow tip. Accepted values are combinations of top, center, bottom and left, center, right

box Object <optional>

Used when displaying a tooltip on a marker

Properties
Name Type Argument Default Description
width number <optional>
0
height number <optional>
0