From 090fdd51d9934052bcd2c8139ede8fd9e47126a1 Mon Sep 17 00:00:00 2001 From: eanar Date: Wed, 20 Feb 2019 23:16:37 -0800 Subject: [PATCH 1/2] Add graph3d tooltip delay option --- lib/graph3d/Graph3d.js | 3 ++- lib/graph3d/Settings.js | 1 + lib/graph3d/options.js | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/graph3d/Graph3d.js b/lib/graph3d/Graph3d.js index f83d9aa34..01d3e66c9 100755 --- a/lib/graph3d/Graph3d.js +++ b/lib/graph3d/Graph3d.js @@ -69,6 +69,7 @@ Graph3d.DEFAULTS = { style : Graph3d.STYLE.DOT, tooltip : false, + tooltipDelay : 300, tooltipStyle : { content : { @@ -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; diff --git a/lib/graph3d/Settings.js b/lib/graph3d/Settings.js index 598048228..ce0d2ae46 100755 --- a/lib/graph3d/Settings.js +++ b/lib/graph3d/Settings.js @@ -74,6 +74,7 @@ var OPTIONKEYS = [ 'xCenter', 'yCenter', 'zoomable', + 'tooltipDelay', 'ctrlToZoom' ]; diff --git a/lib/graph3d/options.js b/lib/graph3d/options.js index a01902d84..ff623d3bf 100644 --- a/lib/graph3d/options.js +++ b/lib/graph3d/options.js @@ -92,6 +92,7 @@ let allOptions = { ] }, tooltip : { boolean: bool, 'function': 'function' }, + tooltipDelay : { number: number }, tooltipStyle : { content: { color : { string }, From a6997b4d023501c7c5edba7ed9d5cd8afb5ec8f1 Mon Sep 17 00:00:00 2001 From: eanar Date: Thu, 21 Feb 2019 00:49:55 -0800 Subject: [PATCH 2/2] Add tooltipDelay to graph3d docs --- docs/graph3d/index.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/graph3d/index.html b/docs/graph3d/index.html index 82de9f3da..58a2a1034 100644 --- a/docs/graph3d/index.html +++ b/docs/graph3d/index.html @@ -506,6 +506,15 @@

Configuration Options

+ + tooltipDelay + number + 300 + The delay time for the tooltip to appear when the mouse cursor + hovers over an x-y grid tile. + + + tooltipStyle Object