@ -628,9 +628,9 @@ c3_axis_fn.init = function init() {
$$ . axes . y = main . append ( "g" ) . attr ( "class" , CLASS . axis + ' ' + CLASS . axisY ) . attr ( "clip-path" , config . axis _y _inner ? "" : $$ . clipPathForYAxis ) . attr ( "transform" , $$ . getTranslate ( 'y' ) ) . style ( "visibility" , config . axis _y _show ? 'visible' : 'hidden' ) ;
$$ . axes . y = main . append ( "g" ) . attr ( "class" , CLASS . axis + ' ' + CLASS . axisY ) . attr ( "clip-path" , config . axis _y _inner ? "" : $$ . clipPathForYAxis ) . attr ( "transform" , $$ . getTranslate ( 'y' ) ) . style ( "visibility" , config . axis _y _show ? 'visible' : 'hidden' ) ;
$$ . axes . y . append ( "text" ) . attr ( "class" , CLASS . axisYLabel ) . attr ( "transform" , config . axis _rotated ? "" : "rotate(-90)" ) . style ( "text-anchor" , this . textAnchorForYAxisLabel . bind ( this ) ) ;
$$ . axes . y . append ( "text" ) . attr ( "class" , CLASS . axisYLabel ) . attr ( "transform" , config . axis _rotated ? "" : "rotate(-90)" ) . style ( "text-anchor" , this . textAnchorForYAxisLabel . bind ( this ) ) ;
$$ . axes . y2 = main . append ( "g" ) . attr ( "class" , CLASS . axis + ' ' + CLASS . axisY2 )
$$ . axes . y2 = main . append ( "g" ) . attr ( "class" , CLASS . axis + ' ' + CLASS . axisY2
// clip-path?
// clip-path?
. attr ( "transform" , $$ . getTranslate ( 'y2' ) ) . style ( "visibility" , config . axis _y2 _show ? 'visible' : 'hidden' ) ;
) . attr ( "transform" , $$ . getTranslate ( 'y2' ) ) . style ( "visibility" , config . axis _y2 _show ? 'visible' : 'hidden' ) ;
$$ . axes . y2 . append ( "text" ) . attr ( "class" , CLASS . axisY2Label ) . attr ( "transform" , config . axis _rotated ? "" : "rotate(-90)" ) . style ( "text-anchor" , this . textAnchorForY2AxisLabel . bind ( this ) ) ;
$$ . axes . y2 . append ( "text" ) . attr ( "class" , CLASS . axisY2Label ) . attr ( "transform" , config . axis _rotated ? "" : "rotate(-90)" ) . style ( "text-anchor" , this . textAnchorForY2AxisLabel . bind ( this ) ) ;
} ;
} ;
c3 _axis _fn . getXAxis = function getXAxis ( scale , orient , tickFormat , tickValues , withOuterTick , withoutTransition , withoutRotateTickText ) {
c3 _axis _fn . getXAxis = function getXAxis ( scale , orient , tickFormat , tickValues , withOuterTick , withoutTransition , withoutRotateTickText ) {
@ -1001,7 +1001,7 @@ c3_axis_fn.redraw = function redraw(transitions, isHidden) {
transitions . axisSubX . call ( $$ . subXAxis ) ;
transitions . axisSubX . call ( $$ . subXAxis ) ;
} ;
} ;
var c3$1 = { version : "0.4.17 " } ;
var c3$1 = { version : "0.4.18 " } ;
var c3 _chart _fn ;
var c3 _chart _fn ;
var c3 _chart _internal _fn ;
var c3 _chart _internal _fn ;
@ -1287,8 +1287,8 @@ c3_chart_internal_fn.initWithData = function (data) {
/*-- Main Region --*/
/*-- Main Region --*/
// text when empty
// text when empty
main . append ( "text" ) . attr ( "class" , CLASS . text + ' ' + CLASS . empty ) . attr ( "text-anchor" , "middle" ) // horizontal centering of text at x position in all browsers.
main . append ( "text" ) . attr ( "class" , CLASS . text + ' ' + CLASS . empty ) . attr ( "text-anchor" , "middle" // horizontal centering of text at x position in all browsers.
. attr ( "dominant-baseline" , "middle" ) ; // vertical centering of text at y position in all browsers, except IE.
) . attr ( "dominant-baseline" , "middle" ) ; // vertical centering of text at y position in all browsers, except IE.
// Regions
// Regions
$$ . initRegion ( ) ;
$$ . initRegion ( ) ;
@ -4319,16 +4319,13 @@ c3_chart_fn.zoom.range = function (range) {
c3 _chart _internal _fn . initPie = function ( ) {
c3 _chart _internal _fn . initPie = function ( ) {
var $$ = this ,
var $$ = this ,
d3 = $$ . d3 ,
d3 = $$ . d3 ;
config = $$ . config ;
$$ . pie = d3 . layout . pie ( ) . value ( function ( d ) {
$$ . pie = d3 . layout . pie ( ) . value ( function ( d ) {
return d . values . reduce ( function ( a , b ) {
return d . values . reduce ( function ( a , b ) {
return a + b . value ;
return a + b . value ;
} , 0 ) ;
} , 0 ) ;
} ) ;
} ) ;
if ( ! config . data _order ) {
$$ . pie . sort ( $$ . getOrderFunction ( ) || null ) ;
$$ . pie . sort ( null ) ;
}
} ;
} ;
c3 _chart _internal _fn . updateRadius = function ( ) {
c3 _chart _internal _fn . updateRadius = function ( ) {
@ -4720,8 +4717,8 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf
} ;
} ;
} ) . attr ( "transform" , withTransform ? "scale(1)" : "" ) . style ( "fill" , function ( d ) {
} ) . attr ( "transform" , withTransform ? "scale(1)" : "" ) . style ( "fill" , function ( d ) {
return $$ . levelColor ? $$ . levelColor ( d . data . values [ 0 ] . value ) : $$ . color ( d . data . id ) ;
return $$ . levelColor ? $$ . levelColor ( d . data . values [ 0 ] . value ) : $$ . color ( d . data . id ) ;
} ) // Where gauge reading color would receive customization.
} // Where gauge reading color would receive customization.
. call ( $$ . endall , function ( ) {
) . call ( $$ . endall , function ( ) {
$$ . transiting = false ;
$$ . transiting = false ;
} ) ;
} ) ;
mainArc . exit ( ) . transition ( ) . duration ( durationForExit ) . style ( 'opacity' , 0 ) . remove ( ) ;
mainArc . exit ( ) . transition ( ) . duration ( durationForExit ) . style ( 'opacity' , 0 ) . remove ( ) ;
@ -5809,26 +5806,36 @@ c3_chart_internal_fn.isOrderAsc = function () {
var config = this . config ;
var config = this . config ;
return typeof config . data _order === 'string' && config . data _order . toLowerCase ( ) === 'asc' ;
return typeof config . data _order === 'string' && config . data _order . toLowerCase ( ) === 'asc' ;
} ;
} ;
c3 _chart _internal _fn . orderTargets = function ( targets ) {
c3 _chart _internal _fn . getOrderFunction = function ( ) {
var $$ = this ,
var $$ = this ,
config = $$ . config ,
config = $$ . config ,
orderAsc = $$ . isOrderAsc ( ) ,
orderAsc = $$ . isOrderAsc ( ) ,
orderDesc = $$ . isOrderDesc ( ) ;
orderDesc = $$ . isOrderDesc ( ) ;
if ( orderAsc || orderDesc ) {
if ( orderAsc || orderDesc ) {
targets . sort ( function ( t1 , t2 ) {
return function ( t1 , t2 ) {
var reducer = function reducer ( p , c ) {
var reducer = function reducer ( p , c ) {
return p + Math . abs ( c . value ) ;
return p + Math . abs ( c . value ) ;
} ;
} ;
var t1Sum = t1 . values . reduce ( reducer , 0 ) ,
var t1Sum = t1 . values . reduce ( reducer , 0 ) ,
t2Sum = t2 . values . reduce ( reducer , 0 ) ;
t2Sum = t2 . values . reduce ( reducer , 0 ) ;
return orderA sc ? t2Sum - t1Sum : t1Sum - t2Sum ;
return orderDe sc ? t2Sum - t1Sum : t1Sum - t2Sum ;
} ) ;
} ;
} else if ( isFunction ( config . data _order ) ) {
} else if ( isFunction ( config . data _order ) ) {
targets . sort ( config . data _order ) ;
return config . data _order ;
} else if ( isArray ( config . data _order ) ) {
} else if ( isArray ( config . data _order ) ) {
targets . sort ( function ( t1 , t2 ) {
var order = config . data _order ;
return config . data _order . indexOf ( t1 . id ) - config . data _order . indexOf ( t2 . id ) ;
return function ( t1 , t2 ) {
} ) ;
return order . indexOf ( t1 . id ) - order . indexOf ( t2 . id ) ;
} ;
}
} ;
c3 _chart _internal _fn . orderTargets = function ( targets ) {
var fct = this . getOrderFunction ( ) ;
if ( fct ) {
targets . sort ( fct ) ;
if ( this . isOrderAsc ( ) || this . isOrderDesc ( ) ) {
targets . reverse ( ) ;
}
}
}
return targets ;
return targets ;
} ;
} ;
@ -7440,8 +7447,8 @@ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
texts = $$ . legend . selectAll ( 'text' ) . data ( targetIds ) . text ( function ( id ) {
texts = $$ . legend . selectAll ( 'text' ) . data ( targetIds ) . text ( function ( id ) {
return isDefined ( config . data _names [ id ] ) ? config . data _names [ id ] : id ;
return isDefined ( config . data _names [ id ] ) ? config . data _names [ id ] : id ;
} ) // MEMO: needed for update
} // MEMO: needed for update
. each ( function ( id , i ) {
) . each ( function ( id , i ) {
updatePositions ( this , id , i ) ;
updatePositions ( this , id , i ) ;
} ) ;
} ) ;
( withTransition ? texts . transition ( ) : texts ) . attr ( 'x' , xForLegendText ) . attr ( 'y' , yForLegendText ) ;
( withTransition ? texts . transition ( ) : texts ) . attr ( 'x' , xForLegendText ) . attr ( 'y' , yForLegendText ) ;
@ -8352,7 +8359,11 @@ c3_chart_internal_fn.pointR = function (d) {
c3 _chart _internal _fn . pointExpandedR = function ( d ) {
c3 _chart _internal _fn . pointExpandedR = function ( d ) {
var $$ = this ,
var $$ = this ,
config = $$ . config ;
config = $$ . config ;
return config . point _focus _expand _enabled ? config . point _focus _expand _r ? config . point _focus _expand _r : $$ . pointR ( d ) * 1.75 : $$ . pointR ( d ) ;
if ( config . point _focus _expand _enabled ) {
return isFunction ( config . point _focus _expand _r ) ? config . point _focus _expand _r ( d ) : config . point _focus _expand _r ? config . point _focus _expand _r : $$ . pointR ( d ) * 1.75 ;
} else {
return $$ . pointR ( d ) ;
}
} ;
} ;
c3 _chart _internal _fn . pointSelectR = function ( d ) {
c3 _chart _internal _fn . pointSelectR = function ( d ) {
var $$ = this ,
var $$ = this ,