@ -1158,6 +1158,7 @@
// point - point of each data
// point - point of each data
point _show : true ,
point _show : true ,
point _r : 2.5 ,
point _r : 2.5 ,
point _sensitivity : 10 ,
point _focus _expand _enabled : true ,
point _focus _expand _enabled : true ,
point _focus _expand _r : undefined ,
point _focus _expand _r : undefined ,
point _select _r : undefined ,
point _select _r : undefined ,
@ -1875,7 +1876,7 @@
return $$ . findClosest ( candidates , pos ) ;
return $$ . findClosest ( candidates , pos ) ;
} ;
} ;
c3 _chart _internal _fn . findClosest = function ( values , pos ) {
c3 _chart _internal _fn . findClosest = function ( values , pos ) {
var $$ = this , minDist = 100 , closest ;
var $$ = this , minDist = $$ . config . point _sensitivity , closest ;
// find mouseovering bar
// find mouseovering bar
values . filter ( function ( v ) { return v && $$ . isBarType ( v . id ) ; } ) . forEach ( function ( v ) {
values . filter ( function ( v ) { return v && $$ . isBarType ( v . id ) ; } ) . forEach ( function ( v ) {
@ -1902,7 +1903,7 @@
yIndex = config . axis _rotated ? 0 : 1 ,
yIndex = config . axis _rotated ? 0 : 1 ,
y = $$ . circleY ( data , data . index ) ,
y = $$ . circleY ( data , data . index ) ,
x = $$ . x ( data . x ) ;
x = $$ . x ( data . x ) ;
return Math . pow ( x - pos [ xIndex ] , 2 ) + Math . pow ( y - pos [ yIndex ] , 2 ) ;
return Math . sqrt ( Math . pow ( x - pos [ xIndex ] , 2 ) + Math . pow ( y - pos [ yIndex ] , 2 ) ) ;
} ;
} ;
c3 _chart _internal _fn . convertValuesToStep = function ( values ) {
c3 _chart _internal _fn . convertValuesToStep = function ( values ) {
var converted = [ ] . concat ( values ) , i ;
var converted = [ ] . concat ( values ) , i ;
@ -2514,7 +2515,7 @@
$$ . showXGridFocus ( selectedData ) ;
$$ . showXGridFocus ( selectedData ) ;
// Show cursor as pointer if point is close to mouse position
// Show cursor as pointer if point is close to mouse position
if ( $$ . isBarType ( closest . id ) || $$ . dist ( closest , mouse ) < 100 ) {
if ( $$ . isBarType ( closest . id ) || $$ . dist ( closest , mouse ) < config . point _sensitivity ) {
$$ . svg . select ( '.' + CLASS . eventRect ) . style ( 'cursor' , 'pointer' ) ;
$$ . svg . select ( '.' + CLASS . eventRect ) . style ( 'cursor' , 'pointer' ) ;
if ( ! $$ . mouseover ) {
if ( ! $$ . mouseover ) {
config . data _onmouseover . call ( $$ . api , closest ) ;
config . data _onmouseover . call ( $$ . api , closest ) ;
@ -2525,16 +2526,13 @@
. on ( 'click' , function ( ) {
. on ( 'click' , function ( ) {
var targetsToShow = $$ . filterTargetsToShow ( $$ . data . targets ) ;
var targetsToShow = $$ . filterTargetsToShow ( $$ . data . targets ) ;
var mouse , closest ;
var mouse , closest ;
if ( $$ . hasArcType ( targetsToShow ) ) { return ; }
if ( $$ . hasArcType ( targetsToShow ) ) { return ; }
mouse = d3 . mouse ( this ) ;
mouse = d3 . mouse ( this ) ;
closest = $$ . findClosestFromTargets ( targetsToShow , mouse ) ;
closest = $$ . findClosestFromTargets ( targetsToShow , mouse ) ;
if ( ! closest ) { return ; }
if ( ! closest ) { return ; }
// select if selection enabled
// select if selection enabled
if ( $$ . isBarType ( closest . id ) || $$ . dist ( closest , mouse ) < 100 ) {
if ( $$ . isBarType ( closest . id ) || $$ . dist ( closest , mouse ) < config . point _sensitivity ) {
$$ . main . selectAll ( '.' + CLASS . shapes + $$ . getTargetSelectorSuffix ( closest . id ) ) . selectAll ( '.' + CLASS . shape + '-' + closest . index ) . each ( function ( ) {
$$ . main . selectAll ( '.' + CLASS . shapes + $$ . getTargetSelectorSuffix ( closest . id ) ) . selectAll ( '.' + CLASS . shape + '-' + closest . index ) . each ( function ( ) {
if ( config . data _selection _grouped || $$ . isWithinShape ( this , closest ) ) {
if ( config . data _selection _grouped || $$ . isWithinShape ( this , closest ) ) {
$$ . toggleShape ( this , closest , closest . index ) ;
$$ . toggleShape ( this , closest , closest . index ) ;