Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Add graph3d tooltip delay option #4262

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/graph3d/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,15 @@ <h2 id="Configuration_Options">Configuration Options</h2>
</td>
</tr>

<tr>
<td>tooltipDelay</td>
<td>number</td>
<td>300</td>
<td>The delay time for the tooltip to appear when the mouse cursor
hovers over an x-y grid tile.
</td>
</tr>

<tr class='toggle collapsible' onclick="toggleTable('optionTable','tooltipStyle', this);">
<td><span parent="tooltipStyle" class="right-caret"></span> tooltipStyle</td>
<td>Object</td>
Expand Down
3 changes: 2 additions & 1 deletion lib/graph3d/Graph3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Graph3d.DEFAULTS = {

style : Graph3d.STYLE.DOT,
tooltip : false,
tooltipDelay : 300,

tooltipStyle : {
content : {
Expand Down Expand Up @@ -2005,7 +2006,7 @@ Graph3d.prototype._onClick = function (event) {
* @param {Event} event A mouse move event
*/
Graph3d.prototype._onTooltip = function (event) {
var delay = 300; // ms
var delay = this.tooltipDelay; // ms
var boundingRect = this.frame.getBoundingClientRect();
var mouseX = getMouseX(event) - boundingRect.left;
var mouseY = getMouseY(event) - boundingRect.top;
Expand Down
1 change: 1 addition & 0 deletions lib/graph3d/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ var OPTIONKEYS = [
'xCenter',
'yCenter',
'zoomable',
'tooltipDelay',
'ctrlToZoom'
];

Expand Down
1 change: 1 addition & 0 deletions lib/graph3d/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ let allOptions = {
]
},
tooltip : { boolean: bool, 'function': 'function' },
tooltipDelay : { number: number },
tooltipStyle : {
content: {
color : { string },
Expand Down