Browse Source

Hide tooltip when hidden on custom xs - #154

pull/183/head
Masayuki Tanaka 11 years ago
parent
commit
ed8f888893
  1. 16
      c3.js
  2. 2
      c3.min.js

16
c3.js

@ -2894,18 +2894,21 @@
unexpandCircles();
})
.on('mousemove', function () {
var targetsToShow = filterTargetsToShow(c3.data.targets);
var mouse, closest, sameXData, selectedData;
if (dragging) { return; } // do nothing when dragging
if (hasArcType(c3.data.targets)) { return; }
if (hasArcType(targetsToShow)) { return; }
mouse = d3.mouse(this);
closest = findClosestFromTargets(c3.data.targets, mouse);
closest = findClosestFromTargets(targetsToShow, mouse);
if (! closest) { return; }
if (isScatterType(closest)) {
sameXData = [closest];
} else {
sameXData = filterSameX(c3.data.targets, closest.x);
sameXData = filterSameX(targetsToShow, closest.x);
}
// show tooltip when cursor is close to some point
@ -2937,12 +2940,15 @@
}
})
.on('click', function () {
var targetsToShow = filterTargetsToShow(c3.data.targets);
var mouse, closest;
if (hasArcType(c3.data.targets)) { return; }
if (hasArcType(targetsToShow)) { return; }
mouse = d3.mouse(this);
closest = findClosestFromTargets(c3.data.targets, mouse);
closest = findClosestFromTargets(targetsToShow, mouse);
if (! closest) { return; }
// select if selection enabled
if (dist(closest, mouse) < 100) {

2
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save