( function ( P ) { function Sc ( ) { function n ( c , e ) { c . attr ( "transform" , function ( c ) { return "translate(" + ( e ( c ) + aa ) + ", 0)" } ) } function t ( c , e ) { c . attr ( "transform" , function ( c ) { return "translate(0," + e ( c ) + ")" } ) } function P ( c ) { var e = c [ 0 ] ; c = c [ c . length - 1 ] ; return e < c ? [ e , c ] : [ c , e ] } function Ca ( c ) { for ( var e = [ ] , n = Math . ceil ( c [ 0 ] ) ; n < c [ 1 ] ; n ++ ) e . push ( n ) ; 0 < e . length && 0 < e [ 0 ] && e . unshift ( e [ 0 ] - ( e [ 1 ] - e [ 0 ] ) ) ; return e } function Da ( c ) { c = c < Q . length ? Q [ c ] : c ; return R ? R ( c ) : c } function l ( l ) { l . each ( function ( ) { var l = c . select ( this ) , ja = Ca ( s . domain ( ) ) ,
H = l . selectAll ( ".tick.major" ) . data ( ja , String ) , D = H . enter ( ) . insert ( "g" , "path" ) . attr ( "class" , "tick major" ) . style ( "opacity" , 1E-6 ) , E = c . transition ( H . exit ( ) ) . style ( "opacity" , 1E-6 ) . remove ( ) , S = c . transition ( H ) . style ( "opacity" , 1 ) , L , M = s . rangeExtent ? s . rangeExtent ( ) : P ( s . range ( ) ) , l = l . selectAll ( ".domain" ) . data ( [ 0 ] ) ; l . enter ( ) . append ( "path" ) . attr ( "class" , "domain" ) ; var l = c . transition ( l ) , I = s . copy ( ) , R = this . _ _chart _ _ || I ; this . _ _chart _ _ = I ; D . append ( "line" ) ; D . append ( "text" ) ; var Q = D . select ( "line" ) , ka = S . select ( "line" ) , ba = H . select ( "text" ) ,
Va = D . select ( "text" ) , Wa = S . select ( "text" ) ; aa = ( I ( 1 ) - I ( 0 ) ) / 2 ; H = ua ? 0 : aa ; switch ( ca ) { case "bottom" : L = n ; Q . attr ( "y2" , F ) ; Va . attr ( "y" , Math . max ( F , 0 ) + e ) ; ka . attr ( "x1" , H ) . attr ( "x2" , H ) . attr ( "y2" , F ) ; Wa . attr ( "x" , 0 ) . attr ( "y" , Math . max ( F , 0 ) + e ) ; ba . attr ( "dy" , ".71em" ) . style ( "text-anchor" , "middle" ) ; ba . text ( function ( c ) { return ja . length < T || 0 === c % Math . ceil ( ja . length / T ) ? Da ( c ) : "" } ) ; l . attr ( "d" , "M" + M [ 0 ] + "," + A + "V0H" + M [ 1 ] + "V" + A ) ; break ; case "left" : L = t , Q . attr ( "x2" , - F ) , Va . attr ( "x" , - ( Math . max ( F , 0 ) + e ) ) , ka . attr ( "x2" , - F ) . attr ( "y2" , 0 ) , Wa . attr ( "x" ,
- ( Math . max ( F , 0 ) + e ) ) . attr ( "y" , aa ) , ba . attr ( "dy" , ".32em" ) . style ( "text-anchor" , "end" ) , ba . text ( function ( c ) { return ja . length < T || 0 === c % Math . ceil ( ja . length / T ) ? Da ( c ) : "" } ) , l . attr ( "d" , "M" + - A + "," + M [ 0 ] + "H0V" + M [ 1 ] + "H" + - A ) } if ( s . ticks ) D . call ( L , R ) , S . call ( L , I ) , E . call ( L , I ) ; else { var mb = I . rangeBand ( ) / 2 , E = function ( c ) { return I ( c ) + mb } ; D . call ( L , E ) ; S . call ( L , E ) } } ) } var s = c . scale . linear ( ) , ca = "bottom" , F = 6 , A = 6 , e = 3 , ua = ! 1 , T = 10 , aa = 0 , R = null , Q = [ ] ; l . scale = function ( c ) { if ( ! arguments . length ) return s ; s = c ; return l } ; l . orient = function ( c ) { if ( ! arguments . length ) return ca ;
ca = c in { top : 1 , right : 1 , bottom : 1 , left : 1 } ? c + "" : "bottom" ; return l } ; l . categories = function ( c ) { if ( ! arguments . length ) return Q ; Q = c ; return l } ; l . tickCentered = function ( c ) { if ( ! arguments . length ) return ua ; ua = c ; return l } ; l . tickTextNum = function ( c ) { if ( ! arguments . length ) return T ; T = c ; return l } ; l . tickFormat = function ( c ) { if ( ! arguments . length ) return R ; R = c ; return l } ; l . tickOffset = function ( ) { return aa } ; l . ticks = function ( ) { } ; return l } function t ( c ) { return "undefined" === typeof c } function n ( c ) { return "undefined" !== typeof c } var nb =
P . c3 = { } , c = P . d3 ; nb . generate = function ( $ ) { var Nb , Ob , Ca , Da , l , s , ca , F , A ; function e ( a , b ) { for ( var d = $ , f = 0 ; f < a . length ; f ++ ) { if ( ! ( a [ f ] in d ) ) return b ; d = d [ a [ f ] ] } return d } function ua ( ) { ob = null === Xa ? aa ( ) : Xa ; va = T ( ) ; Pb = 20 + Qb + la ; Rb = Sb ? Sb : Tb ? pb || g ? 1 : 40 : 20 ; Ya = Ub ? Ub : qb ? 1 : 40 ; Vb = va - Qb - la ; Wb = 20 + la ; Xb = va - la ; s = 0 ; ca = Rb ; F = Pb ; A = Ya ; Ca = Vb ; Da = Wb ; l = Ya ; Nb = Xb ; Ob = Ya ; q = ob - A - ca ; p = va - s - F ; ma = va - Ca - Da } function T ( ) { var a = null === Yb ? + c . select ( wa ) . style ( "height" ) . replace ( "px" , "" ) : Yb ; return 0 < a ? a : 320 } function aa ( ) { return + c . select ( wa ) . style ( "width" ) . replace ( "px" ,
"" ) } function R ( ) { return q + 2 + A + ca } function Q ( ) { return 40 } function ja ( ) { return A + 20 } function nb ( ) { return p - s + 42 } function Mb ( ) { Zb = g ? 10 : 0 ; $b = g ? p : q ; rb = g ? 0 : p ; sb = g ? q : 1 ; m = H ( Zb , $b , n ( m ) ? m . domain ( ) : void 0 , function ( ) { return B . tickOffset ( ) } ) ; w = D ( rb , sb , n ( w ) ? w . domain ( ) : void 0 ) ; U = D ( rb , sb , n ( U ) ? U . domain ( ) : void 0 ) ; da = H ( 0 , q , n ( V ) ? V : void 0 , function ( a ) { return 0 === a % 1 ? Ea . tickOffset ( ) : 0 } ) ; Za = D ( ma , 10 ) ; $a = D ( ma , 10 ) ; B = L ( m , Vc ) ; na = c . svg . axis ( ) . scale ( w ) . orient ( Wc ) ; ab = c . svg . axis ( ) . scale ( U ) . orient ( Xc ) ; Ea = L ( da , Yc ) } function H ( a , b , d ,
f ) { var u = ( r ? c . time . scale ( ) : c . scale . linear ( ) ) . range ( [ a , b ] ) ; u . orgDomain = function ( ) { return u . domain ( ) } ; n ( d ) && u . domain ( d ) ; t ( f ) && ( f = function ( ) { return 0 } ) ; if ( W ) { var xa = u , e , u = function ( a ) { return xa ( a ) + f ( a ) } ; for ( e in xa ) u [ e ] = xa [ e ] ; u . orgDomain = function ( ) { return xa . domain ( ) } ; u . domain = function ( a ) { if ( ! arguments . length ) return a = xa . domain ( ) , [ a [ 0 ] , a [ 1 ] + 1 ] ; xa . domain ( a ) ; return u } } return u } function D ( a , b ) { return c . scale . linear ( ) . range ( [ a , b ] ) } function E ( a ) { return "y2" === M ( a ) ? U : w } function S ( a ) { return "y2" === M ( a ) ? $a : Za }
function L ( a , b ) { var d = ( W ? Sc ( ) : c . svg . axis ( ) ) . scale ( a ) . orient ( b ) ; d . tickFormat ( I ( ) ) ; W ? d . categories ( Fa ) . tickCentered ( Zc ) : d . tickOffset = function ( ) { return 0 } ; return d } function M ( a ) { return a in ac ? ac [ a ] : "y" } function I ( ) { var a = r ? $c : W ? ad : function ( a ) { return a } ; bb && ( a = "function" === typeof bb ? bb : r ? function ( a ) { return c . time . format ( bb ) ( a ) } : a ) ; return a } function Tc ( a ) { return c . min ( a , function ( a ) { return c . min ( a . values , function ( a ) { return a . value } ) } ) } function Uc ( a ) { var b = { } , d , f ; a . forEach ( function ( a ) { b [ a . id ] = [ ] ; a . values . forEach ( function ( d ) { b [ a . id ] . push ( d . value ) } ) } ) ;
for ( d = 0 ; d < v . length ; d ++ ) for ( f = 1 ; f < v [ d ] . length ; f ++ ) Ga ( v [ d ] [ f ] ) && ( t ( b [ v [ d ] [ f ] ] ) || b [ v [ d ] [ f ] ] . forEach ( function ( a , c ) { M ( v [ d ] [ f ] ) === M ( v [ d ] [ 0 ] ) && ( b [ v [ d ] [ 0 ] ] [ c ] += 1 * a ) } ) ) ; return c . max ( Object . keys ( b ) . map ( function ( a ) { return c . max ( b [ a ] ) } ) ) } function ka ( a ) { var b = cb ( function ( b ) { return M ( b . id ) === a } ) , d = "y2" === a ? bd : cd , f = "y2" === a ? dd : ed , d = null !== d ? d : Tc ( b ) , f = null !== f ? f : Uc ( b ) , u = 0.1 * Math . abs ( f - d ) , c = u , e = u , g = "y2" === a ? fd : gd ; null !== g && ( d = Math . max ( Math . abs ( d ) , Math . abs ( f ) ) , f = d - g , d = g - d ) ; "y" === a && null !== Ha && ( c = n ( Ha . top ) ? Ha . top : u ,
e = n ( Ha . bottom ) ? Ha . bottom : u ) ; "y2" === a && null !== Ia && ( c = n ( Ia . top ) ? Ia . top : u , e = n ( Ia . bottom ) ? Ia . bottom : u ) ; return [ bc ( b , "bar" ) ? 0 : d - e , f + c ] } function ba ( a ) { var b ; a ? ( a = m . domain ( ) , b = G . extent ( ) ) : ( a = V , b = m . domain ( ) ) ; return ( a [ 1 ] - a [ 0 ] ) / ( b [ 1 ] - b [ 0 ] ) } function Va ( ) { var a = W ? 0 : 0.01 * Math . abs ( ea - oa ) , b = r ? new Date ( ea . getTime ( ) - a ) : ea - a , a = r ? new Date ( oa . getTime ( ) + a ) : oa + a ; return [ b , a ] } function Wa ( a ) { for ( var b = 0 ; b < a . length ; b ++ ) if ( ! ( a [ b ] in db ) ) return ! 1 ; return ! 0 } function mb ( a ) { for ( var b = [ ] , d = 0 ; d < a . length ; d ++ ) a [ d ] in db && b . push ( cc ( db [ a [ d ] ] ) ) ;
return b } function lb ( a ) { return "start" in a ? m ( r ? pa ( a . start ) : a . start ) : 0 } function dc ( a ) { var b = lb ( a ) ; a = ( "end" in a ? m ( r ? pa ( a . end ) : a . end ) : q ) - b ; return 0 > a ? 0 : a } function ec ( a ) { return qa && a === qa || X && hd ( X , a ) } function id ( a ) { return ! ec ( a ) } function eb ( a ) { var b = Ja [ a . id ] ; a . name = n ( b ) ? b : a . id ; return a } function fc ( a ) { var b = a [ 0 ] , d = { } , f = [ ] , u , c ; for ( u = 1 ; u < a . length ; u ++ ) { d = { } ; for ( c = 0 ; c < a [ u ] . length ; c ++ ) d [ b [ c ] ] = a [ u ] [ c ] ; f . push ( d ) } return f } function gc ( a ) { var b = [ ] , d , f , c ; for ( d = 0 ; d < a . length ; d ++ ) for ( c = a [ d ] [ 0 ] , f = 1 ; f < a [ d ] . length ; f ++ ) t ( b [ f -
1 ] ) && ( b [ f - 1 ] = { } ) , b [ f - 1 ] [ c ] = a [ d ] [ f ] ; return b } function Ka ( a ) { var b = c . keys ( a [ 0 ] ) . filter ( id ) , d = c . keys ( a [ 0 ] ) . filter ( ec ) ; if ( r && 0 === d . length ) return P . alert ( 'data.x or data.xs must be specified when axis.x.type == "timeseries"' ) , [ ] ; tb && b . forEach ( function ( b ) { var c = qa ? qa : X ? X [ b ] : null ; 0 <= d . indexOf ( c ) && ( h . data . x [ b ] = a . map ( function ( a ) { return a [ c ] } ) ) } ) ; b = b . map ( function ( b ) { var d = jd ( b ) ; return { id : d , id _org : b , values : a . map ( function ( a , c ) { var e ; e = qa ? qa : X ? X [ b ] : null ; e = r ? pa ( a [ e ] ) : tb ? a [ e ] ? a [ e ] : h . data . x [ b ] [ c ] : c ; if ( e < ea || null ===
ea ) ea = e ; oa < e && ( oa = e ) ; a . x = e ; return { x : e , value : null === a [ b ] || isNaN ( a [ b ] ) ? null : + a [ b ] , id : d } } ) } } ) ; b . forEach ( function ( a ) { var b ; a . values = a . values . sort ( function ( a , b ) { return ( a . x || 0 === a . x ? a . x : Infinity ) - ( b . x || 0 === b . x ? b . x : Infinity ) } ) ; b = 0 ; a . values . forEach ( function ( a ) { a . index = b ++ } ) } ) ; b . forEach ( function ( a ) { db [ a . id _org ] = cc ( a ) } ) ; return b } function cc ( a ) { return { id : a . id , id _org : a . id _org , values : a . values . map ( function ( a ) { return { x : a . x , value : a . value , id : a . id } } ) } } function La ( ) { return c . max ( h . data . targets , function ( a ) { return a . values . length } ) }
function fb ( a ) { a = t ( a ) ? h . data . targets : a ; return a . map ( function ( a ) { return a . id } ) } function ub ( a ) { var b = fb ( ) , d ; for ( d = 0 ; d < b . length ; d ++ ) if ( b [ d ] === a ) return ! 0 ; return ! 1 } function cb ( a ) { return n ( a ) ? h . data . targets . filter ( a ) : h . data . targets } function ad ( a ) { return a < Fa . length ? Fa [ a ] : a } function vb ( a ) { return "-shapes -shapes-" + a . id } function hc ( a ) { return vb ( a ) + " -line -line-" + a . id } function kd ( a ) { return vb ( a ) + " -circles -circles-" + a . id } function ic ( a ) { return vb ( a ) + " -bars -bars-" + a . id } function ld ( a , b ) { return "-shape -shape-" +
b + " -circle -circle-" + b } function jc ( a , b ) { return "-shape -shape-" + b + " -bar -bar-" + b } function md ( a , b ) { return "region region-" + b + " " + ( "classes" in a ? [ ] . concat ( a . classes ) . join ( " " ) : "" ) } function gb ( a ) { return m ( a . x ) } function Ma ( a ) { return m ( r ? pa ( a . value ) : a . value ) } function kc ( a ) { return w ( a . value ) } function lc ( a , b ) { var d , f = a [ b ] . x , c = [ ] ; for ( d = b - 1 ; 0 <= d && f === a [ d ] . x ; d -- ) c . push ( a [ d ] ) ; for ( d = b ; d < a . length && f === a [ d ] . x ; d ++ ) c . push ( a [ d ] ) ; return c } function mc ( a , b , d , f ) { d = d ? d : 0 ; f = f ? f : a . length - 1 ; var c = Math . floor ( ( f - d ) / 2 ) + d ; 0 <
m ( a [ c ] . x ) - b [ 0 ] ? f = c : d = c ; return 1 === f - d ? ( c = [ ] , a [ d ] . x && ( c = c . concat ( lc ( a , d ) ) ) , a [ f ] . x && ( c = c . concat ( lc ( a , f ) ) ) , nc ( c , b ) ) : mc ( a , b , d , f ) } function oc ( a , b ) { var d ; d = a . map ( function ( a ) { return mc ( a . values , b ) } ) ; return nc ( d , b ) } function nc ( a , b ) { var d , f ; a . forEach ( function ( a ) { var c = wb ( a , b ) ; if ( c < d || ! d ) d = c , f = a } ) ; return f } function pc ( a , b ) { N . html ( qc ( a ) ) . style ( "visibility" , "hidden" ) . style ( "display" , "block" ) ; var d = N . property ( "offsetWidth" ) , f = N . property ( "offsetHeight" ) ; N . style ( "top" , ( b [ 1 ] + 15 + f < T ( ) ? b [ 1 ] + 15 : b [ 1 ] - f ) + "px" ) . style ( "left" ,
g ? b [ 0 ] : m ( a [ 0 ] . x ) + 60 + d < ( null === Xa ? aa ( ) : Xa ) ? m ( a [ 0 ] . x ) + 60 + "px" : m ( a [ 0 ] . x ) - d + 30 + "px" ) . style ( "visibility" , "visible" ) } function rc ( a ) { bc ( h . data . targets , "scatter" ) || k . selectAll ( "line.xgrid-focus" ) . style ( "visibility" , "visible" ) . data ( [ a ] ) . attr ( g ? "y1" : "x1" , gb ) . attr ( g ? "y2" : "x2" , gb ) } function sc ( ) { k . select ( "line.xgrid-focus" ) . style ( "visibility" , "hidden" ) } function fa ( a ) { return a . x || 0 === a . x ? m ( a . x ) : null } function ga ( a ) { return E ( a . id ) ( a . value ) } function nd ( ) { var a = { } , b = 0 , d , f ; cb ( Ga ) . forEach ( function ( c ) { for ( d = 0 ; d < v . length ; d ++ ) if ( ! ( 0 >
v [ d ] . indexOf ( c . id ) ) ) for ( f = 0 ; f < v [ d ] . length ; f ++ ) if ( v [ d ] [ f ] in a ) { a [ c . id ] = a [ v [ d ] [ f ] ] ; break } t ( a [ c . id ] ) && ( a [ c . id ] = b ++ ) } ) ; a . _ _max _ _ = b - 1 ; return a } function tc ( a , b , d , f ) { var c = f ? da : m ; return b ? function ( f ) { var e = f . id in d ? d [ f . id ] : 0 ; return f . x || 0 === f . x ? c ( f . x ) - a * ( b / 2 - e ) : 0 } : function ( ) { return 0 } } function uc ( a , b , d , f ) { var c = Object . keys ( b ) ; return function ( e , g ) { var h = 0 , k = f ? S ( e . id ) : E ( e . id ) ; cb ( Ga ) . forEach ( function ( d ) { d . id !== e . id && b [ d . id ] === b [ e . id ] && c . indexOf ( d . id ) < c . indexOf ( e . id ) && ( h += a ( d . values [ g ] ) ) } ) ; return d ? h : k ( e . value ) -
h } } function vc ( a , b ) { var d = null === a ? function ( a ) { return a } : function ( b ) { return a > b ? a - b : 0 } ; return function ( a ) { var c = b ? S ( a . id ) : E ( a . id ) ; return d ( c ( a . value ) ) } } function Na ( a , b ) { var d = t ( a ) ? fb ( ) : a ; "string" === typeof d && ( d = [ d ] ) ; for ( var f = 0 ; f < d . length ; f ++ ) O [ d [ f ] ] = b } function bc ( a , b ) { var d = ! 1 ; a . forEach ( function ( a ) { O [ a . id ] === b && ( d = ! 0 ) ; a . id in O || "line" !== b || ( d = ! 0 ) } ) ; return d } function xb ( a ) { a = "string" === typeof a ? a : a . id ; return ! ( a in O ) || "line" === O [ a ] || "spline" === O [ a ] } function Ga ( a ) { return "bar" === O [ "string" === typeof a ?
a : a . id ] } function wc ( a ) { return Ga ( a ) ? a . values : [ ] } function od ( a ) { var b ; ( b = xb ( a ) ) || ( b = "scatter" === O [ "string" === typeof a ? a : a . id ] ) ; return b ? a . values : [ ] } function pa ( a ) { var b ; if ( ! a ) throw Error ( a + " can not be parsed as d3.time with format " + yb + ". Maybe 'x' of this data is not defined. See data.x or data.xs option." ) ; b = c . time . format ( yb ) . parse ( a ) ; if ( ! b ) throw Error ( "Failed to parse '" + a + "' with format " + yb ) ; return b } function xc ( a , b ) { var d = c . mouse ( a ) , f = c . select ( a ) , e = 1 * f . attr ( "cx" ) , f = 1 * f . attr ( "cy" ) ; return Math . sqrt ( Math . pow ( e -
d [ 0 ] , 2 ) + Math . pow ( f - d [ 1 ] , 2 ) ) < b } function yc ( a ) { var b = c . mouse ( a ) , d = c . select ( a ) ; a = 1 * d . attr ( "x" ) ; var f = 1 * d . attr ( "y" ) , d = 1 * d . attr ( "width" ) ; return a - 10 < b [ 0 ] && b [ 0 ] < a + d + 10 && f - 10 < b [ 1 ] } function pd ( a , b ) { var d ; for ( d = 0 ; d < b . length ; d ++ ) if ( b [ d ] . start < a && a <= b [ d ] . end ) return ! 0 ; return ! 1 } function hd ( a , b ) { var d = ! 1 ; Object . keys ( a ) . forEach ( function ( f ) { a [ f ] === b && ( d = ! 0 ) } ) ; return d } function wb ( a , b ) { return Math . pow ( m ( a . x ) - b [ 0 ] , 2 ) + Math . pow ( w ( a . value ) - b [ 1 ] , 2 ) } function zc ( a , b , d ) { qd ( a , b ) ; k . select ( ".selected-circles-" + b . id ) . selectAll ( ".selected-circle-" +
d ) . data ( [ b ] ) . enter ( ) . append ( "circle" ) . attr ( "class" , function ( ) { return "selected-circle selected-circle-" + d } ) . attr ( "cx" , g ? ga : fa ) . attr ( "cy" , g ? fa : ga ) . attr ( "stroke" , function ( ) { return Y ( b . id ) } ) . attr ( "r" , 1.4 * Oa ) . transition ( ) . duration ( 100 ) . attr ( "r" , Oa ) } function zb ( a , b , d ) { rd ( a , b ) ; k . select ( ".selected-circles-" + b . id ) . selectAll ( ".selected-circle-" + d ) . transition ( ) . duration ( 100 ) . attr ( "r" , 0 ) . remove ( ) } function Ac ( a , b , d , f ) { a ? zc ( b , d , f ) : zb ( b , d , f ) } function sd ( ) { } function Bc ( ) { } function Cc ( a , b , d , f ) { } function Dc ( a ) { return a . filter ( function ( a ) { return null !==
a . value } ) } function Ab ( a , b ) { return ( b ? k . selectAll ( ".-circles-" + b ) : k ) . selectAll ( ".-circle" + ( a || 0 === a ? "-" + a : "" ) ) } function Bb ( a ) { Ab ( a ) . filter ( function ( ) { return c . select ( this ) . classed ( Z ) } ) . classed ( Z , ! 1 ) . attr ( "r" , Cb ) } function Ec ( a ) { return k . selectAll ( ".-bar" + ( a || 0 === a ? "-" + a : "" ) ) } function td ( a , b , d , f ) { var c , e , h = "M" , k , m , l , Fc , q , p = [ ] ; if ( n ( f ) ) for ( c = 0 ; c < f . length ; c ++ ) p [ c ] = { } , t ( f [ c ] . start ) ? p [ c ] . start = a [ 0 ] . x : p [ c ] . start = r ? pa ( f [ c ] . start ) : f [ c ] . start , t ( f [ c ] . end ) ? p [ c ] . end = a [ a . length - 1 ] . x : p [ c ] . end = r ? pa ( f [ c ] . end ) : f [ c ] . end ;
Fc = g ? function ( a ) { return d ( a . value ) } : function ( a ) { return b ( a . x ) } ; q = g ? function ( a ) { return b ( a . x ) } : function ( a ) { return d ( a . value ) } ; f = r ? function ( a , c , f , e ) { var g = a . x . getTime ( ) ; a = c . x - a . x ; c = new Date ( g + a * ( f + e ) ) ; return "M" + b ( new Date ( g + a * f ) ) + " " + d ( m ( f ) ) + " " + b ( c ) + " " + d ( m ( f + e ) ) } : function ( a , c , f , e ) { return "M" + b ( k ( f ) ) + " " + d ( m ( f ) ) + " " + b ( k ( f + e ) ) + " " + d ( m ( f + e ) ) } ; for ( c = 0 ; c < a . length ; c ++ ) if ( t ( p ) || ! pd ( a [ c ] . x , p ) ) h += " " + Fc ( a [ c ] ) + " " + q ( a [ c ] ) ; else { k = H ( a [ c - 1 ] . x , a [ c ] . x ) ; m = D ( a [ c - 1 ] . value , a [ c ] . value ) ; e = b ( a [ c ] . x ) - b ( a [ c - 1 ] . x ) ; l = d ( a [ c ] . value ) -
d ( a [ c - 1 ] . value ) ; e = Math . sqrt ( Math . pow ( e , 2 ) + Math . pow ( l , 2 ) ) ; l = 2 / e ; var s = 2 * l ; for ( e = l ; 1 >= e ; e += s ) h += f ( a [ c - 1 ] , a [ c ] , e , l ) } return h } function Db ( a ) { var b , d ; hb = c . select ( wa ) ; if ( hb . empty ( ) ) P . alert ( 'No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".' ) ; else { hb . html ( "" ) ; h . data . x = { } ; h . data . targets = Ka ( a ) ; Gc && Na ( fb ( ) . filter ( function ( a ) { return ! ( a in O ) } ) , Gc ) ; ua ( ) ; Mb ( ) ; m . domain ( c . extent ( Va ( ) ) ) ; w . domain ( ka ( "y" ) ) ; U . domain ( ka ( "y2" ) ) ; da . domain ( m . domain ( ) ) ;
Za . domain ( w . domain ( ) ) ; $a . domain ( U . domain ( ) ) ; B . ticks ( 10 > a . length ? a . length : 10 ) ; na . ticks ( ud ) . outerTickSize ( 0 ) . tickFormat ( vd ) ; ab . ticks ( wd ) . outerTickSize ( 0 ) . tickFormat ( xd ) ; V = m . domain ( ) ; G . x ( da ) ; ra && C . x ( m ) ; Pa = c . select ( wa ) . append ( "svg" ) . attr ( "width" , q + A + ca ) . attr ( "height" , p + s + F ) . on ( "mouseenter" , yd ) . on ( "mouseleave" , zd ) ; ib = Pa . append ( "defs" ) ; ib . append ( "clipPath" ) . attr ( "id" , Eb ) . append ( "rect" ) . attr ( "y" , s ) . attr ( "width" , q ) . attr ( "height" , p - s ) ; ib . append ( "clipPath" ) . attr ( "id" , "xaxis-clip" ) . append ( "rect" ) . attr ( "x" , - 1 -
A ) . attr ( "y" , - 20 ) . attr ( "width" , R ) . attr ( "height" , Q ) ; ib . append ( "clipPath" ) . attr ( "id" , "yaxis-clip" ) . append ( "rect" ) . attr ( "x" , - A + 1 ) . attr ( "y" , s - 1 ) . attr ( "width" , ja ) . attr ( "height" , nb ) ; k = Pa . append ( "g" ) . attr ( "transform" , J . main ) ; x = ya ? Pa . append ( "g" ) . attr ( "transform" , J . context ) : null ; za = Aa ? Pa . append ( "g" ) . attr ( "transform" , J . legend ) : null ; N = c . select ( wa ) . style ( "position" , "relative" ) . append ( "div" ) . style ( "position" , "absolute" ) . style ( "z-index" , "10" ) . style ( "display" , "none" ) ; k . append ( "g" ) . attr ( "class" , "x axis" ) . attr ( "clip-path" ,
g ? "" : "url(#xaxis-clip)" ) . attr ( "transform" , J . x ) . call ( g ? na : B ) . append ( "text" ) . attr ( "class" , "-axis-x-label" ) . attr ( "x" , q ) . attr ( "dy" , "-.5em" ) . style ( "text-anchor" , "end" ) . text ( Ad ) ; k . append ( "g" ) . attr ( "class" , "y axis" ) . attr ( "clip-path" , g ? "url(#yaxis-clip)" : "" ) . call ( g ? B : na ) . append ( "text" ) . attr ( "transform" , "rotate(-90)" ) . attr ( "dy" , "1.2em" ) . attr ( "dx" , "-.5em" ) . style ( "text-anchor" , "end" ) . text ( Bd ) ; Tb && k . append ( "g" ) . attr ( "class" , "y2 axis" ) . attr ( "transform" , J . y2 ) . call ( ab ) ; b = k . append ( "g" ) . attr ( "clip-path" , Qa ) . attr ( "class" ,
"grid" ) ; Hc && b . append ( "g" ) . attr ( "class" , "xgrids" ) ; Fb && ( d = b . append ( "g" ) . attr ( "class" , "xgrid-lines" ) . selectAll ( ".xgrid-line" ) . data ( Fb ) . enter ( ) . append ( "g" ) . attr ( "class" , "xgrid-line" ) , d . append ( "line" ) . attr ( "class" , function ( a ) { return "" + a [ "class" ] } ) , d . append ( "text" ) . attr ( "class" , function ( a ) { return "" + a [ "class" ] } ) . attr ( "text-anchor" , "end" ) . attr ( "transform" , g ? "" : "rotate(-90)" ) . attr ( "dx" , g ? 0 : - s ) . attr ( "dy" , - 6 ) . text ( function ( a ) { return a . text } ) ) ; Cd && b . append ( "g" ) . attr ( "class" , "xgrid-focus" ) . append ( "line" ) . attr ( "class" ,
"xgrid-focus" ) . attr ( "x1" , g ? 0 : - 10 ) . attr ( "x2" , g ? q : - 10 ) . attr ( "y1" , g ? - 10 : s ) . attr ( "y2" , g ? - 10 : p ) ; Ic && b . append ( "g" ) . attr ( "class" , "ygrids" ) ; Gb && b . append ( "g" ) . attr ( "class" , "ygrid-lines" ) . selectAll ( "ygrid-line" ) . data ( Gb ) . enter ( ) . append ( "line" ) . attr ( "class" , function ( a ) { return "ygrid-line " + a [ "class" ] } ) ; k . append ( "g" ) . attr ( "clip-path" , Qa ) . attr ( "class" , "regions" ) ; k . append ( "g" ) . attr ( "clip-path" , Qa ) . attr ( "class" , "chart" ) ; b = k . select ( ".chart" ) . append ( "g" ) . attr ( "class" , "event-rects" ) . style ( "fill-opacity" , 0 ) . style ( "cursor" ,
ra ? "ew-resize" : null ) ; X ? Dd ( b ) : Ed ( b , a ) ; k . select ( ".chart" ) . append ( "g" ) . attr ( "class" , "chart-bars" ) ; k . select ( ".chart" ) . append ( "g" ) . attr ( "class" , "chart-lines" ) ; if ( ra ) k . insert ( "rect" , Fd ? null : "g.grid" ) . attr ( "class" , "zoom-rect" ) . attr ( "width" , q ) . attr ( "height" , p ) . style ( "opacity" , 0 ) . style ( "cursor" , "ew-resize" ) . call ( C ) . on ( "dblclick.zoom" , null ) ; null !== jb && G . extent ( "function" !== typeof jb ? jb : jb ( ea , oa ) ) ; ya && ( x . append ( "g" ) . attr ( "clip-path" , Qa ) . attr ( "class" , "chart" ) , x . select ( ".chart" ) . append ( "g" ) . attr ( "class" , "chart-bars" ) ,
x . select ( ".chart" ) . append ( "g" ) . attr ( "class" , "chart-lines" ) , x . append ( "g" ) . attr ( "clip-path" , Qa ) . attr ( "class" , "x brush" ) . call ( G ) . selectAll ( "rect" ) . attr ( "height" , ma ) , x . append ( "g" ) . attr ( "class" , "x axis" ) . attr ( "transform" , J . subx ) . call ( Ea ) ) ; Aa && kb ( h . data . targets ) ; Jc ( h . data . targets ) ; z ( { withTransition : ! 1 , withUpdateXDomain : ! 0 } ) ; if ( Gd ) { if ( r && "string" === typeof Ba ) { Ba = pa ( Ba ) ; for ( a = 0 ; a < h . data . targets [ 0 ] . values . length && 0 !== h . data . targets [ 0 ] . values [ a ] . x - Ba ; a ++ ) ; Ba = a } N . html ( qc ( h . data . targets . map ( function ( a ) { return eb ( a . values [ Ba ] ) } ) ) ) ;
N . style ( "top" , Kc . top ) . style ( "left" , Kc . left ) . style ( "display" , "block" ) } null == P . onresize && ( P . onresize = Hd ) } } function Ed ( a , b ) { a . selectAll ( ".event-rects" ) . data ( b ) . enter ( ) . append ( "rect" ) . attr ( "class" , function ( a , b ) { return "event-rect event-rect-" + b } ) . style ( "cursor" , ha && sa ? "pointer" : null ) . on ( "mouseover" , function ( a , b ) { if ( ! Ra ) { var c = h . data . targets . map ( function ( a ) { return eb ( a . values [ b ] ) } ) , e , g ; if ( 0 < Object . keys ( Ja ) . length ) { g = [ ] ; for ( var k in Ja ) for ( e = 0 ; e < c . length ; e ++ ) if ( c [ e ] . id === k ) { g . push ( c [ e ] ) ; c . shift ( e ) ; break } c =
g . concat ( c ) } Hb && Ab ( b , void 0 ) . classed ( Z , ! 0 ) . attr ( "r" , Ib ) ; Ec ( b ) . classed ( Z , ! 1 ) ; rc ( c [ 0 ] ) } } ) . on ( "mouseout" , function ( a , b ) { sc ( ) ; N . style ( "display" , "none" ) ; Bb ( b ) ; Ec ( void 0 ) . classed ( Z , ! 1 ) } ) . on ( "mousemove" , function ( a , b ) { var e ; Ra || ( e = h . data . targets . map ( function ( a ) { return eb ( a . values [ b ] ) } ) , pc ( e , c . mouse ( this ) ) , ha && ( sa || k . selectAll ( ".-shape-" + b ) . filter ( function ( a ) { return ta ( a ) } ) . each ( function ( ) { var a = c . select ( this ) . classed ( Z , ! 0 ) ; "circle" === this . nodeName && a . attr ( "r" , Ib ) ; c . select ( ".event-rect-" + b ) . style ( "cursor" ,
null ) } ) . filter ( function ( ) { var a = c . select ( this ) ; if ( "circle" === this . nodeName ) return xc ( this , Oa ) ; if ( "rect" === this . nodeName ) return yc ( this , a . attr ( "x" ) , a . attr ( "y" ) ) } ) . each ( function ( ) { var a = c . select ( this ) ; a . classed ( Z ) || ( a . classed ( Z , ! 0 ) , "circle" === this . nodeName && a . attr ( "r" , Oa ) ) ; c . select ( ".event-rect-" + b ) . style ( "cursor" , "pointer" ) } ) ) ) } ) . on ( "click" , function ( a , b ) { Jb ? Jb = ! 1 : k . selectAll ( ".-shape-" + b ) . each ( function ( a ) { Lc ( this , a , b ) } ) } ) . call ( c . behavior . drag ( ) . origin ( Object ) . on ( "drag" , function ( ) { Mc ( c . mouse ( this ) ) } ) . on ( "dragstart" ,
function ( ) { Nc ( c . mouse ( this ) ) } ) . on ( "dragend" , function ( ) { Oc ( ) } ) ) . call ( C ) . on ( "dblclick.zoom" , null ) } function Dd ( a ) { a . append ( "rect" ) . attr ( "x" , 0 ) . attr ( "y" , 0 ) . attr ( "width" , q ) . attr ( "height" , p ) . attr ( "class" , "event-rect" ) . on ( "mouseout" , function ( ) { sc ( ) ; N . style ( "display" , "none" ) ; Bb ( ) } ) . on ( "mousemove" , function ( ) { var a , d , f ; Ra || ( a = c . mouse ( this ) , d = oc ( h . data . targets , a ) , f = [ eb ( d ) ] , pc ( f , a ) , Hb && ( Bb ( ) , Ab ( d . index , d . id ) . classed ( Z , ! 0 ) . attr ( "r" , Ib ) ) , rc ( f [ 0 ] ) , 100 > wb ( d , a ) ? c . select ( ".event-rect" ) . style ( "cursor" , "pointer" ) : c . select ( ".event-rect" ) . style ( "cursor" ,
null ) ) } ) . on ( "click" , function ( ) { var a = c . mouse ( this ) , d = oc ( h . data . targets , a ) ; 100 > wb ( d , a ) && k . select ( ".-circles-" + d . id ) . select ( ".-circle-" + d . index ) . each ( function ( ) { Lc ( this , d , d . index ) } ) } ) . call ( c . behavior . drag ( ) . origin ( Object ) . on ( "drag" , function ( ) { Mc ( c . mouse ( this ) ) } ) . on ( "dragstart" , function ( ) { Nc ( c . mouse ( this ) ) } ) . on ( "dragend" , function ( ) { Oc ( ) } ) ) . call ( C ) . on ( "dblclick.zoom" , null ) } function Lc ( a , b , d ) { var f = c . select ( a ) , e = f . classed ( ia ) , g = ! 1 , h ; "circle" === a . nodeName ? ( g = xc ( a , 1.5 * Oa ) , h = Ac ) : "rect" === a . nodeName && ( g = yc ( a ) ,
h = Cc ) ; if ( sa || g ) ha && ta ( b ) && ( f . classed ( ia , ! e ) , h ( ! e , f , b , d ) ) , Id ( b , f ) } function Mc ( a ) { if ( ha && ( ! ra || C . altDomain ) ) { var b = Kb [ 0 ] , d = Kb [ 1 ] , f = a [ 0 ] ; a = a [ 1 ] ; var e = Math . min ( b , f ) , g = Math . max ( b , f ) , h = sa ? s : Math . min ( d , a ) , m = sa ? p : Math . max ( d , a ) ; k . select ( ".dragarea" ) . attr ( "x" , e ) . attr ( "y" , h ) . attr ( "width" , g - e ) . attr ( "height" , m - h ) ; k . selectAll ( ".-shapes" ) . selectAll ( ".-shape" ) . filter ( function ( a ) { return ta ( a ) } ) . each ( function ( a , b ) { var d = c . select ( this ) , f = d . classed ( ia ) , k = d . classed ( Lb ) , l , n , p , q ; l = ! 1 ; "circle" === this . nodeName ? ( l = 1 * d . attr ( "cx" ) ,
n = 1 * d . attr ( "cy" ) , q = Ac , l = e < l && l < g && h < n && n < m ) : "rect" === this . nodeName && ( l = 1 * d . attr ( "x" ) , n = 1 * d . attr ( "y" ) , p = 1 * d . attr ( "width" ) , q = Cc , l = e < l + p && l < g && n < m ) ; l ^ k && ( d . classed ( Lb , ! k ) , d . classed ( ia , ! f ) , q ( ! f , d , a , b ) ) } ) } } function Nc ( a ) { ha && ( Kb = a , k . select ( ".chart" ) . append ( "rect" ) . attr ( "class" , "dragarea" ) . style ( "opacity" , 0.1 ) , Ra = ! 0 ) } function Oc ( ) { ha && ( k . select ( ".dragarea" ) . transition ( ) . duration ( 100 ) . style ( "opacity" , 0 ) . remove ( ) , k . selectAll ( ".-shape" ) . classed ( Lb , ! 1 ) , Ra = ! 1 ) } function z ( a ) { var b , d , f = nd ( ) , e = f . _ _max _ _ + 1 , l , y ,
t , v , r ; a = n ( a ) ? a : { } ; b = n ( a . withY ) ? a . withY : ! 0 ; v = n ( a . withSubchart ) ? a . withSubchart : ! 0 ; r = n ( a . withTransition ) ? a . withTransition : ! 0 ; a = n ( a . withUpdateXDomain ) ? a . withUpdateXDomain : ! 1 ; r = r ? 250 : 0 ; a && ( m . domain ( G . empty ( ) ? V : G . extent ( ) ) , ra && C . x ( m ) . updateScaleExtent ( ) ) ; w . domain ( ka ( "y" ) ) ; U . domain ( ka ( "y2" ) ) ; k . select ( ".x.axis" ) . transition ( ) . duration ( g ? r : 0 ) . call ( g ? na : B ) ; k . select ( ".y.axis" ) . transition ( ) . duration ( g ? 0 : r ) . call ( g ? B : na ) ; k . select ( ".y2.axis" ) . transition ( ) . call ( ab ) ; k . select ( ".x.axis .-axis-x-label" ) . attr ( "x" , q ) ; Za . domain ( w . domain ( ) ) ;
$a . domain ( U . domain ( ) ) ; N . style ( "display" , "none" ) ; k . select ( "line.xgrid-focus" ) . style ( "visibility" , "hidden" ) . attr ( "y2" , p ) ; if ( Hc ) { if ( "year" === Jd ) for ( a = [ ] , y = ea . getFullYear ( ) , l = oa . getFullYear ( ) ; y <= l ; y ++ ) a . push ( new Date ( y + "-01-01 00:00:00" ) ) ; else a = m . ticks ( 10 ) ; a = k . select ( ".xgrids" ) . selectAll ( ".xgrid" ) . data ( a ) ; a . enter ( ) . append ( "line" ) . attr ( "class" , "xgrid" ) ; a . attr ( "x1" , g ? 0 : function ( a ) { return m ( a ) - B . tickOffset ( ) } ) . attr ( "x2" , g ? q : function ( a ) { return m ( a ) - B . tickOffset ( ) } ) . attr ( "y1" , g ? function ( a ) { return m ( a ) - B . tickOffset ( ) } :
s ) . attr ( "y2" , g ? function ( a ) { return m ( a ) - B . tickOffset ( ) } : p ) . style ( "opacity" , function ( ) { return + c . select ( this ) . attr ( g ? "y1" : "x1" ) === ( g ? p : 0 ) ? 0 : 1 } ) ; a . exit ( ) . remove ( ) } Fb && ( a = k . selectAll ( ".xgrid-lines" ) , a . selectAll ( "line" ) . attr ( "x1" , g ? 0 : Ma ) . attr ( "x2" , g ? q : Ma ) . attr ( "y1" , g ? Ma : s ) . attr ( "y2" , g ? Ma : p ) , a . selectAll ( "text" ) . attr ( "x" , g ? q : 0 ) . attr ( "y" , Ma ) ) ; b && Ic && ( a = k . select ( ".ygrids" ) . selectAll ( ".ygrid" ) . data ( w . ticks ( 10 ) ) , a . enter ( ) . append ( "line" ) . attr ( "class" , "ygrid" ) , a . attr ( "x1" , g ? w : 0 ) . attr ( "x2" , g ? w : q ) . attr ( "y1" , g ? 0 :
w ) . attr ( "y2" , g ? p : w ) , a . exit ( ) . remove ( ) ) ; b && Gb && k . select ( ".ygrid-lines" ) . selectAll ( ".ygrid-line" ) . attr ( "y1" , kc ) . attr ( "y2" , kc ) ; l = W ? e ? 1.2 * B . tickOffset ( ) / e : 0 : 0.6 * ( ( g ? p : q ) * ba ( ! 1 ) / ( La ( ) - 1 ) ) ; y = vc ( g ? null : p ) ; b = tc ( l , e , f ) ; a = uc ( y , f , g ) ; d = k . selectAll ( ".-bars" ) . selectAll ( ".-bar" ) . data ( wc ) ; d . transition ( ) . duration ( r ) . attr ( "x" , g ? a : b ) . attr ( "y" , g ? b : a ) . attr ( "width" , g ? y : l ) . attr ( "height" , g ? l : y ) ; d . enter ( ) . append ( "rect" ) . attr ( "class" , jc ) . attr ( "x" , g ? a : b ) . attr ( "y" , g ? b : a ) . attr ( "width" , g ? y : l ) . attr ( "height" , g ? l : y ) . style ( "opacity" ,
0 ) . transition ( ) . duration ( r ) . style ( "opacity" , 1 ) ; d . exit ( ) . transition ( ) . duration ( r ) . style ( "opacity" , 0 ) . remove ( ) ; k . selectAll ( ".-line" ) . transition ( ) . duration ( r ) . attr ( "d" , Kd ) ; b = k . selectAll ( ".-circles" ) . selectAll ( ".-circle" ) . data ( od ) ; b . transition ( ) . duration ( r ) . style ( "opacity" , function ( a ) { return null === a . value ? 0 : 1 } ) . attr ( "cx" , g ? ga : fa ) . attr ( "cy" , g ? fa : ga ) ; b . enter ( ) . append ( "circle" ) . style ( "opacity" , function ( a ) { return null === a . value ? 0 : 1 } ) . attr ( "class" , ld ) . attr ( "cx" , g ? ga : fa ) . attr ( "cy" , g ? fa : ga ) . attr ( "r" , Cb ) ; b . exit ( ) . remove ( ) ;
ya && ( null !== c . event && "zoom" === c . event . type && G . extent ( m . orgDomain ( ) ) . update ( ) , v && ( x . select ( ".x.axis" ) . transition ( ) . duration ( g ? r : 0 ) . call ( g ? na : Ea ) , G . empty ( ) || G . extent ( m . orgDomain ( ) ) . update ( ) , l = W ? e ? 1.2 * Ea . tickOffset ( ) / e : 0 : 0.6 * ( ( g ? p : q ) * ba ( ! 0 ) / ( La ( ) - 1 ) ) , y = vc ( ma , ! 0 ) , b = tc ( l , e , f , ! 0 ) , a = uc ( y , f , ! 1 , ! 0 ) , f = x . selectAll ( ".-bars" ) . selectAll ( ".-bar" ) . data ( wc ) , f . transition ( ) . duration ( r ) . attr ( "x" , b ) . attr ( "y" , a ) . attr ( "width" , l ) . attr ( "height" , y ) , f . enter ( ) . append ( "rect" ) . attr ( "class" , jc ) . attr ( "x" , b ) . attr ( "y" , a ) . attr ( "width" ,
l ) . attr ( "height" , y ) . style ( "opacity" , 0 ) . transition ( ) . style ( "opacity" , 1 ) , f . exit ( ) . transition ( ) . style ( "opacity" , 0 ) . remove ( ) , x . selectAll ( ".-line" ) . transition ( ) . duration ( r ) . attr ( "d" , Ld ) ) ) ; k . selectAll ( ".selected-circles" ) . filter ( function ( a ) { return Ga ( a ) } ) . selectAll ( "circle" ) . remove ( ) ; k . selectAll ( ".selected-circle" ) . transition ( ) . duration ( r ) . attr ( "cx" , g ? ga : fa ) . attr ( "cy" , g ? fa : ga ) ; X || ( tb ? ( t = function ( a , b ) { var d = 0 < b ? h . data . targets [ 0 ] . values [ b - 1 ] . x : void 0 , c = b < La ( ) - 1 ? h . data . targets [ 0 ] . values [ b + 1 ] . x : void 0 ; return ( m ( c ?
c : a . x + 50 ) - m ( d ? d : a . x - 50 ) ) / 2 } , f = function ( a , b ) { var d = 0 < b ? h . data . targets [ 0 ] . values [ b - 1 ] . x : void 0 ; return ( m ( a . x ) + m ( d ? d : a . x - 50 ) ) / 2 } ) : ( t = ( g ? p : q ) * ba ( ) / ( La ( ) - 1 ) , f = function ( a ) { return m ( a . x ) - t / 2 } ) , k . selectAll ( ".event-rect" ) . attr ( "x" , g ? 0 : f ) . attr ( "y" , g ? f : 0 ) . attr ( "width" , g ? q : t ) . attr ( "height" , g ? t : p ) ) ; f = k . select ( ".regions" ) . selectAll ( "rect.region" ) . data ( K ) ; f . enter ( ) . append ( "rect" ) ; f . attr ( "class" , md ) . attr ( "x" , g ? 0 : lb ) . attr ( "y" , g ? lb : s ) . attr ( "width" , g ? q : dc ) . attr ( "height" , g ? dc : p ) . style ( "fill-opacity" , function ( a ) { return n ( a . opacity ) ?
a . opacity : 0.1 } ) ; f . exit ( ) . transition ( ) . duration ( r ) . style ( "fill-opacity" , 0 ) . remove ( ) } function Md ( ) { "mousemove" === c . event . sourceEvent . type && C . altDomain ? ( m . domain ( C . altDomain ) , C . x ( m ) . updateScaleExtent ( ) ) : ( W && m . orgDomain ( ) [ 0 ] === V [ 0 ] && m . domain ( [ V [ 0 ] - 1E-10 , m . orgDomain ( ) [ 1 ] ] ) , z ( { withTransition : ! 1 , withY : ! 1 , withSubchart : ! 1 } ) , "mousemove" === c . event . sourceEvent . type && ( Jb = ! 0 ) ) } function Hd ( ) { ua ( ) ; Mb ( ) ; G . x ( da ) ; ra && C . x ( m ) ; c . select ( "svg" ) . attr ( "width" , ob ) . attr ( "height" , va ) ; c . select ( "#" + Eb ) . select ( "rect" ) . attr ( "width" ,
q ) . attr ( "height" , p ) ; c . select ( "#xaxis-clip" ) . select ( "rect" ) . attr ( "width" , R ) ; c . select ( ".zoom-rect" ) . attr ( "width" , q ) . attr ( "height" , p ) ; k . select ( ".x.axis" ) . attr ( "transform" , J . x ) ; k . select ( ".y2.axis" ) . attr ( "transform" , J . y2 ) ; ya && ( x . select ( ".x.brush" ) . selectAll ( "rect" ) . attr ( "height" , ma ) , x . attr ( "transform" , J . context ) , x . select ( ".x.axis" ) . attr ( "transform" , J . subx ) ) ; Aa && ( za . attr ( "transform" , J . legend ) , kb ( h . data . targets , { withTransition : ! 1 } ) ) ; z ( { withTransition : ! 1 , withUpdateXDomain : ! 0 } ) } function Jc ( a ) { var b ; k . select ( ".chart-bars" ) . selectAll ( ".chart-bar" ) . data ( a ) . enter ( ) . append ( "g" ) . attr ( "class" ,
function ( a ) { return "chart-bar target target-" + a . id } ) . style ( "pointer-events" , "none" ) . style ( "opacity" , 0 ) . append ( "g" ) . attr ( "class" , ic ) . style ( "fill" , function ( a ) { return Y ( a . id ) } ) . style ( "stroke" , function ( a ) { return Y ( a . id ) } ) . style ( "stroke-width" , 0 ) . style ( "cursor" , function ( a ) { return ta ( a ) ? "pointer" : null } ) ; b = k . select ( ".chart-lines" ) . selectAll ( ".chart-line" ) . data ( a ) . enter ( ) . append ( "g" ) . attr ( "class" , function ( a ) { return "chart-line target target-" + a . id } ) . style ( "pointer-events" , "none" ) . style ( "opacity" , 0 ) ; b . append ( "path" ) . attr ( "class" ,
hc ) . style ( "stroke" , function ( a ) { return Y ( a . id ) } ) ; b . append ( "g" ) . attr ( "class" , function ( a ) { return "selected-circles selected-circles-" + a . id } ) ; b . append ( "g" ) . attr ( "class" , kd ) . style ( "fill" , function ( a ) { return Y ( a . id ) } ) . style ( "cursor" , function ( a ) { return ta ( a ) ? "pointer" : null } ) ; a . forEach ( function ( a ) { k . selectAll ( ".selected-circles-" + a . id ) . selectAll ( ".selected-circle" ) . each ( function ( b ) { b . value = a . values [ b . x ] . value } ) } ) ; ya && ( b = x . select ( ".chart-bars" ) . selectAll ( ".chart-bar" ) . data ( a ) , b = b . enter ( ) . append ( "g" ) . attr ( "class" ,
function ( a ) { return "chart-bar target target-" + a . id } ) . style ( "opacity" , 0 ) , b . append ( "g" ) . attr ( "class" , ic ) . style ( "fill" , function ( a ) { return Y ( a . id ) } ) , b = x . select ( ".chart-lines" ) . selectAll ( ".chart-line" ) . data ( a ) , b = b . enter ( ) . append ( "g" ) . attr ( "class" , function ( a ) { return "chart-line target target-" + a . id } ) . style ( "opacity" , 0 ) , b . append ( "path" ) . attr ( "class" , hc ) . style ( "stroke" , function ( a ) { return Y ( a . id ) } ) ) ; Aa && kb ( a ) ; c . selectAll ( ".target" ) . transition ( ) . style ( "opacity" , 1 ) } function Sa ( a , b ) { h . data . targets . forEach ( function ( b ) { for ( var c =
0 ; c < a . length ; c ++ ) if ( b . id === a [ c ] . id ) { b . values = a [ c ] . values ; a . splice ( c , 1 ) ; break } } ) ; h . data . targets = h . data . targets . concat ( a ) ; Jc ( h . data . targets ) ; z ( ) ; b ( ) } function kb ( a , b ) { var d = fb ( a ) , f , e = q / 2 - Ta * Object . keys ( a ) . length / 2 , g ; b = t ( b ) ? { } : b ; g = n ( b . withTransition ) ? b . withTransition : ! 0 ; f = za . selectAll ( ".legend-item" ) . data ( d ) . enter ( ) . append ( "g" ) . attr ( "class" , function ( a ) { return "legend-item legend-item-" + a } ) . style ( "cursor" , "pointer" ) . on ( "click" , function ( a ) { Nd ( a ) } ) . on ( "mouseover" , function ( a ) { c . selectAll ( ".legend-item" ) . filter ( function ( b ) { return b !==
a } ) . transition ( ) . duration ( 100 ) . style ( "opacity" , 0.3 ) ; h . focus ( a ) } ) . on ( "mouseout" , function ( ) { c . selectAll ( ".legend-item" ) . transition ( ) . duration ( 100 ) . style ( "opacity" , 1 ) ; h . revert ( ) } ) ; f . append ( "rect" ) . attr ( "class" , "legend-item-event" ) . style ( "fill-opacity" , 0 ) . attr ( "x" , - 200 ) . attr ( "y" , function ( ) { return la / 2 - 16 } ) . attr ( "width" , Ta ) . attr ( "height" , 24 ) ; f . append ( "rect" ) . attr ( "class" , "legend-item-tile" ) . style ( "fill" , function ( a ) { return Y ( a ) } ) . attr ( "x" , - 200 ) . attr ( "y" , function ( ) { return la / 2 - 9 } ) . attr ( "width" , 10 ) . attr ( "height" ,
10 ) ; f . append ( "text" ) . text ( function ( a ) { return n ( Ja [ a ] ) ? Ja [ a ] : a } ) . attr ( "x" , - 200 ) . attr ( "y" , function ( ) { return la / 2 } ) ; za . selectAll ( "rect.legend-item-event" ) . data ( d ) . transition ( ) . duration ( g ? 250 : 0 ) . attr ( "x" , function ( a , b ) { return e + Ta * b } ) ; za . selectAll ( "rect.legend-item-tile" ) . data ( d ) . transition ( ) . duration ( g ? 250 : 0 ) . attr ( "x" , function ( a , b ) { return e + Ta * b } ) ; za . selectAll ( "text" ) . data ( d ) . transition ( ) . duration ( g ? 250 : 0 ) . attr ( "x" , function ( a , b ) { return e + Ta * b + 14 } ) } function Ua ( a ) { return n ( a ) ? ".target-" + a : ".target" } var h =
{ data : { } } , db = { } , Z = "_expanded_" , ia = "_selected_" , Lb = "_included_" , wa = e ( [ "bindto" ] , "#chart" ) , Xa = e ( [ "size" , "width" ] , null ) , Yb = e ( [ "size" , "height" ] , null ) , Ub = e ( [ "padding" , "left" ] , null ) , Sb = e ( [ "padding" , "right" ] , null ) , ra = e ( [ "zoom" , "enabled" ] , ! 1 ) , Pc = e ( [ "zoom" , "extent" ] , null ) , Fd = e ( [ "zoom" , "privileged" ] , ! 1 ) , yd = e ( [ "onenter" ] , function ( ) { } ) , zd = e ( [ "onleave" ] , function ( ) { } ) ; if ( ! ( "data" in $ ) ) throw Error ( "data is required in config" ) ; var qa = e ( [ "data" , "x" ] , null ) , X = e ( [ "data" , "xs" ] , null ) , yb = e ( [ "data" , "x_format" ] , "%Y-%m-%d" ) ,
jd = e ( [ "data" , "id_converter" ] , function ( a ) { return a } ) , Ja = e ( [ "data" , "names" ] , { } ) , v = e ( [ "data" , "groups" ] , [ ] ) , ac = e ( [ "data" , "axes" ] , { } ) , Gc = e ( [ "data" , "type" ] , null ) , O = e ( [ "data" , "types" ] , { } ) , Qc = e ( [ "data" , "regions" ] , { } ) , Od = e ( [ "data" , "colors" ] , { } ) , ha = e ( [ "data" , "selection" , "enabled" ] , ! 1 ) , sa = e ( [ "data" , "selection" , "grouped" ] , ! 1 ) , ta = e ( [ "data" , "selection" , "isselectable" ] , function ( ) { return ! 0 } ) , ya = e ( [ "subchart" , "show" ] , ! 1 ) , Qb = ya ? e ( [ "subchart" , "size" , "height" ] , 60 ) : 0 , Pd = e ( [ "color" , "pattern" ] , null ) , Aa = e ( [ "legend" , "show" ] ,
! 0 ) , Ta = e ( [ "legend" , "item" , "width" ] , 80 ) , Nd = e ( [ "legend" , "item" , "onclick" ] , function ( ) { } ) , Rc = e ( [ "axis" , "x" , "type" ] , "indexed" ) , Fa = e ( [ "axis" , "x" , "categories" ] , [ ] ) , Zc = e ( [ "axis" , "x" , "tick" , "centered" ] , ! 1 ) , bb = e ( [ "axis" , "x" , "tick" , "format" ] , null ) , jb = e ( [ "axis" , "x" , "default" ] , null ) , Ad = e ( [ "axis" , "x" , "label" ] , null ) , ed = e ( [ "axis" , "y" , "max" ] , null ) , cd = e ( [ "axis" , "y" , "min" ] , null ) , gd = e ( [ "axis" , "y" , "center" ] , null ) , Bd = e ( [ "axis" , "y" , "label" ] , null ) , qb = e ( [ "axis" , "y" , "inner" ] , ! 1 ) , vd = e ( [ "axis" , "y" , "tick" , "format" ] , function ( a ) { return a } ) ,
Ha = e ( [ "axis" , "y" , "padding" ] , null ) , ud = e ( [ "axis" , "y" , "ticks" ] , 10 ) , Tb = e ( [ "axis" , "y2" , "show" ] , ! 1 ) , dd = e ( [ "axis" , "y2" , "max" ] , null ) , bd = e ( [ "axis" , "y2" , "min" ] , null ) , fd = e ( [ "axis" , "y2" , "center" ] , null ) , pb = e ( [ "axis" , "y2" , "inner" ] , ! 1 ) , xd = e ( [ "axis" , "y2" , "tick" , "format" ] , function ( a ) { return a } ) , Ia = e ( [ "axis" , "y2" , "padding" ] , null ) , wd = e ( [ "axis" , "y2" , "ticks" ] , 10 ) , g = e ( [ "axis" , "rotated" ] , ! 1 ) , Hc = e ( [ "grid" , "x" , "show" ] , ! 1 ) , Jd = e ( [ "grid" , "x" , "type" ] , "tick" ) , Fb = e ( [ "grid" , "x" , "lines" ] , null ) , Ic = e ( [ "grid" , "y" , "show" ] , ! 1 ) , Gb = e ( [ "grid" ,
"y" , "lines" ] , null ) , Cb = e ( [ "point" , "show" ] , ! 0 ) ? e ( [ "point" , "r" ] , 2.5 ) : 0 , Cd = e ( [ "point" , "focus" , "line" , "enabled" ] , ! 0 ) , Hb = e ( [ "point" , "focus" , "expand" , "enabled" ] , ! 0 ) , Ib = e ( [ "point" , "focus" , "expand" , "r" ] , Hb ? 4 : Cb ) , Oa = e ( [ "point" , "focus" , "select" , "r" ] , 8 ) , Id = e ( [ "point" , "onclick" ] , function ( ) { } ) , qd = e ( [ "point" , "onselected" ] , function ( ) { } ) , rd = e ( [ "point" , "onunselected" ] , function ( ) { } ) , K = e ( [ "regions" ] , [ ] ) , qc = e ( [ "tooltip" , "contents" ] , function ( a ) { var b = "<table class='-tooltip'><tr><th colspan='2'>" + I ( ) ( a [ 0 ] . x ) + "</th></tr>" ,
d , c , e ; for ( d = 0 ; d < a . length ; d ++ ) n ( a [ d ] ) ? ( c = n ( a [ d ] . value ) ? ( Math . round ( 100 * a [ d ] . value ) / 100 ) . toFixed ( 2 ) : "-" , e = a [ d ] . name ) : e = c = "-" , b += "<tr class='-tooltip-name-" + a [ d ] . id + "'><td class='name'><span style='background-color:" + Y ( a [ d ] . id ) + "'></span>" + e + "</td><td class='value'>" + c + "</td></tr>" ; return b + "</table>" } ) , Gd = e ( [ "tooltip" , "init" , "show" ] , ! 1 ) , Ba = e ( [ "tooltip" , "init" , "x" ] , 0 ) , Kc = e ( [ "tooltip" , "init" , "position" ] , { top : "0px" , left : "50px" } ) , Eb = wa . replace ( "#" , "" ) + "-clip" , Qa = "url(#" + Eb + ")" , r = "timeseries" === Rc , W = "categorized" ===
Rc , tb = ! r && ( qa || X ) , Kb = null , Ra = ! 1 , Jb = ! 1 , la = Aa ? 40 : 0 , Y = function ( a , b ) { var d = [ ] , c = null !== b ? b : "#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf" . split ( " " ) ; return function ( b ) { if ( b in a ) return a [ b ] ; - 1 === d . indexOf ( b ) && d . push ( b ) ; return c [ d . indexOf ( b ) % c . length ] } } ( Od , Pd ) , $c = function ( ) { var a = [ [ c . time . format ( "%Y/%-m/%-d" ) , function ( ) { return ! 0 } ] , [ c . time . format ( "%-m/%-d" ) , function ( a ) { return a . getMonth ( ) } ] , [ c . time . format ( "%-m/%-d" ) , function ( a ) { return 1 !== a . getDate ( ) } ] , [ c . time . format ( "%-m/%-d" ) ,
function ( a ) { return a . getDay ( ) && 1 !== a . getDate ( ) } ] , [ c . time . format ( "%I %p" ) , function ( a ) { return a . getHours ( ) } ] , [ c . time . format ( "%I:%M" ) , function ( a ) { return a . getMinutes ( ) } ] , [ c . time . format ( ":%S" ) , function ( a ) { return a . getSeconds ( ) } ] , [ c . time . format ( ".%L" ) , function ( a ) { return a . getMilliseconds ( ) } ] ] ; return function ( b ) { for ( var c = a . length - 1 , e = a [ c ] ; ! e [ 1 ] ( b ) ; ) e = a [ -- c ] ; return e [ 0 ] ( b ) } } ( ) , Pb , Wb , Rb , Ya , Vb , Xb , q , p , ma , ob , va , Zb , $b , rb , sb , m , w , U , da , Za , $a , B , na , ab , Ea , Vc = g ? "left" : "bottom" , Wc = g ? qb ? "top" : "bottom" : qb ? "right" : "left" ,
Xc = g ? pb ? "bottom" : "top" : pb ? "left" : "right" , Yc = "bottom" , J = { main : function ( ) { return "translate(" + A + "," + s + ")" } , context : function ( ) { return "translate(" + l + "," + Ca + ")" } , legend : function ( ) { return "translate(" + Ob + "," + Nb + ")" } , y2 : function ( ) { return "translate(" + ( g ? 0 : q ) + "," + ( g ? 10 : 0 ) + ")" } , x : function ( ) { return "translate(0," + p + ")" } , subx : function ( ) { return "translate(0," + ma + ")" } } , Kd = function ( ) { var a = c . svg . line ( ) . x ( g ? function ( a ) { return E ( a . id ) ( a . value ) } : gb ) . y ( g ? gb : function ( a ) { return E ( a . id ) ( a . value ) } ) ; return function ( b ) { var c =
Dc ( b . values ) , e ; if ( xb ( b ) ) return "spline" === O [ "string" === typeof b ? b : b . id ] ? a . interpolate ( "cardinal" ) : a . interpolate ( "linear" ) , Qc [ b . id ] ? td ( c , m , E ( b . id ) , Qc [ b . id ] ) : a ( c ) ; e = m ( c [ 0 ] . x ) ; b = E ( b . id ) ( c [ 0 ] . value ) ; return g ? "M " + b + " " + e : "M " + e + " " + b } } ( ) , Ld = function ( ) { var a = c . svg . line ( ) . x ( function ( a ) { return da ( a . x ) } ) . y ( function ( a ) { return S ( a . id ) ( a . value ) } ) ; return function ( b ) { var c = Dc ( b . values ) ; return xb ( b ) ? a ( c ) : "M " + da ( c [ 0 ] . x ) + " " + S ( b . id ) ( c [ 0 ] . value ) } } ( ) , G = c . svg . brush ( ) . on ( "brush" , function ( ) { z ( { withTransition : ! 1 , withY : ! 1 ,
withSubchart : ! 1 , withUpdateXDomain : ! 0 } ) } ) , C = c . behavior . zoom ( ) . on ( "zoomstart" , function ( ) { C . altDomain = c . event . sourceEvent . altKey ? m . orgDomain ( ) : null } ) . on ( "zoom" , ra ? Md : null ) ; G . update = function ( ) { x && x . select ( ".x.brush" ) . call ( this ) ; return this } ; C . orgScaleExtent = function ( ) { var a = Pc ? Pc : [ 1 , 10 ] ; return [ a [ 0 ] , Math . max ( La ( ) / a [ 1 ] , a [ 1 ] ) ] } ; C . updateScaleExtent = function ( ) { var a = m . orgDomain ( ) , a = ( a [ 1 ] - a [ 0 ] ) / ( V [ 1 ] - V [ 0 ] ) , b = this . orgScaleExtent ( ) ; this . scaleExtent ( [ b [ 0 ] * a , b [ 1 ] * a ] ) ; return this } ; var Pa , ib , k , x , za , N , hb , ea = null ,
oa = null , V ; h . focus = function ( a ) { h . defocus ( ) ; c . selectAll ( Ua ( a ) ) . filter ( function ( a ) { return ub ( a . id ) } ) . classed ( "focused" , ! 0 ) . transition ( ) . duration ( 100 ) . style ( "opacity" , 1 ) } ; h . defocus = function ( a ) { c . selectAll ( Ua ( a ) ) . filter ( function ( a ) { return ub ( a . id ) } ) . classed ( "focused" , ! 1 ) . transition ( ) . duration ( 100 ) . style ( "opacity" , 0.3 ) } ; h . revert = function ( a ) { c . selectAll ( Ua ( a ) ) . filter ( function ( a ) { return ub ( a . id ) } ) . classed ( "focused" , ! 1 ) . transition ( ) . duration ( 100 ) . style ( "opacity" , 1 ) } ; h . show = function ( a ) { c . selectAll ( Ua ( a ) ) . transition ( ) . style ( "opacity" ,
1 ) } ; h . hide = function ( a ) { c . selectAll ( Ua ( a ) ) . transition ( ) . style ( "opacity" , 0 ) } ; h . unzoom = function ( ) { G . clear ( ) . update ( ) ; z ( { withUpdateXDomain : ! 0 } ) } ; h . load = function ( a ) { t ( a . done ) && ( a . done = function ( ) { } ) ; "categories" in a && W && ( Fa = a . categories , B . categories ( Fa ) ) ; if ( "cacheIds" in a && Wa ( a . cacheIds ) ) Sa ( mb ( a . cacheIds ) , a . done ) ; else if ( "data" in a ) Sa ( Ka ( a . data ) , a . done ) ; else if ( "url" in a ) c . csv ( a . url , function ( b , c ) { Sa ( Ka ( c ) , a . done ) } ) ; else if ( "rows" in a ) Sa ( Ka ( fc ( a . rows ) ) , a . done ) ; else if ( "columns" in a ) Sa ( Ka ( gc ( a . columns ) ) ,
a . done ) ; else throw Error ( "url or rows or columns is required." ) ; } ; h . unload = function ( a ) { h . data . targets = h . data . targets . filter ( function ( b ) { return b . id !== a } ) ; c . selectAll ( ".target-" + a ) . transition ( ) . style ( "opacity" , 0 ) . remove ( ) ; Aa && ( c . selectAll ( ".legend-item-" + a ) . remove ( ) , kb ( h . data . targets ) ) ; 0 < h . data . targets . length && z ( ) } ; h . selected = function ( a ) { a = n ( a ) ? "-" + a : "" ; return c . merge ( k . selectAll ( ".-shapes" + a ) . selectAll ( ".-shape" ) . filter ( function ( ) { return c . select ( this ) . classed ( ia ) } ) . map ( function ( a ) { return a . map ( function ( a ) { return a . _ _data _ _ } ) } ) ) } ;
h . select = function ( a , b , d ) { ha && k . selectAll ( ".-shapes" ) . selectAll ( ".-shape" ) . each ( function ( e , g ) { var h = "circle" === this . nodeName ? zc : sd , k = "circle" === this . nodeName ? zb : Bc ; 0 <= b . indexOf ( g ) ? ta ( e ) && ( sa || t ( a ) || 0 <= a . indexOf ( e . id ) ) && h ( c . select ( this ) . classed ( ia , ! 0 ) , e , g ) : n ( d ) && d && k ( c . select ( this ) . classed ( ia , ! 1 ) , e , g ) } ) } ; h . unselect = function ( a , b ) { ha && k . selectAll ( ".-shapes" ) . selectAll ( ".-shape" ) . each ( function ( d , e ) { var g = "circle" === this . nodeName ? zb : Bc ; ( t ( b ) || 0 <= b . indexOf ( e ) ) && ta ( d ) && ( sa || t ( a ) || 0 <= a . indexOf ( d . id ) ) && g ( c . select ( this ) . classed ( ia ,
! 1 ) , d , e ) } ) } ; h . toLine = function ( a ) { Na ( a , "line" ) ; z ( ) } ; h . toSpline = function ( a ) { Na ( a , "spline" ) ; z ( ) } ; h . toBar = function ( a ) { Na ( a , "bar" ) ; z ( ) } ; h . toScatter = function ( a ) { Na ( a , "scatter" ) ; z ( ) } ; h . groups = function ( a ) { if ( t ( a ) ) return v ; v = a ; z ( ) ; return v } ; h . regions = function ( a ) { if ( t ( a ) ) return K ; K = a ; z ( ) ; return K } ; h . regions . add = function ( a ) { if ( t ( a ) ) return K ; K = K . concat ( a ) ; z ( ) ; return K } ; h . regions . remove = function ( a , b ) { var d = [ ] . concat ( a ) ; b = n ( b ) ? b : { } ; d . forEach ( function ( a ) { var d = c . selectAll ( "." + a ) ; n ( b . duration ) && ( d = d . transition ( ) . duration ( b . duration ) . style ( "fill-opacity" ,
0 ) ) ; d . remove ( ) ; K = K . filter ( function ( b ) { return 0 > b . classes . indexOf ( a ) } ) } ) ; return K } ; h . data . get = function ( a ) { a = h . data . getAsTarget ( a ) ; return n ( a ) ? a . values . map ( function ( a ) { return a . value } ) : void 0 } ; h . data . getAsTarget = function ( a ) { var b = cb ( function ( b ) { return b . id === a } ) ; return 0 < b . length ? b [ 0 ] : void 0 } ; h . destroy = function ( ) { h . data . targets = void 0 ; h . data . x = { } ; hb . html ( "" ) ; P . onresize = null } ; if ( "url" in $ . data ) c . csv ( $ . data . url , function ( a , b ) { Db ( b ) } ) ; else if ( "rows" in $ . data ) Db ( fc ( $ . data . rows ) ) ; else if ( "columns" in $ . data ) Db ( gc ( $ . data . columns ) ) ;
else throw Error ( "url or rows or columns is required." ) ; return h } } ) ( window ) ;