File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ angular.module('g1b.calendar-heatmap', []).
82
82
83
83
dayCircles . on ( 'mouseover' , function ( d ) {
84
84
var circle = d3 . select ( this ) ;
85
+ var circle_xpos = parseInt ( circle . attr ( 'cx' ) ) ;
86
+ var circle_ypos = parseInt ( circle . attr ( 'cy' ) ) ;
85
87
( function repeat ( ) {
86
88
circle = circle . transition ( )
87
89
. duration ( 500 )
@@ -95,12 +97,12 @@ angular.module('g1b.calendar-heatmap', []).
95
97
} ) ( ) ;
96
98
tooltip . html ( scope . tooltipHTMLForDate ( d ) )
97
99
. style ( 'left' , function ( ) {
98
- if ( ( parseInt ( svg . style ( 'width' ) ) - d3 . event . pageX ) < TOOLTIP_WIDTH ) {
99
- return ( d3 . event . pageX - CIRCLE_RADIUS * 4 - TOOLTIP_WIDTH ) + 'px' ;
100
+ if ( ( parseInt ( svg . style ( 'width' ) ) - circle_xpos ) < TOOLTIP_WIDTH ) {
101
+ return ( circle_xpos - TOOLTIP_WIDTH ) + 'px' ;
100
102
}
101
- return ( d3 . event . pageX + CIRCLE_RADIUS ) + 'px' ;
103
+ return ( circle_xpos + TOOLTIP_WIDTH / 2 ) + 'px' ;
102
104
} )
103
- . style ( 'top' , ( d3 . event . pageY - CIRCLE_RADIUS ) + 'px' )
105
+ . style ( 'top' , ( circle_ypos + CIRCLE_RADIUS * 3 + MONTH_LABEL_PADDING ) + 'px' )
104
106
. transition ( )
105
107
. duration ( 250 )
106
108
. ease ( 'ease-in' )
You can’t perform that action at this time.
0 commit comments