Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vis#4262: add tooltip delay option #11

Merged
merged 3 commits into from
Sep 13, 2019
Merged
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 @@ -539,6 +539,15 @@ <h2 id="Configuration_Options">Configuration Options</h2>
</td>
</tr>

<tr>
<td>tooltipDelay</td>
<td>number</td>
<td>300</td>
<td>The delay time (in ms) 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, // milliseconds

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