! function ( a ) { "use strict" ; function b ( a ) { return a || 0 === a } function c ( a ) { return "undefined" == typeof a } function d ( a ) { return "undefined" != typeof a } var e = { version : "0.1.29" } , f = { target : "c3-target" , chart : "c3-chart" , chartLine : "c3-chart-line" , chartLines : "c3-chart-lines" , chartBar : "c3-chart-bar" , chartBars : "c3-chart-bars" , chartText : "c3-chart-text" , chartTexts : "c3-chart-texts" , chartArc : "c3-chart-arc" , chartArcs : "c3-chart-arcs" , chartArcsTitle : "c3-chart-arcs-title" , selectedCircle : "c3-selected-circle" , selectedCircles : "c3-selected-circles" , eventRect : "c3-event-rect" , eventRects : "c3-event-rects" , eventRectsSingle : "c3-event-rects-single" , eventRectsMultiple : "c3-event-rects-multiple" , zoomRect : "c3-zoom-rect" , brush : "c3-brush" , focused : "c3-focused" , region : "c3-region" , regions : "c3-regions" , tooltip : "c3-tooltip" , tooltipName : "c3-tooltip-name" , shape : "c3-shape" , shapes : "c3-shapes" , line : "c3-line" , bar : "c3-bar" , bars : "c3-bars" , circle : "c3-circle" , circles : "c3-circles" , arc : "c3-arc" , area : "c3-area" , text : "c3-text" , texts : "c3-texts" , grid : "c3-grid" , xgrid : "c3-xgrid" , xgrids : "c3-xgrids" , xgridLine : "c3-xgrid-line" , xgridLines : "c3-xgrid-lines" , xgridFocus : "c3-xgrid-focus" , ygrid : "c3-ygrid" , ygrids : "c3-ygrids" , ygridLine : "c3-ygrid-line" , ygridLines : "c3-ygrid-lines" , axisX : "c3-axis-x" , axisXLabel : "c3-axis-x-label" , axisY : "c3-axis-y" , axisYLabel : "c3-axis-y-label" , axisY2 : "c3-axis-y2" , axisY2Label : "c3-axis-y2-label" , legendItem : "c3-legend-item" , legendItemEvent : "c3-legend-item-event" , legendItemTile : "c3-legend-item-tile" , dragarea : "c3-dragarea" , EXPANDED : "_expanded_" , SELECTED : "_selected_" , INCLUDED : "_included_" } ; e . generate = function ( e ) { function g ( a , b ) { if ( ! ( a in e ) ) throw Error ( b ) } function h ( a , b ) { var c , d , f , g = e ; for ( c = 0 ; c < a . length ; c ++ ) { if ( "object" == typeof g && ! ( a [ c ] in g ) ) return b ; if ( d = c === a . length - 1 , f = g [ a [ c ] ] , ! d && "object" != typeof f || d && "object" != typeof b && "object" == typeof f && null !== f ) return b ; g = f } return g } function i ( a ) { return "url(" + document . URL . split ( "#" ) [ 0 ] + "#" + a + ")" } function j ( a ) { var b = a !== ! 1 ? 250 : 0 ; zi . attr ( "transform" , ki . main ) , zi . select ( "." + f . axisX ) . transition ( ) . duration ( b ) . attr ( "transform" , ki . x ) , zi . select ( "." + f . axisY ) . transition ( ) . duration ( b ) . attr ( "transform" , ki . y ) , zi . select ( "." + f . axisY2 ) . attr ( "transform" , ki . y2 ) , zi . select ( "." + f . chartArcs ) . attr ( "transform" , ki . arc ) } function k ( ) { zg && ( Ai . attr ( "transform" , ki . context ) , Ai . select ( "." + f . axisX ) . attr ( "transform" , ki . subx ) ) } function l ( a ) { var b = a !== ! 1 ? 250 : 0 ; Bi . transition ( ) . duration ( b ) . attr ( "transform" , ki . legend ) } function m ( a ) { j ( a ) , k ( a ) , l ( a ) } function n ( ) { var a = Q ( ) , b = P ( ) ; Bf = r ( ) , Cf = s ( ) , uf = { top : Gg ? w ( "y2" ) : ri , right : u ( ) , bottom : w ( Gg ? "y" : "x" ) + ( Gg ? 0 : Ag ) + ( li ? 0 : a ) , left : ( Gg ? Ag + qi : 0 ) + t ( ) } , xf = Bf - uf . left - uf . right , zf = Cf - uf . top - uf . bottom , 0 > xf && ( xf = 0 ) , 0 > zf && ( zf = 0 ) , vf = { top : Gg ? uf . top : Cf - Ag - ( li ? 0 : a ) , right : 0 / 0 , bottom : 20 + ( li ? 0 : a ) , left : Gg ? pi : uf . left } , yf = Gg ? uf . left - pi - qi : xf , Af = Gg ? zf : Cf - vf . top - vf . bottom , 0 > yf && ( yf = 0 ) , 0 > Af && ( Af = 0 ) , wf = { top : li ? 0 : Cf - a , right : 0 / 0 , bottom : 0 , left : li ? Bf - b : 0 } , p ( ) , li && Td ( gf . data . targets ) && ( wf . left = xf / 2 + Ef ) } function o ( ) { zi . select ( "line." + f . xgridFocus ) . attr ( "x1" , Gg ? 0 : - 10 ) . attr ( "x2" , Gg ? xf : - 10 ) . attr ( "y1" , Gg ? - 10 : uf . top ) . attr ( "y2" , Gg ? - 10 : zf ) } function p ( ) { Ef = zf / 2 , Df = . 95 * Ef , Ff = Sd ( gf . data . targets ) ? . 6 * Df : 0 } function q ( ) { var a = Gg ? f . axisX : f . axisY , b = ff . select ( "." + a ) . node ( ) , c = b ? b . getBoundingClientRect ( ) : { right : 0 } , d = ff . select ( jf ) . node ( ) . getBoundingClientRect ( ) , e = c . right - d . left - t ( ) ; return e > 0 ? e : 0 } function r ( ) { return kf ? kf : x ( ) } function s ( ) { var a = lf ? lf : y ( ) ; return a > 0 ? a : 320 } function t ( ) { return Td ( gf . data . targets ) ? 0 : mf ? mf : Gg || ! Tg || Yg ? 1 : v ( "y" ) } function u ( ) { var a = 1 ; return Td ( gf . data . targets ) ? 0 : nf ? nf : li ? P ( ) + ( ah && ! Gg ? v ( "y2" ) : a ) : ah ? fh || Gg ? a : v ( "y2" ) : a } function v ( a ) { var b = gb ( a ) ; return b . isInner ? 20 + zb ( a ) : 40 + zb ( a ) } function w ( a ) { return "y" !== a || Tg ? "y2" !== a || ah ? ( gb ( a ) . isInner ? 30 : 40 ) + ( "y2" === a ? - 10 : 0 ) : ri : Cg && ! li ? 10 : 1 } function x ( ) { return + ff . select ( jf ) . style ( "width" ) . replace ( "px" , "" ) } function y ( ) { return + ff . select ( jf ) . style ( "height" ) . replace ( "px" , "" ) } function z ( a ) { return a ? - 5 : - ( uf . left - 1 ) } function A ( a ) { return a ? - 20 : - 1 } function B ( ) { return z ( ! Gg ) } function C ( ) { return A ( ! Gg ) } function D ( ) { return z ( Gg ) } function E ( ) { return A ( Gg ) } function F ( a ) { return a ? xf + 2 + 4 : uf . left + 20 } function G ( a ) { return a ? 80 : zf + 2 } function H ( ) { retu
} Ci . html ( Mh ( gf . data . targets . map ( function ( a ) { return lc ( a . values [ Oh ] ) } ) , $ ( ) , md , ci ) ) , Ci . style ( "top" , Ph . top ) . style ( "left" , Ph . left ) . style ( "display" , "block" ) } null == a . onresize && ( a . onresize = Pe ( ) ) , a . onresize . add && a . onresize . add ( function ( ) { Re ( { withLegend : ! 0 , withTransition : ! 1 , withTransitionForTransform : ! 1 } ) } ) } function Ge ( a ) { a . append ( "rect" ) . attr ( "class" , ad ) . style ( "cursor" , og && pg ? "pointer" : null ) . on ( "mouseover" , function ( a , b ) { if ( ! $h && ! Td ( gf . data . targets ) ) { var c , d , e = gf . data . targets . map ( function ( a ) { return lc ( a . values [ b ] ) } ) ; if ( Object . keys ( eg ) . length > 0 ) { d = [ ] ; for ( var g in eg ) for ( c = 0 ; c < e . length ; c ++ ) if ( e [ c ] . id === g ) { d . push ( e [ c ] ) , e . shift ( c ) ; break } e = d . concat ( e ) } sh && ue ( b ) , xe ( b ) , zi . selectAll ( "." + f . shape + "-" + b ) . each ( function ( a ) { tg ( a ) } ) } } ) . on ( "mouseout" , function ( a , b ) { Td ( gf . data . targets ) || ( Fd ( ) , Dd ( ) , ve ( b ) , ye ( ) , zi . selectAll ( "." + f . shape + "-" + b ) . each ( function ( a ) { ug ( a ) } ) ) } ) . on ( "mousemove" , function ( a , b ) { var c ; $h || Td ( gf . data . targets ) || ( c = Dc ( gf . data . targets ) . map ( function ( a ) { return lc ( a . values [ b ] ) } ) , Cd ( c , ff . mouse ( this ) ) , Ed ( c ) , og && ( pg || zi . selectAll ( "." + f . shape + "-" + b ) . filter ( function ( a ) { return qg ( a ) } ) . each ( function ( ) { var a = ff . select ( this ) . classed ( f . EXPANDED , ! 0 ) ; "circle" === this . nodeName && a . attr ( "r" , th ) , xi . select ( "." + f . eventRect + "-" + b ) . style ( "cursor" , null ) } ) . filter ( function ( ) { return "circle" === this . nodeName ? ee ( this , uh ) : "path" === this . nodeName ? fe ( this ) : void 0 } ) . each ( function ( ) { var a = ff . select ( this ) ; a . classed ( f . EXPANDED ) || ( a . classed ( f . EXPANDED , ! 0 ) , "circle" === this . nodeName && a . attr ( "r" , uh ) ) , xi . select ( "." + f . eventRect + "-" + b ) . style ( "cursor" , "pointer" ) } ) ) ) } ) . on ( "click" , function ( a , b ) { return Td ( gf . data . targets ) ? void 0 : _h ? void ( _h = ! 1 ) : void zi . selectAll ( "." + f . shape + "-" + b ) . each ( function ( a ) { Ie ( this , a , b ) } ) } ) . call ( ff . behavior . drag ( ) . origin ( Object ) . on ( "drag" , function ( ) { Je ( ff . mouse ( this ) ) } ) . on ( "dragstart" , function ( ) { Ke ( ff . mouse ( this ) ) } ) . on ( "dragend" , function ( ) { Le ( ) } ) ) . call ( wi ) . on ( "dblclick.zoom" , null ) } function He ( a ) { a . append ( "rect" ) . attr ( "x" , 0 ) . attr ( "y" , 0 ) . attr ( "width" , xf ) . attr ( "height" , zf ) . attr ( "class" , f . eventRect ) . on ( "mouseout" , function ( ) { Td ( gf . data . targets ) || ( Fd ( ) , Dd ( ) , ve ( ) ) } ) . on ( "mousemove" , function ( ) { var a , b , c , d ; $h || Td ( gf . data . targets ) || ( a = ff . mouse ( this ) , b = vd ( gf . data . targets , a ) , c = xd ( gf . data . targets , b . x ) , d = c . map ( function ( a ) { return lc ( a ) } ) , Cd ( d , a ) , sh && ( ve ( ) , ue ( b . index , b . id ) ) , Ed ( d ) , ke ( b , a ) < 100 ? ( xi . select ( "." + f . eventRect ) . style ( "cursor" , "pointer" ) , ai || ( tg ( b ) , ai = ! 0 ) ) : ( xi . select ( "." + f . eventRect ) . style ( "cursor" , null ) , ug ( b ) , ai = ! 1 ) ) } ) . on ( "click" , function ( ) { var a , b ; Td ( gf . data . targets ) || ( a = ff . mouse ( this ) , b = vd ( gf . data . targets , a ) , ke ( b , a ) < 100 && zi . select ( "." + f . circles + "-" + bd ( b . id ) ) . select ( "." + f . circle + "-" + b . index ) . each ( function ( ) { Ie ( this , b , b . index ) } ) ) } ) . call ( ff . behavior . drag ( ) . origin ( Object ) . on ( "drag" , function ( ) { Je ( ff . mouse ( this ) ) } ) . on ( "dragstart" , function ( ) { Ke ( ff . mouse ( this ) ) } ) . on ( "dragend" , function ( ) { Le ( ) } ) ) . call ( wi ) . on ( "dblclick.zoom" , null ) } function Ie ( a , b , c ) { var d , e = ff . select ( a ) , g = e . classed ( f . SELECTED ) , h = ! 1 ; "circle" === a . nodeName ? ( h = ee ( a , 1.5 * uh ) , d = oe ) : "path" === a . nodeName && ( h = fe ( a ) , d = re ) , ( pg || h ) && ( og && qg ( b ) && ( rg || zi . selectAll ( "." + f . shapes + ( pg ? bd ( b . id ) : "" ) ) . selectAll ( "." + f . shape ) . each ( function ( a , b ) { var c = ff . select ( this ) ; c . classed ( f . SELECTED ) && d ( ! 1 , c . classed ( f . SELECTED , ! 1 ) , a , b ) } ) , e . classed ( f . SELECTED , ! g ) , d ( ! g , e , b , c ) ) , sg ( b , a ) ) } function Je ( a ) { var b , c , d , e , g , h , i , j ; Td ( gf . data . targets ) || og && ( ! of || wi . altDomain ) && rg && ( b = Zh [ 0 ] , c = Zh [ 1 ] , d = a [ 0 ] , e = a [ 1 ] , g = Math . min ( b , d ) , h = Math . max ( b , d ) , i = pg ? uf . top : Math . min ( c , e ) , j = pg ? zf : Math . max ( c , e ) , zi . select ( "." + f . dragarea ) . attr ( "x" , g ) . attr ( "y" , i ) . attr ( "width" , h - g ) . attr ( "height" , j - i ) , zi . selectAll ( "." + f . shapes ) . selectAll ( "." + f . shape ) . filter ( function ( a ) { return qg ( a ) } ) . each ( function ( a , b ) { var c , d , e , k , l , m , n = ff . select ( this ) , o = n . classed ( f . SELECTED ) , p = n . classed ( f . INCLUDED ) , q = ! 1 ; "circle" === this . nodeName ? ( c = 1 * n . attr ( "cx" ) , d = 1 * n . attr ( "cy" ) , l = oe , q = c > g && h > c && d > i && j > d ) : "path" === this . nodeName && ( m = yd ( this ) , c = m . x , d = m . y , e = m . width , k = m . height , l = re , q = ! ( c > h || g > c + e || d > j || i > d + k ) ) , q ^ p && ( n . classed ( f . INCLUDED , ! p ) , n . classed ( f . SELECTED , ! o ) , l ( ! o , n , a , b ) ) } ) ) } function Ke ( a ) { Td ( gf . data . targets ) || og && ( Zh = a , zi . select ( "." + f . chart ) . append ( "rect" ) . attr ( "class" , f . dragarea ) . style ( "opacity" , . 1 ) , $h = ! 0 , xg ( ) ) } functi
} , gf . xs = function ( a ) { return arguments . length && ( nc ( gf . data . targets , a ) , Me ( { withUpdateOrgXDomain : ! 0 , withUpdateXDomain : ! 0 } ) ) , gf . data . xs } , gf . axis . labels = function ( a ) { arguments . length && ( Object . keys ( a ) . forEach ( function ( b ) { bb ( b , a [ b ] ) } ) , Ab ( ) ) } , gf . axis . max = function ( a ) { arguments . length && ( "object" == typeof a ? ( b ( a . y ) && ( Ug = + a . y ) , b ( a . y2 ) && ( bh = + a . y2 ) ) : Ug = bh = + a , Me ( ) ) } , gf . axis . min = function ( a ) { arguments . length && ( "object" == typeof a ? ( b ( a . y ) && ( Vg = + a . y ) , b ( a . y2 ) && ( ch = + a . y2 ) ) : Vg = ch = + a , Me ( ) ) } , gf . axis . range = function ( a ) { arguments . length && ( "undefined" != typeof a . max && gf . axis . max ( a . max ) , "undefined" != typeof a . min && gf . axis . min ( a . min ) ) } , gf . legend . show = function ( a ) { Cg || ( Cg = ! 0 , Bi . style ( "visibility" , "visible" ) ) , $e ( yc ( a ) ) , Me ( { withTransitionForHorizontalAxis : ! 1 } ) } , gf . legend . hide = function ( a ) { Cg && he ( a ) && ( Cg = ! 1 , Bi . style ( "visibility" , "hidden" ) ) , _e ( yc ( a ) ) , Me ( { withTransitionForHorizontalAxis : ! 1 } ) } , gf . resize = function ( a ) { kf = a ? a . width : null , lf = a ? a . height : null , Re ( { withLegend : ! 0 , withTransition : ! 1 , withTransitionForTransform : ! 1 } ) } , gf . destroy = function ( ) { gf . data . targets = void 0 , gf . data . xs = { } , Di . html ( "" ) , a . onresize = null } , "url" in e . data ) ff . csv ( e . data . url , function ( a , b ) { Fe ( b ) } ) ; else if ( "rows" in e . data ) Fe ( pc ( e . data . rows ) ) ; else { if ( ! ( "columns" in e . data ) ) throw Error ( "url or rows or columns is required." ) ; Fe ( qc ( e . data . columns ) ) } return gf } , "function" == typeof a . define && a . define . amd ? a . define ( "c3" , [ "d3" ] , e ) : a . c3 = e } ( window ) ;