Skip to content

Commit

Permalink
mouse pointer only appears when clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Feb 15, 2016
1 parent 0da2ebb commit c396cf3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
22 changes: 21 additions & 1 deletion d3plus.js
Expand Up @@ -23122,7 +23122,16 @@ module.exports = function(vars) {
}
else {

d3.select(this).style("cursor","pointer")
var zoomDir = zoomDirection(d.d3plus_data || d, vars)
var pointer = typeof vars.mouse.viz === "function" ||
typeof vars.mouse.viz[events.click] === "function" ||
(vars.zoom.value && (vars.types[vars.type.value].zoom ||
(d.d3plus.threshold && d.d3plus.merged) ||
zoomDir === 1 ||
(zoomDir === -1 && vars.history.states.length && !vars.tooltip.value.long)));

d3.select(this)
.style("cursor", pointer ? "pointer" : "auto")
.transition().duration(vars.timing.mouseevents)
.call(transform,true)

Expand Down Expand Up @@ -23179,6 +23188,17 @@ module.exports = function(vars) {
}
else {

var zoomDir = zoomDirection(d.d3plus_data || d, vars)
var pointer = typeof vars.mouse.viz === "function" ||
typeof vars.mouse.viz[events.click] === "function" ||
(vars.zoom.value && (vars.types[vars.type.value].zoom ||
(d.d3plus.threshold && d.d3plus.merged) ||
zoomDir === 1 ||
(zoomDir === -1 && vars.history.states.length && !vars.tooltip.value.long)));


d3.select(this).style("cursor", pointer ? "pointer" : "auto");

// vars.covered = false
var tooltipType = vars.types[vars.type.value].tooltip || "follow"

Expand Down
22 changes: 21 additions & 1 deletion src/viz/helpers/shapes/draw.js
Expand Up @@ -451,7 +451,16 @@ module.exports = function(vars) {
}
else {

d3.select(this).style("cursor","pointer")
var zoomDir = zoomDirection(d.d3plus_data || d, vars)
var pointer = typeof vars.mouse.viz === "function" ||
typeof vars.mouse.viz[events.click] === "function" ||
(vars.zoom.value && (vars.types[vars.type.value].zoom ||
(d.d3plus.threshold && d.d3plus.merged) ||
zoomDir === 1 ||
(zoomDir === -1 && vars.history.states.length && !vars.tooltip.value.long)));

d3.select(this)
.style("cursor", pointer ? "pointer" : "auto")
.transition().duration(vars.timing.mouseevents)
.call(transform,true)

Expand Down Expand Up @@ -508,6 +517,17 @@ module.exports = function(vars) {
}
else {

var zoomDir = zoomDirection(d.d3plus_data || d, vars)
var pointer = typeof vars.mouse.viz === "function" ||
typeof vars.mouse.viz[events.click] === "function" ||
(vars.zoom.value && (vars.types[vars.type.value].zoom ||
(d.d3plus.threshold && d.d3plus.merged) ||
zoomDir === 1 ||
(zoomDir === -1 && vars.history.states.length && !vars.tooltip.value.long)));


d3.select(this).style("cursor", pointer ? "pointer" : "auto");

// vars.covered = false
var tooltipType = vars.types[vars.type.value].tooltip || "follow"

Expand Down

0 comments on commit c396cf3

Please sign in to comment.