Skip to content

Commit

Permalink
Merge pull request #168 from davidmsantos90/master
Browse files Browse the repository at this point in the history
[CDF-422]: CCC - Tooltip moves when hovering over a chart dot
  • Loading branch information
pamval committed Jan 8, 2015
2 parents 357141a + 2295a65 commit 4547376
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
7 changes: 6 additions & 1 deletion package-res/ccc/plugin/point/point-plot-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,12 @@ def
this.pvDot = new pvc.visual.Dot(this, this.pvLine, {
extensionId: extensionIds,
freePosition: true,
wrapper: wrapper
wrapper: wrapper,
tooltipArgs: {
options: {
ignoreRadius: linesVisible
}
}
})
.intercept('visible', function(scene) {
return (!scene.isNull && !scene.isIntermediate /*&& !scene.isInterpolated*/) &&
Expand Down
8 changes: 7 additions & 1 deletion package-res/ccc/plugin/scatter/scatter-plot-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,13 @@ def
var dot = new pvc.visual.DotSizeColor(me, me.pvLine, {
extensionId: 'dot',
wrapper: wrapper,
activeSeriesAware: me.linesVisible
activeSeriesAware: me.linesVisible,
tooltipArgs: {
options: {
ignoreRadius: rootScene.isSizeBound ? false : me.linesVisible
}
}

})
.override('x', function(scene) { return scene.basePosition; })
.override('y', function(scene) { return scene.orthoPosition; })
Expand Down
21 changes: 13 additions & 8 deletions package-res/lib/tipsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,32 +84,37 @@
// Wedge
var midAngle = instance.startAngle + instance.angle / 2;
radius = instance.outerRadius;// - (instance.outerRadius - instance.innerRadius) * 0.05;

left = t.x + instance.left + radius * Math.cos(midAngle);
top = t.y + instance.top + radius * Math.sin(midAngle);

} else if(_mark.properties.shapeRadius){
radius = Math.max(2, instance.shapeRadius);
if(getTooltipOptions().ignoreRadius) {
radius = 0;
} else {
radius = Math.max(2, instance.shapeRadius);
}

var cx = instance.left;
var cy = instance.top;

switch(instance.shape){
case 'diamond':
radius *= Math.SQRT2;
// NOTE fall through
break;

case 'circle':
// Want the inscribed square
radius /= Math.SQRT2;
break;
}

left = (cx - radius) * t.k + t.x;
top = (cy - radius) * t.k + t.y;
height = width = 2*radius * t.k;


} else {
left = instance.left * t.k + t.x;
top = instance.top * t.k + t.y;
Expand Down

0 comments on commit 4547376

Please sign in to comment.