API / geotoolkit / controls / tooltip / ToolTip / ToolTip
Provides HTML based tooltip helper to display content information
↳
ToolTip
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
alignment | AnchorType | Tooltip alignment according to the point set by offsets |
autoflip | boolean | True to automatically flip tooltip alignment if it doesn't fit the window |
cssclasses | string | CSS classes' names to be applied for tooltip 'cg-tooltip' by default |
delay | number | |
hidedelay | number | Auto hide in millisecond, 0 means false and autohide is disabled |
offsetx | number | Offset of tooltip from current position by x in pixels |
offsety | number | Offset of tooltip from current position by y in pixels |
orientation | Orientation | Tooltip orientation |
showdelay | number | Delay between displaying tooltip, 0 means false and tooltip shows immediately |
size | Range | Client size range |
size-high | number | Upper range boundary |
size-low | number | Lower range boundary |
size-max | number | |
size-min | number |
Constructors
• Protected new ToolTip(options?)
| Name | Type | Description |
|---|---|---|
Optional options | Options | tooltip properties |
EventDispatcher.constructor
Methods
▸ dispose(): void
Dispose.
void
▸ getAnchorCssClasses(): Partial<Record<AnchorCssKeys, string>>
Return CSS class map for tooltip anchors
Partial<Record<AnchorCssKeys, string>>
CSS classes
▸ getAnchorType(): AnchorType
Get element anchor type
Element anchor type
▸ getAutoFlip(): boolean
Return auto-flip state, true if auto-flip is enabled
boolean
▸ getAutoHide(): number
Return tooltip auto-hide delay, 0 means false and auto hide is disabled
number
▸ getClassName(): string
string
▸ getClientSizeRange(): Range
Returns client size range by width
size range
▸ getCssClasses(): string
Return CSS classes for tooltip
string
CSS classes
▸ getDelay(): number
Return delay in miliseconds to auto hide tooltip if auto hide is specified
number
▸ getFade(): number
Return delay in miliseconds to auto hide tooltip if auto hide is specified
number
▸ getHTML(): string | HTMLElement
Returns tooltip content
string | HTMLElement
tooltip content
▸ getId(): string
Return tooltip ID
string
tooltip id
▸ getNode(): Node
Return tooltip node
node tooltip associated with
▸ getOffset(): Point
Get offset
Offset
▸ getOrientation(): Orientation
Set element orientation
this
▸ getPlot(): Plot
Return tooltip Plot
plot tooltip associated with
▸ getProperties(): OptionsOut
Gets all the properties pertaining to this object
properties
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
EventDispatcher.hasEventListener
▸ hide(fade?): ToolTip
Hide Tooltip
| Name | Type | Description |
|---|---|---|
Optional fade | number | fade transition in milliseconds |
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ isVisible(): boolean
Returs tooltip visible state
boolean
visible state
▸ notify(type, source, args?): ToolTip
Notify listeners
| Name | Type | Description |
|---|---|---|
type | string | event types |
source | any | of the event |
Optional args | any | arguments of the event |
this
▸ off(type?, callback?): ToolTip
Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.
| Name | Type | Description |
|---|---|---|
Optional type | string | type of the event |
Optional callback | EventListener | function to be called |
this
▸ off<E>(type, callback): ToolTip
| Name | Type |
|---|---|
E | extends string |
▸ on(type, callback, options?): ToolTip
Attach listener on event that will be called whenever the specified event is delivered to the target
If the callback function is already in the list of event listeners for this target, the function is not added a second time.
If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
callback | EventListener | to be called |
Optional options | Options | options of subscription |
this
▸ on<E>(type, callback, options?): ToolTip
| Name | Type |
|---|---|
E | extends string |
| Name | Type |
|---|---|
type | E |
callback | (eventType: E, sender: ToolTip, args: EventMap[E]) => void |
Optional options | Options |
▸ setAnchorCssClasses(cssAnchorClasses): ToolTip
Sets CSS class map for tooltip anchors (to render arrows), by default this map contains css-classnames for the following anchors { 'topcenter': 'cg-tooltip-arrow-top', 'bottomcenter': 'cg-tooltip-arrow-bottom', 'leftcenter': 'cg-tooltip-arrow-left', 'rightcenter': 'cg-tooltip-arrow-right' } you can set it to null is to remove default css classes and use rectangular tooltip instead of callout
| Name | Type | Description |
|---|---|---|
cssAnchorClasses | Partial<Record<AnchorCssKeys, string>> | CSS classes |
this
▸ setAnchorType(alignment): ToolTip
Set element anchor type
| Name | Type |
|---|---|
alignment | AnchorType |
this
▸ setAutoFlip(autoFlip): ToolTip
Set tooltip auto-flip in case if there is not enough space to display
| Name | Type | Description |
|---|---|---|
autoFlip | boolean | Enable auto-flip |
this
▸ setAutoHide(autoHide): ToolTip
Set tooltip auto-hide delay, 0 means false and auto hide is disabled
| Name | Type | Description |
|---|---|---|
autoHide | number | Enable auto-hide |
this
▸ setClientSizeRange(sizeRange): ToolTip
Sets client size range by width
this
▸ setCssClasses(cssClass): ToolTip
Sets CSS classes to be allied for tooltip
| Name | Type |
|---|---|
cssClass | string |
this
▸ setDelay(delay): ToolTip
Set delay in miliseconds to auto hide tooltip if auto hide is specified
| Name | Type | Description |
|---|---|---|
delay | number | delay in miliseconds |
this
▸ setFade(fade): ToolTip
Set delay in miliseconds to auto hide tooltip if auto hide is specified
| Name | Type |
|---|---|
fade | number |
this
▸ setHTML(html): ToolTip
Sets tooltip content
| Name | Type | Description |
|---|---|---|
html | string | HTMLElement | HTML tooltip content |
this
▸ setNode(node): ToolTip
| Name | Type |
|---|---|
node | Node |
▸ setOffset(offsetX, offsetY): ToolTip
Set offset
| Name | Type | Description |
|---|---|---|
offsetX | number | X offset |
offsetY | number | Y offset |
this
▸ setOrientation(orientation): ToolTip
Get element orientation
| Name | Type |
|---|---|
orientation | Orientation |
Element orientation
▸ setProperties(properties?): ToolTip
Sets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional properties | Properties | object containing the properties to set |
▸ setSilent(bool): ToolTip
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ show(position): ToolTip
Show tooltip in specified coordinates
Throws
Error if target is not valid
▸ Static createToolTip(target, options?): ToolTip
Create tooltip for specified Plot or Node
| Name | Type | Description |
|---|---|---|
target | Node | Plot | Plot or Node tooltip associated with |
Optional options | Options | tooltip options |
new tooltip
▸ Static getClassName(): string
string
▸ Static getDefault(target): ToolTip
Returns default tooltip associated with Plot containing specified Node
Throws
Error if target is not valid
| Name | Type | Description |
|---|---|---|
target | Node | Node tooltip associated with |
tooltip
▸ Static getDefault(target): ToolTip
Returns default tooltip associated with specified Plot
Throws
Error if target is not valid
| Name | Type | Description |
|---|---|---|
target | Plot | Plot tooltip associated with |
tooltip