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

Commit

Permalink
Add graph3d tooltip delay option
Browse files Browse the repository at this point in the history
  • Loading branch information
eanar committed Feb 21, 2019
1 parent 320b180 commit 090fdd5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
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

0 comments on commit 090fdd5

Please sign in to comment.