graphdb-workbench 2.4.2-TR1 → 2.5.0-TR2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/dist/{0.c6e0a1afafc7ffdfaccc.bundle.js → 0.5cf9732a04e93f12731e.bundle.js} +2 -2
  2. package/dist/{1.62d2152f08a53359457f.bundle.js → 1.307e6748342e15538f78.bundle.js} +1 -1
  3. package/dist/{10.2fd5d150b0f308c19b16.bundle.js → 10.eaecca674349ae64405b.bundle.js} +1 -1
  4. package/dist/{100.63b83a1aaec9dec2a159.bundle.js → 100.1d955d05c2b126f9864d.bundle.js} +1 -1
  5. package/dist/{101.04c16567a76c2d46e334.bundle.js → 101.0bb6e53298a278f00fa2.bundle.js} +1 -1
  6. package/dist/{102.2859258827e790c5fe06.bundle.js → 102.d97d1f597aa1f5fe8a84.bundle.js} +1 -1
  7. package/dist/{103.8d9dfc8dbeceed83ea4d.bundle.js → 103.ff30a5a1fda8bab8cfe9.bundle.js} +1 -1
  8. package/dist/{104.6b5154dbe7983078d26a.bundle.js → 104.53563d67730df28d2e77.bundle.js} +1 -1
  9. package/dist/{105.2a66bd0e522508ebd271.bundle.js → 105.ebc3fdf28cb773554460.bundle.js} +1 -1
  10. package/dist/{106.27c9e4f19d1f4638da85.bundle.js → 106.b05d55bc263ff0e2567d.bundle.js} +1 -1
  11. package/dist/{107.1cafdb62789a6d01efe3.bundle.js → 107.70dda8914a8aff1551df.bundle.js} +1 -1
  12. package/dist/{108.99fadee1ed0c7110af9a.bundle.js → 108.7e527e2daa85d33a37e8.bundle.js} +1 -1
  13. package/dist/{109.058abd1bafecf89da08f.bundle.js → 109.4c1c05058c0432fcfbf4.bundle.js} +1 -1
  14. package/dist/{11.d13b4e6a939fc0b5a125.bundle.js → 11.00f9d1d1c4f991bc1ce4.bundle.js} +1 -1
  15. package/dist/{110.63c5d2fc22ca73bc2161.bundle.js → 110.9fd8458398c332601b77.bundle.js} +1 -1
  16. package/dist/{111.57dcb90ea5fe513d6161.bundle.js → 111.5078636e1b82935a545a.bundle.js} +1 -1
  17. package/dist/{112.9bd920a0a14fde24231a.bundle.js → 112.96dcfe33b064076ac1be.bundle.js} +1 -1
  18. package/dist/{113.fe6efdeb16cea90aef64.bundle.js → 113.48a6c80675afe8267a64.bundle.js} +1 -1
  19. package/dist/{114.2f1bbfe1abb21122d2e1.bundle.js → 114.2b3a6bb6ee773061303b.bundle.js} +1 -1
  20. package/dist/115.278def3ba989bbfe9ff4.bundle.js +1 -0
  21. package/dist/116.d90649c4c649e647d7a2.bundle.js +1 -0
  22. package/dist/{117.23e75248d8a499cef320.bundle.js → 117.7f5d816abf5b77ef3fbd.bundle.js} +1 -1
  23. package/dist/{118.aa4d1a68202c7681e169.bundle.js → 118.0aec8deaa819988fca29.bundle.js} +1 -1
  24. package/dist/{119.6eba5cf04079e83072ee.bundle.js → 119.c674c2b0aa6c5ee48ad1.bundle.js} +1 -1
  25. package/dist/{12.2a55bbc8fc029c5f151d.bundle.js → 12.8bb532c884a451e3f8fa.bundle.js} +4 -4
  26. package/dist/{120.0c5bcf54ab7e6114cded.bundle.js → 120.a2448289b4b4e15c5599.bundle.js} +1 -1
  27. package/dist/{121.eb2e07b504cbc0c0e151.bundle.js → 121.1337e56ef13853bb4d3f.bundle.js} +1 -1
  28. package/dist/{122.13211f5eed5e4bf17a48.bundle.js → 122.e9ed2fec5b91dc03ab8f.bundle.js} +1 -1
  29. package/dist/{123.8dbec2943eab449ea638.bundle.js → 123.de697a3f49fe40251c44.bundle.js} +1 -1
  30. package/dist/{124.8e3d5ba12c298ea9a439.bundle.js → 124.97257036d8794229c8fe.bundle.js} +1 -1
  31. package/dist/{125.2c1cfa4f1508591c2db9.bundle.js → 125.6222bdc96a658ac9213a.bundle.js} +1 -1
  32. package/dist/{126.1e81957d72de76d2a7b5.bundle.js → 126.7c1df25008b8ed08ff11.bundle.js} +1 -1
  33. package/dist/{127.9a1e0e14854bba15d762.bundle.js → 127.5047733607194ae1a9cc.bundle.js} +1 -1
  34. package/dist/{128.280921c83837d6b5ed1e.bundle.js → 128.1f57f66c0e4398a2c115.bundle.js} +1 -1
  35. package/dist/{129.905991d7d0b2c8cdddac.bundle.js → 129.1a17d5bd3eb86bf2c340.bundle.js} +1 -1
  36. package/dist/{13.7197ee7d89f056798f2f.bundle.js → 13.96a152f024ccbd18a722.bundle.js} +1 -1
  37. package/dist/{130.9aea5c200bad449041e5.bundle.js → 130.8d0c570a8363e55b4892.bundle.js} +1 -1
  38. package/dist/{131.80cb5a2bd108a4f0c74c.bundle.js → 131.5aaf572eec986ec511e2.bundle.js} +1 -1
  39. package/dist/{132.d3ba757be1f57238c518.bundle.js → 132.bc39877b95fd7beba2a0.bundle.js} +1 -1
  40. package/dist/{133.7ff3260122aed5f9da82.bundle.js → 133.c9432441d39dbdf45a46.bundle.js} +1 -1
  41. package/dist/{134.937aed94c3cba12e70de.bundle.js → 134.64ab677e16aa2b0c78b1.bundle.js} +1 -1
  42. package/dist/{135.e7ef2dedc3321ef31558.bundle.js → 135.1f22537c07a23801b0c2.bundle.js} +1 -1
  43. package/dist/{136.50ad256ff91ae8bd138c.bundle.js → 136.22f6c4a19299925123a0.bundle.js} +1 -1
  44. package/dist/{137.802084605202b8b7aef1.bundle.js → 137.3d5a974735fb47aa1d79.bundle.js} +1 -1
  45. package/dist/{138.3d79db7fc7908d986c2d.bundle.js → 138.6dccf89299df5ba81af2.bundle.js} +1 -1
  46. package/dist/{139.21dbd727f5f9bbadc865.bundle.js → 139.f2f1dc4f6f79f7424bcd.bundle.js} +1 -1
  47. package/dist/{14.75489051dc19828ddf6a.bundle.js → 14.e4d543000ac65753d253.bundle.js} +1 -1
  48. package/dist/{140.e35e4a6421c31a6eb0d2.bundle.js → 140.81f624f6236989915ef9.bundle.js} +1 -1
  49. package/dist/{141.d48e599aa8dec29049e5.bundle.js → 141.20ad74ad83f165d5cb61.bundle.js} +1 -1
  50. package/dist/{142.d5af4ebdde0264efdbe0.bundle.js → 142.55f33d8cf0e735f0469c.bundle.js} +1 -1
  51. package/dist/{143.4a600ce8f1b38bc3c484.bundle.js → 143.5c160cfd9771df4684ba.bundle.js} +1 -1
  52. package/dist/{144.24d2001adcd0546ce679.bundle.js → 144.d72be2c687a7d0249625.bundle.js} +1 -1
  53. package/dist/{145.2ca8245e03e22c0fd9ed.bundle.js → 145.97fadd2dd3aba8e5da23.bundle.js} +1 -1
  54. package/dist/{146.0bf605fa5b7cc102937f.bundle.js → 146.49a2b40691494c6a5486.bundle.js} +1 -1
  55. package/dist/{147.c08eab536793c5ab07fc.bundle.js → 147.f2e561500c77abfc45c1.bundle.js} +1 -1
  56. package/dist/{148.a55927446e6b202926f1.bundle.js → 148.395ab2825c81f4fb38d5.bundle.js} +1 -1
  57. package/dist/{149.0f1210813636e6d0e48c.bundle.js → 149.56f682c28cec694efee1.bundle.js} +1 -1
  58. package/dist/{15.b27c1c98f320b78e704c.bundle.js → 15.4c321cabb25d09b7c7d2.bundle.js} +1 -1
  59. package/dist/{150.7224dc087612aa0ff0c1.bundle.js → 150.2ce51c5750848ed010dc.bundle.js} +1 -1
  60. package/dist/{151.474f1a6c85c10e352bc4.bundle.js → 151.a2a2037e3a004c4fa641.bundle.js} +1 -1
  61. package/dist/{152.1ef6bdbc8329b2a8d288.bundle.js → 152.dfc9f74cbf64ccf0ea49.bundle.js} +1 -1
  62. package/dist/{153.8fbeed8e7e94213c6df1.bundle.js → 153.f710bf5c73f7d736a4b1.bundle.js} +1 -1
  63. package/dist/{154.384bdfe1f4b3fce850b0.bundle.js → 154.91111db7b52bbdfcc183.bundle.js} +1 -1
  64. package/dist/{155.68e389692623c7b68878.bundle.js → 155.46f2a94df187ed492591.bundle.js} +1 -1
  65. package/dist/{159.b791a62882176dc9a9b3.bundle.js → 159.9577c774cf79013ad6c2.bundle.js} +1 -1
  66. package/dist/{16.9f43f2a2cb3de6b50964.bundle.js → 16.6204732b58f59043436f.bundle.js} +1 -1
  67. package/dist/{160.847d226a7c31b8dd3dba.bundle.js → 160.167e1fbef805b2af0682.bundle.js} +1 -1
  68. package/dist/{161.b255fab3ed77f7ac2230.bundle.js → 161.1f0e297091910853ffca.bundle.js} +1 -1
  69. package/dist/{162.532b65eb7575ded1f259.bundle.js → 162.95bf5e11490cb06f098b.bundle.js} +1 -1
  70. package/dist/163.0fb1f67ddcc7e065e52f.bundle.js +1 -0
  71. package/dist/164.dae97bcb647a99ec9b9d.bundle.js +1 -0
  72. package/dist/{165.83034f9c4e5a749e4123.bundle.js → 165.0e6d22f7b067f146992b.bundle.js} +1 -1
  73. package/dist/{166.b5734b2ae2128dc1f352.bundle.js → 166.f782a91912c5270aa790.bundle.js} +1 -1
  74. package/dist/{167.39609d5258c038019b9e.bundle.js → 167.b41022f1342505667e3b.bundle.js} +1 -1
  75. package/dist/{168.34a1790ea589d9926a97.bundle.js → 168.604316ed153524b052f3.bundle.js} +1 -1
  76. package/dist/{169.45b7052421531eceff65.bundle.js → 169.ae3ad7effef98b52e2d1.bundle.js} +1 -1
  77. package/dist/{17.7a20974aaea2122ed42f.bundle.js → 17.aedb44984ef305e0c70f.bundle.js} +1 -1
  78. package/dist/{170.e24cfa80d3f51df2b1b5.bundle.js → 170.e191fb225ddb65024473.bundle.js} +1 -1
  79. package/dist/{171.c0e7ce3fd59ef1bfc4f5.bundle.js → 171.d4e42adb13537e847ff0.bundle.js} +1 -1
  80. package/dist/{172.17dfb02daf0edd4dcfda.bundle.js → 172.f3db13f6a03c55f90160.bundle.js} +1 -1
  81. package/dist/{173.5e3fea538a2a2d5b5c0c.bundle.js → 173.ae711cba7e2c97fc73b5.bundle.js} +1 -1
  82. package/dist/{174.73ba2cba36d471c65a24.bundle.js → 174.b7ee6807e89a48c2a3fa.bundle.js} +1 -1
  83. package/dist/{175.1b84ab33587a120edf96.bundle.js → 175.f5ebcaf8e16fdfb515e2.bundle.js} +1 -1
  84. package/dist/{176.8c5f2eac9630f47dcfe6.bundle.js → 176.b42e87b0a480cb123000.bundle.js} +1 -1
  85. package/dist/{177.b4e1effc89e36a54d383.bundle.js → 177.dbaee0a7e49c31c80499.bundle.js} +1 -1
  86. package/dist/{178.5878cdc649570bd1584c.bundle.js → 178.6c9658eb1819b03fc6a3.bundle.js} +1 -1
  87. package/dist/{179.e3d0eb54e065b5d3a9b3.bundle.js → 179.485675f301804b2813c5.bundle.js} +1 -1
  88. package/dist/{18.db18b987a6ea55fddc4a.bundle.js → 18.488e471db34855b418d6.bundle.js} +2 -2
  89. package/dist/{180.253197fc8d3c22a436eb.bundle.js → 180.3b38de15bc031d2b8f19.bundle.js} +1 -1
  90. package/dist/{181.6647e03a6aef077b32de.bundle.js → 181.5444eb4d48a6fc35718c.bundle.js} +1 -1
  91. package/dist/{182.a1fda6fcbab204e52e0c.bundle.js → 182.f28b62d80d9407e6b4f9.bundle.js} +1 -1
  92. package/dist/{183.18cb5ff4f822a8fed662.bundle.js → 183.a3a44afb0cd9dd52c87c.bundle.js} +1 -1
  93. package/dist/{184.f12257544b5398d3f2a3.bundle.js → 184.6abe5f451fb29c1e3a38.bundle.js} +1 -1
  94. package/dist/{185.14c3f0198be367d63776.bundle.js → 185.bfc5a7adba6373ef44d4.bundle.js} +1 -1
  95. package/dist/{186.0202fbf77a009c0044d1.bundle.js → 186.099e4c95a734e9f63ca4.bundle.js} +1 -1
  96. package/dist/{187.391e7d134c74be03ba3f.bundle.js → 187.a206a2dcf4e239da40d4.bundle.js} +1 -1
  97. package/dist/{188.ac13c63e6f27a377ba89.bundle.js → 188.4d4acf513bd189d12864.bundle.js} +1 -1
  98. package/dist/{189.dddf3f9a7ebe12c03816.bundle.js → 189.9144f1cf1d05118f6609.bundle.js} +1 -1
  99. package/dist/{19.9a73670b7772d8bf1969.bundle.js → 19.21c59626445a9385699a.bundle.js} +2 -2
  100. package/dist/{190.d7ad07ba4f1352960a8c.bundle.js → 190.93b55ad878d31e3a8a2a.bundle.js} +1 -1
  101. package/dist/{191.5d9d4325ae7b9ee2a4a9.bundle.js → 191.8c6c8350386fbd0dcd29.bundle.js} +1 -1
  102. package/dist/{192.633b1aba2828a7f05a5e.bundle.js → 192.8e5ebb875be32eb7b10c.bundle.js} +1 -1
  103. package/dist/{193.1fbde1bb67cbf14b1790.bundle.js → 193.0dfcfc1502000419984d.bundle.js} +1 -1
  104. package/dist/{194.409535e01db5b95f7902.bundle.js → 194.020806d6a750f32da571.bundle.js} +1 -1
  105. package/dist/{195.225e32febad8b009632d.bundle.js → 195.42bc3bc47d16a8986102.bundle.js} +1 -1
  106. package/dist/{196.6bbcfa8da98327b65eb1.bundle.js → 196.a89d3cc96dbc17612807.bundle.js} +1 -1
  107. package/dist/{197.541dd252fe17ef0e0f77.bundle.js → 197.56140e8c74f403c502fc.bundle.js} +1 -1
  108. package/dist/{198.63399ef675dbcd2056b7.bundle.js → 198.27d99bd1d52cdc67f8da.bundle.js} +1 -1
  109. package/dist/{199.282d9b54b913bfc128d3.bundle.js → 199.d67eb5c3c551be737327.bundle.js} +1 -1
  110. package/dist/{2.888ee146d785447620e1.bundle.js → 2.9a37e6579bbd99faa7df.bundle.js} +3 -3
  111. package/dist/{20.918905a6efc81c27dcf6.bundle.js → 20.7b83550ae0524adafae2.bundle.js} +1 -1
  112. package/dist/{200.76fd30afe28687f92b15.bundle.js → 200.95c99f2cbcc8567cfafb.bundle.js} +1 -1
  113. package/dist/{201.889e42d915554f3cd902.bundle.js → 201.b3f612dca72d097ddbbb.bundle.js} +1 -1
  114. package/dist/{202.05304444fcad7ed7158e.bundle.js → 202.7eac5c94dfe42ec52f8d.bundle.js} +1 -1
  115. package/dist/{203.81ba13895d041a1a4300.bundle.js → 203.1e581561902792ec691f.bundle.js} +1 -1
  116. package/dist/{204.1f6da63d62a8a330ca43.bundle.js → 204.b72540b4d3ceb0ac4f32.bundle.js} +1 -1
  117. package/dist/{205.f57f57ac33eaff53b51d.bundle.js → 205.93926b6252ecdd8c9fd3.bundle.js} +1 -1
  118. package/dist/{206.294496c4ba1c972bfad7.bundle.js → 206.e0210f4eb7c671c2b35c.bundle.js} +1 -1
  119. package/dist/{207.898fb8ad46af1a86525d.bundle.js → 207.8389e4e07b35e7bc0c76.bundle.js} +1 -1
  120. package/dist/{208.51b02bb87aae392135d2.bundle.js → 208.3aeedd28a9bb6b36c571.bundle.js} +1 -1
  121. package/dist/{209.a51458ccf909fbbc9b1f.bundle.js → 209.23d2270d49f851b3cf22.bundle.js} +1 -1
  122. package/dist/{21.fa61daf65c6bc29e06a2.bundle.js → 21.17e9bf36c5712302e4d3.bundle.js} +1 -1
  123. package/dist/{210.337c0b7764194dc8cb4e.bundle.js → 210.b78e4b9f60d4de111d82.bundle.js} +1 -1
  124. package/dist/211.06a38ffb491ba96d64c0.bundle.js +1 -0
  125. package/dist/212.6f681b92651c586e7b28.bundle.js +1 -0
  126. package/dist/{22.3850ed5528218c3beb66.bundle.js → 22.cdc2663b96debbc6a65b.bundle.js} +2 -2
  127. package/dist/{23.dc3e430b47f766cc2366.bundle.js → 23.e54645da219284390374.bundle.js} +1 -1
  128. package/dist/{24.4c9b73b3909403e82055.bundle.js → 24.8ad805c765b343209036.bundle.js} +1 -1
  129. package/dist/{25.d97f589a3debedff6dfb.bundle.js → 25.1140a5ef5bf075c3491f.bundle.js} +2 -2
  130. package/dist/{26.60c61d8ca245bad6597d.bundle.js → 26.d7177f34f8098990bcb3.bundle.js} +1 -1
  131. package/dist/{27.56996601ec3795c65c3d.bundle.js → 27.259ab6929d861a838a12.bundle.js} +1 -1
  132. package/dist/{28.79f65106f49c5036504b.bundle.js → 28.c1f0f131faa88af53758.bundle.js} +1 -1
  133. package/dist/{29.3f41e0d8e9f58188a02b.bundle.js → 29.4443dad5ba9aad14b478.bundle.js} +1 -1
  134. package/dist/{3.f2e3c8a056a0e0f1068c.bundle.js → 3.df62d907d77392bdf941.bundle.js} +1 -1
  135. package/dist/{30.4712f3e92b6469d3d8dd.bundle.js → 30.bf3e693ce3351bce27eb.bundle.js} +1 -1
  136. package/dist/{31.a05a0072057c061cd0dc.bundle.js → 31.163ee32806665a6dddc2.bundle.js} +1 -1
  137. package/dist/{32.27c9ee63125cca89f908.bundle.js → 32.299ae5cd6e71391a700b.bundle.js} +1 -1
  138. package/dist/{33.b8fdd52b492f933a3730.bundle.js → 33.3701773f9c0698ce5ae7.bundle.js} +1 -1
  139. package/dist/{34.e5150a1b66426d5f5af7.bundle.js → 34.38770b233efed1f35272.bundle.js} +1 -1
  140. package/dist/{35.0766d50ada31ef79b4b0.bundle.js → 35.258b98e04cadda4357be.bundle.js} +1 -1
  141. package/dist/{36.25471fd55c32f7f02568.bundle.js → 36.a8e153e08c2b12d049f0.bundle.js} +1 -1
  142. package/dist/{37.356f6302c079cea446b6.bundle.js → 37.1119f4daa657494b2dee.bundle.js} +1 -1
  143. package/dist/{38.94b303a3b944480a495a.bundle.js → 38.d15791426b51ee288dc5.bundle.js} +1 -1
  144. package/dist/{39.a5409bc3fec719768f37.bundle.js → 39.9efb9b21bd341c60d1e4.bundle.js} +1 -1
  145. package/dist/4.bd56ee8cbc353164d400.bundle.js +1 -0
  146. package/dist/40.dd1047127a761d6c693c.bundle.js +1 -0
  147. package/dist/{41.62789a75dd9dddbc1297.bundle.js → 41.c04dc34ce71145c5235b.bundle.js} +1 -1
  148. package/dist/{42.e33e9c7350f30402dbe0.bundle.js → 42.54663aebeff19dc1a04b.bundle.js} +1 -1
  149. package/dist/{43.3876fb2ec9b5b6b646df.bundle.js → 43.7fe7063c77cece5cf59e.bundle.js} +1 -1
  150. package/dist/{44.e63112a4f3ee65c29a0a.bundle.js → 44.73e88426aa1d3cc58091.bundle.js} +1 -1
  151. package/dist/{45.2b1cf89f777bb5fda383.bundle.js → 45.2c7f65e05059e34ab746.bundle.js} +1 -1
  152. package/dist/{46.f07b159fc6cc07492e2b.bundle.js → 46.95ac85b4987df292517e.bundle.js} +1 -1
  153. package/dist/{47.1bacc6e38fde37677380.bundle.js → 47.801c3fb2b25e4e6dbbf5.bundle.js} +1 -1
  154. package/dist/{48.345db2f50dae9ec7d11a.bundle.js → 48.ae955aa8fea59fb24b79.bundle.js} +1 -1
  155. package/dist/{49.b0d0df9a0bd2458a38f7.bundle.js → 49.c0bffcf362b3538f7f42.bundle.js} +1 -1
  156. package/dist/{5.93d75276b7a283deddc8.bundle.js → 5.adea5d522be945b9d8d3.bundle.js} +1 -1
  157. package/dist/{50.f453781f031f1511a294.bundle.js → 50.f82d79aa8e75c28b2c75.bundle.js} +1 -1
  158. package/dist/{51.9a911ea64d2bbe27a6b8.bundle.js → 51.14acfebcc61778b5045a.bundle.js} +1 -1
  159. package/dist/{52.0673b651acdd40122168.bundle.js → 52.89e5fcc6a82e2e2d11cb.bundle.js} +1 -1
  160. package/dist/{53.9b5d43c58aa368765457.bundle.js → 53.15d83110f5d1b6e0f021.bundle.js} +1 -1
  161. package/dist/{54.028884d762d361c54c23.bundle.js → 54.058f9938d40042f017c0.bundle.js} +1 -1
  162. package/dist/{55.4966f01604a6c84d301e.bundle.js → 55.cdfe9e9734ec244dccf2.bundle.js} +1 -1
  163. package/dist/{56.da176c234be30906ed18.bundle.js → 56.914a47bab6bf9c7e4d61.bundle.js} +1 -1
  164. package/dist/{57.413a1beccae08b5eb787.bundle.js → 57.de9b6f6789d80f1ee398.bundle.js} +1 -1
  165. package/dist/{58.8ba78ec049c5c97e4391.bundle.js → 58.96b61554d69abf431857.bundle.js} +1 -1
  166. package/dist/{59.25436d0038d7be337d24.bundle.js → 59.7c3f6c5c030f93b69c00.bundle.js} +1 -1
  167. package/dist/{6.8ec0502f2e6517640ba2.bundle.js → 6.a57818789247c2f1ef4b.bundle.js} +1 -1
  168. package/dist/{60.571f2c6fcdec505acb5a.bundle.js → 60.f848378894d660806d43.bundle.js} +1 -1
  169. package/dist/{61.8dca89c50677ace894ee.bundle.js → 61.0e2fc08f48e7a83de619.bundle.js} +1 -1
  170. package/dist/{62.3a5f8d2165a2f6058360.bundle.js → 62.31d980d635d5aa6cc42a.bundle.js} +1 -1
  171. package/dist/{63.2ea3fe6eb8be5ab57564.bundle.js → 63.95216588581bb1f62328.bundle.js} +1 -1
  172. package/dist/{64.4e84a027a9f1d66a69db.bundle.js → 64.2d3b8812de9eb6d3bae7.bundle.js} +1 -1
  173. package/dist/{65.da0571f9102cc340a6b9.bundle.js → 65.bf364041da1c850b076d.bundle.js} +1 -1
  174. package/dist/{66.104f9f5e48af12f94fbe.bundle.js → 66.69e4ab8673cdd0336061.bundle.js} +1 -1
  175. package/dist/{67.fa36cb1b8e55e91d8850.bundle.js → 67.1188a6e4a5f5447a8b62.bundle.js} +1 -1
  176. package/dist/{68.1d425ce7da7058254c2f.bundle.js → 68.8b0088e4baff9545383c.bundle.js} +1 -1
  177. package/dist/{69.7816b63a19bf02451f5d.bundle.js → 69.ccb1145496017634c4d2.bundle.js} +1 -1
  178. package/dist/{7.39ff1f0ec65d7d7b73f5.bundle.js → 7.8bf1a2c5b84a141e21a7.bundle.js} +2 -2
  179. package/dist/{70.fcca4105919427b384ee.bundle.js → 70.9b1d6b92a7be3d8a1433.bundle.js} +1 -1
  180. package/dist/{71.1d860b69a990d36ece53.bundle.js → 71.990da7d0131774540d94.bundle.js} +1 -1
  181. package/dist/{72.25f264649b4e7f9dd670.bundle.js → 72.20d6c82cb7230ef10a0f.bundle.js} +1 -1
  182. package/dist/{73.fe7ca97e0d6f3e83d9af.bundle.js → 73.d485b901f51bb892883e.bundle.js} +1 -1
  183. package/dist/{74.02eb1c81c5a7b39d63be.bundle.js → 74.c0b3c6941c176e0aebcc.bundle.js} +1 -1
  184. package/dist/{75.89f4b3371fc1c8679763.bundle.js → 75.13e0f311c6c98067c4f8.bundle.js} +1 -1
  185. package/dist/{9.a1218bf604d655a3d23b.bundle.js → 76.44bdcc2130c6a744bc55.bundle.js} +1 -1
  186. package/dist/{77.122517ab9f81c08963fd.bundle.js → 77.0373cd7f1c2851df3908.bundle.js} +1 -1
  187. package/dist/{79.cb33ee2df704588c0dee.bundle.js → 79.2d02d1f12feaf1bc654c.bundle.js} +1 -1
  188. package/dist/{8.2b1b357b8afba4bd5dda.bundle.js → 8.5b0bbad215fce77138ff.bundle.js} +1 -1
  189. package/dist/{80.28723cd3d93bd3fe3c1b.bundle.js → 80.a4376c99a06dddcdb6d4.bundle.js} +1 -1
  190. package/dist/{81.e4cdfbb440c07a0f9d1e.bundle.js → 81.c350699b7e38b228dca3.bundle.js} +1 -1
  191. package/dist/{82.63053f57c54f3870c6b4.bundle.js → 82.6b63305bab4b778375aa.bundle.js} +1 -1
  192. package/dist/{83.0837870d0e1682a6487c.bundle.js → 83.ac30096c59d105a3d52a.bundle.js} +1 -1
  193. package/dist/{84.160b1ea5b257276fe22f.bundle.js → 84.783d54197f0f84301924.bundle.js} +1 -1
  194. package/dist/{85.32462b06fa1284fc2a87.bundle.js → 85.1994df654ef9bc6d52e2.bundle.js} +1 -1
  195. package/dist/{86.399f5cbb00afc5ccccd7.bundle.js → 86.15d8d134c41d9eedb5f7.bundle.js} +1 -1
  196. package/dist/{87.1a8b0b4fd818a413de82.bundle.js → 87.41f83e9f577d7793f934.bundle.js} +1 -1
  197. package/dist/{88.738b3a2efa5ba9bfef71.bundle.js → 88.d8bda5d7848ae703a232.bundle.js} +1 -1
  198. package/dist/{89.ecce6e48f1d5921ad7b9.bundle.js → 89.69a97ef6ec74d79a7793.bundle.js} +1 -1
  199. package/dist/{76.56266cca991e6450cb2e.bundle.js → 9.1e2a1467755135bb1717.bundle.js} +1 -1
  200. package/dist/{90.052a76395eb9473edb9e.bundle.js → 90.18bbf27296113fc1cbb6.bundle.js} +1 -1
  201. package/dist/{91.a6eb1cd89547ccc2da08.bundle.js → 91.9a1da3ee81fee797b8c7.bundle.js} +1 -1
  202. package/dist/{92.a76fcac9855d6ea43acc.bundle.js → 92.4514c3a90b050bbd1129.bundle.js} +1 -1
  203. package/dist/{93.a66b80c93662e56ccc97.bundle.js → 93.e9359d8547790d707791.bundle.js} +1 -1
  204. package/dist/94.8c85dda9eef7f694b6d1.bundle.js +1 -0
  205. package/dist/{95.2c6ad9bc82627035b7ed.bundle.js → 95.bc10c26610fc2465037f.bundle.js} +1 -1
  206. package/dist/{96.0c1b0454a0595ac0b888.bundle.js → 96.dcb020a5702c939c0a09.bundle.js} +1 -1
  207. package/dist/{97.f0e6133cd5a664499c6f.bundle.js → 97.25396f327398863000ba.bundle.js} +1 -1
  208. package/dist/{98.1886caa9872ba5f2eb07.bundle.js → 98.781947753583522ed496.bundle.js} +1 -1
  209. package/dist/{99.42f11427ea2c99e9173b.bundle.js → 99.bbfe048c33a2650a6237.bundle.js} +1 -1
  210. package/dist/{bundle.247e31198b23654b053d.bundle.js → bundle.4f4714a6ecd45bda1c44.bundle.js} +8 -8
  211. package/dist/css/bootstrap-graphdb-theme.css +5 -28
  212. package/dist/css/clustermanagement.css +4 -0
  213. package/dist/index.html +4 -4
  214. package/dist/js/angular/clustermanagement/templates/modal/add-nodes-dialog.html +12 -5
  215. package/dist/js/angular/clustermanagement/templates/modal/cluster-create-dialog.html +9 -2
  216. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  217. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  218. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  219. package/dist/js/angular/core/templates/core-errors.html +1 -1
  220. package/dist/js/angular/security/templates/user.html +4 -1
  221. package/dist/license-checker.json +2 -16
  222. package/dist/{main.dc50b704432268af5a47.bundle.js → main.4e93e1e66611ac456dcb.bundle.js} +1 -1
  223. package/dist/main.964fb6ea8405dc7f47ca.css +1 -0
  224. package/dist/pages/aclmanagement.html +1 -1
  225. package/dist/pages/autocomplete.html +1 -1
  226. package/dist/pages/choose-repository-type.html +1 -1
  227. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  228. package/dist/pages/create-index.html +4 -4
  229. package/dist/pages/dependencies.html +1 -1
  230. package/dist/pages/domainRangeInfo.html +2 -2
  231. package/dist/pages/edit.html +1 -1
  232. package/dist/pages/explore.html +1 -1
  233. package/dist/pages/export.html +1 -1
  234. package/dist/pages/find.html +1 -1
  235. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  236. package/dist/pages/graphs-visualizations.html +7 -7
  237. package/dist/pages/guides.html +1 -1
  238. package/dist/pages/import.html +2 -2
  239. package/dist/pages/jdbc-create.html +5 -5
  240. package/dist/pages/monitor/backup-and-restore.html +1 -1
  241. package/dist/pages/monitor/queries.html +1 -1
  242. package/dist/pages/monitor/resources.html +2 -2
  243. package/dist/pages/namespaces.html +2 -2
  244. package/dist/pages/plugins.html +1 -1
  245. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  246. package/dist/pages/rdfrank.html +2 -2
  247. package/dist/pages/repositories.html +1 -3
  248. package/dist/pages/repository.html +1 -3
  249. package/dist/pages/similarity-indexes.html +1 -1
  250. package/dist/pages/sparql-template-create.html +5 -5
  251. package/dist/pages/sparql.html +3 -3
  252. package/dist/pages/webapi.html +2 -2
  253. package/dist/res/swagger/index.html +27 -27
  254. package/dist/vendor.0ae6fb8c7aea6c6f7c6f.bundle.js +27 -0
  255. package/package.json +1 -4
  256. package/dist/115.a39103a5752b1dee21dd.bundle.js +0 -1
  257. package/dist/116.b3acff9003106b7f9b62.bundle.js +0 -1
  258. package/dist/163.18ce4731466e3c04fe13.bundle.js +0 -1
  259. package/dist/164.f26289867aedbaf63da2.bundle.js +0 -1
  260. package/dist/211.1f858cfbe1e9267dd629.bundle.js +0 -1
  261. package/dist/212.1c0e881dff8f75170f2a.bundle.js +0 -1
  262. package/dist/4.83e133ed3a567a27c699.bundle.js +0 -1
  263. package/dist/40.61f5dedc12beb42c1f44.bundle.js +0 -1
  264. package/dist/94.e61e957dc3eeda570bfa.bundle.js +0 -1
  265. package/dist/css/lib/bootstrap-switch/bootstrap-switch.min.css +0 -10
  266. package/dist/main.3ac2b4b19f56209c6467.css +0 -1
  267. package/dist/vendor.c22e3aa91c9d63aeef57.bundle.js +0 -35
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[31],{319:function(t,e,n){n(320),t.exports="nvd3"},320:function(t,e,n){!function(t){"use strict";var e=t.nv;e=n(321),angular.module("nvd3",[]).directive("nvd3",["nvd3Utils",function(t){return{restrict:"AE",scope:{data:"=",options:"=",api:"=?",events:"=?",config:"=?",onReady:"&?"},link:function(n,r,i){var o={extended:!1,visible:!0,disabled:!1,refreshDataOnly:!0,deepWatchOptions:!0,deepWatchData:!0,deepWatchDataDepth:2,debounce:10,debounceImmediate:!0};function a(t,e,r){t&&e&&angular.forEach(t,(function(i,o){"_"===o[0]||("dispatch"===o?(void 0!==e[o]&&null!==e[o]||n._config.extended&&(e[o]={}),s(i,e[o])):"tooltip"===o?(void 0!==e[o]&&null!==e[o]||n._config.extended&&(e[o]={}),a(t[o],e[o],r)):"contentGenerator"===o?e[o]&&t[o](e[o]):-1===["axis","clearHighlights","defined","highlightPoint","nvPointerEventsClass","options","rangeBand","rangeBands","scatter","open","close","node"].indexOf(o)&&(void 0===e[o]||null===e[o]?n._config.extended&&(e[o]=i()):t[o](e[o])))}))}function s(t,e){t&&e&&angular.forEach(t,(function(r,i){void 0===e[i]||null===e[i]?n._config.extended&&(e[i]=r.on):t.on(i+"._",e[i])}))}function l(e){var i=t.deepExtend(function(t){switch(t){case"title":return{enable:!1,text:"Write Your Title",className:"h4",css:{width:n.options.chart.width+"px",textAlign:"center"}};case"subtitle":return{enable:!1,text:"Write Your Subtitle",css:{width:n.options.chart.width+"px",textAlign:"center"}};case"caption":return{enable:!1,text:"Figure 1. Write Your Caption text.",css:{width:n.options.chart.width+"px",textAlign:"center"}}}}(e),n.options[e]||{});n._config.extended&&(n.options[e]=i);var o=angular.element("<div></div>").html(i.html||"").addClass(e).addClass(i.className).removeAttr("style").css(i.css);i.html||o.text(i.text),i.enable&&("title"===e?r.prepend(o):"subtitle"===e?angular.element(r[0].querySelector(".title")).after(o):"caption"===e&&r.append(o))}function u(){var e=t.deepExtend({classes:{"with-3d-shadow":!0,"with-transitions":!0,gallery:!1},css:{}},n.options.styles||{});n._config.extended&&(n.options.styles=e),angular.forEach(e.classes,(function(t,e){t?r.addClass(e):r.removeClass(e)})),r.removeAttr("style").css(e.css)}function c(t,e){t!==e&&(n._config.disabled||(n._config.refreshDataOnly?n.api.update():n.api.refresh()))}n.isReady=!1,n._config=angular.extend(o,n.config),n.api={refresh:function(){n.api.updateWithOptions(),n.isReady=!0},refreshWithTimeout:function(t){setTimeout((function(){n.api.refresh()}),t)},update:function(){n.chart&&n.svg?"sunburstChart"===n.options.chart.type?n.svg.datum(angular.copy(n.data)).call(n.chart):n.svg.datum(n.data).call(n.chart):n.api.refresh()},updateWithTimeout:function(t){setTimeout((function(){n.api.update()}),t)},updateWithOptions:function(r){if(arguments.length){if(n.options=r,n._config.deepWatchOptions&&!n._config.disabled)return}else r=n.options;n.api.clearElement(),!1!==angular.isDefined(r)&&n._config.visible&&(n.chart=e.models[r.chart.type](),n.chart.id=Math.random().toString(36).substr(2,15),angular.forEach(n.chart,(function(t,e){"_"===e[0]||["clearHighlights","highlightPoint","id","options","resizeHandler","state","open","close","tooltipContent"].indexOf(e)>=0||("dispatch"===e?(void 0!==r.chart[e]&&null!==r.chart[e]||n._config.extended&&(r.chart[e]={}),s(n.chart[e],r.chart[e])):["bars","bars1","bars2","boxplot","bullet","controls","discretebar","distX","distY","focus","interactiveLayer","legend","lines","lines1","lines2","multibar","pie","scatter","scatters1","scatters2","sparkline","stack1","stack2","sunburst","tooltip","x2Axis","xAxis","y1Axis","y2Axis","y3Axis","y4Axis","yAxis","yAxis1","yAxis2"].indexOf(e)>=0||"stacked"===e&&"stackedAreaChart"===r.chart.type?(void 0!==r.chart[e]&&null!==r.chart[e]||n._config.extended&&(r.chart[e]={}),a(n.chart[e],r.chart[e],r.chart.type)):"focusHeight"===e&&"lineChart"===r.chart.type||"focusHeight"===e&&"lineWithFocusChart"===r.chart.type||("xTickFormat"!==e&&"yTickFormat"!==e||"lineWithFocusChart"!==r.chart.type)&&("tooltips"===e&&"boxPlotChart"===r.chart.type||("tooltipXContent"!==e&&"tooltipYContent"!==e||"scatterChart"!==r.chart.type)&&("x"!==e&&"y"!==e||"forceDirectedGraph"!==r.chart.type)&&(void 0===r.chart[e]||null===r.chart[e]?n._config.extended&&(r.chart[e]="barColor"===e?t()():t()):n.chart[e](r.chart[e]))))})),n.api.updateWithData(),(r.title||n._config.extended)&&l("title"),(r.subtitle||n._config.extended)&&l("subtitle"),(r.caption||n._config.extended)&&l("caption"),(r.styles||n._config.extended)&&u(),e.addGraph((function(){if(n.chart)return n.chart.resizeHandler&&n.chart.resizeHandler.clear(),n.chart.resizeHandler=e.utils.windowResize((function(){n.chart&&n.chart.update&&n.chart.update()})),void 0!==r.chart.zoom&&["scatterChart","lineChart","candlestickBarChart","cumulativeLineChart","historicalBarChart","ohlcBarChart","stackedAreaChart"].indexOf(r.chart.type)>-1&&t.zoom(n,r),n.chart}),r.chart.callback))},updateWithData:function(t){if(arguments.length){if(n.data=t,n._config.deepWatchData&&!n._config.disabled)return}else t="sunburstChart"===n.options.chart.type?angular.copy(n.data):n.data;var e,i;t&&(d3.select(r[0]).select("svg").remove(),n.svg=d3.select(r[0]).insert("svg",".caption"),(e=n.options.chart.height)&&(isNaN(+e)||(e+="px"),n.svg.attr("height",e).style({height:e})),(i=n.options.chart.width)?(isNaN(+i)||(i+="px"),n.svg.attr("width",i).style({width:i})):n.svg.attr("width","100%").style({width:"100%"}),n.svg.datum(t).call(n.chart),n.chart&&n.chart.zoomRender&&n.chart.zoomRender())},clearElement:function(){if(r.find(".title").remove(),r.find(".subtitle").remove(),r.find(".caption").remove(),r.empty(),n.chart&&n.chart.tooltip&&n.chart.tooltip.id&&d3.select("#"+n.chart.tooltip.id()).remove(),n.chart&&n.chart.interactiveLayer&&n.chart.interactiveLayer.tooltip&&n.chart.interactiveLayer.tooltip.id&&d3.select("#"+n.chart.interactiveLayer.tooltip.id()).remove(),e.graphs&&n.chart)for(var t=e.graphs.length-1;t>=0;t--)e.graphs[t]&&e.graphs[t].id===n.chart.id&&e.graphs.splice(t,1);e.tooltip&&e.tooltip.cleanup&&e.tooltip.cleanup(),n.chart&&n.chart.resizeHandler&&n.chart.resizeHandler.clear(),n.chart=null},getScope:function(){return n},getElement:function(){return r}},n._config.deepWatchOptions&&n.$watch("options",t.debounce((function(t){n._config.disabled||n.api.refresh()}),n._config.debounce,n._config.debounceImmediate),!0),n._config.deepWatchData&&(1===n._config.deepWatchDataDepth?n.$watchCollection("data",c):n.$watch("data",c,2===n._config.deepWatchDataDepth)),n.$watch("config",(function(t,e){t!==e&&(n._config=angular.extend(o,t),n.api.refresh())}),!0),n._config.deepWatchOptions||n._config.deepWatchData||n.api.refresh(),angular.forEach(n.events,(function(t,e){n.$on(e,(function(e,r){return t(e,n,r)}))})),r.on("$destroy",(function(){n.api.clearElement()})),n.$watch("isReady",(function(t){t&&n.onReady&&"function"==typeof n.onReady()&&n.onReady()(n,r)}))}}}]).factory("nvd3Utils",(function(){return{debounce:function(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}},deepExtend:function(t){var e=this;return angular.forEach(arguments,(function(n){n!==t&&angular.forEach(n,(function(n,r){t[r]&&t[r].constructor&&t[r].constructor===Object?e.deepExtend(t[r],n):t[r]=n}))})),t},zoom:function(t,e){var n=e.chart.zoom;if(void 0===n.enabled||null===n.enabled||n.enabled){var r,i,o,a,s,l=t.chart.xAxis.scale(),u=t.chart.yAxis.scale(),c=t.chart.xDomain||l.domain,d=t.chart.yDomain||u.domain,f=l.domain().slice(),p=u.domain().slice(),h=n.scale||1,g=n.translate||[0,0],v=n.scaleExtent||[1,10],m=n.useFixedDomain||!1,y=n.useNiceScale||!1,x=n.horizontalOff||!1,b=n.verticalOff||!1,k=n.unzoomEventType||"dblclick.zoom";y&&(l.nice(),u.nice()),r=function(t,e){return t[0]=Math.min(Math.max(t[0],e[0]),e[1]-e[1]/v[1]),t[1]=Math.max(e[0]+e[1]/v[1],Math.min(t[1],e[1])),t},o=function(){if(void 0!==n.zoomed){var e=n.zoomed(l.domain(),u.domain());x||c([e.x1,e.x2]),b||d([e.y1,e.y2])}else x||c(m?r(l.domain(),f):l.domain()),b||d(m?r(u.domain(),p):u.domain());t.chart&&t.chart.update()},a=function(){if(void 0!==n.unzoomed){var e=n.unzoomed(l.domain(),u.domain());x||c([e.x1,e.x2]),b||d([e.y1,e.y2])}else x||c(f),b||d(p);i.scale(h).translate(g),t.chart&&t.chart.update()},s=function(){void 0!==n.zoomend&&n.zoomend()},i=d3.behavior.zoom().x(l).y(u).scaleExtent(v).on("zoom",o).on("zoomend",s),t.svg&&(t.svg.call(i),i.scale(h).translate(g).event(t.svg),"none"!==k&&t.svg.on(k,a)),t.chart&&(t.chart.zoomRender=function(){i.scale(h).translate(g),l=t.chart.xAxis.scale(),u=t.chart.yAxis.scale(),c=t.chart.xDomain||l.domain,d=t.chart.yDomain||u.domain,f=l.domain().slice(),p=u.domain().slice(),i.x(l).y(u),t.svg.call(i),"none"!==k&&t.svg.on(k,a)})}}}}))}(window)},321:function(t,e,n){var r;(r={dev:!1}).tooltip=r.tooltip||{},r.utils=r.utils||{},r.models=r.models||{},r.charts={},r.logs={},r.dom={},"undefined"==typeof d3&&(d3=n(297)),r.dispatch=d3.dispatch("render_start","render_end"),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i}),r.dev&&(r.dispatch.on("render_start",(function(t){r.logs.startTime=+new Date})),r.dispatch.on("render_end",(function(t){r.logs.endTime=+new Date,r.logs.totalTime=r.logs.endTime-r.logs.startTime,r.log("total",r.logs.totalTime)}))),r.log=function(){if(r.dev&&window.console&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(r.dev&&window.console&&"function"==typeof console.log&&Function.prototype.bind){var t=Function.prototype.bind.call(console.log,console);t.apply(console,arguments)}return arguments[arguments.length-1]},r.deprecated=function(t,e){console&&console.warn&&console.warn("nvd3 warning: `"+t+"` has been deprecated. ",e||"")},r.render=function(t){t=t||1,r.render.active=!0,r.dispatch.render_start();var e=function(){for(var n,i,o=0;o<t&&(i=r.render.queue[o]);o++)n=i.generate(),typeof i.callback==typeof Function&&i.callback(n);r.render.queue.splice(0,o),r.render.queue.length?setTimeout(e):(r.dispatch.render_end(),r.render.active=!1)};setTimeout(e)},r.render.active=!1,r.render.queue=[],r.addGraph=function(t){typeof arguments[0]==typeof Function&&(t={generate:arguments[0],callback:arguments[1]}),r.render.queue.push(t),r.render.active||r.render()},t.exports=r,"undefined"!=typeof window&&(window.nv=r),r.dom.write=function(t){return void 0!==window.fastdom?fastdom.mutate(t):t()},r.dom.read=function(t){return void 0!==window.fastdom?fastdom.measure(t):t()},r.interactiveGuideline=function(){"use strict";var t={left:0,top:0},e=null,n=null,i=d3.scale.linear(),o=d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick","elementMouseDown","elementMouseUp"),a=!0,s=null,l=r.models.tooltip(),u=window.ActiveXObject;function c(d){d.each((function(d){var f=d3.select(this),p=e||960,h=n||400,g=f.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([d]);function v(){var e=d3.event.clientX-this.getBoundingClientRect().left,n=d3.event.clientY-this.getBoundingClientRect().top,r=!0,a=!1;if(u&&(e=d3.event.offsetX,n=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(r=!1),d3.event.target.className.baseVal.match("nv-legend")&&(a=!0)),r&&(e-=t.left,n-=t.top),"mouseout"===d3.event.type||e<0||n<0||e>p||n>h||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||a){if(u&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&(void 0===d3.event.relatedTarget.className||d3.event.relatedTarget.className.match(l.nvPointerEventsClass)))return;return o.elementMouseout({mouseX:e,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0)}l.hidden(!1);var s=void 0;if("function"==typeof i.rangeBands){var d=d3.bisect(i.range(),e)-1;if(!(i.range()[d]+i.rangeBand()>=e))return o.elementMouseout({mouseX:e,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0);s=i.domain()[d3.bisect(i.range(),e)-1]}else s=i.invert(e);o.elementMousemove({mouseX:e,mouseY:n,pointXValue:s}),"dblclick"===d3.event.type&&o.elementDblclick({mouseX:e,mouseY:n,pointXValue:s}),"click"===d3.event.type&&o.elementClick({mouseX:e,mouseY:n,pointXValue:s}),"mousedown"===d3.event.type&&o.elementMouseDown({mouseX:e,mouseY:n,pointXValue:s}),"mouseup"===d3.event.type&&o.elementMouseUp({mouseX:e,mouseY:n,pointXValue:s})}g.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer").append("g").attr("class","nv-interactiveGuideLine"),s&&(s.on("touchmove",v).on("mousemove",v,!0).on("mouseout",v,!0).on("mousedown",v,!0).on("mouseup",v,!0).on("dblclick",v).on("click",v),c.guideLine=null,c.renderGuideLine=function(t){a&&(c.guideLine&&c.guideLine.attr("x1")===t||r.dom.write((function(){var e=g.select(".nv-interactiveGuideLine").selectAll("line").data(null!=t?[r.utils.NaNtoZero(t)]:[],String);e.enter().append("line").attr("class","nv-guideline").attr("x1",(function(t){return t})).attr("x2",(function(t){return t})).attr("y1",h).attr("y2",0),e.exit().remove()})))})}))}return l.duration(0).hideDelay(0).hidden(!1),c.dispatch=o,c.tooltip=l,c.margin=function(e){return arguments.length?(t.top=void 0!==e.top?e.top:t.top,t.left=void 0!==e.left?e.left:t.left,c):t},c.width=function(t){return arguments.length?(e=t,c):e},c.height=function(t){return arguments.length?(n=t,c):n},c.xScale=function(t){return arguments.length?(i=t,c):i},c.showGuideLine=function(t){return arguments.length?(a=t,c):a},c.svgContainer=function(t){return arguments.length?(s=t,c):s},c},r.interactiveBisect=function(t,e,n){"use strict";if(!(t instanceof Array))return null;var r;r="function"!=typeof n?function(t){return t.x}:n;var i=d3.bisector((function(t,e){return r(t)-e})).left,o=d3.max([0,i(t,e)-1]),a=r(t[o]);if(void 0===a&&(a=o),a===e)return o;var s=d3.min([o+1,t.length-1]),l=r(t[s]);return void 0===l&&(l=s),Math.abs(l-e)>=Math.abs(a-e)?o:s},r.nearestValueIndex=function(t,e,n){"use strict";var r=1/0,i=null;return t.forEach((function(t,o){var a=Math.abs(e-t);null!=t&&a<=r&&a<n&&(r=a,i=o)})),i},r.models.tooltip=function(){"use strict";var t="nvtooltip-"+Math.floor(1e5*Math.random()),e=null,n="w",i=25,o=0,a=null,s=!0,l=200,u=null,c={left:null,top:null},d=!0,f=100,p=!0,h=function(t,e,n){return t},g=function(t){return t},v=function(t,e){return t},m=function(t,e){if(null===t)return"";var n=d3.select(document.createElement("table"));p&&n.selectAll("thead").data([t]).enter().append("thead").append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(g(t.value));var r=n.selectAll("tbody").data([t]).enter().append("tbody").selectAll("tr").data((function(t){return t.series})).enter().append("tr").classed("highlight",(function(t){return t.highlight}));r.append("td").classed("legend-color-guide",!0).append("div").style("background-color",(function(t){return t.color})),r.append("td").classed("key",!0).classed("total",(function(t){return!!t.total})).html((function(t,e){return v(t.key,e)})),r.append("td").classed("value",!0).html((function(t,e){return h(t.value,e,t)})),r.filter((function(t,e){return void 0!==t.percent})).append("td").classed("percent",!0).html((function(t,e){return"("+d3.format("%")(t.percent)+")"})),r.selectAll("td").each((function(t){if(t.highlight){var e=d3.scale.linear().domain([0,1]).range(["#fff",t.color]);d3.select(this).style("border-bottom-color",e(.6)).style("border-top-color",e(.6))}}));var i=n.node().outerHTML;return void 0!==t.footer&&(i+="<div class='footer'>"+t.footer+"</div>"),i},y=function(){var t={left:null!==d3.event?d3.event.clientX:0,top:null!==d3.event?d3.event.clientY:0};if("none"!=getComputedStyle(document.body).transform){var e=document.body.getBoundingClientRect();t.left-=e.left,t.top-=e.top}return t},x=function(){r.dom.read((function(){var t=y(),e=function(t){var e,r,o,a=u.node().offsetHeight,s=u.node().offsetWidth,l=document.documentElement.clientWidth,c=document.documentElement.clientHeight;switch(n){case"e":e=-s-i,r=-a/2,t.left+e<0&&(e=i),(o=t.top+r)<0&&(r-=o),(o=t.top+r+a)>c&&(r-=o-c);break;case"w":e=i,r=-a/2,t.left+e+s>l&&(e=-s-i),(o=t.top+r)<0&&(r-=o),(o=t.top+r+a)>c&&(r-=o-c);break;case"n":e=-s/2-5,r=i,t.top+r+a>c&&(r=-a-i),(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"s":e=-s/2,r=-a-i,t.top+r<0&&(r=i),(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"center":e=-s/2,r=-a/2;break;default:e=0,r=0}return{left:e,top:r}}(t),r=t.left+e.left,o=t.top+e.top;if(s)u.interrupt().transition().delay(l).duration(0).style("opacity",0);else{var a="translate("+c.left+"px, "+c.top+"px)",d="translate("+Math.round(r)+"px, "+Math.round(o)+"px)",p=d3.interpolateString(a,d),h=u.style("opacity")<.1;u.interrupt().transition().duration(h?0:f).styleTween("transform",(function(t){return p}),"important").styleTween("-webkit-transform",(function(t){return p})).style("-ms-transform",d).style("opacity",1)}c.left=r,c.top=o}))};function b(){if(d&&function(t){if(t&&t.series){if(r.utils.isArray(t.series))return!0;if(r.utils.isObject(t.series))return t.series=[t.series],!0}return!1}(e))return r.dom.write((function(){u&&u.node()||((u=d3.select(document.body).select("#"+t).data([1])).enter().append("div").attr("class","nvtooltip "+(a||"xy-tooltip")).attr("id",t).style("top",0).style("left",0).style("opacity",0).style("position","fixed").selectAll("div, table, td, tr").classed("nv-pointer-events-none",!0).classed("nv-pointer-events-none",!0),u.exit().remove());var n=m(e,u.node());n&&(u.node().innerHTML=n),x()})),b}return b.nvPointerEventsClass="nv-pointer-events-none",b.options=r.utils.optionsFunc.bind(b),b._options=Object.create({},{duration:{get:function(){return f},set:function(t){f=t}},gravity:{get:function(){return n},set:function(t){n=t}},distance:{get:function(){return i},set:function(t){i=t}},snapDistance:{get:function(){return o},set:function(t){o=t}},classes:{get:function(){return a},set:function(t){a=t}},enabled:{get:function(){return d},set:function(t){d=t}},hideDelay:{get:function(){return l},set:function(t){l=t}},contentGenerator:{get:function(){return m},set:function(t){m=t}},valueFormatter:{get:function(){return h},set:function(t){h=t}},headerFormatter:{get:function(){return g},set:function(t){g=t}},keyFormatter:{get:function(){return v},set:function(t){v=t}},headerEnabled:{get:function(){return p},set:function(t){p=t}},position:{get:function(){return y},set:function(t){y=t}},chartContainer:{get:function(){return document.body},set:function(t){r.deprecated("chartContainer","feature removed after 1.8.3")}},fixedTop:{get:function(){return null},set:function(t){r.deprecated("fixedTop","feature removed after 1.8.1")}},offset:{get:function(){return{left:0,top:0}},set:function(t){r.deprecated("offset","use chart.tooltip.distance() instead")}},hidden:{get:function(){return s},set:function(t){s!=t&&(s=!!t,b())}},data:{get:function(){return e},set:function(t){t.point&&(t.value=t.point.x,t.series=t.series||{},t.series.value=t.point.y,t.series.color=t.point.color||t.series.color),e=t}},node:{get:function(){return u.node()},set:function(t){}},id:{get:function(){return t},set:function(t){}}}),r.utils.initOptions(b),b},r.utils.windowSize=function(){var t={width:640,height:480};return window.innerWidth&&window.innerHeight?(t.width=window.innerWidth,t.height=window.innerHeight,t):"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?(t.width=document.documentElement.offsetWidth,t.height=document.documentElement.offsetHeight,t):document.body&&document.body.offsetWidth?(t.width=document.body.offsetWidth,t.height=document.body.offsetHeight,t):t},r.utils.isArray=Array.isArray,r.utils.isObject=function(t){return null!==t&&"object"==typeof t},r.utils.isFunction=function(t){return"function"==typeof t},r.utils.isDate=function(t){return"[object Date]"===toString.call(t)},r.utils.isNumber=function(t){return!isNaN(t)&&"number"==typeof t},r.utils.windowResize=function(t){return window.addEventListener?window.addEventListener("resize",t):r.log("ERROR: Failed to bind to window.resize with: ",t),{callback:t,clear:function(){window.removeEventListener("resize",t)}}},r.utils.getColor=function(t){if(void 0===t)return r.utils.defaultColor();if(r.utils.isArray(t)){var e=d3.scale.ordinal().range(t);return function(t,n){var r=void 0===n?t:n;return t.color||e(r)}}return t},r.utils.defaultColor=function(){return r.utils.getColor(d3.scale.category20().range())},r.utils.customTheme=function(t,e,n){e=e||function(t){return t.key};var i=(n=n||d3.scale.category20().range()).length;return function(o,a){var s=e(o);return r.utils.isFunction(t[s])?t[s]():void 0!==t[s]?t[s]:(i||(i=n.length),n[i-=1])}},r.utils.pjax=function(t,e){var n=function(n){d3.html(n,(function(n){var i=d3.select(e).node();i.parentNode.replaceChild(d3.select(n).select(e).node(),i),r.utils.pjax(t,e)}))};d3.selectAll(t).on("click",(function(){history.pushState(this.href,this.textContent,this.href),n(this.href),d3.event.preventDefault()})),d3.select(window).on("popstate",(function(){d3.event.state&&n(d3.event.state)}))},r.utils.calcApproxTextWidth=function(t){if(r.utils.isFunction(t.style)&&r.utils.isFunction(t.text)){var e=parseInt(t.style("font-size").replace("px",""),10),n=t.text().length;return r.utils.NaNtoZero(n*e*.5)}return 0},r.utils.NaNtoZero=function(t){return!r.utils.isNumber(t)||isNaN(t)||null===t||t===1/0||t===-1/0?0:t},d3.selection.prototype.watchTransition=function(t){var e=[this].concat([].slice.call(arguments,1));return t.transition.apply(t,e)},r.utils.renderWatch=function(t,e){if(!(this instanceof r.utils.renderWatch))return new r.utils.renderWatch(t,e);var n=void 0!==e?e:250,i=[],o=this;this.models=function(t){return(t=[].slice.call(arguments,0)).forEach((function(t){var e;t.__rendered=!1,(e=t).dispatch.on("renderEnd",(function(t){e.__rendered=!0,o.renderEnd("model")})),i.indexOf(t)<0&&i.push(t)})),this},this.reset=function(t){void 0!==t&&(n=t),i=[]},this.transition=function(t,e,r){if(r=(e=arguments.length>1?[].slice.call(arguments,1):[]).length>1?e.pop():void 0!==n?n:250,t.__rendered=!1,i.indexOf(t)<0&&i.push(t),0===r)return t.__rendered=!0,t.delay=function(){return this},t.duration=function(){return this},t;0===t.length||t.every((function(t){return!t.length}))?t.__rendered=!0:t.__rendered=!1;var a=0;return t.transition().duration(r).each((function(){++a})).each("end",(function(n,r){0==--a&&(t.__rendered=!0,o.renderEnd.apply(this,e))}))},this.renderEnd=function(){i.every((function(t){return t.__rendered}))&&(i.forEach((function(t){t.__rendered=!1})),t.renderEnd.apply(this,arguments))}},r.utils.deepExtend=function(t){var e=arguments.length>1?[].slice.call(arguments,1):[];e.forEach((function(e){for(var n in e){var i=r.utils.isArray(t[n]),o=r.utils.isObject(t[n]),a=r.utils.isObject(e[n]);o&&!i&&a?r.utils.deepExtend(t[n],e[n]):t[n]=e[n]}}))},r.utils.state=function(){if(!(this instanceof r.utils.state))return new r.utils.state;var t={},e=function(){},n=function(){return{}},i=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",(function(t){e(t,!0)})),this.getter=function(t){return n=t,this},this.setter=function(t,n){return n||(n=function(){}),e=function(e,r){t(e),r&&n()},this},this.init=function(t){i=i||{},r.utils.deepExtend(i,t)};var o=function(){var e=n();if(JSON.stringify(e)===JSON.stringify(t))return!1;for(var r in e)void 0===t[r]&&(t[r]={}),t[r]=e[r];return!0};this.update=function(){i&&(e(i,!1),i=null),o.call(this)&&this.dispatch.change(t)}},r.utils.optionsFunc=function(t){return t&&d3.map(t).forEach(function(t,e){r.utils.isFunction(this[t])&&this[t](e)}.bind(this)),this},r.utils.calcTicksX=function(t,e){for(var n=1,i=0;i<e.length;i+=1){var o=e[i]&&e[i].values?e[i].values.length:0;n=o>n?o:n}return r.log("Requested number of ticks: ",t),r.log("Calculated max values to be: ",n),t=(t=t>n?t=n-1:t)<1?1:t,t=Math.floor(t),r.log("Calculating tick count as: ",t),t},r.utils.calcTicksY=function(t,e){return r.utils.calcTicksX(t,e)},r.utils.initOption=function(t,e){t._calls&&t._calls[e]?t[e]=t._calls[e]:(t[e]=function(n){return arguments.length?(t._overrides[e]=!0,t._options[e]=n,t):t._options[e]},t["_"+e]=function(n){return arguments.length?(t._overrides[e]||(t._options[e]=n),t):t._options[e]})},r.utils.initOptions=function(t){t._overrides=t._overrides||{};var e=Object.getOwnPropertyNames(t._options||{}),n=Object.getOwnPropertyNames(t._calls||{});for(var i in e=e.concat(n))r.utils.initOption(t,e[i])},r.utils.inheritOptionsD3=function(t,e,n){t._d3options=n.concat(t._d3options||[]),t._d3options=(t._d3options||[]).filter((function(t,e,n){return n.indexOf(t)===e})),n.unshift(e),n.unshift(t),d3.rebind.apply(this,n)},r.utils.arrayUnique=function(t){return t.sort().filter((function(e,n){return!n||e!=t[n-1]}))},r.utils.symbolMap=d3.map(),r.utils.symbol=function(){var t,e=64;function n(n,i){var o=t.call(this,n,i),a=e.call(this,n,i);return-1!==d3.svg.symbolTypes.indexOf(o)?d3.svg.symbol().type(o).size(a)():r.utils.symbolMap.get(o)(a)}return n.type=function(e){return arguments.length?(t=d3.functor(e),n):t},n.size=function(t){return arguments.length?(e=d3.functor(t),n):e},n},r.utils.inheritOptions=function(t,e){var n=Object.getOwnPropertyNames(e._options||{}),i=Object.getOwnPropertyNames(e._calls||{}),o=e._inherited||[],a=e._d3options||[],s=n.concat(i).concat(o).concat(a);s.unshift(e),s.unshift(t),d3.rebind.apply(this,s),t._inherited=r.utils.arrayUnique(n.concat(i).concat(o).concat(n).concat(t._inherited||[])),t._d3options=r.utils.arrayUnique(a.concat(t._d3options||[]))},r.utils.initSVG=function(t){t.classed({"nvd3-svg":!0})},r.utils.sanitizeHeight=function(t,e){return t||parseInt(e.style("height"),10)||400},r.utils.sanitizeWidth=function(t,e){return t||parseInt(e.style("width"),10)||960},r.utils.availableHeight=function(t,e,n){return Math.max(0,r.utils.sanitizeHeight(t,e)-n.top-n.bottom)},r.utils.availableWidth=function(t,e,n){return Math.max(0,r.utils.sanitizeWidth(t,e)-n.left-n.right)},r.utils.noData=function(t,e){var n=t.options(),i=n.margin(),o=n.noData(),a=null==o?["No Data Available."]:[o],s=r.utils.availableHeight(null,e,i),l=r.utils.availableWidth(null,e,i),u=i.left+l/2,c=i.top+s/2;e.selectAll("g").remove();var d=e.selectAll(".nv-noData").data(a);d.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),d.attr("x",u).attr("y",c).text((function(t){return t}))},r.utils.wrapTicks=function(t,e){t.each((function(){for(var t,n=d3.select(this),r=n.text().split(/\s+/).reverse(),i=[],o=0,a=n.attr("y"),s=parseFloat(n.attr("dy")),l=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");t=r.pop();)i.push(t),l.text(i.join(" ")),l.node().getComputedTextLength()>e&&(i.pop(),l.text(i.join(" ")),i=[t],l=n.append("tspan").attr("x",0).attr("y",a).attr("dy",1.1*++o+s+"em").text(t))}))},r.utils.arrayEquals=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!r.arrayEquals(t[n],e[n]))return!1}else if(t[n]!=e[n])return!1;return!0},r.utils.pointIsInArc=function(t,e,n){var r=n.innerRadius()(e),i=n.outerRadius()(e),o=n.startAngle()(e),a=n.endAngle()(e),s=t.x*t.x+t.y*t.y,l=Math.atan2(t.x,-t.y);return l=l<0?l+2*Math.PI:l,r*r<=s&&s<=i*i&&o<=l&&l<=a},r.models.axis=function(){"use strict";var t,e,n=d3.svg.axis(),i=d3.scale.linear(),o={top:0,right:0,bottom:0,left:0},a=75,s=60,l=null,u=!0,c=0,d=!0,f=!1,p=!1,h=null,g=0,v=void 0,m=250,y=d3.dispatch("renderEnd");n.scale(i).orient("bottom").tickFormat((function(t){return t}));var x=r.utils.renderWatch(y,m);function b(s){return x.reset(),s.each((function(s){var m=d3.select(this);r.utils.initSVG(m);var y=m.selectAll("g.nv-wrap.nv-axis").data([s]),b=(y.enter().append("g").attr("class","nvd3 nv-wrap nv-axis").append("g"),y.select("g"));null!==h?n.ticks(h):"top"!=n.orient()&&"bottom"!=n.orient()||n.ticks(Math.abs(i.range()[1]-i.range()[0])/100),b.watchTransition(x,"axis").call(n),e=e||n.scale();var k=n.tickFormat();null==k&&(k=e.tickFormat());var w,A,M,C=b.selectAll("text.nv-axislabel").data([l||null]);switch(C.exit().remove(),void 0!==v&&b.selectAll("g").select("text").style("font-size",v),n.orient()){case"top":C.enter().append("text").attr("class","nv-axislabel"),M=0,1===i.range().length?M=p?2*i.range()[0]+i.rangeBand():0:2===i.range().length?M=p?i.range()[0]+i.range()[1]+i.rangeBand():i.range()[1]:i.range().length>2&&(M=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",0).attr("x",M/2),u&&((A=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")})).append("text"),A.exit().remove(),A.attr("transform",(function(t,e){return"translate("+r.utils.NaNtoZero(i(t))+",0)"})).select("text").attr("dy","-0.5em").attr("y",-n.tickPadding()).attr("text-anchor","middle").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),A.watchTransition(x,"min-max top").attr("transform",(function(t,e){return"translate("+r.utils.NaNtoZero(i.range()[e])+",0)"})));break;case"bottom":w=g+36;var S=30,W=0,E=b.selectAll("g").select("text"),F="";if(c%360){E.attr("transform",""),E.each((function(t,e){var n=this.getBoundingClientRect(),r=n.width;W=n.height,r>S&&(S=r)})),F="rotate("+c+" 0,"+(W/2+n.tickPadding())+")";var D=Math.abs(Math.sin(c*Math.PI/180));w=(D?D*S:S)+30,E.attr("transform",F).style("text-anchor",c%360>0?"start":"end")}else f?E.attr("transform",(function(t,e){return"translate(0,"+(e%2==0?"0":"12")+")"})):E.attr("transform","translate(0,0)");C.enter().append("text").attr("class","nv-axislabel"),M=0,1===i.range().length?M=p?2*i.range()[0]+i.rangeBand():0:2===i.range().length?M=p?i.range()[0]+i.range()[1]+i.rangeBand():i.range()[1]:i.range().length>2&&(M=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",w).attr("x",M/2),u&&((A=y.selectAll("g.nv-axisMaxMin").data([i.domain()[0],i.domain()[i.domain().length-1]])).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")})).append("text"),A.exit().remove(),A.attr("transform",(function(t,e){return"translate("+r.utils.NaNtoZero(i(t)+(p?i.rangeBand()/2:0))+",0)"})).select("text").attr("dy",".71em").attr("y",n.tickPadding()).attr("transform",F).style("text-anchor",c?c%360>0?"start":"end":"middle").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),A.watchTransition(x,"min-max bottom").attr("transform",(function(t,e){return"translate("+r.utils.NaNtoZero(i(t)+(p?i.rangeBand()/2:0))+",0)"})));break;case"right":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"begin").attr("transform",d?"rotate(90)":"").attr("y",d?12-Math.max(o.right,a)-(g||0):-10).attr("x",d?d3.max(i.range())/2:n.tickPadding()),u&&((A=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")})).append("text").style("opacity",0),A.exit().remove(),A.attr("transform",(function(t,e){return"translate(0,"+r.utils.NaNtoZero(i(t))+")"})).select("text").attr("dy",".32em").attr("y",0).attr("x",n.tickPadding()).style("text-anchor","start").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),A.watchTransition(x,"min-max right").attr("transform",(function(t,e){return"translate(0,"+r.utils.NaNtoZero(i.range()[e])+")"})).select("text").style("opacity",1));break;case"left":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"end").attr("transform",d?"rotate(-90)":"").attr("y",d?25-Math.max(o.left,a)-(g||0):-10).attr("x",d?-d3.max(i.range())/2:-n.tickPadding()),u&&((A=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")})).append("text").style("opacity",0),A.exit().remove(),A.attr("transform",(function(t,n){return"translate(0,"+r.utils.NaNtoZero(e(t))+")"})).select("text").attr("dy",".32em").attr("y",0).attr("x",-n.tickPadding()).attr("text-anchor","end").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),A.watchTransition(x,"min-max right").attr("transform",(function(t,e){return"translate(0,"+r.utils.NaNtoZero(i.range()[e])+")"})).select("text").style("opacity",1))}if(C.text((function(t){return t})),!u||"left"!==n.orient()&&"right"!==n.orient()||(b.selectAll("g").each((function(t,e){d3.select(this).select("text").attr("opacity",1),(i(t)<i.range()[1]+10||i(t)>i.range()[0]-10)&&((t>1e-10||t<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))})),i.domain()[0]==i.domain()[1]&&0==i.domain()[0]&&y.selectAll("g.nv-axisMaxMin").style("opacity",(function(t,e){return e?0:1}))),u&&("top"===n.orient()||"bottom"===n.orient())){var _=[];y.selectAll("g.nv-axisMaxMin").each((function(t,e){try{e?_.push(i(t)-this.getBoundingClientRect().width-4):_.push(i(t)+this.getBoundingClientRect().width+4)}catch(n){e?_.push(i(t)-4):_.push(i(t)+4)}})),b.selectAll("g").each((function(t,e){(i(t)<_[0]||i(t)>_[1])&&(t>1e-10||t<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove())}))}b.selectAll(".tick").filter((function(t){return!parseFloat(Math.round(1e5*t)/1e6)&&void 0!==t})).classed("zero",!0),e=i.copy()})),x.renderEnd("axis immediate"),b}return b.axis=n,b.dispatch=y,b.options=r.utils.optionsFunc.bind(b),b._options=Object.create({},{axisLabelDistance:{get:function(){return g},set:function(t){g=t}},staggerLabels:{get:function(){return f},set:function(t){f=t}},rotateLabels:{get:function(){return c},set:function(t){c=t}},rotateYLabel:{get:function(){return d},set:function(t){d=t}},showMaxMin:{get:function(){return u},set:function(t){u=t}},axisLabel:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return s},set:function(t){s=t}},ticks:{get:function(){return h},set:function(t){h=t}},width:{get:function(){return a},set:function(t){a=t}},fontSize:{get:function(){return v},set:function(t){v=t}},tickFormatMaxMin:{get:function(){return t},set:function(e){t=e}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},duration:{get:function(){return m},set:function(t){m=t,x.reset(m)}},scale:{get:function(){return i},set:function(t){i=t,n.scale(i),p="function"==typeof i.rangeBands,r.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"])}}}),r.utils.initOptions(b),r.utils.inheritOptionsD3(b,n,["orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"]),r.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"]),b},r.models.boxPlot=function(){"use strict";var t,e,n,i,o,a,s={top:0,right:0,bottom:0,left:0},l=960,u=500,c=Math.floor(1e4*Math.random()),d=d3.scale.ordinal(),f=d3.scale.linear(),p=function(t){return t.label},h=function(t){return t.values.Q1},g=function(t){return t.values.Q2},v=function(t){return t.values.Q3},m=function(t){return t.values.whisker_low},y=function(t){return t.values.whisker_high},x=function(t){return t.color},b=function(t){return t.values.outliers},k=function(t,e,n){return t},w=function(t,e,n){return t},A=function(t,e,n){},M=r.utils.defaultColor(),C=null,S=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),W=250,E=null,F=r.utils.renderWatch(S,W);function D(c){return F.reset(),c.each((function(c){var D=l-s.left-s.right,_=u-s.top-s.bottom;C=d3.select(this),r.utils.initSVG(C),d.domain(t||c.map((function(t,e){return p(t,e)}))).rangeBands(e||[0,D],.1);var N=[];if(!n){var O=[];c.forEach((function(t,e){var n=h(t),r=v(t),i=m(t),o=y(t),a=b(t);a&&a.forEach((function(t,e){O.push(k(t,e,void 0))})),i&&O.push(i),n&&O.push(n),r&&O.push(r),o&&O.push(o)})),N=[d3.min(O),d3.max(O)]}f.domain(n||N),f.range(i||[_,0]),o=o||d,a=a||f.copy().range([f(0),f(0)]);var L=C.selectAll("g.nv-wrap").data([c]);L.enter().append("g").attr("class","nvd3 nv-wrap"),L.attr("transform","translate("+s.left+","+s.top+")");var B=L.selectAll(".nv-boxplot").data((function(t){return t})),T=B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);B.attr("class","nv-boxplot").attr("transform",(function(t,e,n){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"})).classed("hover",(function(t){return t.hover})),B.watchTransition(F,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay((function(t,e){return e*W/c.length})).attr("transform",(function(t,e){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"})),B.exit().remove(),T.each((function(t,e){var n=d3.select(this);[m,y].forEach((function(r){if(void 0!==r(t)&&null!==r(t)){var i=r===m?"low":"high";n.append("line").style("stroke",x(t)||M(t,e)).attr("class","nv-boxplot-whisker nv-boxplot-"+i),n.append("line").style("stroke",x(t)||M(t,e)).attr("class","nv-boxplot-tick nv-boxplot-"+i)}}))}));var P=function(){return null===E?.9*d.rangeBand():Math.min(75,.9*d.rangeBand())},z=function(){return.45*d.rangeBand()-P()/2},I=function(){return.45*d.rangeBand()+P()/2};[m,y].forEach((function(t){var e=t===m?"low":"high",n=t===m?h:v;B.select("line.nv-boxplot-whisker.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",.45*d.rangeBand()).attr("y1",(function(e,n){return f(t(e))})).attr("x2",.45*d.rangeBand()).attr("y2",(function(t,e){return f(n(t))})),B.select("line.nv-boxplot-tick.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",z).attr("y1",(function(e,n){return f(t(e))})).attr("x2",I).attr("y2",(function(e,n){return f(t(e))}))})),[m,y].forEach((function(t){var e=t===m?"low":"high";T.selectAll(".nv-boxplot-"+e).on("mouseover",(function(e,n,r){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:t(e),color:x(e)||M(e,r)},e:d3.event})})).on("mouseout",(function(e,n,r){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:t(e),color:x(e)||M(e,r)},e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})}))})),T.append("rect").attr("class","nv-boxplot-box").on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),S.elementMouseover({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||M(t,e)},{key:"Q2",value:g(t),color:x(t)||M(t,e)},{key:"Q1",value:h(t),color:x(t)||M(t,e)}],data:t,index:e,e:d3.event})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),S.elementMouseout({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||M(t,e)},{key:"Q2",value:g(t),color:x(t)||M(t,e)},{key:"Q1",value:h(t),color:x(t)||M(t,e)}],data:t,index:e,e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})})),B.select("rect.nv-boxplot-box").watchTransition(F,"nv-boxplot: boxes").attr("y",(function(t,e){return f(v(t))})).attr("width",P).attr("x",z).attr("height",(function(t,e){return Math.abs(f(v(t))-f(h(t)))||1})).style("fill",(function(t,e){return x(t)||M(t,e)})).style("stroke",(function(t,e){return x(t)||M(t,e)})),T.append("line").attr("class","nv-boxplot-median"),B.select("line.nv-boxplot-median").watchTransition(F,"nv-boxplot: boxplots line").attr("x1",z).attr("y1",(function(t,e){return f(g(t))})).attr("x2",I).attr("y2",(function(t,e){return f(g(t))}));var V=B.selectAll(".nv-boxplot-outlier").data((function(t){return b(t)||[]}));V.enter().append("circle").style("fill",(function(t,e,n){return A(t,e,n)||M(t,n)})).style("stroke",(function(t,e,n){return A(t,e,n)||M(t,n)})).style("z-index",9e3).on("mouseover",(function(t,e,n){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:w(t,e,n),color:A(t,e,n)||M(t,n)},e:d3.event})})).on("mouseout",(function(t,e,n){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:w(t,e,n),color:A(t,e,n)||M(t,n)},e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})})),V.attr("class","nv-boxplot-outlier"),V.watchTransition(F,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*d.rangeBand()).attr("cy",(function(t,e,n){return f(k(t,e,n))})).attr("r","3"),V.exit().remove(),o=d.copy(),a=f.copy()})),F.renderEnd("nv-boxplot immediate"),D}return D.dispatch=S,D.options=r.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return u},set:function(t){u=t}},maxBoxWidth:{get:function(){return E},set:function(t){E=t}},x:{get:function(){return p},set:function(t){p=t}},q1:{get:function(){return h},set:function(t){h=t}},q2:{get:function(){return g},set:function(t){g=t}},q3:{get:function(){return v},set:function(t){v=t}},wl:{get:function(){return m},set:function(t){m=t}},wh:{get:function(){return y},set:function(t){y=t}},itemColor:{get:function(){return x},set:function(t){x=t}},outliers:{get:function(){return b},set:function(t){b=t}},outlierValue:{get:function(){return k},set:function(t){k=t}},outlierLabel:{get:function(){return w},set:function(t){w=t}},outlierColor:{get:function(){return A},set:function(t){A=t}},xScale:{get:function(){return d},set:function(t){d=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return t},set:function(e){t=e}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return e},set:function(t){e=t}},yRange:{get:function(){return i},set:function(t){i=t}},id:{get:function(){return c},set:function(t){c=t}},y:{get:function(){return console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead."),{}},set:function(t){console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead.")}},margin:{get:function(){return s},set:function(t){s.top=void 0!==t.top?t.top:s.top,s.right=void 0!==t.right?t.right:s.right,s.bottom=void 0!==t.bottom?t.bottom:s.bottom,s.left=void 0!==t.left?t.left:s.left}},color:{get:function(){return M},set:function(t){M=r.utils.getColor(t)}},duration:{get:function(){return W},set:function(t){W=t,F.reset(W)}}}),r.utils.initOptions(D),D},r.models.boxPlotChart=function(){"use strict";var t,e,n=r.models.boxPlot(),i=r.models.axis(),o=r.models.axis(),a={top:15,right:10,bottom:50,left:60},s=null,l=null,u=r.utils.getColor(),c=!0,d=!0,f=!1,p=!1,h=r.models.tooltip(),g="No Data Available.",v=d3.dispatch("beforeUpdate","renderEnd"),m=250;i.orient("bottom").showMaxMin(!1).tickFormat((function(t){return t})),o.orient(f?"right":"left").tickFormat(d3.format(",.1f")),h.duration(0);var y=r.utils.renderWatch(v,m);function x(u){return y.reset(),y.models(n),c&&y.models(i),d&&y.models(o),u.each((function(u){var h=d3.select(this);r.utils.initSVG(h);var y=(s||parseInt(h.style("width"))||960)-a.left-a.right,b=(l||parseInt(h.style("height"))||400)-a.top-a.bottom;if(x.update=function(){v.beforeUpdate(),h.transition().duration(m).call(x)},x.container=this,!u||!u.length){var k=h.selectAll(".nv-noData").data([g]);return k.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),k.attr("x",a.left+y/2).attr("y",a.top+b/2).text((function(t){return t})),x}h.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale().clamp(!0);var w=h.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([u]),A=w.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),M=A.append("defs"),C=w.select("g");if(A.append("g").attr("class","nv-x nv-axis"),A.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),A.append("g").attr("class","nv-barsWrap"),C.attr("transform","translate("+a.left+","+a.top+")"),f&&C.select(".nv-y.nv-axis").attr("transform","translate("+y+",0)"),n.width(y).height(b),C.select(".nv-barsWrap").datum(u.filter((function(t){return!t.disabled}))).transition().call(n),M.append("clipPath").attr("id","nv-x-label-clip-"+n.id()).append("rect"),C.select("#nv-x-label-clip-"+n.id()+" rect").attr("width",t.rangeBand()*(p?2:1)).attr("height",16).attr("x",-t.rangeBand()/(p?1:2)),c){i.scale(t).ticks(r.utils.calcTicksX(y/100,u)).tickSize(-b,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),C.select(".nv-x.nv-axis").call(i);var S=C.select(".nv-x.nv-axis").selectAll("g");p&&S.selectAll("text").attr("transform",(function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"}))}d&&(o.scale(e).ticks(Math.floor(b/36)).tickSize(-y,0),C.select(".nv-y.nv-axis").call(o)),C.select(".nv-zeroLine line").attr("x1",0).attr("x2",y).attr("y1",e(0)).attr("y2",e(0))})),y.renderEnd("nv-boxplot chart immediate"),x}return n.dispatch.on("elementMouseover.tooltip",(function(t){h.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){h.data(t).hidden(!0)})),n.dispatch.on("elementMousemove.tooltip",(function(t){h()})),x.dispatch=v,x.boxplot=n,x.xAxis=i,x.yAxis=o,x.tooltip=h,x.options=r.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},staggerLabels:{get:function(){return p},set:function(t){p=t}},showXAxis:{get:function(){return c},set:function(t){c=t}},showYAxis:{get:function(){return d},set:function(t){d=t}},tooltipContent:{get:function(){return h},set:function(t){h=t}},noData:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!==t.top?t.top:a.top,a.right=void 0!==t.right?t.right:a.right,a.bottom=void 0!==t.bottom?t.bottom:a.bottom,a.left=void 0!==t.left?t.left:a.left}},duration:{get:function(){return m},set:function(t){m=t,y.reset(m),n.duration(m),i.duration(m),o.duration(m)}},color:{get:function(){return u},set:function(t){u=r.utils.getColor(t),n.color(u)}},rightAlignYAxis:{get:function(){return f},set:function(t){f=t,o.orient(t?"right":"left")}}}),r.utils.inheritOptions(x,n),r.utils.initOptions(x),x},r.models.bullet=function(){"use strict";var t={top:0,right:0,bottom:0,left:0},e="left",n=!1,i=function(t){return t.ranges},o=function(t){return t.markers?t.markers:[]},a=function(t){return t.markerLines?t.markerLines:[0]},s=function(t){return t.measures},l=function(t){return t.rangeLabels?t.rangeLabels:[]},u=function(t){return t.markerLabels?t.markerLabels:[]},c=function(t){return t.markerLineLabels?t.markerLineLabels:[]},d=function(t){return t.measureLabels?t.measureLabels:[]},f=[0],p=380,h=30,g=null,v=null,m=r.utils.getColor(["#1f77b4"]),y=d3.dispatch("elementMouseover","elementMouseout","elementMousemove"),x=["Maximum","Mean","Minimum"],b=["Max","Avg","Min"],k=1e3;function w(t,e){var n=t.slice();t.sort((function(t,r){var i=n.indexOf(t),o=n.indexOf(r);return d3.descending(e[i],e[o])}))}function A(e){return e.each((function(e,v){var A=p-t.left-t.right,M=h-t.top-t.bottom;g=d3.select(this),r.utils.initSVG(g);var C=i.call(this,e,v).slice(),S=o.call(this,e,v).slice(),W=a.call(this,e,v).slice(),E=s.call(this,e,v).slice(),F=l.call(this,e,v).slice(),D=u.call(this,e,v).slice(),_=c.call(this,e,v).slice(),N=d.call(this,e,v).slice();w(F,C),w(D,S),w(_,W),w(N,E),C.sort(d3.descending),S.sort(d3.descending),W.sort(d3.descending),E.sort(d3.descending);var O=d3.scale.linear().domain(d3.extent(d3.merge([f,C]))).range(n?[A,0]:[0,A]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(O.range()),this.__chart__=O,d3.min(C),d3.max(C),C[1];for(var L=g.selectAll("g.nv-wrap.nv-bullet").data([e]),B=L.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet").append("g"),T=L.select("g"),P=(v=0,C.length);v<P;v++){var z="nv-range nv-range"+v;v<=2&&(z=z+" nv-range"+b[v]),B.append("rect").attr("class",z)}B.append("rect").attr("class","nv-measure"),L.attr("transform","translate("+t.left+","+t.top+")");var I=function(t){return Math.abs(O(t)-O(0))},V=function(t){return O(t<0?t:0)};for(v=0,P=C.length;v<P;v++){var H=C[v];T.select("rect.nv-range"+v).datum(H).attr("height",M).transition().duration(k).attr("width",I(H)).attr("x",V(H))}T.select("rect.nv-measure").style("fill",m).attr("height",M/3).attr("y",M/3).on("mouseover",(function(){y.elementMouseover({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).on("mousemove",(function(){y.elementMousemove({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).on("mouseout",(function(){y.elementMouseout({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).transition().duration(k).attr("width",E<0?O(0)-O(E[0]):O(E[0])-O(0)).attr("x",V(E));var Y=M/6,G=S.map((function(t,e){return{value:t,label:D[e]}}));B.selectAll("path.nv-markerTriangle").data(G).enter().append("path").attr("class","nv-markerTriangle").attr("d","M0,"+Y+"L"+Y+","+-Y+" "+-Y+","+-Y+"Z").on("mouseover",(function(t){y.elementMouseover({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[O(t.value),M/2]})})).on("mousemove",(function(t){y.elementMousemove({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){y.elementMouseout({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})),T.selectAll("path.nv-markerTriangle").data(G).transition().duration(k).attr("transform",(function(t){return"translate("+O(t.value)+","+M/2+")"}));var R=W.map((function(t,e){return{value:t,label:_[e]}}));B.selectAll("line.nv-markerLine").data(R).enter().append("line").attr("cursor","").attr("class","nv-markerLine").attr("x1",(function(t){return O(t.value)})).attr("y1","2").attr("x2",(function(t){return O(t.value)})).attr("y2",M-2).on("mouseover",(function(t){y.elementMouseover({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[O(t.value),M/2]})})).on("mousemove",(function(t){y.elementMousemove({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){y.elementMouseout({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})),T.selectAll("line.nv-markerLine").data(R).transition().duration(k).attr("x1",(function(t){return O(t.value)})).attr("x2",(function(t){return O(t.value)})),L.selectAll(".nv-range").on("mouseover",(function(t,e){var n=F[e]||x[e];y.elementMouseover({value:t,label:n,color:d3.select(this).style("fill")})})).on("mousemove",(function(){y.elementMousemove({value:E[0],label:N[0]||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){var n=F[e]||x[e];y.elementMouseout({value:t,label:n,color:d3.select(this).style("fill")})}))})),A}return A.dispatch=y,A.options=r.utils.optionsFunc.bind(A),A._options=Object.create({},{ranges:{get:function(){return i},set:function(t){i=t}},markers:{get:function(){return o},set:function(t){o=t}},measures:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return f},set:function(t){f=t}},width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},tickFormat:{get:function(){return v},set:function(t){v=t}},duration:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},orient:{get:function(){return e},set:function(t){n="right"==(e=t)||"bottom"==e}},color:{get:function(){return m},set:function(t){m=r.utils.getColor(t)}}}),r.utils.initOptions(A),A},r.models.bulletChart=function(){"use strict";var t=r.models.bullet(),e=r.models.tooltip(),n="left",i=!1,o={top:5,right:40,bottom:20,left:120},a=function(t){return t.ranges},s=function(t){return t.markers?t.markers:[]},l=function(t){return t.measures},u=null,c=55,d=null,f=null,p=null,h=d3.dispatch();function g(e){return e.each((function(n,p){var h=d3.select(this);r.utils.initSVG(h);var v=r.utils.availableWidth(u,h,o),m=c-o.top-o.bottom;if(g.update=function(){g(e)},g.container=this,!n||!a.call(this,n,p))return r.utils.noData(g,h),g;h.selectAll(".nv-noData").remove();var y=a.call(this,n,p).slice().sort(d3.descending),x=s.call(this,n,p).slice().sort(d3.descending),b=l.call(this,n,p).slice().sort(d3.descending),k=h.selectAll("g.nv-wrap.nv-bulletChart").data([n]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart").append("g"),A=k.select("g");w.append("g").attr("class","nv-bulletWrap"),w.append("g").attr("class","nv-titles"),k.attr("transform","translate("+o.left+","+o.top+")");var M=d3.scale.linear().domain([0,Math.max(y[0],x[0]||0,b[0])]).range(i?[v,0]:[0,v]),C=this.__chart__||d3.scale.linear().domain([0,1/0]).range(M.range());this.__chart__=M;var S=w.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(c-o.top-o.bottom)/2+")");S.append("text").attr("class","nv-title").text((function(t){return t.title})),S.append("text").attr("class","nv-subtitle").attr("dy","1em").text((function(t){return t.subtitle})),t.width(v).height(m);var W=A.select(".nv-bulletWrap");d3.transition(W).call(t);var E=d||M.tickFormat(v/100),F=A.selectAll("g.nv-tick").data(M.ticks(f||v/50),(function(t){return this.textContent||E(t)})),D=F.enter().append("g").attr("class","nv-tick").attr("transform",(function(t){return"translate("+C(t)+",0)"})).style("opacity",1e-6);D.append("line").attr("y1",m).attr("y2",7*m/6),D.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*m/6).text(E);var _=d3.transition(F).transition().duration(t.duration()).attr("transform",(function(t){return"translate("+M(t)+",0)"})).style("opacity",1);_.select("line").attr("y1",m).attr("y2",7*m/6),_.select("text").attr("y",7*m/6),d3.transition(F.exit()).transition().duration(t.duration()).attr("transform",(function(t){return"translate("+M(t)+",0)"})).style("opacity",1e-6).remove()})),d3.timer.flush(),g}return e.duration(0).headerEnabled(!1),t.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:t.label,value:t.value,color:t.color},e.data(t).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){e.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){e()})),g.bullet=t,g.dispatch=h,g.tooltip=e,g.options=r.utils.optionsFunc.bind(g),g._options=Object.create({},{ranges:{get:function(){return a},set:function(t){a=t}},markers:{get:function(){return s},set:function(t){s=t}},measures:{get:function(){return l},set:function(t){l=t}},width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},tickFormat:{get:function(){return d},set:function(t){d=t}},ticks:{get:function(){return f},set:function(t){f=t}},noData:{get:function(){return p},set:function(t){p=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},orient:{get:function(){return n},set:function(t){i="right"==(n=t)||"bottom"==n}}}),r.utils.inheritOptions(g,t),r.utils.initOptions(g),g},r.models.candlestickBar=function(){"use strict";var t,e,n,i,o,a={top:0,right:0,bottom:0,left:0},s=null,l=null,u=Math.floor(1e4*Math.random()),c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=function(t){return t.open},g=function(t){return t.close},v=function(t){return t.high},m=function(t){return t.low},y=[],x=[],b=!1,k=!0,w=r.utils.defaultColor(),A=!1,M=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");function C(w){return w.each((function(w){t=d3.select(this);var A=r.utils.availableWidth(s,t,a),C=r.utils.availableHeight(l,t,a);r.utils.initSVG(t);var S=A/w[0].values.length*.45;c.domain(e||d3.extent(w[0].values.map(f).concat(y))),b?c.range(i||[.5*A/w[0].values.length,A*(w[0].values.length-.5)/w[0].values.length]):c.range(i||[5+S/2,A-S/2-5]),d.domain(n||[d3.min(w[0].values.map(m).concat(x)),d3.max(w[0].values.map(v).concat(x))]).range(o||[C,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var W=d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([w[0].values]),E=W.enter().append("g").attr("class","nvd3 nv-wrap nv-candlestickBar"),F=E.append("defs"),D=E.append("g"),_=W.select("g");D.append("g").attr("class","nv-ticks"),W.attr("transform","translate("+a.left+","+a.top+")"),t.on("click",(function(t,e){M.chartClick({data:t,index:e,pos:d3.event,id:u})})),F.append("clipPath").attr("id","nv-chart-clip-path-"+u).append("rect"),W.select("#nv-chart-clip-path-"+u+" rect").attr("width",A).attr("height",C),_.attr("clip-path",k?"url(#nv-chart-clip-path-"+u+")":"");var N=W.select(".nv-ticks").selectAll(".nv-tick").data((function(t){return t}));N.exit().remove();var O=N.enter().append("g");N.attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})),O.append("line").attr("class","nv-candlestick-lines").attr("transform",(function(t,e){return"translate("+c(f(t,e))+",0)"})).attr("x1",0).attr("y1",(function(t,e){return d(v(t,e))})).attr("x2",0).attr("y2",(function(t,e){return d(m(t,e))})),O.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",(function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"})).attr("x",0).attr("y",0).attr("width",S).attr("height",(function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)})),N.select(".nv-candlestick-lines").transition().attr("transform",(function(t,e){return"translate("+c(f(t,e))+",0)"})).attr("x1",0).attr("y1",(function(t,e){return d(v(t,e))})).attr("x2",0).attr("y2",(function(t,e){return d(m(t,e))})),N.select(".nv-candlestick-rects").transition().attr("transform",(function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"})).attr("x",0).attr("y",0).attr("width",S).attr("height",(function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)}))})),C}return C.highlightPoint=function(e,n){C.clearHighlights(),t.select(".nv-candlestickBar .nv-tick-0-"+e).classed("hover",n)},C.clearHighlights=function(){t.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},C.dispatch=M,C.options=r.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceX:{get:function(){return y},set:function(t){y=t}},forceY:{get:function(){return x},set:function(t){x=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return k},set:function(t){k=t}},id:{get:function(){return u},set:function(t){u=t}},interactive:{get:function(){return A},set:function(t){A=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return a},set:function(t){a.top=null!=t.top?t.top:a.top,a.right=null!=t.right?t.right:a.right,a.bottom=null!=t.bottom?t.bottom:a.bottom,a.left=null!=t.left?t.left:a.left}},color:{get:function(){return w},set:function(t){w=r.utils.getColor(t)}}}),r.utils.initOptions(C),C},r.models.cumulativeLineChart=function(){"use strict";var t,e,n=r.models.line(),i=r.models.axis(),o=r.models.axis(),a=r.models.legend(),s=r.models.legend(),l=r.interactiveGuideline(),u=r.models.tooltip(),c={top:30,right:30,bottom:50,left:60},d=null,f=r.utils.defaultColor(),p=null,h=null,g=!0,v=!0,m=!0,y=!1,x=!0,b=!1,k=!0,w=n.id(),A=r.utils.state(),M=null,C=null,S=function(t){return t.average},W=d3.dispatch("stateChange","changeState","renderEnd"),E=250,F=!1;A.index=0,A.rescaleY=k,i.orient("bottom").tickPadding(7),o.orient(y?"right":"left"),u.valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.updateState(!1);var D,_=d3.scale.linear(),N={i:0,x:0},O=r.utils.renderWatch(W,E);function L(u){return O.reset(),O.models(n),v&&O.models(i),m&&O.models(o),u.each((function(u){var C=d3.select(this);r.utils.initSVG(C),C.classed("nv-chart-"+w,!0);var O,P=r.utils.availableWidth(p,C,c),z=r.utils.availableHeight(h,C,c);if(L.update=function(){0===E?C.call(L):C.transition().duration(E).call(L)},L.container=this,A.setter(function(t){return function(e){void 0!==e.index&&(N.i=e.index),void 0!==e.rescaleY&&(k=e.rescaleY),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(u),L.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),index:N.i,rescaleY:k}}}(u)).update(),A.disabled=u.map((function(t){return!!t.disabled})),!M)for(O in M={},A)A[O]instanceof Array?M[O]=A[O].slice(0):M[O]=A[O];var I=d3.behavior.drag().on("dragstart",(function(t,e){d3.select(L.container).style("cursor","ew-resize")})).on("drag",(function(t,e){N.x=d3.event.x,N.i=Math.round(_.invert(N.x)),Q()})).on("dragend",(function(t,e){d3.select(L.container).style("cursor","auto"),A.index=N.i,W.stateChange(A)}));if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return r.utils.noData(L,C),L;C.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale(),_.domain([0,u[0].values.length-1]).range([0,P]).clamp(!0),u=function(t,e){return B||(B=n.y()),e.map((function(e,n){if(!e.values)return e;var r=e.values[t];if(null==r)return e;var i=B(r,t);return Math.abs(i)<1e-5&&!F?(e.tempDisabled=!0,e):(e.tempDisabled=!1,e.values=e.values.map((function(t,e){return t.display={y:(B(t,e)-i)/i},t})),e)}))}(N.i,u),void 0===D&&(D=T(u)),k?n.yDomain(null):(n.yDomain(D),n.clipEdge(!0));var V=b?"none":"all",H=C.selectAll("g.nv-wrap.nv-cumulativeLine").data([u]),Y=H.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),G=H.select("g");if(Y.append("g").attr("class","nv-interactive"),Y.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),Y.append("g").attr("class","nv-y nv-axis"),Y.append("g").attr("class","nv-background"),Y.append("g").attr("class","nv-linesWrap").style("pointer-events",V),Y.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),Y.append("g").attr("class","nv-legendWrap"),Y.append("g").attr("class","nv-controlsWrap"),g?(a.width(P),G.select(".nv-legendWrap").datum(u).call(a),d||a.height()===c.top||(c.top=a.height(),z=r.utils.availableHeight(h,C,c)),G.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):G.select(".nv-legendWrap").selectAll("*").remove(),x){var R=[{key:"Re-scale y-axis",disabled:!k}];s.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),G.select(".nv-controlsWrap").datum(R).attr("transform","translate(0,"+-c.top+")").call(s)}else G.select(".nv-controlsWrap").selectAll("*").remove();H.attr("transform","translate("+c.left+","+c.top+")"),y&&G.select(".nv-y.nv-axis").attr("transform","translate("+P+",0)");var X=u.filter((function(t){return t.tempDisabled}));H.select(".tempDisabled").remove(),X.length&&H.append("text").attr("class","tempDisabled").attr("x",P/2).attr("y","-.71em").style("text-anchor","end").text(X.map((function(t){return t.key})).join(", ")+" values cannot be calculated for this time period."),b&&(l.width(P).height(z).margin({left:c.left,top:c.top}).svgContainer(C).xScale(t),H.select(".nv-interactive").call(l)),Y.select(".nv-background").append("rect"),G.select(".nv-background rect").attr("width",P).attr("height",z),n.y((function(t){return t.display.y})).width(P).height(z).color(u.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!u[e].disabled&&!u[e].tempDisabled})));var j=G.select(".nv-linesWrap").datum(u.filter((function(t){return!t.disabled&&!t.tempDisabled})));j.call(n),u.forEach((function(t,e){t.seriesIndex=e}));var Z=u.filter((function(t){return!t.disabled&&!!S(t)})),q=G.select(".nv-avgLinesWrap").selectAll("line").data(Z,(function(t){return t.key})),K=function(t){var n=e(S(t));return n<0?0:n>z?z:n};q.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",(function(t,e){return n.color()(t,t.seriesIndex)})).attr("x1",0).attr("x2",P).attr("y1",K).attr("y2",K),q.style("stroke-opacity",(function(t){var n=e(S(t));return n<0||n>z?0:1})).attr("x1",0).attr("x2",P).attr("y1",K).attr("y2",K),q.exit().remove();var U=j.selectAll(".nv-indexLine").data([N]);function Q(){U.data([N]);var t=L.duration();L.duration(0),L.update(),L.duration(t)}U.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).style("pointer-events","all").call(I),U.attr("transform",(function(t){return"translate("+_(t.i)+",0)"})).attr("height",z),v&&(i.scale(t)._ticks(r.utils.calcTicksX(P/70,u)).tickSize(-z,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),G.select(".nv-x.nv-axis").call(i)),m&&(o.scale(e)._ticks(r.utils.calcTicksY(z/36,u)).tickSize(-P,0),G.select(".nv-y.nv-axis").call(o)),G.select(".nv-background rect").on("click",(function(){N.x=d3.mouse(this)[0],N.i=Math.round(_.invert(N.x)),A.index=N.i,W.stateChange(A),Q()})),n.dispatch.on("elementClick",(function(t){N.i=t.pointIndex,N.x=_(N.i),A.index=N.i,W.stateChange(A),Q()})),s.dispatch.on("legendClick",(function(t,e){t.disabled=!t.disabled,k=!t.disabled,A.rescaleY=k,k||(D=T(u)),W.stateChange(A),L.update()})),a.dispatch.on("stateChange",(function(t){for(var e in t)A[e]=t[e];W.stateChange(A),L.update()})),l.dispatch.on("elementMousemove",(function(t){n.clearHighlights();var e,a,s,c=[];if(u.filter((function(t,e){return t.seriesIndex=e,!(t.disabled||t.tempDisabled)})).forEach((function(i,o){a=r.interactiveBisect(i.values,t.pointXValue,L.x()),n.highlightPoint(o,a,!0);var l=i.values[a];void 0!==l&&(void 0===e&&(e=l),void 0===s&&(s=L.xScale()(L.x()(l,a))),c.push({key:i.key,value:L.y()(l,a),color:f(i,i.seriesIndex)}))})),c.length>2){var d=L.yScale().invert(t.mouseY),p=.03*Math.abs(L.yScale().domain()[0]-L.yScale().domain()[1]),h=r.nearestValueIndex(c.map((function(t){return t.value})),d,p);null!==h&&(c[h].highlight=!0)}var g=i.tickFormat()(L.x()(e,a),a);l.tooltip.valueFormatter((function(t,e){return o.tickFormat()(t)})).data({value:g,series:c})(),l.renderGuideLine(s)})),l.dispatch.on("elementMouseout",(function(t){n.clearHighlights()})),W.on("changeState",(function(t){void 0!==t.disabled&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),A.disabled=t.disabled),void 0!==t.index&&(N.i=t.index,N.x=_(N.i),A.index=t.index,U.data([N])),void 0!==t.rescaleY&&(k=t.rescaleY),L.update()}))})),O.renderEnd("cumulativeLineChart immediate"),L}n.dispatch.on("elementMouseover.tooltip",(function(t){var e={x:L.x()(t.point),y:L.y()(t.point),color:t.point.color};t.point=e,u.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){u.hidden(!0)}));var B=null;function T(t){var e=t.filter((function(t){return!(t.disabled||t.tempDisabled)})).map((function(t,e){return d3.extent(t.values,(function(t){return t.display.y}))}));return[d3.min(e,(function(t){return t[0]})),d3.max(e,(function(t){return t[1]}))]}return L.dispatch=W,L.lines=n,L.legend=a,L.controls=s,L.xAxis=i,L.yAxis=o,L.interactiveLayer=l,L.state=A,L.tooltip=u,L.options=r.utils.optionsFunc.bind(L),L._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showControls:{get:function(){return x},set:function(t){x=t}},showLegend:{get:function(){return g},set:function(t){g=t}},average:{get:function(){return S},set:function(t){S=t}},defaultState:{get:function(){return M},set:function(t){M=t}},noData:{get:function(){return C},set:function(t){C=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},noErrorCheck:{get:function(){return F},set:function(t){F=t}},rescaleY:{get:function(){return k},set:function(t){k=t,L.state.rescaleY=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t),a.color(f)}},useInteractiveGuideline:{get:function(){return b},set:function(t){b=t,!0===t&&(L.interactive(!1),L.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,o.orient(t?"right":"left")}},duration:{get:function(){return E},set:function(t){E=t,n.duration(E),i.duration(E),o.duration(E),O.reset(E)}}}),r.utils.inheritOptions(L,n),r.utils.initOptions(L),L},r.models.discreteBar=function(){"use strict";var t,e,n,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=d3.scale.ordinal(),p=d3.scale.linear(),h=function(t){return t.x},g=function(t){return t.y},v=[0],m=r.utils.defaultColor(),y=!1,x=d3.format(",.2f"),b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),k="discreteBar",w=250,A=r.utils.renderWatch(b,w);function M(d){return A.reset(),d.each((function(d){var w=u-l.left-l.right,M=c-l.top-l.bottom;t=d3.select(this),r.utils.initSVG(t),d.forEach((function(t,e){t.values.forEach((function(t){t.series=e}))}));var C=e&&n?[]:d.map((function(t){return t.values.map((function(t,e){return{x:h(t,e),y:g(t,e),y0:t.y0}}))}));f.domain(e||d3.merge(C).map((function(t){return t.x}))).rangeBands(i||[0,w],.1),p.domain(n||d3.extent(d3.merge(C).map((function(t){return t.y})).concat(v))),y?p.range(o||[M-(p.domain()[0]<0?12:0),p.domain()[1]>0?12:0]):p.range(o||[M,0]),a=a||f,s=s||p.copy().range([p(0),p(0)]);var S=t.selectAll("g.nv-wrap.nv-discretebar").data([d]),W=S.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar").append("g");S.select("g"),W.append("g").attr("class","nv-groups"),S.attr("transform","translate("+l.left+","+l.top+")");var E=S.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));E.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),E.exit().watchTransition(A,"discreteBar: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),E.attr("class",(function(t,e){return"nv-group nv-series-"+e})).classed("hover",(function(t){return t.hover})),E.watchTransition(A,"discreteBar: groups").style("stroke-opacity",1).style("fill-opacity",.75);var F=E.selectAll("g.nv-bar").data((function(t){return t.values}));F.exit().remove();var D=F.enter().append("g").attr("transform",(function(t,e,n){return"translate("+(f(h(t,e))+.05*f.rangeBand())+", "+p(0)+")"})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),b.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),b.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e){b.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){b.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e){b.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}));D.append("rect").attr("height",0).attr("width",.9*f.rangeBand()/d.length),y?(D.append("text").attr("text-anchor","middle"),F.select("text").text((function(t,e){return x(g(t,e))})).watchTransition(A,"discreteBar: bars text").attr("x",.9*f.rangeBand()/2).attr("y",(function(t,e){return g(t,e)<0?p(g(t,e))-p(0)+12:-4}))):F.selectAll("text").remove(),F.attr("class",(function(t,e){return g(t,e)<0?"nv-bar negative":"nv-bar positive"})).style("fill",(function(t,e){return t.color||m(t,e)})).style("stroke",(function(t,e){return t.color||m(t,e)})).select("rect").attr("class",k).watchTransition(A,"discreteBar: bars rect").attr("width",.9*f.rangeBand()/d.length),F.watchTransition(A,"discreteBar: bars").attr("transform",(function(t,e){return"translate("+(f(h(t,e))+.05*f.rangeBand())+", "+(g(t,e)<0?p(0):p(0)-p(g(t,e))<1?p(0)-1:p(g(t,e)))+")"})).select("rect").attr("height",(function(t,e){return Math.max(Math.abs(p(g(t,e))-p(0)),1)})),a=f.copy(),s=p.copy()})),A.renderEnd("discreteBar immediate"),M}return M.dispatch=b,M.options=r.utils.optionsFunc.bind(M),M._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},forceY:{get:function(){return v},set:function(t){v=t}},showValues:{get:function(){return y},set:function(t){y=t}},x:{get:function(){return h},set:function(t){h=t}},y:{get:function(){return g},set:function(t){g=t}},xScale:{get:function(){return f},set:function(t){f=t}},yScale:{get:function(){return p},set:function(t){p=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},valueFormat:{get:function(){return x},set:function(t){x=t}},id:{get:function(){return d},set:function(t){d=t}},rectClass:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},color:{get:function(){return m},set:function(t){m=r.utils.getColor(t)}},duration:{get:function(){return w},set:function(t){w=t,A.reset(w)}}}),r.utils.initOptions(M),M},r.models.discreteBarChart=function(){"use strict";var t,e,n=r.models.discreteBar(),i=r.models.axis(),o=r.models.axis(),a=r.models.legend(),s=r.models.tooltip(),l={top:15,right:10,bottom:50,left:60},u=null,c=null,d=null,f=r.utils.getColor(),p=!1,h=!0,g=!0,v=!1,m=!1,y=!1,x=0,b=null,k=d3.dispatch("beforeUpdate","renderEnd"),w=250;i.orient("bottom").showMaxMin(!1).tickFormat((function(t){return t})),o.orient(v?"right":"left").tickFormat(d3.format(",.1f")),s.duration(0).headerEnabled(!1).valueFormatter((function(t,e){return o.tickFormat()(t,e)})).keyFormatter((function(t,e){return i.tickFormat()(t,e)}));var A=r.utils.renderWatch(k,w);function M(s){return A.reset(),A.models(n),h&&A.models(i),g&&A.models(o),s.each((function(s){var f=d3.select(this);r.utils.initSVG(f);var b=r.utils.availableWidth(c,f,l),A=r.utils.availableHeight(d,f,l);if(M.update=function(){k.beforeUpdate(),f.transition().duration(w).call(M)},M.container=this,!(s&&s.length&&s.filter((function(t){return t.values.length})).length))return r.utils.noData(M,f),M;f.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale().clamp(!0);var C=f.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([s]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),W=S.append("defs"),E=C.select("g");if(S.append("g").attr("class","nv-x nv-axis"),S.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),S.append("g").attr("class","nv-barsWrap"),S.append("g").attr("class","nv-legendWrap"),E.attr("transform","translate("+l.left+","+l.top+")"),p?(a.width(b),E.select(".nv-legendWrap").datum(s).call(a),u||a.height()===l.top||(l.top=a.height(),A=r.utils.availableHeight(d,f,l)),C.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")):E.select(".nv-legendWrap").selectAll("*").remove(),v&&E.select(".nv-y.nv-axis").attr("transform","translate("+b+",0)"),n.width(b).height(A),E.select(".nv-barsWrap").datum(s.filter((function(t){return!t.disabled}))).transition().call(n),W.append("clipPath").attr("id","nv-x-label-clip-"+n.id()).append("rect"),E.select("#nv-x-label-clip-"+n.id()+" rect").attr("width",t.rangeBand()*(m?2:1)).attr("height",16).attr("x",-t.rangeBand()/(m?1:2)),h){i.scale(t)._ticks(r.utils.calcTicksX(b/100,s)).tickSize(-A,0),E.select(".nv-x.nv-axis").attr("transform","translate(0,"+(e.range()[0]+(n.showValues()&&e.domain()[0]<0?16:0))+")"),E.select(".nv-x.nv-axis").call(i);var F=E.select(".nv-x.nv-axis").selectAll("g");m&&F.selectAll("text").attr("transform",(function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"})),x&&F.selectAll(".tick text").attr("transform","rotate("+x+" 0,0)").style("text-anchor",x>0?"start":"end"),y&&E.selectAll(".tick text").call(r.utils.wrapTicks,M.xAxis.rangeBand())}g&&(o.scale(e)._ticks(r.utils.calcTicksY(A/36,s)).tickSize(-b,0),E.select(".nv-y.nv-axis").call(o)),E.select(".nv-zeroLine line").attr("x1",0).attr("x2",v?-b:b).attr("y1",e(0)).attr("y2",e(0))})),A.renderEnd("discreteBar chart immediate"),M}return n.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:M.x()(t.data),value:M.y()(t.data),color:t.color},s.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){s.hidden(!0)})),n.dispatch.on("elementMousemove.tooltip",(function(t){s()})),M.dispatch=k,M.discretebar=n,M.legend=a,M.xAxis=i,M.yAxis=o,M.tooltip=s,M.options=r.utils.optionsFunc.bind(M),M._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},showLegend:{get:function(){return p},set:function(t){p=t}},staggerLabels:{get:function(){return m},set:function(t){m=t}},rotateLabels:{get:function(){return x},set:function(t){x=t}},wrapLabels:{get:function(){return y},set:function(t){y=!!t}},showXAxis:{get:function(){return h},set:function(t){h=t}},showYAxis:{get:function(){return g},set:function(t){g=t}},noData:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return w},set:function(t){w=t,A.reset(w),n.duration(w),i.duration(w),o.duration(w)}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t),n.color(f),a.color(f)}},rightAlignYAxis:{get:function(){return v},set:function(t){v=t,o.orient(t?"right":"left")}}}),r.utils.inheritOptions(M,n),r.utils.initOptions(M),M},r.models.distribution=function(){"use strict";var t,e={top:0,right:0,bottom:0,left:0},n=400,i=8,o="x",a=function(t){return t[o]},s=r.utils.defaultColor(),l=d3.scale.linear(),u=250,c=d3.dispatch("renderEnd"),d=r.utils.renderWatch(c,u);function f(n){return d.reset(),n.each((function(n){"x"===o?(e.left,e.right):(e.top,e.bottom);var u="x"==o?"y":"x",c=d3.select(this);r.utils.initSVG(c),t=t||l;var f=c.selectAll("g.nv-distribution").data([n]),p=(f.enter().append("g").attr("class","nvd3 nv-distribution").append("g"),f.select("g"));f.attr("transform","translate("+e.left+","+e.top+")");var h=p.selectAll("g.nv-dist").data((function(t){return t}),(function(t){return t.key}));h.enter().append("g"),h.attr("class",(function(t,e){return"nv-dist nv-series-"+e})).style("stroke",(function(t,e){return s(t,e)}));var g=h.selectAll("line.nv-dist"+o).data((function(t){return t.values}));g.enter().append("line").attr(o+"1",(function(e,n){return t(a(e,n))})).attr(o+"2",(function(e,n){return t(a(e,n))})),d.transition(h.exit().selectAll("line.nv-dist"+o),"dist exit").attr(o+"1",(function(t,e){return l(a(t,e))})).attr(o+"2",(function(t,e){return l(a(t,e))})).style("stroke-opacity",0).remove(),g.attr("class",(function(t,e){return"nv-dist"+o+" nv-dist"+o+"-"+e})).attr(u+"1",0).attr(u+"2",i),d.transition(g,"dist").attr(o+"1",(function(t,e){return l(a(t,e))})).attr(o+"2",(function(t,e){return l(a(t,e))})),t=l.copy()})),d.renderEnd("distribution immediate"),f}return f.options=r.utils.optionsFunc.bind(f),f.dispatch=c,f.margin=function(t){return arguments.length?(e.top=void 0!==t.top?t.top:e.top,e.right=void 0!==t.right?t.right:e.right,e.bottom=void 0!==t.bottom?t.bottom:e.bottom,e.left=void 0!==t.left?t.left:e.left,f):e},f.width=function(t){return arguments.length?(n=t,f):n},f.axis=function(t){return arguments.length?(o=t,f):o},f.size=function(t){return arguments.length?(i=t,f):i},f.getData=function(t){return arguments.length?(a=d3.functor(t),f):a},f.scale=function(t){return arguments.length?(l=t,f):l},f.color=function(t){return arguments.length?(s=r.utils.getColor(t),f):s},f.duration=function(t){return arguments.length?(u=t,d.reset(u),f):u},f},r.models.focus=function(t){"use strict";t=t||r.models.line();var e,n,i=r.models.axis(),o=r.models.axis(),a=d3.svg.brush(),s={top:10,right:0,bottom:30,left:0},l=r.utils.defaultColor(),u=null,c=70,d=!0,f=!1,p=!1,h=null,g=250,v=d3.dispatch("brush","onBrush","renderEnd"),m=!0;t.interactive(!1),t.pointActive((function(t){return!1}));var y=r.utils.renderWatch(v,g);function x(b){return y.reset(),y.models(t),d&&y.models(i),f&&y.models(o),b.each((function(y){var b=d3.select(this);r.utils.initSVG(b);var k=r.utils.availableWidth(u,b,s),w=c-s.top-s.bottom;x.update=function(){0===g?b.call(x):b.transition().duration(g).call(x)},x.container=this,e=t.xScale(),n=t.yScale();var A=b.selectAll("g.nv-focus").data([y]),M=A.enter().append("g").attr("class","nvd3 nv-focus").append("g"),C=A.select("g");A.attr("transform","translate("+s.left+","+s.top+")"),M.append("g").attr("class","nv-background").append("rect"),M.append("g").attr("class","nv-x nv-axis"),M.append("g").attr("class","nv-y nv-axis"),M.append("g").attr("class","nv-contentWrap"),M.append("g").attr("class","nv-brushBackground"),M.append("g").attr("class","nv-x nv-brush"),p&&C.select(".nv-y.nv-axis").attr("transform","translate("+k+",0)"),C.select(".nv-background rect").attr("width",k).attr("height",w),t.width(k).height(w).color(y.map((function(t,e){return t.color||l(t,e)})).filter((function(t,e){return!y[e].disabled})));var S=C.select(".nv-contentWrap").datum(y.filter((function(t){return!t.disabled})));d3.transition(S).call(t),a.x(e).on("brush",(function(){D(m)})),a.on("brushend",(function(){m||v.onBrush(a.empty()?e.domain():a.extent())})),h&&a.extent(h);var W=C.select(".nv-brushBackground").selectAll("g").data([h||a.extent()]),E=W.enter().append("g");E.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",w),E.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",w);var F=C.select(".nv-x.nv-brush").call(a);function D(t){h=a.empty()?null:a.extent();var n=a.empty()?e.domain():a.extent();v.brush({extent:n,brush:a}),a.empty()||a.extent(h),W.data([a.empty()?e.domain():h]).each((function(t,n){var r=e(t[0])-e.range()[0],i=k-e(t[1]);d3.select(this).select(".left").attr("width",r<0?0:r),d3.select(this).select(".right").attr("x",e(t[1])).attr("width",i<0?0:i)})),t&&v.onBrush(n)}F.selectAll("rect").attr("height",w),F.selectAll(".resize").append("path").attr("d",(function(t){var e=+("e"==t),n=e?1:-1,r=w/3;return"M"+.5*n+","+r+"A6,6 0 0 "+e+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+e+" "+.5*n+","+2*r+"ZM"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)})),D(!0),C.select(".nv-background rect").attr("width",k).attr("height",w),d&&(i.scale(e)._ticks(r.utils.calcTicksX(k/100,y)).tickSize(-w,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),d3.transition(C.select(".nv-x.nv-axis")).call(i)),f&&(o.scale(n)._ticks(r.utils.calcTicksY(w/36,y)).tickSize(-k,0),d3.transition(C.select(".nv-y.nv-axis")).call(o)),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")")})),y.renderEnd("focus immediate"),x}return x.dispatch=v,x.content=t,x.brush=a,x.xAxis=i,x.yAxis=o,x.options=r.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},showXAxis:{get:function(){return d},set:function(t){d=t}},showYAxis:{get:function(){return f},set:function(t){f=t}},brushExtent:{get:function(){return h},set:function(t){h=t}},syncBrushing:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return s},set:function(t){s.top=void 0!==t.top?t.top:s.top,s.right=void 0!==t.right?t.right:s.right,s.bottom=void 0!==t.bottom?t.bottom:s.bottom,s.left=void 0!==t.left?t.left:s.left}},duration:{get:function(){return g},set:function(e){g=e,y.reset(g),t.duration(g),i.duration(g),o.duration(g)}},color:{get:function(){return l},set:function(e){l=r.utils.getColor(e),t.color(l)}},interpolate:{get:function(){return t.interpolate()},set:function(e){t.interpolate(e)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t)}},x:{get:function(){return t.x()},set:function(e){t.x(e)}},y:{get:function(){return t.y()},set:function(e){t.y(e)}},rightAlignYAxis:{get:function(){return p},set:function(t){p=t,o.orient(p?"right":"left")}}}),r.utils.inheritOptions(x,t),r.utils.initOptions(x),x},r.models.forceDirectedGraph=function(){"use strict";var t={top:2,right:0,bottom:2,left:0},e=400,n=32,i=null,o=d3.dispatch("renderEnd"),a=r.utils.getColor(["#000"]),s=r.models.tooltip(),l=null,u=.1,c=.9,d=30,f=-120,p=.1,h=.8,g=.1,v=5,m=function(t){},y=function(t){},x=d3.functor(0),b=d3.functor(0),k=r.utils.renderWatch(o);function w(o){return k.reset(),o.each((function(o){i=d3.select(this),r.utils.initSVG(i);var l=r.utils.availableWidth(e,i,t),x=r.utils.availableHeight(n,i,t);if(i.attr("width",l).attr("height",x),!(o&&o.links&&o.nodes))return r.utils.noData(w,i),w;i.selectAll(".nv-noData").remove(),i.selectAll("*").remove();var b=new Set;o.nodes.forEach((function(t){Object.keys(t).forEach((function(t){b.add(t)}))}));var k=d3.layout.force().nodes(o.nodes).links(o.links).size([l,x]).linkStrength(u).friction(c).linkDistance(d).charge(f).gravity(p).theta(h).alpha(g).start(),A=i.selectAll(".link").data(o.links).enter().append("line").attr("class","nv-force-link").style("stroke-width",(function(t){return Math.sqrt(t.value)})),M=i.selectAll(".node").data(o.nodes).enter().append("g").attr("class","nv-force-node").call(k.drag);M.append("circle").attr("r",v).style("fill",(function(t){return a(t)})).on("mouseover",(function(t){i.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.py),i.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.px);var e=a(t);t.series=[],b.forEach((function(n){t.series.push({color:e,key:n,value:t[n]})})),s.data(t).hidden(!1)})).on("mouseout",(function(t){s.hidden(!0)})),s.headerFormatter((function(t){return"Node"})),y(A),m(M),k.on("tick",(function(){A.attr("x1",(function(t){return t.source.x})).attr("y1",(function(t){return t.source.y})).attr("x2",(function(t){return t.target.x})).attr("y2",(function(t){return t.target.y})),M.attr("transform",(function(t){return"translate("+t.x+", "+t.y+")"}))}))})),w}return w.options=r.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return e},set:function(t){e=t}},height:{get:function(){return n},set:function(t){n=t}},linkStrength:{get:function(){return u},set:function(t){u=t}},friction:{get:function(){return c},set:function(t){c=t}},linkDist:{get:function(){return d},set:function(t){d=t}},charge:{get:function(){return f},set:function(t){f=t}},gravity:{get:function(){return p},set:function(t){p=t}},theta:{get:function(){return h},set:function(t){h=t}},alpha:{get:function(){return g},set:function(t){g=t}},radius:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return a},set:function(t){a=r.utils.getColor(t)}},noData:{get:function(){return l},set:function(t){l=t}},nodeExtras:{get:function(){return m},set:function(t){m=t}},linkExtras:{get:function(){return y},set:function(t){y=t}}}),w.dispatch=o,w.tooltip=s,r.utils.initOptions(w),w},r.models.furiousLegend=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},e=400,n=20,i=function(t){return t.key},o=function(t){return t},a=r.utils.getColor(),s=20,l=!0,u=28,c=!0,d=!0,f=!1,p=!1,h=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),g="classic";function v(m){function y(t,e){return"furious"!=g?"#000":p?t.disengaged?a(t,e):"#fff":p?void 0:t.disabled?a(t,e):"#fff"}function x(t,e){return p&&"furious"==g?t.disengaged?"#fff":a(t,e):t.disabled?"#fff":a(t,e)}return m.each((function(v){var m=e-t.left-t.right,b=d3.select(this);r.utils.initSVG(b);var k=b.selectAll("g.nv-legend").data([v]),w=(k.enter().append("g").attr("class","nvd3 nv-legend").append("g"),k.select("g"));k.attr("transform","translate("+t.left+","+t.top+")");var A,M=w.selectAll(".nv-series").data((function(t){return"furious"!=g?t:t.filter((function(t){return!!p||!t.disengaged}))})),C=M.enter().append("g").attr("class","nv-series");"classic"==g?(C.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),A=M.select("circle")):"furious"==g&&(C.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),A=M.select("rect"),C.append("g").attr("class","nv-check-box").property("innerHTML",'<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr("transform","translate(-10,-8)scale(0.5)"),M.select(".nv-check-box").each((function(t,e){d3.select(this).selectAll("path").attr("stroke",y(t,e))}))),C.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var S,W=M.select("text.nv-legend-text");switch(M.on("mouseover",(function(t,e){h.legendMouseover(t,e)})).on("mouseout",(function(t,e){h.legendMouseout(t,e)})).on("click",(function(t,e){h.legendClick(t,e);var n=M.data();d&&("classic"==g?f?(n.forEach((function(t){t.disabled=!0})),t.disabled=!1):(t.disabled=!t.disabled,n.every((function(t){return t.disabled}))&&n.forEach((function(t){t.disabled=!1}))):"furious"==g&&(p?(t.disengaged=!t.disengaged,t.userDisabled=null==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled):p||(t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter((function(t){return!t.disengaged})).every((function(t){return t.userDisabled}))&&n.forEach((function(t){t.disabled=t.userDisabled=!1})))),h.stateChange({disabled:n.map((function(t){return!!t.disabled})),disengaged:n.map((function(t){return!!t.disengaged}))}))})).on("dblclick",(function(t,e){if(("furious"!=g||!p)&&(h.legendDblclick(t,e),d)){var n=M.data();n.forEach((function(t){t.disabled=!0,"furious"==g&&(t.userDisabled=t.disabled)})),t.disabled=!1,"furious"==g&&(t.userDisabled=t.disabled),h.stateChange({disabled:n.map((function(t){return!!t.disabled}))})}})),M.classed("nv-disabled",(function(t){return t.userDisabled})),M.exit().remove(),W.attr("fill",y).text((function(t){return o(i(t))})),g){case"furious":S=23;break;case"classic":S=20}if(l){var E=[];M.each((function(t,e){var n,a;if(o(i(t))&&o(i(t)).length>s){var l=o(i(t)).substring(0,s);n=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(t)))}else n=d3.select(this).select("text");try{if((a=n.node().getComputedTextLength())<=0)throw Error()}catch(t){a=r.utils.calcApproxTextWidth(n)}E.push(a+u)}));for(var F=0,D=0,_=[];D<m&&F<E.length;)_[F]=E[F],D+=E[F++];for(0===F&&(F=1);D>m&&F>1;){_=[],F--;for(var N=0;N<E.length;N++)E[N]>(_[N%F]||0)&&(_[N%F]=E[N]);D=_.reduce((function(t,e,n,r){return t+e}))}for(var O=[],L=0,B=0;L<F;L++)O[L]=B,B+=_[L];M.attr("transform",(function(t,e){return"translate("+O[e%F]+","+(5+Math.floor(e/F)*S)+")"})),c?w.attr("transform","translate("+(e-t.right-D)+","+t.top+")"):w.attr("transform","translate(0,"+t.top+")"),n=t.top+t.bottom+Math.ceil(E.length/F)*S}else{var T,P=5,z=5,I=0;M.attr("transform",(function(n,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return T=z,e<t.left+t.right+T+i&&(z=T=5,P+=S),(z+=i)>I&&(I=z),"translate("+T+","+P+")"})),w.attr("transform","translate("+(e-t.right-I)+","+t.top+")"),n=t.top+t.bottom+P+15}"furious"==g&&A.attr("width",(function(t,e){return W[0][e].getComputedTextLength()+27})).attr("height",18).attr("y",-9).attr("x",-15),A.style("fill",x).style("stroke",(function(t,e){return t.color||a(t,e)}))})),v}return v.dispatch=h,v.options=r.utils.optionsFunc.bind(v),v._options=Object.create({},{width:{get:function(){return e},set:function(t){e=t}},height:{get:function(){return n},set:function(t){n=t}},key:{get:function(){return i},set:function(t){i=t}},keyFormatter:{get:function(){return o},set:function(t){o=t}},align:{get:function(){return l},set:function(t){l=t}},rightAlign:{get:function(){return c},set:function(t){c=t}},maxKeyLength:{get:function(){return s},set:function(t){s=t}},padding:{get:function(){return u},set:function(t){u=t}},updateState:{get:function(){return d},set:function(t){d=t}},radioButtonMode:{get:function(){return f},set:function(t){f=t}},expanded:{get:function(){return p},set:function(t){p=t}},vers:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return a},set:function(t){a=r.utils.getColor(t)}}}),r.utils.initOptions(v),v},r.models.historicalBar=function(){"use strict";var t,e,n,i,o={top:0,right:0,bottom:0,left:0},a=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=[],g=[0],v=!1,m=!0,y=r.utils.defaultColor(),x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),b=!0,k=r.utils.renderWatch(x,0);function w(A){return A.each((function(w){k.reset(),u=d3.select(this);var A=r.utils.availableWidth(a,u,o),M=r.utils.availableHeight(s,u,o);r.utils.initSVG(u),c.domain(t||d3.extent(w[0].values.map(f).concat(h))),v?c.range(n||[.5*A/w[0].values.length,A*(w[0].values.length-.5)/w[0].values.length]):c.range(n||[0,A]),d.domain(e||d3.extent(w[0].values.map(p).concat(g))).range(i||[M,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var C=u.selectAll("g.nv-wrap.nv-historicalBar-"+l).data([w[0].values]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+l),W=S.append("defs"),E=S.append("g"),F=C.select("g");E.append("g").attr("class","nv-bars"),C.attr("transform","translate("+o.left+","+o.top+")"),u.on("click",(function(t,e){x.chartClick({data:t,index:e,pos:d3.event,id:l})})),W.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect"),C.select("#nv-chart-clip-path-"+l+" rect").attr("width",A).attr("height",M),F.attr("clip-path",m?"url(#nv-chart-clip-path-"+l+")":"");var D=C.select(".nv-bars").selectAll(".nv-bar").data((function(t){return t}),(function(t,e){return f(t,e)}));D.exit().remove(),D.enter().append("rect").attr("x",0).attr("y",(function(t,e){return r.utils.NaNtoZero(d(Math.max(0,p(t,e))))})).attr("height",(function(t,e){return r.utils.NaNtoZero(Math.abs(d(p(t,e))-d(0)))})).attr("transform",(function(t,e){return"translate("+(c(f(t,e))-A/w[0].values.length*.45)+",0)"})).on("mouseover",(function(t,e){b&&(d3.select(this).classed("hover",!0),x.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")}))})).on("mouseout",(function(t,e){b&&(d3.select(this).classed("hover",!1),x.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")}))})).on("mousemove",(function(t,e){b&&x.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){b&&(x.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation())})).on("dblclick",(function(t,e){b&&(x.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation())})),D.attr("fill",(function(t,e){return y(t,e)})).attr("class",(function(t,e,n){return(p(t,e)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+n+"-"+e})).watchTransition(k,"bars").attr("transform",(function(t,e){return"translate("+(c(f(t,e))-A/w[0].values.length*.45)+",0)"})).attr("width",A/w[0].values.length*.9),D.watchTransition(k,"bars").attr("y",(function(t,e){var n=p(t,e)<0?d(0):d(0)-d(p(t,e))<1?d(0)-1:d(p(t,e));return r.utils.NaNtoZero(n)})).attr("height",(function(t,e){return r.utils.NaNtoZero(Math.max(Math.abs(d(p(t,e))-d(0)),1))}))})),k.renderEnd("historicalBar immediate"),w}return w.highlightPoint=function(t,e){u.select(".nv-bars .nv-bar-0-"+t).classed("hover",e)},w.clearHighlights=function(){u.select(".nv-bars .nv-bar.hover").classed("hover",!1)},w.dispatch=x,w.options=r.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return h},set:function(t){h=t}},forceY:{get:function(){return g},set:function(t){g=t}},padData:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return t},set:function(e){t=e}},yDomain:{get:function(){return e},set:function(t){e=t}},xRange:{get:function(){return n},set:function(t){n=t}},yRange:{get:function(){return i},set:function(t){i=t}},clipEdge:{get:function(){return m},set:function(t){m=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return y},set:function(t){y=r.utils.getColor(t)}}}),r.utils.initOptions(w),w},r.models.historicalBarChart=function(t){"use strict";var e,n,i=t||r.models.historicalBar(),o=r.models.axis(),a=r.models.axis(),s=r.models.legend(),l=r.interactiveGuideline(),u=r.models.tooltip(),c={top:30,right:90,bottom:50,left:90},d=null,f=r.utils.defaultColor(),p=null,h=null,g=!1,v=!0,m=!0,y=!1,x=!1,b={},k=null,w=null,A=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),M=250;o.orient("bottom").tickPadding(7),a.orient(y?"right":"left"),u.duration(0).headerEnabled(!1).valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return o.tickFormat()(t,e)}));var C=r.utils.renderWatch(A,0);function S(t){return t.each((function(u){C.reset(),C.models(i),v&&C.models(o),m&&C.models(a);var w=d3.select(this);r.utils.initSVG(w);var W,E=r.utils.availableWidth(p,w,c),F=r.utils.availableHeight(h,w,c);if(S.update=function(){w.transition().duration(M).call(S)},S.container=this,b.disabled=u.map((function(t){return!!t.disabled})),!k)for(W in k={},b)b[W]instanceof Array?k[W]=b[W].slice(0):k[W]=b[W];if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return r.utils.noData(S,w),S;w.selectAll(".nv-noData").remove(),e=i.xScale(),n=i.yScale();var D=w.selectAll("g.nv-wrap.nv-historicalBarChart").data([u]),_=D.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),N=D.select("g");_.append("g").attr("class","nv-x nv-axis"),_.append("g").attr("class","nv-y nv-axis"),_.append("g").attr("class","nv-barsWrap"),_.append("g").attr("class","nv-legendWrap"),_.append("g").attr("class","nv-interactive"),g?(s.width(E),N.select(".nv-legendWrap").datum(u).call(s),d||s.height()===c.top||(c.top=s.height(),F=r.utils.availableHeight(h,w,c)),D.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):N.select(".nv-legendWrap").selectAll("*").remove(),D.attr("transform","translate("+c.left+","+c.top+")"),y&&N.select(".nv-y.nv-axis").attr("transform","translate("+E+",0)"),x&&(l.width(E).height(F).margin({left:c.left,top:c.top}).svgContainer(w).xScale(e),D.select(".nv-interactive").call(l)),i.width(E).height(F).color(u.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!u[e].disabled}))),N.select(".nv-barsWrap").datum(u.filter((function(t){return!t.disabled}))).transition().call(i),v&&(o.scale(e)._ticks(r.utils.calcTicksX(E/100,u)).tickSize(-F,0),N.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),N.select(".nv-x.nv-axis").transition().call(o)),m&&(a.scale(n)._ticks(r.utils.calcTicksY(F/36,u)).tickSize(-E,0),N.select(".nv-y.nv-axis").transition().call(a)),l.dispatch.on("elementMousemove",(function(t){i.clearHighlights();var e,n,s,c=[];u.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(o,a){n=r.interactiveBisect(o.values,t.pointXValue,S.x()),i.highlightPoint(n,!0);var l=o.values[n];void 0!==l&&(void 0===e&&(e=l),void 0===s&&(s=S.xScale()(S.x()(l,n))),c.push({key:o.key,value:S.y()(l,n),color:f(o,o.seriesIndex),data:o.values[n]}))}));var d=o.tickFormat()(S.x()(e,n));l.tooltip.valueFormatter((function(t,e){return a.tickFormat()(t)})).data({value:d,index:n,series:c})(),l.renderGuideLine(s)})),l.dispatch.on("elementMouseout",(function(t){A.tooltipHide(),i.clearHighlights()})),s.dispatch.on("legendClick",(function(e,n){e.disabled=!e.disabled,u.filter((function(t){return!t.disabled})).length||u.map((function(t){return t.disabled=!1,D.selectAll(".nv-series").classed("disabled",!1),t})),b.disabled=u.map((function(t){return!!t.disabled})),A.stateChange(b),t.transition().call(S)})),s.dispatch.on("legendDblclick",(function(t){u.forEach((function(t){t.disabled=!0})),t.disabled=!1,b.disabled=u.map((function(t){return!!t.disabled})),A.stateChange(b),S.update()})),A.on("changeState",(function(t){void 0!==t.disabled&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),b.disabled=t.disabled),S.update()}))})),C.renderEnd("historicalBarChart immediate"),S}return i.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:S.x()(t.data),value:S.y()(t.data),color:t.color},u.data(t).hidden(!1)})),i.dispatch.on("elementMouseout.tooltip",(function(t){u.hidden(!0)})),i.dispatch.on("elementMousemove.tooltip",(function(t){u()})),S.dispatch=A,S.bars=i,S.legend=s,S.xAxis=o,S.yAxis=a,S.interactiveLayer=l,S.tooltip=u,S.options=r.utils.optionsFunc.bind(S),S._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return g},set:function(t){g=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},defaultState:{get:function(){return k},set:function(t){k=t}},noData:{get:function(){return w},set:function(t){w=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t),s.color(f),i.color(f)}},duration:{get:function(){return M},set:function(t){M=t,C.reset(M),a.duration(M),o.duration(M)}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,a.orient(t?"right":"left")}},useInteractiveGuideline:{get:function(){return x},set:function(t){x=t,!0===t&&S.interactive(!1)}}}),r.utils.inheritOptions(S,i),r.utils.initOptions(S),S},r.models.ohlcBarChart=function(){var t=r.models.historicalBarChart(r.models.ohlcBar());return t.useInteractiveGuideline(!0),t.interactiveLayer.tooltip.contentGenerator((function(e){var n=e.series[0].data;return'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+e.value+"</h3><table><tr><td>open:</td><td>"+t.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+t.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+t.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+t.yAxis.tickFormat()(n.low)+"</td></tr></table>"})),t},r.models.candlestickBarChart=function(){var t=r.models.historicalBarChart(r.models.candlestickBar());return t.useInteractiveGuideline(!0),t.interactiveLayer.tooltip.contentGenerator((function(e){var n=e.series[0].data;return'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+e.value+"</h3><table><tr><td>open:</td><td>"+t.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+t.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+t.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+t.yAxis.tickFormat()(n.low)+"</td></tr></table>"})),t},r.models.legend=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},e=400,n=20,i=function(t){return t.key},o=function(t){return t},a=r.utils.getColor(),s=20,l=!0,u=32,c=!0,d=!0,f=!0,p=!1,h=!1,g=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),v="classic";function m(y){function x(t,e){return"furious"!=v?"#000":h?t.disengaged?"#000":"#fff":h?void 0:(t.color||(t.color=a(t,e)),t.disabled?t.color:"#fff")}function b(t,e){return h&&"furious"==v&&t.disengaged?"#eee":t.color||a(t,e)}function k(t,e){return h&&"furious"==v?1:t.disabled?0:1}return y.each((function(a){var m=e-t.left-t.right,y=d3.select(this);r.utils.initSVG(y);var w=y.selectAll("g.nv-legend").data([a]),A=w.enter().append("g").attr("class","nvd3 nv-legend").append("g"),M=w.select("g");c?w.attr("transform","translate("+-t.right+","+t.top+")"):w.attr("transform","translate("+t.left+","+t.top+")");var C,S,W=M.selectAll(".nv-series").data((function(t){return"furious"!=v?t:t.filter((function(t){return!!h||!t.disengaged}))})),E=W.enter().append("g").attr("class","nv-series");switch(v){case"furious":S=23;break;case"classic":S=20}"classic"==v?(E.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),C=W.select(".nv-legend-symbol")):"furious"==v&&(E.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),C=W.select(".nv-legend-symbol"),E.append("g").attr("class","nv-check-box").property("innerHTML",'<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr("transform","translate(-10,-8)scale(0.5)"),W.select(".nv-check-box").each((function(t,e){d3.select(this).selectAll("path").attr("stroke",x(t,e))}))),E.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var F=W.select("text.nv-legend-text");W.on("mouseover",(function(t,e){g.legendMouseover(t,e)})).on("mouseout",(function(t,e){g.legendMouseout(t,e)})).on("click",(function(t,e){g.legendClick(t,e);var n=W.data();d&&("classic"==v?p?(n.forEach((function(t){t.disabled=!0})),t.disabled=!1):(t.disabled=!t.disabled,n.every((function(t){return t.disabled}))&&n.forEach((function(t){t.disabled=!1}))):"furious"==v&&(h?(t.disengaged=!t.disengaged,t.userDisabled=null==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled):h||(t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter((function(t){return!t.disengaged})).every((function(t){return t.userDisabled}))&&n.forEach((function(t){t.disabled=t.userDisabled=!1})))),g.stateChange({disabled:n.map((function(t){return!!t.disabled})),disengaged:n.map((function(t){return!!t.disengaged}))}))})).on("dblclick",(function(t,e){if(f){if("furious"==v&&h)return;if(g.legendDblclick(t,e),d){var n=W.data();n.forEach((function(t){t.disabled=!0,"furious"==v&&(t.userDisabled=t.disabled)})),t.disabled=!1,"furious"==v&&(t.userDisabled=t.disabled),g.stateChange({disabled:n.map((function(t){return!!t.disabled}))})}}})),W.classed("nv-disabled",(function(t){return t.userDisabled})),W.exit().remove(),F.attr("fill",x).text((function(t){return o(i(t))}));var D=0;if(l){var _=[];W.each((function(t,e){var n,a;if(o(i(t))&&o(i(t)).length>s){var l=o(i(t)).substring(0,s);n=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(t)))}else n=d3.select(this).select("text");try{if((a=n.node().getComputedTextLength())<=0)throw Error()}catch(t){a=r.utils.calcApproxTextWidth(n)}_.push(a+u)}));var N=0,O=[];for(D=0;D<m&&N<_.length;)O[N]=_[N],D+=_[N++];for(0===N&&(N=1);D>m&&N>1;){O=[],N--;for(var L=0;L<_.length;L++)_[L]>(O[L%N]||0)&&(O[L%N]=_[L]);D=O.reduce((function(t,e,n,r){return t+e}))}for(var B=[],T=0,P=0;T<N;T++)B[T]=P,P+=O[T];W.attr("transform",(function(t,e){return"translate("+B[e%N]+","+(5+Math.floor(e/N)*S)+")"})),c?M.attr("transform","translate("+(e-t.right-D)+","+t.top+")"):M.attr("transform","translate(0,"+t.top+")"),n=t.top+t.bottom+Math.ceil(_.length/N)*S}else{var z,I=5,V=5,H=0;W.attr("transform",(function(n,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return z=V,e<t.left+t.right+z+i&&(V=z=5,I+=S),(V+=i)>H&&(H=V),D<z+H&&(D=z+H),"translate("+z+","+I+")"})),M.attr("transform","translate("+(e-t.right-H)+","+t.top+")"),n=t.top+t.bottom+I+15}"furious"==v&&(C.attr("width",(function(t,e){return F[0][e].getComputedTextLength()+27})).attr("height",18).attr("y",-9).attr("x",-15),A.insert("rect",":first-child").attr("class","nv-legend-bg").attr("fill","#eee").attr("opacity",0),M.select(".nv-legend-bg").transition().duration(300).attr("x",-S).attr("width",D+S-12).attr("height",n+10).attr("y",-t.top-10).attr("opacity",h?1:0)),C.style("fill",b).style("fill-opacity",k).style("stroke",b)})),m}return m.dispatch=g,m.options=r.utils.optionsFunc.bind(m),m._options=Object.create({},{width:{get:function(){return e},set:function(t){e=t}},height:{get:function(){return n},set:function(t){n=t}},key:{get:function(){return i},set:function(t){i=t}},keyFormatter:{get:function(){return o},set:function(t){o=t}},align:{get:function(){return l},set:function(t){l=t}},maxKeyLength:{get:function(){return s},set:function(t){s=t}},rightAlign:{get:function(){return c},set:function(t){c=t}},padding:{get:function(){return u},set:function(t){u=t}},updateState:{get:function(){return d},set:function(t){d=t}},enableDoubleClick:{get:function(){return f},set:function(t){f=t}},radioButtonMode:{get:function(){return p},set:function(t){p=t}},expanded:{get:function(){return h},set:function(t){h=t}},vers:{get:function(){return v},set:function(t){v=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return a},set:function(t){a=r.utils.getColor(t)}}}),r.utils.initOptions(m),m},r.models.line=function(){"use strict";var t,e,n=r.models.scatter(),i={top:0,right:0,bottom:0,left:0},o=960,a=500,s=null,l=r.utils.defaultColor(),u=function(t){return t.x},c=function(t){return t.y},d=function(t,e){return!isNaN(c(t,e))&&null!==c(t,e)},f=function(t){return t.area},p=!1,h="linear",g=250,v=d3.dispatch("elementClick","elementMouseover","elementMouseout","renderEnd");n.pointSize(16).pointDomain([16,256]);var m,y,x=r.utils.renderWatch(v,g);function b(g){return x.reset(),x.models(n),g.each((function(g){s=d3.select(this);var v=r.utils.availableWidth(o,s,i),b=r.utils.availableHeight(a,s,i);r.utils.initSVG(s),t=n.xScale(),e=n.yScale(),m=m||t,y=y||e;var k=s.selectAll("g.nv-wrap.nv-line").data([g]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),A=w.append("defs"),M=w.append("g"),C=k.select("g");M.append("g").attr("class","nv-groups"),M.append("g").attr("class","nv-scatterWrap"),k.attr("transform","translate("+i.left+","+i.top+")"),n.width(v).height(b);var S=k.select(".nv-scatterWrap");S.call(n),A.append("clipPath").attr("id","nv-edge-clip-"+n.id()).append("rect"),k.select("#nv-edge-clip-"+n.id()+" rect").attr("width",v).attr("height",b>0?b:0),C.attr("clip-path",p?"url(#nv-edge-clip-"+n.id()+")":""),S.attr("clip-path",p?"url(#nv-edge-clip-"+n.id()+")":"");var W=k.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));W.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",(function(t){return t.strokeWidth||1.5})).style("fill-opacity",1e-6),W.exit().remove(),W.attr("class",(function(t,e){return(t.classed||"")+" nv-group nv-series-"+e})).classed("hover",(function(t){return t.hover})).style("fill",(function(t,e){return l(t,e)})).style("stroke",(function(t,e){return l(t,e)})),W.watchTransition(x,"line: groups").style("stroke-opacity",1).style("fill-opacity",(function(t){return t.fillOpacity||.5}));var E=W.selectAll("path.nv-area").data((function(t){return f(t)?[t]:[]}));E.enter().append("path").attr("class","nv-area").attr("d",(function(t){return d3.svg.area().interpolate(h).defined(d).x((function(t,e){return r.utils.NaNtoZero(m(u(t,e)))})).y0((function(t,e){return r.utils.NaNtoZero(y(c(t,e)))})).y1((function(t,n){return y(e.domain()[0]<=0?e.domain()[1]>=0?0:e.domain()[1]:e.domain()[0])})).apply(this,[t.values])})),W.exit().selectAll("path.nv-area").remove(),E.watchTransition(x,"line: areaPaths").attr("d",(function(n){return d3.svg.area().interpolate(h).defined(d).x((function(e,n){return r.utils.NaNtoZero(t(u(e,n)))})).y0((function(t,n){return r.utils.NaNtoZero(e(c(t,n)))})).y1((function(t,n){return e(e.domain()[0]<=0?e.domain()[1]>=0?0:e.domain()[1]:e.domain()[0])})).apply(this,[n.values])}));var F=W.selectAll("path.nv-line").data((function(t){return[t.values]}));F.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(h).defined(d).x((function(t,e){return r.utils.NaNtoZero(m(u(t,e)))})).y((function(t,e){return r.utils.NaNtoZero(y(c(t,e)))}))),F.watchTransition(x,"line: linePaths").attr("d",d3.svg.line().interpolate(h).defined(d).x((function(e,n){return r.utils.NaNtoZero(t(u(e,n)))})).y((function(t,n){return r.utils.NaNtoZero(e(c(t,n)))}))),m=t.copy(),y=e.copy()})),x.renderEnd("line immediate"),b}return b.dispatch=v,b.scatter=n,n.dispatch.on("elementClick",(function(){v.elementClick.apply(this,arguments)})),n.dispatch.on("elementMouseover",(function(){v.elementMouseover.apply(this,arguments)})),n.dispatch.on("elementMouseout",(function(){v.elementMouseout.apply(this,arguments)})),b.options=r.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},defined:{get:function(){return d},set:function(t){d=t}},interpolate:{get:function(){return h},set:function(t){h=t}},clipEdge:{get:function(){return p},set:function(t){p=t}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},duration:{get:function(){return g},set:function(t){g=t,x.reset(g),n.duration(g)}},isArea:{get:function(){return f},set:function(t){f=d3.functor(t)}},x:{get:function(){return u},set:function(t){u=t,n.x(t)}},y:{get:function(){return c},set:function(t){c=t,n.y(t)}},color:{get:function(){return l},set:function(t){l=r.utils.getColor(t),n.color(l)}}}),r.utils.inheritOptions(b,n),r.utils.initOptions(b),b},r.models.lineChart=function(){"use strict";var t,e,n=r.models.line(),i=r.models.axis(),o=r.models.axis(),a=r.models.legend(),s=r.interactiveGuideline(),l=r.models.tooltip(),u=r.models.focus(r.models.line()),c={top:30,right:20,bottom:50,left:60},d=null,f=r.utils.defaultColor(),p=null,h=null,g=!0,v="top",m=!0,y=!0,x=!1,b=!1,k=!1,w=r.utils.state(),A=null,M=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=250;i.orient("bottom").tickPadding(7),o.orient(x?"right":"left"),n.clipEdge(!0).duration(0),l.valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.tooltip.valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)}));var W=r.utils.renderWatch(C,S);function E(l){return W.reset(),W.models(n),m&&W.models(i),y&&W.models(o),l.each((function(l){var M=d3.select(this);r.utils.initSVG(M);var W,F=r.utils.availableWidth(p,M,c),D=r.utils.availableHeight(h,M,c)-(k?u.height():0);if(E.update=function(){0===S?M.call(E):M.transition().duration(S).call(E)},E.container=this,w.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(l),E.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(l)).update(),w.disabled=l.map((function(t){return!!t.disabled})),!A)for(W in A={},w)w[W]instanceof Array?A[W]=w[W].slice(0):A[W]=w[W];if(!(l&&l.length&&l.filter((function(t){return t.values.length})).length))return r.utils.noData(E,M),E;M.selectAll(".nv-noData").remove(),u.dispatch.on("onBrush",(function(t){I(t)})),t=n.xScale(),e=n.yScale();var _=M.selectAll("g.nv-wrap.nv-lineChart").data([l]),N=_.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),O=_.select("g");N.append("g").attr("class","nv-legendWrap");var L=N.append("g").attr("class","nv-focus");L.append("g").attr("class","nv-background").append("rect"),L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis"),L.append("g").attr("class","nv-linesWrap"),L.append("g").attr("class","nv-interactive"),N.append("g").attr("class","nv-focusWrap"),g?(a.width(F),O.select(".nv-legendWrap").datum(l).call(a),"bottom"===v?(c.bottom=i.height()+a.height(),D=r.utils.availableHeight(h,M,c),O.select(".nv-legendWrap").attr("transform","translate(0,"+(D+i.height())+")")):"top"===v&&(d||a.height()===c.top||(c.top=a.height(),D=r.utils.availableHeight(h,M,c)-(k?u.height():0)),_.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")"))):O.select(".nv-legendWrap").selectAll("*").remove(),_.attr("transform","translate("+c.left+","+c.top+")"),x&&O.select(".nv-y.nv-axis").attr("transform","translate("+F+",0)"),b&&(s.width(F).height(D).margin({left:c.left,top:c.top}).svgContainer(M).xScale(t),_.select(".nv-interactive").call(s)),O.select(".nv-focus .nv-background rect").attr("width",F).attr("height",D),n.width(F).height(D).color(l.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!l[e].disabled})));var B=O.select(".nv-linesWrap").datum(l.filter((function(t){return!t.disabled})));function T(){m&&O.select(".nv-focus .nv-x.nv-axis").transition().duration(S).call(i)}function P(){y&&O.select(".nv-focus .nv-y.nv-axis").transition().duration(S).call(o)}if(m&&i.scale(t)._ticks(r.utils.calcTicksX(F/100,l)).tickSize(-D,0),y&&o.scale(e)._ticks(r.utils.calcTicksY(D/36,l)).tickSize(-F,0),O.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+D+")"),k||null!==u.brush.extent()){u.width(F),O.select(".nv-focusWrap").style("display",k?"initial":"none").attr("transform","translate(0,"+(D+c.bottom+u.margin().top)+")").call(u);var z=u.brush.empty()?u.xDomain():u.brush.extent();null!==z&&I(z)}else B.call(n),T(),P();function I(t){O.select(".nv-focus .nv-linesWrap").datum(l.filter((function(t){return!t.disabled})).map((function(e,r){return{key:e.key,area:e.area,classed:e.classed,values:e.values.filter((function(e,r){return n.x()(e,r)>=t[0]&&n.x()(e,r)<=t[1]})),disableTooltip:e.disableTooltip}}))).transition().duration(S).call(n),T(),P()}a.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];C.stateChange(w),E.update()})),s.dispatch.on("elementMousemove",(function(e){n.clearHighlights();var i,a,c,d=[];if(l.filter((function(t,e){return t.seriesIndex=e,!t.disabled&&!t.disableTooltip})).forEach((function(o,s){var l=null!==u.brush.extent()?u.brush.empty()?u.xScale().domain():u.brush.extent():t.domain(),p=o.values.filter((function(t,e){return l[0]<=l[1]?n.x()(t,e)>=l[0]&&n.x()(t,e)<=l[1]:n.x()(t,e)>=l[1]&&n.x()(t,e)<=l[0]})),h=p[a=r.interactiveBisect(p,e.pointXValue,n.x())],g=E.y()(h,a);null!==g&&n.highlightPoint(s,a,!0),void 0!==h&&(void 0===i&&(i=h),void 0===c&&(c=E.xScale()(E.x()(h,a))),d.push({key:o.key,value:g,color:f(o,o.seriesIndex),data:h}))})),d.length>2){var p=E.yScale().invert(e.mouseY),h=.03*Math.abs(E.yScale().domain()[0]-E.yScale().domain()[1]),g=r.nearestValueIndex(d.map((function(t){return t.value})),p,h);null!==g&&(d[g].highlight=!0)}s.tooltip.valueFormatter(s.tooltip.valueFormatter()||function(t,e){return null==t?"N/A":o.tickFormat()(t)}).data({value:E.x()(i,a),index:a,series:d})(),s.renderGuideLine(c)})),s.dispatch.on("elementClick",(function(t){var e,i=[];l.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(n){var o=r.interactiveBisect(n.values,t.pointXValue,E.x()),a=n.values[o];if(void 0!==a){void 0===e&&(e=E.xScale()(E.x()(a,o)));var s=E.yScale()(E.y()(a,o));i.push({point:a,pointIndex:o,pos:[e,s],seriesIndex:n.seriesIndex,series:n})}})),n.dispatch.elementClick(i)})),s.dispatch.on("elementMouseout",(function(t){n.clearHighlights()})),C.on("changeState",(function(t){void 0!==t.disabled&&l.length===t.disabled.length&&(l.forEach((function(e,n){e.disabled=t.disabled[n]})),w.disabled=t.disabled),E.update()}))})),W.renderEnd("lineChart immediate"),E}return n.dispatch.on("elementMouseover.tooltip",(function(t){t.series.disableTooltip||l.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){l.hidden(!0)})),E.dispatch=C,E.lines=n,E.legend=a,E.focus=u,E.xAxis=i,E.x2Axis=u.xAxis,E.yAxis=o,E.y2Axis=u.yAxis,E.interactiveLayer=s,E.tooltip=l,E.state=w,E.dispatch=C,E.options=r.utils.optionsFunc.bind(E),E._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return g},set:function(t){g=t}},legendPosition:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return m},set:function(t){m=t}},showYAxis:{get:function(){return y},set:function(t){y=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return M},set:function(t){M=t}},focusEnable:{get:function(){return k},set:function(t){k=t}},focusHeight:{get:function(){return u.height()},set:function(t){u.height(t)}},focusShowAxisX:{get:function(){return u.showXAxis()},set:function(t){u.showXAxis(t)}},focusShowAxisY:{get:function(){return u.showYAxis()},set:function(t){u.showYAxis(t)}},brushExtent:{get:function(){return u.brushExtent()},set:function(t){u.brushExtent(t)}},focusMargin:{get:function(){return u.margin},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),u.margin.right=void 0!==t.right?t.right:u.margin.right,u.margin.bottom=void 0!==t.bottom?t.bottom:u.margin.bottom,u.margin.left=void 0!==t.left?t.left:u.margin.left}},margin:{get:function(){return c},set:function(t){c.top=void 0!==t.top?t.top:c.top,c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return S},set:function(t){S=t,W.reset(S),n.duration(S),u.duration(S),i.duration(S),o.duration(S)}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t),a.color(f),n.color(f),u.color(f)}},interpolate:{get:function(){return n.interpolate()},set:function(t){n.interpolate(t),u.interpolate(t)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t),u.xTickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t),u.yTickFormat(t)}},x:{get:function(){return n.x()},set:function(t){n.x(t),u.x(t)}},y:{get:function(){return n.y()},set:function(t){n.y(t),u.y(t)}},rightAlignYAxis:{get:function(){return x},set:function(t){x=t,o.orient(x?"right":"left")}},useInteractiveGuideline:{get:function(){return b},set:function(t){(b=t)&&(n.interactive(!1),n.useVoronoi(!1))}}}),r.utils.inheritOptions(E,n),r.utils.initOptions(E),E},r.models.lineWithFocusChart=function(){return r.models.lineChart().margin({bottom:30}).focusEnable(!0)},r.models.linePlusBarChart=function(){"use strict";var t,e,n,i,o,a,s,l=r.models.line(),u=r.models.line(),c=r.models.historicalBar(),d=r.models.historicalBar(),f=r.models.axis(),p=r.models.axis(),h=r.models.axis(),g=r.models.axis(),v=r.models.axis(),m=r.models.axis(),y=r.models.legend(),x=d3.svg.brush(),b=r.models.tooltip(),k={top:30,right:30,bottom:30,left:60},w=null,A={top:0,right:30,bottom:20,left:60},M=null,C=null,S=function(t){return t.x},W=function(t){return t.y},E=r.utils.defaultColor(),F=!0,D=!0,_=!1,N=!0,O=50,L=null,B=null,T=d3.dispatch("brush","stateChange","changeState"),P=0,z=r.utils.state(),I=null,V=" (left axis)",H=" (right axis)",Y=!1;l.clipEdge(!0),u.interactive(!1),u.pointActive((function(t){return!1})),f.orient("bottom").tickPadding(5),h.orient("left"),g.orient("right"),p.orient("bottom").tickPadding(5),v.orient("left"),m.orient("right"),b.headerEnabled(!0).headerFormatter((function(t,e){return f.tickFormat()(t,e)}));var G=function(t){return t.every((function(t){return t.disabled}))};function R(b){return b.each((function(b){var B=d3.select(this);r.utils.initSVG(B);var X,j=r.utils.availableWidth(M,B,k),Z=r.utils.availableHeight(C,B,k)-(D?O:0),q=O-A.top-A.bottom;if(R.update=function(){B.transition().duration(P).call(R)},R.container=this,z.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(b),R.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(b)).update(),z.disabled=b.map((function(t){return!!t.disabled})),!I)for(X in I={},z)z[X]instanceof Array?I[X]=z[X].slice(0):I[X]=z[X];if(!(b&&b.length&&b.filter((function(t){return t.values.length})).length))return r.utils.noData(R,B),R;B.selectAll(".nv-noData").remove();var K=b.filter((function(t){return!t.disabled&&t.bar})),U=b.filter((function(t){return!t.bar}));e=K.length&&!Y?c.xScale():l.xScale(),n=p.scale(),i=Y?l.yScale():c.yScale(),o=Y?c.yScale():l.yScale(),a=Y?u.yScale():d.yScale(),s=Y?d.yScale():u.yScale();var Q=b.filter((function(t){return!t.disabled&&(Y?!t.bar:t.bar)})).map((function(t){return t.values.map((function(t,e){return{x:S(t,e),y:W(t,e)}}))})),$=b.filter((function(t){return!t.disabled&&(Y?t.bar:!t.bar)})).map((function(t){return t.values.map((function(t,e){return{x:S(t,e),y:W(t,e)}}))}));e.range([0,j]),n.domain(d3.extent(d3.merge(Q.concat($)),(function(t){return t.x}))).range([0,j]);var J=B.selectAll("g.nv-wrap.nv-linePlusBar").data([b]),tt=J.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),et=J.select("g");tt.append("g").attr("class","nv-legendWrap");var nt=tt.append("g").attr("class","nv-focus");nt.append("g").attr("class","nv-x nv-axis"),nt.append("g").attr("class","nv-y1 nv-axis"),nt.append("g").attr("class","nv-y2 nv-axis"),nt.append("g").attr("class","nv-barsWrap"),nt.append("g").attr("class","nv-linesWrap");var rt=tt.append("g").attr("class","nv-context");if(rt.append("g").attr("class","nv-x nv-axis"),rt.append("g").attr("class","nv-y1 nv-axis"),rt.append("g").attr("class","nv-y2 nv-axis"),rt.append("g").attr("class","nv-barsWrap"),rt.append("g").attr("class","nv-linesWrap"),rt.append("g").attr("class","nv-brushBackground"),rt.append("g").attr("class","nv-x nv-brush"),F){var it=y.align()?j/2:j,ot=y.align()?it:0;y.width(it),et.select(".nv-legendWrap").datum(b.map((function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=Y?t.originalKey+(t.bar?H:V):t.originalKey+(t.bar?V:H),t}))).call(y),w||y.height()===k.top||(k.top=y.height(),Z=r.utils.availableHeight(C,B,k)-O),et.select(".nv-legendWrap").attr("transform","translate("+ot+","+-k.top+")")}else et.select(".nv-legendWrap").selectAll("*").remove();J.attr("transform","translate("+k.left+","+k.top+")"),et.select(".nv-context").style("display",D?"initial":"none"),d.width(j).height(q).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&b[e].bar}))),u.width(j).height(q).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&!b[e].bar})));var at=et.select(".nv-context .nv-barsWrap").datum(K.length?K:[{values:[]}]),st=et.select(".nv-context .nv-linesWrap").datum(G(U)?[{values:[]}]:U.filter((function(t){return!t.disabled})));et.select(".nv-context").attr("transform","translate(0,"+(Z+k.bottom+A.top)+")"),at.transition().call(d),st.transition().call(u),N&&(p._ticks(r.utils.calcTicksX(j/100,b)).tickSize(-q,0),et.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+a.range()[0]+")"),et.select(".nv-context .nv-x.nv-axis").transition().call(p)),_&&(v.scale(a)._ticks(q/36).tickSize(-j,0),m.scale(s)._ticks(q/36).tickSize(K.length?0:-j,0),et.select(".nv-context .nv-y3.nv-axis").style("opacity",K.length?1:0).attr("transform","translate(0,"+n.range()[0]+")"),et.select(".nv-context .nv-y2.nv-axis").style("opacity",U.length?1:0).attr("transform","translate("+n.range()[1]+",0)"),et.select(".nv-context .nv-y1.nv-axis").transition().call(v),et.select(".nv-context .nv-y2.nv-axis").transition().call(m)),x.x(n).on("brush",dt),L&&x.extent(L);var lt=et.select(".nv-brushBackground").selectAll("g").data([L||x.extent()]),ut=lt.enter().append("g");ut.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",q),ut.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",q);var ct=et.select(".nv-x.nv-brush").call(x);function dt(){L=x.empty()?null:x.extent(),t=x.empty()?n.domain():x.extent(),T.brush({extent:t,brush:x}),x.empty()||x.extent(L),lt.data([x.empty()?n.domain():L]).each((function(t,e){var r=n(t[0])-n.range()[0],i=n.range()[1]-n(t[1]);d3.select(this).select(".left").attr("width",r<0?0:r),d3.select(this).select(".right").attr("x",n(t[1])).attr("width",i<0?0:i)})),c.width(j).height(Z).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&b[e].bar}))),l.width(j).height(Z).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&!b[e].bar})));var a=et.select(".nv-focus .nv-barsWrap").datum(K.length?K.map((function(e,n){return{key:e.key,values:e.values.filter((function(e,n){return c.x()(e,n)>=t[0]&&c.x()(e,n)<=t[1]}))}})):[{values:[]}]),s=et.select(".nv-focus .nv-linesWrap").datum(G(U)?[{values:[]}]:U.filter((function(t){return!t.disabled})).map((function(e,n){return{area:e.area,fillOpacity:e.fillOpacity,strokeWidth:e.strokeWidth,key:e.key,values:e.values.filter((function(e,n){return l.x()(e,n)>=t[0]&&l.x()(e,n)<=t[1]}))}})));e=K.length&&!Y?c.xScale():l.xScale(),f.scale(e)._ticks(r.utils.calcTicksX(j/100,b)).tickSize(-Z,0),f.domain([Math.ceil(t[0]),Math.floor(t[1])]),et.select(".nv-x.nv-axis").transition().duration(P).call(f),a.transition().duration(P).call(c),s.transition().duration(P).call(l),et.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+i.range()[0]+")"),h.scale(i)._ticks(r.utils.calcTicksY(Z/36,b)).tickSize(-j,0),g.scale(o)._ticks(r.utils.calcTicksY(Z/36,b)),Y?g.tickSize(U.length?0:-j,0):g.tickSize(K.length?0:-j,0);var u=K.length?1:0,d=U.length&&!G(U)?1:0,p=Y?d:u,v=Y?u:d;et.select(".nv-focus .nv-y1.nv-axis").style("opacity",p),et.select(".nv-focus .nv-y2.nv-axis").style("opacity",v).attr("transform","translate("+e.range()[1]+",0)"),et.select(".nv-focus .nv-y1.nv-axis").transition().duration(P).call(h),et.select(".nv-focus .nv-y2.nv-axis").transition().duration(P).call(g)}ct.selectAll("rect").attr("height",q),ct.selectAll(".resize").append("path").attr("d",(function(t){var e=+("e"==t),n=e?1:-1,r=q/3;return"M"+.5*n+","+r+"A6,6 0 0 "+e+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+e+" "+.5*n+","+2*r+"ZM"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)})),y.dispatch.on("stateChange",(function(t){for(var e in t)z[e]=t[e];T.stateChange(z),R.update()})),T.on("changeState",(function(t){void 0!==t.disabled&&(b.forEach((function(e,n){e.disabled=t.disabled[n]})),z.disabled=t.disabled),R.update()})),dt()})),R}return l.dispatch.on("elementMouseover.tooltip",(function(t){b.duration(100).valueFormatter((function(t,e){return(Y?{main:h,focus:v}:{main:g,focus:m}).main.tickFormat()(t,e)})).data(t).hidden(!1)})),l.dispatch.on("elementMouseout.tooltip",(function(t){b.hidden(!0)})),c.dispatch.on("elementMouseover.tooltip",(function(t){t.value=R.x()(t.data),t.series={value:R.y()(t.data),color:t.color},b.duration(0).valueFormatter((function(t,e){return(Y?{main:g,focus:m}:{main:h,focus:v}).main.tickFormat()(t,e)})).data(t).hidden(!1)})),c.dispatch.on("elementMouseout.tooltip",(function(t){b.hidden(!0)})),c.dispatch.on("elementMousemove.tooltip",(function(t){b()})),R.dispatch=T,R.legend=y,R.lines=l,R.lines2=u,R.bars=c,R.bars2=d,R.xAxis=f,R.x2Axis=p,R.y1Axis=h,R.y2Axis=g,R.y3Axis=v,R.y4Axis=m,R.tooltip=b,R.options=r.utils.optionsFunc.bind(R),R._options=Object.create({},{width:{get:function(){return M},set:function(t){M=t}},height:{get:function(){return C},set:function(t){C=t}},showLegend:{get:function(){return F},set:function(t){F=t}},brushExtent:{get:function(){return L},set:function(t){L=t}},noData:{get:function(){return B},set:function(t){B=t}},focusEnable:{get:function(){return D},set:function(t){D=t}},focusHeight:{get:function(){return O},set:function(t){O=t}},focusShowAxisX:{get:function(){return N},set:function(t){N=t}},focusShowAxisY:{get:function(){return _},set:function(t){_=t}},legendLeftAxisHint:{get:function(){return V},set:function(t){V=t}},legendRightAxisHint:{get:function(){return H},set:function(t){H=t}},margin:{get:function(){return k},set:function(t){void 0!==t.top&&(k.top=t.top,w=t.top),k.right=void 0!==t.right?t.right:k.right,k.bottom=void 0!==t.bottom?t.bottom:k.bottom,k.left=void 0!==t.left?t.left:k.left}},focusMargin:{get:function(){return A},set:function(t){A.top=void 0!==t.top?t.top:A.top,A.right=void 0!==t.right?t.right:A.right,A.bottom=void 0!==t.bottom?t.bottom:A.bottom,A.left=void 0!==t.left?t.left:A.left}},duration:{get:function(){return P},set:function(t){P=t}},color:{get:function(){return E},set:function(t){E=r.utils.getColor(t),y.color(E)}},x:{get:function(){return S},set:function(t){S=t,l.x(t),u.x(t),c.x(t),d.x(t)}},y:{get:function(){return W},set:function(t){W=t,l.y(t),u.y(t),c.y(t),d.y(t)}},switchYAxisOrder:{get:function(){return Y},set:function(t){if(Y!==t){var e=h;h=g,g=e;var n=v;v=m,m=n}Y=t,h.orient("left"),g.orient("right"),v.orient("left"),m.orient("right")}}}),r.utils.inheritOptions(R,l),r.utils.initOptions(R),R},r.models.multiBar=function(){"use strict";var t,e,n,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=d3.scale.ordinal(),f=d3.scale.linear(),p=Math.floor(1e4*Math.random()),h=null,g=function(t){return t.x},v=function(t){return t.y},m=[0],y=!0,x=!1,b="zero",k=r.utils.defaultColor(),w=!1,A=null,M=500,C=.1,S=.75,W=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=r.utils.renderWatch(W,M),F=0;function D(_){return E.reset(),_.each((function(D){var _=u-l.left-l.right,N=c-l.top-l.bottom;h=d3.select(this),r.utils.initSVG(h);var O=0;if(w&&D.length&&(w=[{values:D[0].values.map((function(t){return{x:t.x,y:0,series:t.series,size:.01}}))}]),x){var L=d3.layout.stack().offset(b).values((function(t){return t.values})).y(v)(!D.length&&w?w:D);L.forEach((function(t,e){t.nonStackable?(D[e].nonStackableSeries=O++,L[e]=D[e]):e>0&&L[e-1].nonStackable&&L[e].values.map((function(t,n){t.y0-=L[e-1].values[n].y,t.y1=t.y0+t.y}))})),D=L}D.forEach((function(t,e){t.values.forEach((function(n){n.series=e,n.key=t.key}))})),x&&D.length>0&&D[0].values.map((function(t,e){var n=0,r=0;D.map((function(t,i){if(!D[i].nonStackable){var o=t.values[e];o.size=Math.abs(o.y),o.y<0?(o.y1=r,r-=o.size):(o.y1=o.size+n,n+=o.size)}}))}));var B=e&&n?[]:D.map((function(t,e){return t.values.map((function(t,n){return{x:g(t,n),y:v(t,n),y0:t.y0,y1:t.y1,idx:e}}))}));d.domain(e||d3.merge(B).map((function(t){return t.x}))).rangeBands(i||[0,_],C),f.domain(n||d3.extent(d3.merge(B).map((function(t){var e=t.y;return x&&!D[t.idx].nonStackable&&(e=t.y>0?t.y1:t.y1+t.y),e})).concat(m))).range(o||[N,0]),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]-.01*d.domain()[0],d.domain()[1]+.01*d.domain()[1]]):d.domain([-1,1])),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]+.01*f.domain()[0],f.domain()[1]-.01*f.domain()[1]]):f.domain([-1,1])),a=a||d,s=s||f;var T=h.selectAll("g.nv-wrap.nv-multibar").data([D]),P=T.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),z=P.append("defs"),I=P.append("g"),V=T.select("g");I.append("g").attr("class","nv-groups"),T.attr("transform","translate("+l.left+","+l.top+")"),z.append("clipPath").attr("id","nv-edge-clip-"+p).append("rect"),T.select("#nv-edge-clip-"+p+" rect").attr("width",_).attr("height",N),V.attr("clip-path",y?"url(#nv-edge-clip-"+p+")":"");var H=T.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t,e){return e}));H.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var Y=E.transition(H.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,M)).attr("y",(function(t,e,n){var r=s(0)||0;return x&&D[t.series]&&!D[t.series].nonStackable&&(r=s(t.y0)),r})).attr("height",0).remove();Y.delay&&Y.delay((function(t,e){return e*(M/(F+1))-e})),H.attr("class",(function(t,e){return"nv-group nv-series-"+e})).classed("hover",(function(t){return t.hover})).style("fill",(function(t,e){return k(t,e)})).style("stroke",(function(t,e){return k(t,e)})),H.style("stroke-opacity",1).style("fill-opacity",S);var G=H.selectAll("rect.nv-bar").data((function(t){return w&&!D.length?w.values:t.values}));G.exit().remove(),G.enter().append("rect").attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})).attr("x",(function(t,e,n){return x&&!D[n].nonStackable?0:n*d.rangeBand()/D.length})).attr("y",(function(t,e,n){return s(x&&!D[n].nonStackable?t.y0:0)||0})).attr("height",0).attr("width",(function(t,e,n){return d.rangeBand()/(x&&!D[n].nonStackable?1:D.length)})).attr("transform",(function(t,e){return"translate("+d(g(t,e))+",0)"})),G.style("fill",(function(t,e,n){return k(t,n,e)})).style("stroke",(function(t,e,n){return k(t,n,e)})).on("mouseover",(function(t,e,n){d3.select(this).classed("hover",!0),W.elementMouseover({data:t,index:e,series:D[n],color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e,n){d3.select(this).classed("hover",!1),W.elementMouseout({data:t,index:e,series:D[n],color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e,n){W.elementMousemove({data:t,index:e,series:D[n],color:d3.select(this).style("fill")})})).on("click",(function(t,e,n){W.elementClick({data:t,index:e,series:D[n],color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e,n){W.elementDblClick({data:t,index:e,series:D[n],color:d3.select(this).style("fill")}),d3.event.stopPropagation()})),G.attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})).attr("transform",(function(t,e){return"translate("+d(g(t,e))+",0)"})),A&&(t||(t=D.map((function(){return!0}))),G.style("fill",(function(e,n,r){return d3.rgb(A(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})).style("stroke",(function(e,n,r){return d3.rgb(A(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})));var R=G.watchTransition(E,"multibar",Math.min(250,M)).delay((function(t,e){return e*M/D[0].values.length}));x?R.attr("y",(function(t,e,n){return D[n].nonStackable?v(t,e)<0?f(0):f(0)-f(v(t,e))<-1?f(0)-1:f(v(t,e))||0:f(t.y1)})).attr("height",(function(t,e,n){return D[n].nonStackable?Math.max(Math.abs(f(v(t,e))-f(0)),0)||0:Math.max(Math.abs(f(t.y+t.y0)-f(t.y0)),0)})).attr("x",(function(t,e,n){var r=0;return D[n].nonStackable&&(r=t.series*d.rangeBand()/D.length,D.length!==O&&(r=D[n].nonStackableSeries*d.rangeBand()/(2*O))),r})).attr("width",(function(t,e,n){if(D[n].nonStackable){var r=d.rangeBand()/O;return D.length!==O&&(r=d.rangeBand()/(2*O)),r}return d.rangeBand()})):R.attr("x",(function(t,e){return t.series*d.rangeBand()/D.length})).attr("width",d.rangeBand()/D.length).attr("y",(function(t,e){return v(t,e)<0?f(0):f(0)-f(v(t,e))<1?f(0)-1:f(v(t,e))||0})).attr("height",(function(t,e){return Math.max(Math.abs(f(v(t,e))-f(0)),1)||0})),a=d.copy(),s=f.copy(),D[0]&&D[0].values&&(F=D[0].values.length)})),E.renderEnd("multibar immediate"),D}return D.dispatch=W,D.options=r.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},xScale:{get:function(){return d},set:function(t){d=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceY:{get:function(){return m},set:function(t){m=t}},stacked:{get:function(){return x},set:function(t){x=t}},stackOffset:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return y},set:function(t){y=t}},disabled:{get:function(){return t},set:function(e){t=e}},id:{get:function(){return p},set:function(t){p=t}},hideable:{get:function(){return w},set:function(t){w=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return S},set:function(t){S=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return M},set:function(t){M=t,E.reset(M)}},color:{get:function(){return k},set:function(t){k=r.utils.getColor(t)}},barColor:{get:function(){return A},set:function(t){A=t?r.utils.getColor(t):null}}}),r.utils.initOptions(D),D},r.models.multiBarChart=function(){"use strict";var t,e,n=r.models.multiBar(),i=r.models.axis(),o=r.models.axis(),a=r.interactiveGuideline(),s=r.models.legend(),l=r.models.legend(),u=r.models.tooltip(),c={top:30,right:20,bottom:50,left:60},d=null,f=null,p=null,h=r.utils.defaultColor(),g=!0,v={},m=!0,y=null,x=!0,b=!0,k=!1,w=!0,A=!1,M=!1,C=0,S=r.utils.state(),W=null,E=null,F=d3.dispatch("stateChange","changeState","renderEnd"),D=function(){return g?180:0},_=250,N=!1;S.stacked=!1,n.stacked(!1),i.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat((function(t){return t})),o.orient(k?"right":"left").tickFormat(d3.format(",.1f")),u.duration(0).valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),a.tooltip.valueFormatter((function(t,e){return null==t?"N/A":o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),a.tooltip.valueFormatter((function(t,e){return null==t?"N/A":o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),a.tooltip.duration(0).valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),l.updateState(!1);var O=r.utils.renderWatch(F),L=!1;function B(E){return O.reset(),O.models(n),x&&O.models(i),b&&O.models(o),E.each((function(E){var O=d3.select(this);r.utils.initSVG(O);var T,P=r.utils.availableWidth(f,O,c),z=r.utils.availableHeight(p,O,c);if(B.update=function(){0===_?O.call(B):O.transition().duration(_).call(B)},B.container=this,S.setter(function(t){return function(e){void 0!==e.stacked&&(L=e.stacked),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(E),B.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),stacked:L}}}(E)).update(),S.disabled=E.map((function(t){return!!t.disabled})),!W)for(T in W={},S)S[T]instanceof Array?W[T]=S[T].slice(0):W[T]=S[T];if(!(E&&E.length&&E.filter((function(t){return t.values.length})).length))return r.utils.noData(B,O),B;O.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale();var I=O.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([E]),V=I.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),H=I.select("g");if(V.append("g").attr("class","nv-x nv-axis"),V.append("g").attr("class","nv-y nv-axis"),V.append("g").attr("class","nv-barsWrap"),V.append("g").attr("class","nv-legendWrap"),V.append("g").attr("class","nv-controlsWrap"),V.append("g").attr("class","nv-interactive"),m?"bottom"===y?(s.width(P-c.right),H.select(".nv-legendWrap").datum(E).call(s),c.bottom=i.height()+s.height(),z=r.utils.availableHeight(p,O,c),H.select(".nv-legendWrap").attr("transform","translate(0,"+(z+i.height())+")")):(s.width(P-D()),H.select(".nv-legendWrap").datum(E).call(s),d||s.height()===c.top||(c.top=s.height(),z=r.utils.availableHeight(p,O,c)),H.select(".nv-legendWrap").attr("transform","translate("+D()+","+-c.top+")")):H.select(".nv-legendWrap").selectAll("*").remove(),g){var Y=[{key:v.grouped||"Grouped",disabled:n.stacked()},{key:v.stacked||"Stacked",disabled:!n.stacked()}];l.width(D()).color(["#444","#444","#444"]),H.select(".nv-controlsWrap").datum(Y).attr("transform","translate(0,"+-c.top+")").call(l)}else H.select(".nv-controlsWrap").selectAll("*").remove();if(I.attr("transform","translate("+c.left+","+c.top+")"),k&&H.select(".nv-y.nv-axis").attr("transform","translate("+P+",0)"),n.disabled(E.map((function(t){return t.disabled}))).width(P).height(z).color(E.map((function(t,e){return t.color||h(t,e)})).filter((function(t,e){return!E[e].disabled}))),H.select(".nv-barsWrap").datum(E.filter((function(t){return!t.disabled}))).call(n),x){i.scale(t)._ticks(r.utils.calcTicksX(P/100,E)).tickSize(-z,0),H.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),H.select(".nv-x.nv-axis").call(i);var G=H.select(".nv-x.nv-axis > g").selectAll("g");if(G.selectAll("line, text").style("opacity",1),A){var R=function(t,e){return"translate("+t+","+e+")"};G.selectAll("text").attr("transform",(function(t,e,n){return R(0,n%2==0?5:17)}));var X=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;H.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",(function(t,e){return R(0,0===e||X%2!=0?17:5)}))}M&&H.selectAll(".tick text").call(r.utils.wrapTicks,B.xAxis.rangeBand()),w&&G.filter((function(t,e){return e%Math.ceil(E[0].values.length/(P/100))!=0})).selectAll("text, line").style("opacity",0),C&&G.selectAll(".tick text").attr("transform","rotate("+C+" 0,0)").style("text-anchor",C>0?"start":"end"),H.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}b&&(o.scale(e)._ticks(r.utils.calcTicksY(z/36,E)).tickSize(-P,0),H.select(".nv-y.nv-axis").call(o)),N&&(a.width(P).height(z).margin({left:c.left,top:c.top}).svgContainer(O).xScale(t),I.select(".nv-interactive").call(a)),s.dispatch.on("stateChange",(function(t){for(var e in t)S[e]=t[e];F.stateChange(S),B.update()})),l.dispatch.on("legendClick",(function(t,e){if(t.disabled){switch(Y=Y.map((function(t){return t.disabled=!0,t})),t.disabled=!1,t.key){case"Grouped":case v.grouped:n.stacked(!1);break;case"Stacked":case v.stacked:n.stacked(!0)}S.stacked=n.stacked(),F.stateChange(S),B.update()}})),F.on("changeState",(function(t){void 0!==t.disabled&&(E.forEach((function(e,n){e.disabled=t.disabled[n]})),S.disabled=t.disabled),void 0!==t.stacked&&(n.stacked(t.stacked),S.stacked=t.stacked,L=t.stacked),B.update()})),N?(a.dispatch.on("elementMousemove",(function(e){if(null!=e.pointXValue){var n,r,i,o,s=[];E.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(a,l){r=t.domain().indexOf(e.pointXValue);var u=a.values[r];void 0!==u&&(o=u.x,void 0===n&&(n=u),void 0===i&&(i=e.mouseX),s.push({key:a.key,value:B.y()(u,r),color:h(a,a.seriesIndex),data:a.values[r]}))})),a.tooltip.data({value:o,index:r,series:s})(),a.renderGuideLine(i)}})),a.dispatch.on("elementMouseout",(function(t){a.tooltip.hidden(!0)}))):(n.dispatch.on("elementMouseover.tooltip",(function(t){t.value=B.x()(t.data),t.series={key:t.data.key,value:B.y()(t.data),color:t.color},u.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){u.hidden(!0)})),n.dispatch.on("elementMousemove.tooltip",(function(t){u()})))})),O.renderEnd("multibarchart immediate"),B}return B.dispatch=F,B.multibar=n,B.legend=s,B.controls=l,B.xAxis=i,B.yAxis=o,B.state=S,B.tooltip=u,B.interactiveLayer=a,B.options=r.utils.optionsFunc.bind(B),B._options=Object.create({},{width:{get:function(){return f},set:function(t){f=t}},height:{get:function(){return p},set:function(t){p=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},showControls:{get:function(){return g},set:function(t){g=t}},controlLabels:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return W},set:function(t){W=t}},noData:{get:function(){return E},set:function(t){E=t}},reduceXTicks:{get:function(){return w},set:function(t){w=t}},rotateLabels:{get:function(){return C},set:function(t){C=t}},staggerLabels:{get:function(){return A},set:function(t){A=t}},wrapLabels:{get:function(){return M},set:function(t){M=!!t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return _},set:function(t){_=t,n.duration(_),i.duration(_),o.duration(_),O.reset(_)}},color:{get:function(){return h},set:function(t){h=r.utils.getColor(t),s.color(h)}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,o.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return N},set:function(t){N=t}},barColor:{get:function(){return n.barColor},set:function(t){n.barColor(t),s.color((function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()}))}}}),r.utils.inheritOptions(B,n),r.utils.initOptions(B),B},r.models.multiBarHorizontal=function(){"use strict";var t,e,n,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=null,p=d3.scale.ordinal(),h=d3.scale.linear(),g=function(t){return t.x},v=function(t){return t.y},m=function(t){return t.yErr},y=[0],x=r.utils.defaultColor(),b=null,k=!1,w=!1,A=60,M=.1,C=.75,S=d3.format(",.2f"),W=250,E=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),F=r.utils.renderWatch(E,W);function D(d){return F.reset(),d.each((function(d){var W=u-l.left-l.right,D=c-l.top-l.bottom;f=d3.select(this),r.utils.initSVG(f),k&&(d=d3.layout.stack().offset("zero").values((function(t){return t.values})).y(v)(d)),d.forEach((function(t,e){t.values.forEach((function(n){n.series=e,n.key=t.key}))})),k&&d[0].values.map((function(t,e){var n=0,r=0;d.map((function(t){var i=t.values[e];i.size=Math.abs(i.y),i.y<0?(i.y1=r-i.size,r-=i.size):(i.y1=n,n+=i.size)}))}));var _=e&&n?[]:d.map((function(t){return t.values.map((function(t,e){return{x:g(t,e),y:v(t,e),y0:t.y0,y1:t.y1}}))}));p.domain(e||d3.merge(_).map((function(t){return t.x}))).rangeBands(i||[0,D],M),h.domain(n||d3.extent(d3.merge(_).map((function(t){return k?t.y>0?t.y1+t.y:t.y1:t.y})).concat(y))),w&&!k?h.range(o||[h.domain()[0]<0?A:0,W-(h.domain()[1]>0?A:0)]):h.range(o||[0,W]),a=a||p,s=s||d3.scale.linear().domain(h.domain()).range([h(0),h(0)]);var N=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([d]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),L=(O.append("defs"),O.append("g"));N.select("g"),L.append("g").attr("class","nv-groups"),N.attr("transform","translate("+l.left+","+l.top+")");var B=N.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t,e){return e}));B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),B.exit().watchTransition(F,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),B.attr("class",(function(t,e){return"nv-group nv-series-"+e})).classed("hover",(function(t){return t.hover})).style("fill",(function(t,e){return x(t,e)})).style("stroke",(function(t,e){return x(t,e)})),B.watchTransition(F,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",C);var T=B.selectAll("g.nv-bar").data((function(t){return t.values}));T.exit().remove();var P=T.enter().append("g").attr("transform",(function(t,e,n){return"translate("+s(k?t.y0:0)+","+(k?0:n*p.rangeBand()/d.length+p(g(t,e)))+")"}));P.append("rect").attr("width",0).attr("height",p.rangeBand()/(k?1:d.length)),T.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),E.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),E.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){E.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e){E.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){E.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e){E.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()})),m(d[0],0)&&(P.append("polyline"),T.select("polyline").attr("fill","none").attr("points",(function(t,e){var n=m(t,e),r=.8*p.rangeBand()/(2*(k?1:d.length));return[[(n=(n=n.length?n:[-Math.abs(n),Math.abs(n)]).map((function(n){return h(n+(v(t,e)<0?0:v(t,e)))-h(0)})))[0],-r],[n[0],r],[n[0],0],[n[1],0],[n[1],-r],[n[1],r]].map((function(t){return t.join(",")})).join(" ")})).attr("transform",(function(t,e){return"translate(0, "+p.rangeBand()/(2*(k?1:d.length))+")"}))),P.append("text"),w&&!k?(T.select("text").attr("text-anchor",(function(t,e){return v(t,e)<0?"end":"start"})).attr("y",p.rangeBand()/(2*d.length)).attr("dy",".32em").text((function(t,e){var n=S(v(t,e)),r=m(t,e);return void 0===r?n:r.length?n+"+"+S(Math.abs(r[1]))+"-"+S(Math.abs(r[0])):n+"±"+S(Math.abs(r))})),T.watchTransition(F,"multibarhorizontal: bars").select("text").attr("x",(function(t,e){return v(t,e)<0?-4:h(v(t,e))-h(0)+4}))):T.selectAll("text").text(""),T.selectAll("text.nv-bar-label").text(""),T.attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})),b&&(t||(t=d.map((function(){return!0}))),T.style("fill",(function(e,n,r){return d3.rgb(b(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})).style("stroke",(function(e,n,r){return d3.rgb(b(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()}))),k?T.watchTransition(F,"multibarhorizontal: bars").attr("transform",(function(t,e){return"translate("+h(t.y1)+","+p(g(t,e))+")"})).select("rect").attr("width",(function(t,e){return Math.abs(h(v(t,e)+t.y0)-h(t.y0))||0})).attr("height",p.rangeBand()):T.watchTransition(F,"multibarhorizontal: bars").attr("transform",(function(t,e){return"translate("+(v(t,e)<0?h(v(t,e)):h(0))+","+(t.series*p.rangeBand()/d.length+p(g(t,e)))+")"})).select("rect").attr("height",p.rangeBand()/d.length).attr("width",(function(t,e){return Math.max(Math.abs(h(v(t,e))-h(0)),1)||0})),a=p.copy(),s=h.copy()})),F.renderEnd("multibarHorizontal immediate"),D}return D.dispatch=E,D.options=r.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},yErr:{get:function(){return m},set:function(t){m=t}},xScale:{get:function(){return p},set:function(t){p=t}},yScale:{get:function(){return h},set:function(t){h=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceY:{get:function(){return y},set:function(t){y=t}},stacked:{get:function(){return k},set:function(t){k=t}},showValues:{get:function(){return w},set:function(t){w=t}},disabled:{get:function(){return t},set:function(e){t=e}},id:{get:function(){return d},set:function(t){d=t}},valueFormat:{get:function(){return S},set:function(t){S=t}},valuePadding:{get:function(){return A},set:function(t){A=t}},groupSpacing:{get:function(){return M},set:function(t){M=t}},fillOpacity:{get:function(){return C},set:function(t){C=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return W},set:function(t){W=t,F.reset(W)}},color:{get:function(){return x},set:function(t){x=r.utils.getColor(t)}},barColor:{get:function(){return b},set:function(t){b=t?r.utils.getColor(t):null}}}),r.utils.initOptions(D),D},r.models.multiBarHorizontalChart=function(){"use strict";var t,e,n=r.models.multiBarHorizontal(),i=r.models.axis(),o=r.models.axis(),a=r.models.legend().height(30),s=r.models.legend().height(30),l=r.models.tooltip(),u={top:30,right:20,bottom:50,left:60},c=null,d=null,f=null,p=r.utils.defaultColor(),h=!0,g="top",v={},m=!0,y="top",x=!0,b=!0,k=!1,w=r.utils.state(),A=null,M=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=function(){return h?180:0},W=250;w.stacked=!1,n.stacked(k),i.orient("left").tickPadding(5).showMaxMin(!1).tickFormat((function(t){return t})),o.orient("bottom").tickFormat(d3.format(",.1f")),l.duration(0).valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.updateState(!1);var E=r.utils.renderWatch(C,W);function F(l){return E.reset(),E.models(n),x&&E.models(i),b&&E.models(o),l.each((function(l){var M=d3.select(this);r.utils.initSVG(M);var E,D=r.utils.availableWidth(d,M,u),_=r.utils.availableHeight(f,M,u);if(F.update=function(){M.transition().duration(W).call(F)},F.container=this,k=n.stacked(),w.setter(function(t){return function(e){void 0!==e.stacked&&(k=e.stacked),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(l),F.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),stacked:k}}}(l)).update(),w.disabled=l.map((function(t){return!!t.disabled})),!A)for(E in A={},w)w[E]instanceof Array?A[E]=w[E].slice(0):A[E]=w[E];if(!(l&&l.length&&l.filter((function(t){return t.values.length})).length))return r.utils.noData(F,M),F;M.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale().clamp(!0);var N=M.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([l]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),L=N.select("g");if(O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),O.append("g").attr("class","nv-barsWrap"),O.append("g").attr("class","nv-legendWrap"),O.append("g").attr("class","nv-controlsWrap"),m?(a.width(D-S()),L.select(".nv-legendWrap").datum(l).call(a),"bottom"===y?(u.bottom=i.height()+a.height(),_=r.utils.availableHeight(f,M,u),L.select(".nv-legendWrap").attr("transform","translate("+S()+","+(_+i.height())+")")):"top"===y&&(c||a.height()===u.top||(u.top=a.height(),_=r.utils.availableHeight(f,M,u)),L.select(".nv-legendWrap").attr("transform","translate("+S()+","+-u.top+")"))):L.select(".nv-legendWrap").selectAll("*").remove(),h){var B=[{key:v.grouped||"Grouped",disabled:n.stacked()},{key:v.stacked||"Stacked",disabled:!n.stacked()}];s.width(S()).color(["#444","#444","#444"]),"bottom"===g?(u.bottom=i.height()+a.height(),_=r.utils.availableHeight(f,M,u),L.select(".nv-controlsWrap").datum(B).attr("transform","translate(0,"+(_+i.height())+")").call(s)):"top"===g&&L.select(".nv-controlsWrap").datum(B).attr("transform","translate(0,"+-u.top+")").call(s)}else L.select(".nv-controlsWrap").selectAll("*").remove();N.attr("transform","translate("+u.left+","+u.top+")"),n.disabled(l.map((function(t){return t.disabled}))).width(D).height(_).color(l.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!l[e].disabled}))),L.select(".nv-barsWrap").datum(l.filter((function(t){return!t.disabled}))).transition().call(n),x&&(i.scale(t)._ticks(r.utils.calcTicksY(_/24,l)).tickSize(-D,0),L.select(".nv-x.nv-axis").call(i),L.select(".nv-x.nv-axis").selectAll("g").selectAll("line, text")),b&&(o.scale(e)._ticks(r.utils.calcTicksX(D/100,l)).tickSize(-_,0),L.select(".nv-y.nv-axis").attr("transform","translate(0,"+_+")"),L.select(".nv-y.nv-axis").call(o)),L.select(".nv-zeroLine line").attr("x1",e(0)).attr("x2",e(0)).attr("y1",0).attr("y2",-_),a.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];C.stateChange(w),F.update()})),s.dispatch.on("legendClick",(function(t,e){if(t.disabled){switch(B=B.map((function(t){return t.disabled=!0,t})),t.disabled=!1,t.key){case"Grouped":case v.grouped:n.stacked(!1);break;case"Stacked":case v.stacked:n.stacked(!0)}w.stacked=n.stacked(),C.stateChange(w),k=n.stacked(),F.update()}})),C.on("changeState",(function(t){void 0!==t.disabled&&(l.forEach((function(e,n){e.disabled=t.disabled[n]})),w.disabled=t.disabled),void 0!==t.stacked&&(n.stacked(t.stacked),w.stacked=t.stacked,k=t.stacked),F.update()}))})),E.renderEnd("multibar horizontal chart immediate"),F}return n.dispatch.on("elementMouseover.tooltip",(function(t){t.value=F.x()(t.data),t.series={key:t.data.key,value:F.y()(t.data),color:t.color},l.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){l.hidden(!0)})),n.dispatch.on("elementMousemove.tooltip",(function(t){l()})),F.dispatch=C,F.multibar=n,F.legend=a,F.controls=s,F.xAxis=i,F.yAxis=o,F.state=w,F.tooltip=l,F.options=r.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return d},set:function(t){d=t}},height:{get:function(){return f},set:function(t){f=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},controlsPosition:{get:function(){return g},set:function(t){g=t}},showControls:{get:function(){return h},set:function(t){h=t}},controlLabels:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return M},set:function(t){M=t}},margin:{get:function(){return u},set:function(t){void 0!==t.top&&(u.top=t.top,c=t.top),u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return W},set:function(t){W=t,E.reset(W),n.duration(W),i.duration(W),o.duration(W)}},color:{get:function(){return p},set:function(t){p=r.utils.getColor(t),a.color(p)}},barColor:{get:function(){return n.barColor},set:function(t){n.barColor(t),a.color((function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()}))}}}),r.utils.inheritOptions(F,n),r.utils.initOptions(F),F},r.models.multiChart=function(){"use strict";var t,e,n={top:30,right:20,bottom:50,left:60},i=null,o=r.utils.defaultColor(),a=null,s=null,l=!0,u=null,c=function(t){return t.x},d=function(t){return t.y},f="linear",p=!0,h=r.interactiveGuideline(),g=!1,v=" (right axis)",m=250,y=d3.scale.linear(),x=d3.scale.linear(),b=d3.scale.linear(),k=r.models.line().yScale(x).duration(m),w=r.models.line().yScale(b).duration(m),A=r.models.scatter().yScale(x).duration(m),M=r.models.scatter().yScale(b).duration(m),C=r.models.multiBar().stacked(!1).yScale(x).duration(m),S=r.models.multiBar().stacked(!1).yScale(b).duration(m),W=r.models.stackedArea().yScale(x).duration(m),E=r.models.stackedArea().yScale(b).duration(m),F=r.models.axis().scale(y).orient("bottom").tickPadding(5).duration(m),D=r.models.axis().scale(x).orient("left").duration(m),_=r.models.axis().scale(b).orient("right").duration(m),N=r.models.legend().height(30),O=r.models.tooltip(),L=d3.dispatch(),B=[k,w,A,M,C,S,W,E];function T(u){return u.each((function(u){var p=d3.select(this);r.utils.initSVG(p),T.update=function(){p.transition().call(T)},T.container=this;var m=r.utils.availableWidth(a,p,n),L=r.utils.availableHeight(s,p,n),P=u.filter((function(t){return"line"==t.type&&1==t.yAxis})),z=u.filter((function(t){return"line"==t.type&&2==t.yAxis})),I=u.filter((function(t){return"scatter"==t.type&&1==t.yAxis})),V=u.filter((function(t){return"scatter"==t.type&&2==t.yAxis})),H=u.filter((function(t){return"bar"==t.type&&1==t.yAxis})),Y=u.filter((function(t){return"bar"==t.type&&2==t.yAxis})),G=u.filter((function(t){return"area"==t.type&&1==t.yAxis})),R=u.filter((function(t){return"area"==t.type&&2==t.yAxis}));if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return r.utils.noData(T,p),T;p.selectAll(".nv-noData").remove();var X=u.filter((function(t){return!t.disabled&&1==t.yAxis})).map((function(t){return t.values.map((function(t,e){return{x:c(t),y:d(t)}}))})),j=u.filter((function(t){return!t.disabled&&2==t.yAxis})).map((function(t){return t.values.map((function(t,e){return{x:c(t),y:d(t)}}))}));y.domain(d3.extent(d3.merge(X.concat(j)),(function(t){return t.x}))).range([0,m]);var Z=p.selectAll("g.wrap.multiChart").data([u]),q=Z.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");q.append("g").attr("class","nv-x nv-axis"),q.append("g").attr("class","nv-y1 nv-axis"),q.append("g").attr("class","nv-y2 nv-axis"),q.append("g").attr("class","stack1Wrap"),q.append("g").attr("class","stack2Wrap"),q.append("g").attr("class","bars1Wrap"),q.append("g").attr("class","bars2Wrap"),q.append("g").attr("class","scatters1Wrap"),q.append("g").attr("class","scatters2Wrap"),q.append("g").attr("class","lines1Wrap"),q.append("g").attr("class","lines2Wrap"),q.append("g").attr("class","legendWrap"),q.append("g").attr("class","nv-interactive");var K=Z.select("g"),U=u.map((function(t,e){return u[e].color||o(t,e)}));if(l){var Q=N.align()?m/2:m,$=N.align()?Q:0;N.width(Q),N.color(U),K.select(".legendWrap").datum(u.map((function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=t.originalKey+(1==t.yAxis?"":v),t}))).call(N),i||N.height()===n.top||(n.top=N.height(),L=r.utils.availableHeight(s,p,n)),K.select(".legendWrap").attr("transform","translate("+$+","+-n.top+")")}else K.select(".legendWrap").selectAll("*").remove();k.width(m).height(L).interpolate(f).color(U.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"line"==u[e].type}))),w.width(m).height(L).interpolate(f).color(U.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"line"==u[e].type}))),A.width(m).height(L).color(U.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"scatter"==u[e].type}))),M.width(m).height(L).color(U.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"scatter"==u[e].type}))),C.width(m).height(L).color(U.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"bar"==u[e].type}))),S.width(m).height(L).color(U.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"bar"==u[e].type}))),W.width(m).height(L).interpolate(f).color(U.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"area"==u[e].type}))),E.width(m).height(L).interpolate(f).color(U.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"area"==u[e].type}))),K.attr("transform","translate("+n.left+","+n.top+")");var J=K.select(".lines1Wrap").datum(P.filter((function(t){return!t.disabled}))),tt=K.select(".scatters1Wrap").datum(I.filter((function(t){return!t.disabled}))),et=K.select(".bars1Wrap").datum(H.filter((function(t){return!t.disabled}))),nt=K.select(".stack1Wrap").datum(G.filter((function(t){return!t.disabled}))),rt=K.select(".lines2Wrap").datum(z.filter((function(t){return!t.disabled}))),it=K.select(".scatters2Wrap").datum(V.filter((function(t){return!t.disabled}))),ot=K.select(".bars2Wrap").datum(Y.filter((function(t){return!t.disabled}))),at=K.select(".stack2Wrap").datum(R.filter((function(t){return!t.disabled}))),st=[];C.stacked()&&H.length&&(st=H.filter((function(t){return!t.disabled})).map((function(t){return t.values}))).length>0&&(st=st.reduce((function(t,e){return t.map((function(t,n){return{x:t.x,y:t.y+e[n].y}}))}))),H.length&&st.push({x:0,y:0});var lt=[];function ut(t){var e=2===t.series.yAxis?_:D;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},O.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function ct(t){var e=2===t.series.yAxis?_:D;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},O.duration(100).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function dt(t){var e=2===t.series.yAxis?_:D;t.point.x=W.x()(t.point),t.point.y=W.y()(t.point),O.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function ft(t){var e=2===t.series.yAxis?_:D;t.value=C.x()(t.data),t.series={value:C.y()(t.data),color:t.color,key:t.data.key},O.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function pt(){for(var t=0,e=B.length;t<e;t++){var n=B[t];try{n.clearHighlights()}catch(t){}}}S.stacked()&&Y.length&&(lt=Y.filter((function(t){return!t.disabled})).map((function(t){return t.values}))).length>0&&(lt=lt.reduce((function(t,e){return t.map((function(t,n){return{x:t.x,y:t.y+e[n].y}}))}))),Y.length&&lt.push({x:0,y:0}),x.domain(t||d3.extent(d3.merge(X).concat(st),(function(t){return t.y}))).range([0,L]),b.domain(e||d3.extent(d3.merge(j).concat(lt),(function(t){return t.y}))).range([0,L]),k.yDomain(x.domain()),A.yDomain(x.domain()),C.yDomain(x.domain()),W.yDomain(x.domain()),w.yDomain(b.domain()),M.yDomain(b.domain()),S.yDomain(b.domain()),E.yDomain(b.domain()),G.length&&d3.transition(nt).call(W),R.length&&d3.transition(at).call(E),H.length&&d3.transition(et).call(C),Y.length&&d3.transition(ot).call(S),P.length&&d3.transition(J).call(k),z.length&&d3.transition(rt).call(w),I.length&&d3.transition(tt).call(A),V.length&&d3.transition(it).call(M),F._ticks(r.utils.calcTicksX(m/100,u)).tickSize(-L,0),K.select(".nv-x.nv-axis").attr("transform","translate(0,"+L+")"),d3.transition(K.select(".nv-x.nv-axis")).call(F),D._ticks(r.utils.calcTicksY(L/36,u)).tickSize(-m,0),d3.transition(K.select(".nv-y1.nv-axis")).call(D),_._ticks(r.utils.calcTicksY(L/36,u)).tickSize(-m,0),d3.transition(K.select(".nv-y2.nv-axis")).call(_),K.select(".nv-y1.nv-axis").classed("nv-disabled",!X.length).attr("transform","translate("+y.range()[0]+",0)"),K.select(".nv-y2.nv-axis").classed("nv-disabled",!j.length).attr("transform","translate("+y.range()[1]+",0)"),N.dispatch.on("stateChange",(function(t){T.update()})),g&&(h.width(m).height(L).margin({left:n.left,top:n.top}).svgContainer(p).xScale(y),Z.select(".nv-interactive").call(h)),g?(h.dispatch.on("elementMousemove",(function(t){pt();var e,n,i,a=[];u.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(s,l){var u=y.domain(),c=s.values.filter((function(t,e){return T.x()(t,e)>=u[0]&&T.x()(t,e)<=u[1]})),d=c[n=r.interactiveBisect(c,t.pointXValue,T.x())],f=T.y()(d,n);null!==f&&function(t,e,n){for(var r=0,i=B.length;r<i;r++){var o=B[r];try{o.highlightPoint(t,e,n)}catch(t){}}}(l,n,!0),void 0!==d&&(void 0===e&&(e=d),void 0===i&&(i=y(T.x()(d,n))),a.push({key:s.key,value:f,color:o(s,s.seriesIndex),data:d,yAxis:2==s.yAxis?_:D}))})),h.tooltip.headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter(h.tooltip.valueFormatter()||function(t,e){var n=a[e].yAxis;return null==t?"N/A":n.tickFormat()(t)}).data({value:T.x()(e,n),index:n,series:a})(),h.renderGuideLine(i)})),h.dispatch.on("elementMouseout",(function(t){pt()}))):(k.dispatch.on("elementMouseover.tooltip",ut),w.dispatch.on("elementMouseover.tooltip",ut),k.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),w.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),A.dispatch.on("elementMouseover.tooltip",ct),M.dispatch.on("elementMouseover.tooltip",ct),A.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),M.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),W.dispatch.on("elementMouseover.tooltip",dt),E.dispatch.on("elementMouseover.tooltip",dt),W.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),E.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),C.dispatch.on("elementMouseover.tooltip",ft),S.dispatch.on("elementMouseover.tooltip",ft),C.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),S.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),C.dispatch.on("elementMousemove.tooltip",(function(t){O()})),S.dispatch.on("elementMousemove.tooltip",(function(t){O()})))})),T}return T.dispatch=L,T.legend=N,T.lines1=k,T.lines2=w,T.scatters1=A,T.scatters2=M,T.bars1=C,T.bars2=S,T.stack1=W,T.stack2=E,T.xAxis=F,T.yAxis1=D,T.yAxis2=_,T.tooltip=O,T.interactiveLayer=h,T.options=r.utils.optionsFunc.bind(T),T._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},yDomain1:{get:function(){return t},set:function(e){t=e}},yDomain2:{get:function(){return e},set:function(t){e=t}},noData:{get:function(){return u},set:function(t){u=t}},interpolate:{get:function(){return f},set:function(t){f=t}},legendRightAxisHint:{get:function(){return v},set:function(t){v=t}},margin:{get:function(){return n},set:function(t){void 0!==t.top&&(n.top=t.top,i=t.top),n.right=void 0!==t.right?t.right:n.right,n.bottom=void 0!==t.bottom?t.bottom:n.bottom,n.left=void 0!==t.left?t.left:n.left}},color:{get:function(){return o},set:function(t){o=r.utils.getColor(t)}},x:{get:function(){return c},set:function(t){c=t,k.x(t),w.x(t),A.x(t),M.x(t),C.x(t),S.x(t),W.x(t),E.x(t)}},y:{get:function(){return d},set:function(t){d=t,k.y(t),w.y(t),A.y(t),M.y(t),W.y(t),E.y(t),C.y(t),S.y(t)}},useVoronoi:{get:function(){return p},set:function(t){p=t,k.useVoronoi(t),w.useVoronoi(t),W.useVoronoi(t),E.useVoronoi(t)}},useInteractiveGuideline:{get:function(){return g},set:function(t){(g=t)&&(k.interactive(!1),k.useVoronoi(!1),w.interactive(!1),w.useVoronoi(!1),W.interactive(!1),W.useVoronoi(!1),E.interactive(!1),E.useVoronoi(!1),A.interactive(!1),M.interactive(!1))}},duration:{get:function(){return m},set:function(t){m=t,[k,w,W,E,A,M,F,D,_].forEach((function(t){t.duration(m)}))}}}),r.utils.initOptions(T),T},r.models.ohlcBar=function(){"use strict";var t,e,n,i,o={top:0,right:0,bottom:0,left:0},a=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=function(t){return t.open},g=function(t){return t.close},v=function(t){return t.high},m=function(t){return t.low},y=[],x=[],b=!1,k=!0,w=r.utils.defaultColor(),A=!1,M=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");function C(A){return A.each((function(A){u=d3.select(this);var C=r.utils.availableWidth(a,u,o),S=r.utils.availableHeight(s,u,o);r.utils.initSVG(u);var W=C/A[0].values.length*.9;c.domain(t||d3.extent(A[0].values.map(f).concat(y))),b?c.range(n||[.5*C/A[0].values.length,C*(A[0].values.length-.5)/A[0].values.length]):c.range(n||[5+W/2,C-W/2-5]),d.domain(e||[d3.min(A[0].values.map(m).concat(x)),d3.max(A[0].values.map(v).concat(x))]).range(i||[S,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var E=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([A[0].values]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),D=F.append("defs"),_=F.append("g"),N=E.select("g");_.append("g").attr("class","nv-ticks"),E.attr("transform","translate("+o.left+","+o.top+")"),u.on("click",(function(t,e){M.chartClick({data:t,index:e,pos:d3.event,id:l})})),D.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect"),E.select("#nv-chart-clip-path-"+l+" rect").attr("width",C).attr("height",S),N.attr("clip-path",k?"url(#nv-chart-clip-path-"+l+")":"");var O=E.select(".nv-ticks").selectAll(".nv-tick").data((function(t){return t}));O.exit().remove(),O.enter().append("path").attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})).attr("d",(function(t,e){return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-W/2+",0l"+W/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(t,e)))+"l"+W/2+",0l"+-W/2+",0z"})).attr("transform",(function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"})).attr("fill",(function(t,e){return w[0]})).attr("stroke",(function(t,e){return w[0]})).attr("x",0).attr("y",(function(t,e){return d(Math.max(0,p(t,e)))})).attr("height",(function(t,e){return Math.abs(d(p(t,e))-d(0))})),O.attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})),d3.transition(O).attr("transform",(function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"})).attr("d",(function(t,e){var n=C/A[0].values.length*.9;return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-n/2+",0l"+n/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(t,e)))+"l"+n/2+",0l"+-n/2+",0z"}))})),C}return C.highlightPoint=function(t,e){C.clearHighlights(),u.select(".nv-ohlcBar .nv-tick-0-"+t).classed("hover",e)},C.clearHighlights=function(){u.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},C.dispatch=M,C.options=r.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return t},set:function(e){t=e}},yDomain:{get:function(){return e},set:function(t){e=t}},xRange:{get:function(){return n},set:function(t){n=t}},yRange:{get:function(){return i},set:function(t){i=t}},forceX:{get:function(){return y},set:function(t){y=t}},forceY:{get:function(){return x},set:function(t){x=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return k},set:function(t){k=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return A},set:function(t){A=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return o},set:function(t){o.top=null!=t.top?t.top:o.top,o.right=null!=t.right?t.right:o.right,o.bottom=null!=t.bottom?t.bottom:o.bottom,o.left=null!=t.left?t.left:o.left}},color:{get:function(){return w},set:function(t){w=r.utils.getColor(t)}}}),r.utils.initOptions(C),C},r.models.parallelCoordinates=function(){"use strict";var t,e,n,i={top:30,right:0,bottom:10,left:0},o=null,a=null,s=null,l=null,u=d3.scale.ordinal(),c={},d="undefined values",f=[],p=[],h=[],g=!0,v=r.utils.defaultColor(),m=[],y=[],x=[],b=[],k=1,w=d3.svg.line(),A=d3.svg.axis(),M=d3.dispatch("brushstart","brush","brushEnd","dimensionsOrder","stateChange","elementClick","elementMouseover","elementMouseout","elementMousemove","renderEnd","activeChanged"),C=r.utils.renderWatch(M);function S(W){return C.reset(),W.each((function(C){var S=d3.select(this);if(s=r.utils.availableWidth(o,S,i),l=r.utils.availableHeight(a,S,i),r.utils.initSVG(S),void 0===C[0].values){var W=[];C.forEach((function(t){var e={};Object.keys(t).forEach((function(n){"name"!==n&&(e[n]=t[n])})),W.push({key:t.name,values:e})})),C=W}var E=C.map((function(t){return t.values}));0===y.length&&(y=C),h=f.sort((function(t,e){return t.currentPosition-e.currentPosition})).map((function(t){return t.key})),p=f.filter((function(t){return!t.disabled})),u.rangePoints([0,s],1).domain(p.map((function(t){return t.key})));var F={},D=!1,_=[];h.forEach((function(t){var e=d3.extent(E,(function(e){return+e[t]})),n=e[0],r=e[1],i=!1;(isNaN(n)||isNaN(r))&&(i=!0,n=0,r=0),n===r&&(n-=1,r+=1);var o=m.filter((function(e){return e.dimension==t}));0!==o.length&&(i?(n=c[t].domain()[0],r=c[t].domain()[1]):!o[0].hasOnlyNaN&&g?(n=n>o[0].extent[0]?o[0].extent[0]:n,r=r<o[0].extent[1]?o[0].extent[1]:r):o[0].hasNaN&&(r=r<o[0].extent[1]?o[0].extent[1]:r,F[t]=c[t].domain()[1],D=!0)),c[t]=d3.scale.linear().domain([n,r]).range([.9*(l-12),0]),b=[],c[t].brush=d3.svg.brush().y(c[t]).on("brushstart",j).on("brush",Z).on("brushend",q)}));var N=S.selectAll("g.nv-wrap.nv-parallelCoordinates").data([C]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinates").append("g"),L=N.select("g");O.append("g").attr("class","nv-parallelCoordinates background"),O.append("g").attr("class","nv-parallelCoordinates foreground"),O.append("g").attr("class","nv-parallelCoordinates missingValuesline"),N.attr("transform","translate("+i.left+","+i.top+")"),w.interpolate("cardinal").tension(k),A.orient("left");var B,T,P=d3.behavior.drag().on("dragstart",(function(t){x[t.key]=this.parentNode.__origin__=u(t.key),e.attr("visibility","hidden")})).on("drag",(function(e){x[e.key]=Math.min(s,Math.max(0,this.parentNode.__origin__+=d3.event.x)),t.attr("d",R),p.sort((function(t,e){return U(t.key)-U(e.key)})),p.forEach((function(t,e){return t.currentPosition=e})),u.domain(p.map((function(t){return t.key}))),n.attr("transform",(function(t){return"translate("+U(t.key)+")"}))})).on("dragend",(function(n,r){delete this.parentNode.__origin__,delete x[n.key],d3.select(this.parentNode).attr("transform","translate("+u(n.key)+")"),t.attr("d",R),e.attr("d",R).attr("visibility",null),M.dimensionsOrder(p)})),z=u.range()[1]-u.range()[0];if(z=isNaN(z)?u.range()[0]:z,!isNaN(z)){var I=[0+z/2,l-12,s-z/2,l-12];(B=N.select(".missingValuesline").selectAll("line").data([I])).enter().append("line"),B.exit().remove(),B.attr("x1",(function(t){return t[0]})).attr("y1",(function(t){return t[1]})).attr("x2",(function(t){return t[2]})).attr("y2",(function(t){return t[3]})),(T=N.select(".missingValuesline").selectAll("text").data([d])).append("text").data([d]),T.enter().append("text"),T.exit().remove(),T.attr("y",l).attr("x",s-92-z/2).text((function(t){return t}))}(e=N.select(".background").selectAll("path").data(C)).enter().append("path"),e.exit().remove(),e.attr("d",R),(t=N.select(".foreground").selectAll("path").data(C)).enter().append("path"),t.exit().remove(),t.attr("d",R).style("stroke-width",(function(t,e){return isNaN(t.strokeWidth)&&(t.strokeWidth=1),t.strokeWidth})).attr("stroke",(function(t,e){return t.color||v(t,e)})),t.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0).style("stroke-width",t.strokeWidth+2+"px").style("stroke-opacity",1),M.elementMouseover({label:t.name,color:t.color||v(t,e),values:t.values,dimensions:p})})),t.on("mouseout",(function(t,e){d3.select(this).classed("hover",!1).style("stroke-width",t.strokeWidth+"px").style("stroke-opacity",.7),M.elementMouseout({label:t.name,index:e})})),t.on("mousemove",(function(t,e){M.elementMousemove()})),t.on("click",(function(t){M.elementClick({id:t.id})}));var V=(n=L.selectAll(".dimension").data(p)).enter().append("g").attr("class","nv-parallelCoordinates dimension");n.attr("transform",(function(t){return"translate("+u(t.key)+",0)"})),V.append("g").attr("class","nv-axis"),V.append("text").attr("class","nv-label").style("cursor","move").attr("dy","-1em").attr("text-anchor","middle").on("mouseover",(function(t,e){M.elementMouseover({label:t.tooltip||t.key,color:t.color})})).on("mouseout",(function(t,e){M.elementMouseout({label:t.tooltip})})).on("mousemove",(function(t,e){M.elementMousemove()})).call(P),V.append("g").attr("class","nv-brushBackground"),n.exit().remove(),n.select(".nv-label").text((function(t){return t.key})),X(g);var H=h.filter((function(t){return!c[t].brush.empty()})),Y=H.map((function(t){return c[t].brush.extent()})),G=y.slice(0);function R(t){return w(p.map((function(e){if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key]))||D){var n=c[e.key].domain(),r=c[e.key].range(),i=n[0]-(n[1]-n[0])/9;if(b.indexOf(e.key)<0){var o=d3.scale.linear().domain([i,n[1]]).range([l-12,r[1]]);c[e.key].brush.y(o),b.push(e.key)}if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key])))return[u(e.key),c[e.key](i)]}return void 0!==B&&(b.length>0||D?(B.style("display","inline"),T.style("display","inline")):(B.style("display","none"),T.style("display","none"))),[u(e.key),c[e.key](t.values[e.key])]})))}function X(t){m.forEach((function(e){var n=c[e.dimension].brush.y().domain();e.hasOnlyNaN&&(e.extent[1]=(c[e.dimension].domain()[1]-n[0])*(e.extent[1]-e.extent[0])/(F[e.dimension]-e.extent[0])+n[0]),e.hasNaN&&(e.extent[0]=n[0]),t&&c[e.dimension].brush.extent(e.extent)})),n.select(".nv-brushBackground").each((function(t){d3.select(this).call(c[t.key].brush)})).selectAll("rect").attr("x",-8).attr("width",16),K()}function j(){!1===g&&(g=!0,X(!0))}function Z(){H=h.filter((function(t){return!c[t].brush.empty()})),Y=H.map((function(t){return c[t].brush.extent()})),m=[],H.forEach((function(t,e){m[e]={dimension:t,extent:Y[e],hasNaN:!1,hasOnlyNaN:!1}})),y=[],t.style("display",(function(t){var e=H.every((function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||Y[n][0]!=c[e].brush.y().domain()[0])||Y[n][0]<=t.values[e]&&t.values[e]<=Y[n][1]&&!isNaN(parseFloat(t.values[e]))}));return e&&y.push(t),e?null:"none"})),K(),M.brush({filters:m,active:y})}function q(){var t=H.length>0;m.forEach((function(t){t.extent[0]===c[t.dimension].brush.y().domain()[0]&&b.indexOf(t.dimension)>=0&&(t.hasNaN=!0),t.extent[1]<c[t.dimension].domain()[0]&&(t.hasOnlyNaN=!0)})),M.brushEnd(y,t)}function K(){n.select(".nv-axis").each((function(t,e){var n=m.filter((function(e){return e.dimension==t.key}));_[t.key]=c[t.key].domain(),0!=n.length&&g&&(_[t.key]=[],n[0].extent[1]>c[t.key].domain()[0]&&(_[t.key]=[n[0].extent[1]]),n[0].extent[0]>=c[t.key].domain()[0]&&_[t.key].push(n[0].extent[0])),d3.select(this).call(A.scale(c[t.key]).tickFormat(t.format).tickValues(_[t.key]))}))}function U(t){var e=x[t];return null==e?u(t):e}y=[],t.style("display",(function(t){var e=H.every((function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||Y[n][0]!=c[e].brush.y().domain()[0])||Y[n][0]<=t.values[e]&&t.values[e]<=Y[n][1]&&!isNaN(parseFloat(t.values[e]))}));return e&&y.push(t),e?null:"none"})),(m.length>0||!r.utils.arrayEquals(y,G))&&M.activeChanged(y)})),S}return S.dispatch=M,S.options=r.utils.optionsFunc.bind(S),S._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},dimensionData:{get:function(){return f},set:function(t){f=t}},displayBrush:{get:function(){return g},set:function(t){g=t}},filters:{get:function(){return m},set:function(t){m=t}},active:{get:function(){return y},set:function(t){y=t}},lineTension:{get:function(){return k},set:function(t){k=t}},undefinedValuesLabel:{get:function(){return d},set:function(t){d=t}},dimensions:{get:function(){return f.map((function(t){return t.key}))},set:function(t){r.deprecated("dimensions","use dimensionData instead"),0===f.length?t.forEach((function(t){f.push({key:t})})):t.forEach((function(t,e){f[e].key=t}))}},dimensionNames:{get:function(){return f.map((function(t){return t.key}))},set:function(t){r.deprecated("dimensionNames","use dimensionData instead"),h=[],0===f.length?t.forEach((function(t){f.push({key:t})})):t.forEach((function(t,e){f[e].key=t}))}},dimensionFormats:{get:function(){return f.map((function(t){return t.format}))},set:function(t){r.deprecated("dimensionFormats","use dimensionData instead"),0===f.length?t.forEach((function(t){f.push({format:t})})):t.forEach((function(t,e){f[e].format=t}))}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return v},set:function(t){v=r.utils.getColor(t)}}}),r.utils.initOptions(S),S},r.models.parallelCoordinatesChart=function(){"use strict";var t=r.models.parallelCoordinates(),e=r.models.legend(),n=r.models.tooltip(),i=(r.models.tooltip(),{top:0,right:0,bottom:0,left:0}),o=null,a=null,s=null,l=!0,u=r.utils.defaultColor(),c=r.utils.state(),d=[],f=!0,p=null,h=null,g="undefined",v=d3.dispatch("dimensionsOrder","brushEnd","stateChange","changeState","renderEnd"),m=r.utils.renderWatch(v);function y(n){return m.reset(),m.models(t),n.each((function(n){var u=d3.select(this);r.utils.initSVG(u);var h,g=r.utils.availableWidth(a,u,i),m=r.utils.availableHeight(s,u,i);if(y.update=function(){u.call(y)},y.container=this,c.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(d),y.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(d)).update(),c.disabled=d.map((function(t){return!!t.disabled})),(d=d.map((function(t){return t.disabled=!!t.disabled,t}))).forEach((function(t,e){t.originalPosition=isNaN(t.originalPosition)?e:t.originalPosition,t.currentPosition=isNaN(t.currentPosition)?e:t.currentPosition})),!p)for(h in p={},c)c[h]instanceof Array?p[h]=c[h].slice(0):p[h]=c[h];if(!n||!n.length)return r.utils.noData(y,u),y;u.selectAll(".nv-noData").remove();var x=u.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").data([n]),b=x.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinatesChart").append("g"),k=x.select("g");b.append("g").attr("class","nv-parallelCoordinatesWrap"),b.append("g").attr("class","nv-legendWrap"),k.select("rect").attr("width",g).attr("height",m>0?m:0),l?(e.width(g).color((function(t){return"rgb(188,190,192)"})),k.select(".nv-legendWrap").datum(d.sort((function(t,e){return t.originalPosition-e.originalPosition}))).call(e),o||e.height()===i.top||(i.top=e.height(),m=r.utils.availableHeight(s,u,i)),x.select(".nv-legendWrap").attr("transform","translate( 0 ,"+-i.top+")")):k.select(".nv-legendWrap").selectAll("*").remove(),x.attr("transform","translate("+i.left+","+i.top+")"),t.width(g).height(m).dimensionData(d).displayBrush(f),k.select(".nv-parallelCoordinatesWrap ").datum(n).transition().call(t),t.dispatch.on("brushEnd",(function(t,e){e?(f=!0,v.brushEnd(t)):f=!1})),e.dispatch.on("stateChange",(function(t){for(var e in t)c[e]=t[e];v.stateChange(c),y.update()})),t.dispatch.on("dimensionsOrder",(function(t){d.sort((function(t,e){return t.currentPosition-e.currentPosition}));var e=!1;d.forEach((function(t,n){t.currentPosition=n,t.currentPosition!==t.originalPosition&&(e=!0)})),v.dimensionsOrder(d,e)})),v.on("changeState",(function(t){void 0!==t.disabled&&(d.forEach((function(e,n){e.disabled=t.disabled[n]})),c.disabled=t.disabled),y.update()}))})),m.renderEnd("parraleleCoordinateChart immediate"),y}return n.contentGenerator((function(t){var e='<table><thead><tr><td class="legend-color-guide"><div style="background-color:'+t.color+'"></div></td><td><strong>'+t.key+"</strong></td></tr></thead>";return 0!==t.series.length&&(e+='<tbody><tr><td height ="10px"></td></tr>',t.series.forEach((function(t){e=e+'<tr><td class="legend-color-guide"><div style="background-color:'+t.color+'"></div></td><td class="key">'+t.key+'</td><td class="value">'+t.value+"</td></tr>"})),e+="</tbody>"),e+="</table>"})),t.dispatch.on("elementMouseover.tooltip",(function(t){var e={key:t.label,color:t.color,series:[]};t.values&&(Object.keys(t.values).forEach((function(n){var r,i=t.dimensions.filter((function(t){return t.key===n}))[0];i&&(r=isNaN(t.values[n])||isNaN(parseFloat(t.values[n]))?g:i.format(t.values[n]),e.series.push({idx:i.currentPosition,key:n,value:r,color:i.color}))})),e.series.sort((function(t,e){return t.idx-e.idx}))),n.data(e).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){n.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(){n()})),y.dispatch=v,y.parallelCoordinates=t,y.legend=e,y.tooltip=n,y.options=r.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},defaultState:{get:function(){return p},set:function(t){p=t}},dimensionData:{get:function(){return d},set:function(t){d=t}},displayBrush:{get:function(){return f},set:function(t){f=t}},noData:{get:function(){return h},set:function(t){h=t}},nanValue:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,o=t.top),i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return u},set:function(n){u=r.utils.getColor(n),e.color(u),t.color(u)}}}),r.utils.inheritOptions(y,t),r.utils.initOptions(y),y},r.models.pie=function(){"use strict";var t={top:0,right:0,bottom:0,left:0},e=500,n=500,i=function(t){return t.x},o=function(t){return t.y},a=Math.floor(1e4*Math.random()),s=null,l=r.utils.defaultColor(),u=d3.format(",.2f"),c=!0,d=!1,f="key",p=.02,h=!1,g=!1,v=!1,m=!0,y=0,x=!1,b=!1,k=!1,w=!1,A=0,M=.5,C=250,S=[],W=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=[],F=[],D=r.utils.renderWatch(W);function _(N){return D.reset(),N.each((function(_){var N=e-t.left-t.right,O=n-t.top-t.bottom,L=Math.min(N,O)/2,B=[],T=[];if(s=d3.select(this),0===S.length)for(var P=L-L/10,z=M*L,I=0;I<_[0].length;I++)B.push(P),T.push(z);else m?(B=S.map((function(t){return(t.outer-t.outer/10)*L})),T=S.map((function(t){return(t.inner-t.inner/10)*L})),M=d3.min(S.map((function(t){return t.inner-t.inner/10})))):(B=S.map((function(t){return t.outer*L})),T=S.map((function(t){return t.inner*L})),M=d3.min(S.map((function(t){return t.inner}))));r.utils.initSVG(s);var V=s.selectAll(".nv-wrap.nv-pie").data(_),H=V.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+a).append("g"),Y=V.select("g"),G=H.append("g").attr("class","nv-pie");for(H.append("g").attr("class","nv-pieLabels"),V.attr("transform","translate("+t.left+","+t.top+")"),Y.select(".nv-pie").attr("transform","translate("+N/2+","+O/2+")"),Y.select(".nv-pieLabels").attr("transform","translate("+N/2+","+O/2+")"),s.on("click",(function(t,e){W.chartClick({data:t,index:e,pos:d3.event,id:a})})),E=[],F=[],I=0;I<_[0].length;I++){var R=d3.svg.arc().outerRadius(B[I]),X=d3.svg.arc().outerRadius(B[I]+5);!1!==b&&(R.startAngle(b),X.startAngle(b)),!1!==w&&(R.endAngle(w),X.endAngle(w)),g&&(R.innerRadius(T[I]),X.innerRadius(T[I])),R.cornerRadius&&A&&(R.cornerRadius(A),X.cornerRadius(A)),E.push(R),F.push(X)}var j=d3.layout.pie().sort(null).value((function(t){return t.disabled?0:o(t)}));j.padAngle&&k&&j.padAngle(k),g&&v&&(G.append("text").attr("class","nv-pie-title"),V.select(".nv-pie-title").style("text-anchor","middle").text((function(t){return v})).style("font-size",Math.min(N,O)*M*2/(v.length+2)+"px").attr("dy","0.35em").attr("transform",(function(t,e){return"translate(0, "+y+")"})));var Z=V.select(".nv-pie").selectAll(".nv-slice").data(j),q=V.select(".nv-pieLabels").selectAll(".nv-label").data(j);Z.exit().remove(),q.exit().remove();var K=Z.enter().append("g");if(K.attr("class","nv-slice"),K.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),m&&d3.select(this).select("path").transition().duration(70).attr("d",F[e]),W.elementMouseover({data:t.data,index:e,color:d3.select(this).style("fill"),percent:(t.endAngle-t.startAngle)/(2*Math.PI)})})),K.on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),m&&d3.select(this).select("path").transition().duration(50).attr("d",E[e]),W.elementMouseout({data:t.data,index:e})})),K.on("mousemove",(function(t,e){W.elementMousemove({data:t.data,index:e})})),K.on("click",(function(t,e){W.elementClick({data:t.data,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this})})),K.on("dblclick",(function(t,e){W.elementDblClick({data:t.data,index:e,color:d3.select(this).style("fill")})})),Z.attr("fill",(function(t,e){return l(t.data,e)})),Z.attr("stroke",(function(t,e){return l(t.data,e)})),K.append("path").each((function(t){this._current=t})),Z.select("path").transition().duration(C).attr("d",(function(t,e){return E[e](t)})).attrTween("d",(function(t,e){t.endAngle=isNaN(t.endAngle)?0:t.endAngle,t.startAngle=isNaN(t.startAngle)?0:t.startAngle,g||(t.innerRadius=0);var n=d3.interpolate(this._current,t);return this._current=n(0),function(t){return E[e](n(t))}})),c){var U=[];for(I=0;I<_[0].length;I++)U.push(E[I]),d?g&&(U[I]=d3.svg.arc().outerRadius(E[I].outerRadius()),!1!==b&&U[I].startAngle(b),!1!==w&&U[I].endAngle(w)):g||U[I].innerRadius(0);q.enter().append("g").classed("nv-label",!0).each((function(t,e){var n=d3.select(this);n.attr("transform",(function(t,e){if(x){t.outerRadius=B[e]+10,t.innerRadius=B[e]+15;var n=(t.startAngle+t.endAngle)/2*(180/Math.PI);return(t.startAngle+t.endAngle)/2<Math.PI?n-=90:n+=90,"translate("+U[e].centroid(t)+") rotate("+n+")"}return t.outerRadius=L+10,t.innerRadius=L+15,"translate("+U[e].centroid(t)+")"})),n.append("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3),n.append("text").style("text-anchor",x?(t.startAngle+t.endAngle)/2<Math.PI?"start":"end":"middle").style("fill","#000")}));var Q={},$=function(t){return 140*Math.floor(t[0]/140)+","+14*Math.floor(t[1]/14)},J=function(t){return(t.endAngle-t.startAngle)/(2*Math.PI)};q.watchTransition(D,"pie labels").attr("transform",(function(t,e){if(x){t.outerRadius=B[e]+10,t.innerRadius=B[e]+15;var n=(t.startAngle+t.endAngle)/2*(180/Math.PI);return(t.startAngle+t.endAngle)/2<Math.PI?n-=90:n+=90,"translate("+U[e].centroid(t)+") rotate("+n+")"}t.outerRadius=L+10,t.innerRadius=L+15;var r=U[e].centroid(t),i=J(t);if(t.value&&i>=p){var o=$(r);Q[o]&&(r[1]-=14),Q[$(r)]=!0}return"translate("+r+")"})),q.select(".nv-label text").style("text-anchor",(function(t,e){return x?(t.startAngle+t.endAngle)/2<Math.PI?"start":"end":"middle"})).text((function(t,e){var n=J(t),r="";if(!t.value||n<p)return"";if("function"==typeof f)r=f(t,e,{key:i(t.data),value:o(t.data),percent:u(n)});else switch(f){case"key":r=i(t.data);break;case"value":r=u(o(t.data));break;case"percent":r=d3.format("%")(n)}return r})),h&&q.each((function(t,e){if(this.getBBox){var n=this.getBBox(),i=U[e].centroid(t),o={x:i[0]+n.x,y:i[1]+n.y},a={x:o.x+n.width,y:o.y},s={x:o.x,y:o.y+n.height},l={x:o.x+n.width,y:o.y+n.height};t.visible=r.utils.pointIsInArc(o,t,R)&&r.utils.pointIsInArc(a,t,R)&&r.utils.pointIsInArc(s,t,R)&&r.utils.pointIsInArc(l,t,R)}})).style("display",(function(t){return t.visible?null:"none"}))}})),D.renderEnd("pie immediate"),_}return _.dispatch=W,_.options=r.utils.optionsFunc.bind(_),_._options=Object.create({},{arcsRadius:{get:function(){return S},set:function(t){S=t}},width:{get:function(){return e},set:function(t){e=t}},height:{get:function(){return n},set:function(t){n=t}},showLabels:{get:function(){return c},set:function(t){c=t}},title:{get:function(){return v},set:function(t){v=t}},titleOffset:{get:function(){return y},set:function(t){y=t}},labelThreshold:{get:function(){return p},set:function(t){p=t}},hideOverlapLabels:{get:function(){return h},set:function(t){h=t}},valueFormat:{get:function(){return u},set:function(t){u=t}},x:{get:function(){return i},set:function(t){i=t}},id:{get:function(){return a},set:function(t){a=t}},endAngle:{get:function(){return w},set:function(t){w=t}},startAngle:{get:function(){return b},set:function(t){b=t}},padAngle:{get:function(){return k},set:function(t){k=t}},cornerRadius:{get:function(){return A},set:function(t){A=t}},donutRatio:{get:function(){return M},set:function(t){M=t}},labelsOutside:{get:function(){return d},set:function(t){d=t}},labelSunbeamLayout:{get:function(){return x},set:function(t){x=t}},donut:{get:function(){return g},set:function(t){g=t}},growOnHover:{get:function(){return m},set:function(t){m=t}},pieLabelsOutside:{get:function(){return d},set:function(t){d=t,r.deprecated("pieLabelsOutside","use labelsOutside instead")}},donutLabelsOutside:{get:function(){return d},set:function(t){d=t,r.deprecated("donutLabelsOutside","use labelsOutside instead")}},labelFormat:{get:function(){return u},set:function(t){u=t,r.deprecated("labelFormat","use valueFormat instead")}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},duration:{get:function(){return C},set:function(t){C=t,D.reset(C)}},y:{get:function(){return o},set:function(t){o=d3.functor(t)}},color:{get:function(){return l},set:function(t){l=r.utils.getColor(t)}},labelType:{get:function(){return f},set:function(t){f=t||"key"}}}),r.utils.initOptions(_),_},r.models.pieChart=function(){"use strict";var t=r.models.pie(),e=r.models.legend(),n=r.models.tooltip(),i={top:30,right:20,bottom:20,left:20},o=null,a=null,s=null,l=!1,u=!0,c="top",d=r.utils.defaultColor(),f=r.utils.state(),p=null,h=null,g=250,v=d3.dispatch("stateChange","changeState","renderEnd");n.duration(0).headerEnabled(!1).valueFormatter((function(e,n){return t.valueFormat()(e,n)}));var m=r.utils.renderWatch(v);function y(n){return m.reset(),m.models(t),n.each((function(n){var l=d3.select(this);r.utils.initSVG(l);var d,h=r.utils.availableWidth(a,l,i),g=r.utils.availableHeight(s,l,i);if(y.update=function(){l.transition().call(y)},y.container=this,f.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(n),y.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(n)).update(),f.disabled=n.map((function(t){return!!t.disabled})),!p)for(d in p={},f)f[d]instanceof Array?p[d]=f[d].slice(0):p[d]=f[d];if(!n||!n.length)return r.utils.noData(y,l),y;l.selectAll(".nv-noData").remove();var m=l.selectAll("g.nv-wrap.nv-pieChart").data([n]),x=m.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),b=m.select("g");if(x.append("g").attr("class","nv-pieWrap"),x.append("g").attr("class","nv-legendWrap"),u)if("top"===c)e.width(h).key(t.x()),m.select(".nv-legendWrap").datum(n).call(e),o||e.height()===i.top||(i.top=e.height(),g=r.utils.availableHeight(s,l,i)),m.select(".nv-legendWrap").attr("transform","translate(0,"+-i.top+")");else if("right"===c){var k=r.models.legend().width();h/2<k&&(k=h/2),e.height(g).key(t.x()),e.width(k),h-=e.width(),m.select(".nv-legendWrap").datum(n).call(e).attr("transform","translate("+h+",0)")}else"bottom"===c&&(e.width(h).key(t.x()),m.select(".nv-legendWrap").datum(n).call(e),i.bottom=e.height(),g=r.utils.availableHeight(s,l,i),m.select(".nv-legendWrap").attr("transform","translate(0,"+g+")"));else b.select(".nv-legendWrap").selectAll("*").remove();m.attr("transform","translate("+i.left+","+i.top+")"),t.width(h).height(g);var w=b.select(".nv-pieWrap").datum([n]);d3.transition(w).call(t),e.dispatch.on("stateChange",(function(t){for(var e in t)f[e]=t[e];v.stateChange(f),y.update()})),v.on("changeState",(function(t){void 0!==t.disabled&&(n.forEach((function(e,n){e.disabled=t.disabled[n]})),f.disabled=t.disabled),y.update()}))})),m.renderEnd("pieChart immediate"),y}return t.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:y.x()(t.data),value:y.y()(t.data),color:t.color,percent:t.percent},l||(delete t.percent,delete t.series.percent),n.data(t).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){n.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){n()})),y.legend=e,y.dispatch=v,y.pie=t,y.tooltip=n,y.options=r.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},noData:{get:function(){return h},set:function(t){h=t}},showTooltipPercent:{get:function(){return l},set:function(t){l=t}},showLegend:{get:function(){return u},set:function(t){u=t}},legendPosition:{get:function(){return c},set:function(t){c=t}},defaultState:{get:function(){return p},set:function(t){p=t}},color:{get:function(){return d},set:function(n){d=n,e.color(d),t.color(d)}},duration:{get:function(){return g},set:function(e){g=e,m.reset(g),t.duration(g)}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,o=t.top),i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}}}),r.utils.inheritOptions(y,t),r.utils.initOptions(y),y},r.models.sankey=function(){"use strict";var t={},e=24,n=8,i=[1,1],o=[],a=[],s=!0,l=function(t){o.forEach((function(t){t.sourceLinks=[],t.targetLinks=[]})),a.forEach((function(t){var e=t.source,n=t.target;"number"==typeof e&&(e=t.source=o[t.source]),"number"==typeof n&&(n=t.target=o[t.target]),e.sourceLinks.push(t),n.targetLinks.push(t)})),o.forEach((function(t){t.value=Math.max(d3.sum(t.sourceLinks,f),d3.sum(t.targetLinks,f))})),function(){for(var t,n,r=o,a=0;r.length&&a<o.length;)t=[],r.forEach((function(n){n.x=a,n.dx=e,n.sourceLinks.forEach((function(e){t.indexOf(e.target)<0&&t.push(e.target)}))})),r=t,++a;s&&function(t){o.forEach((function(e){e.sourceLinks.length||(e.x=t-1)}))}(a),n=(i[0]-e)/(a-1),o.forEach((function(t){t.x*=n}))}(),function(t){var e,r=d3.nest().key((function(t){return t.x})).sortKeys(d3.ascending).entries(o).map((function(t){return t.values}));e=d3.min(r,(function(t){return(i[1]-(t.length-1)*n)/d3.sum(t,f)})),r.forEach((function(t){t.forEach((function(t,n){t.y=n,t.dy=t.value*e}))})),a.forEach((function(t){t.dy=t.value*e})),p(),d();for(var s=1;t>0;--t)u(s*=.99),p(),d(),l(s),p(),d();function l(t){function e(t){return(t.source.y+t.sy+t.dy/2)*t.value}r.forEach((function(n,r){n.forEach((function(n){if(n.targetLinks.length){var r=d3.sum(n.targetLinks,e)/d3.sum(n.targetLinks,f);n.y+=(r-c(n))*t}}))}))}function u(t){function e(t){return(t.target.y+t.ty+t.dy/2)*t.value}r.slice().reverse().forEach((function(n){n.forEach((function(n){if(n.sourceLinks.length){var r=d3.sum(n.sourceLinks,e)/d3.sum(n.sourceLinks,f);n.y+=(r-c(n))*t}}))}))}function p(){r.forEach((function(t){var e,r,o,a=0,s=t.length;for(t.sort(h),o=0;o<s;++o)(r=a-(e=t[o]).y)>0&&(e.y+=r),a=e.y+e.dy+n;if((r=a-n-i[1])>0)for(a=e.y-=r,o=s-2;o>=0;--o)(r=(e=t[o]).y+e.dy+n-a)>0&&(e.y-=r),a=e.y}))}function h(t,e){return t.y-e.y}}(t)},u=function(){var t=.5;function e(e){var n=e.source.x+e.source.dx,r=e.target.x,i=d3.interpolateNumber(n,r),o=i(t),a=i(1-t),s=e.source.y+e.sy+e.dy/2,l=e.target.y+e.ty+e.dy/2;return"M"+n+","+s+"C"+o+","+s+" "+a+","+l+" "+r+","+l}return e.curvature=function(n){return arguments.length?(t=+n,e):t},e},c=function(t){return t.y+t.dy/2};function d(){function t(t,e){return t.source.y-e.source.y}function e(t,e){return t.target.y-e.target.y}o.forEach((function(n){n.sourceLinks.sort(e),n.targetLinks.sort(t)})),o.forEach((function(t){var e=0,n=0;t.sourceLinks.forEach((function(t){t.sy=e,e+=t.dy})),t.targetLinks.forEach((function(t){t.ty=n,n+=t.dy}))}))}function f(t){return t.value}return t.options=r.utils.optionsFunc.bind(t),t._options=Object.create({},{nodeWidth:{get:function(){return e},set:function(t){e=+t}},nodePadding:{get:function(){return n},set:function(t){n=t}},nodes:{get:function(){return o},set:function(t){o=t}},links:{get:function(){return a},set:function(t){a=t}},size:{get:function(){return i},set:function(t){i=t}},sinksRight:{get:function(){return s},set:function(t){s=t}},layout:{get:function(){l(32)},set:function(t){l(t)}},relayout:{get:function(){d()},set:function(t){}},center:{get:function(){return c()},set:function(t){"function"==typeof t&&(c=t)}},link:{get:function(){return u()},set:function(t){return"function"==typeof t&&(u=t),u()}}}),r.utils.initOptions(t),t},r.models.sankeyChart=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},e=r.models.sankey(),n=600,i=400,o=36,a=40,s="units",l=void 0,u=d3.format(",.0f"),c=function(t){return u(t)+" "+s},d=d3.scale.category20(),f=function(t){return t.source.name+" → "+t.target.name+"\n"+c(t.value)},p=function(t){return t.color=d(t.name.replace(/ .*/,""))},h=function(t){return d3.rgb(t.color).darker(2)},g=function(t){return t.name+"\n"+c(t.value)},v=function(t,e){t.append("text").attr("x",0).attr("y",0).attr("class","nvd3-sankey-chart-error").attr("text-anchor","middle").text(e)};function m(t){return t.each((function(r){var s={nodes:[{node:1,name:"Test 1"},{node:2,name:"Test 2"},{node:3,name:"Test 3"},{node:4,name:"Test 4"},{node:5,name:"Test 5"},{node:6,name:"Test 6"}],links:[{source:0,target:1,value:2295},{source:0,target:5,value:1199},{source:1,target:2,value:1119},{source:1,target:5,value:1176},{source:2,target:3,value:487},{source:2,target:5,value:632},{source:3,target:4,value:301},{source:3,target:5,value:186}]},u=!1,c=!1;if(("object"==typeof r.nodes&&r.nodes.length)>=0&&("object"==typeof r.links&&r.links.length)>=0&&(u=!0),r.nodes&&r.nodes.length>0&&r.links&&r.links.length>0&&(c=!0),!u)return console.error("NVD3 Sankey chart error:","invalid data format for",r),console.info("Valid data format is: ",s,JSON.stringify(s)),v(t,"Error loading chart, data is invalid"),!1;if(!c)return v(t,"No data available"),!1;var d=t.append("svg").attr("width",n).attr("height",i).append("g").attr("class","nvd3 nv-wrap nv-sankeyChart");e.nodeWidth(o).nodePadding(a).size([n,i]);var m=e.link();e.nodes(r.nodes).links(r.links).layout(32).center(l);var y=d.append("g").selectAll(".link").data(r.links).enter().append("path").attr("class","link").attr("d",m).style("stroke-width",(function(t){return Math.max(1,t.dy)})).sort((function(t,e){return e.dy-t.dy}));y.append("title").text(f);var x=d.append("g").selectAll(".node").data(r.nodes).enter().append("g").attr("class","node").attr("transform",(function(t){return"translate("+t.x+","+t.y+")"})).call(d3.behavior.drag().origin((function(t){return t})).on("dragstart",(function(){this.parentNode.appendChild(this)})).on("drag",(function(t){d3.select(this).attr("transform","translate("+t.x+","+(t.y=Math.max(0,Math.min(i-t.dy,d3.event.y)))+")"),e.relayout(),y.attr("d",m)})));x.append("rect").attr("height",(function(t){return t.dy})).attr("width",e.nodeWidth()).style("fill",p).style("stroke",h).append("title").text(g),x.append("text").attr("x",-6).attr("y",(function(t){return t.dy/2})).attr("dy",".35em").attr("text-anchor","end").attr("transform",null).text((function(t){return t.name})).filter((function(t){return t.x<n/2})).attr("x",6+e.nodeWidth()).attr("text-anchor","start")})),m}return m.options=r.utils.optionsFunc.bind(m),m._options=Object.create({},{units:{get:function(){return s},set:function(t){s=t}},width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return i},set:function(t){i=t}},format:{get:function(){return c},set:function(t){c=t}},linkTitle:{get:function(){return f},set:function(t){f=t}},nodeWidth:{get:function(){return o},set:function(t){o=t}},nodePadding:{get:function(){return a},set:function(t){a=t}},center:{get:function(){return l},set:function(t){l=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},nodeStyle:{get:function(){return{}},set:function(t){p=void 0!==t.fillColor?t.fillColor:p,h=void 0!==t.strokeColor?t.strokeColor:h,g=void 0!==t.title?t.title:g}}}),r.utils.initOptions(m),m},r.models.scatter=function(){"use strict";var t,e,n,i,o,a,s,l,u={top:0,right:0,bottom:0,left:0},c=null,d=null,f=r.utils.defaultColor(),p=null,h=Math.floor(1e5*Math.random()),g=null,v=d3.scale.linear(),m=d3.scale.linear(),y=d3.scale.linear(),x=function(t){return t.x},b=function(t){return t.y},k=function(t){return t.size||1},w=function(t){return t.shape||"circle"},A=[],M=[],C=[],S=!0,W=function(t){return!t.notActive},E=!1,F=.1,D=!1,_=!0,N=!1,O=function(){return 25},L=null,B=null,T=null,P=null,z=null,I=null,V=!1,H=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),Y=!0,G=250,R=300,X=!1,j=!1,Z=r.utils.renderWatch(H,G),q=[16,256],K={};function U(t){var e;return e=t[0].series+":"+t[1],K[e]=K[e]||{}}function Q(t){var e;e=t[0].series+":"+t[1],delete K[e]}function $(t){var e,n,r,i=U(t),o=!1;for(e=1;e<arguments.length;e+=2)n=arguments[e],r=arguments[e+1](t[0],t[1]),i[n]===r&&i.hasOwnProperty(n)||(i[n]=r,o=!0);return o}function J(G){return Z.reset(),G.each((function(G){g=d3.select(this);var K=r.utils.availableWidth(c,g,u),U=r.utils.availableHeight(d,g,u);r.utils.initSVG(g),G.forEach((function(t,e){t.values.forEach((function(t){t.series=e}))}));var tt="function"==typeof J.yScale().base,et=L&&B&&z?[]:d3.merge(G.map((function(t){return t.values.map((function(t,e){return{x:x(t,e),y:b(t,e),size:k(t,e)}}))})));if(v.domain(L||d3.extent(et.map((function(t){return t.x})).concat(A))),E&&G[0]?v.range(T||[(K*F+K)/(2*G[0].values.length),K-K*(1+F)/(2*G[0].values.length)]):v.range(T||[0,K]),tt){var nt=d3.min(et.map((function(t){if(0!==t.y)return t.y})));m.clamp(!0).domain(B||d3.extent(et.map((function(t){return 0!==t.y?t.y:.1*nt})).concat(M))).range(P||[U,0])}else m.domain(B||d3.extent(et.map((function(t){return t.y})).concat(M))).range(P||[U,0]);y.domain(z||d3.extent(et.map((function(t){return t.size})).concat(C))).range(I||q),V=v.domain()[0]===v.domain()[1]||m.domain()[0]===m.domain()[1],v.domain()[0]===v.domain()[1]&&(v.domain()[0]?v.domain([v.domain()[0]-.01*v.domain()[0],v.domain()[1]+.01*v.domain()[1]]):v.domain([-1,1])),m.domain()[0]===m.domain()[1]&&(m.domain()[0]?m.domain([m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]):m.domain([-1,1])),isNaN(v.domain()[0])&&v.domain([-1,1]),isNaN(m.domain()[0])&&m.domain([-1,1]),t=t||v,e=e||m,n=n||y;var rt=v(1)!==t(1)||m(1)!==e(1)||y(1)!==n(1);s=s||d;var it=(a=a||c)!==c||s!==d,ot=(i=i||[])[0]!==v.domain()[0]||i[1]!==v.domain()[1];i=v.domain(),o=o||[],ot=ot||o[0]!==m.domain()[0]||o[1]!==m.domain()[1],o=m.domain();var at=g.selectAll("g.nv-wrap.nv-scatter").data([G]),st=at.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+h),lt=st.append("defs"),ut=st.append("g"),ct=at.select("g");function dt(){if(j=!1,!S)return!1;if(!0===Y){at.select(".nv-point-paths").selectAll("path").remove();var t=d3.merge(G.map((function(t,e){return t.values.map((function(t,n){var i=x(t,n),o=b(t,n);return[r.utils.NaNtoZero(v(i))+1e-4*Math.random(),r.utils.NaNtoZero(m(o))+1e-4*Math.random(),e,n,t]})).filter((function(t,e){return W(t[4],e)}))})));if(0==t.length)return!1;t.length<3&&(t.push([v.range()[0]-20,m.range()[0]-20,null,null]),t.push([v.range()[1]+20,m.range()[1]+20,null,null]),t.push([v.range()[0]-20,m.range()[0]+20,null,null]),t.push([v.range()[1]+20,m.range()[1]-20,null,null]));var e=d3.geom.polygon([[-10,-10],[-10,d+10],[c+10,d+10],[c+10,-10]]);t=t.sort((function(t,e){return t[0]-e[0]||t[1]-e[1]}));for(var n=0;n<t.length-1;)Math.abs(t[n][0]-t[n+1][0])<1e-4&&Math.abs(t[n][1]-t[n+1][1])<1e-4?t.splice(n+1,1):n++;var i=d3.geom.voronoi(t).map((function(n,r){return{data:e.clip(n),series:t[r][2],point:t[r][3]}})),o=at.select(".nv-point-paths").selectAll("path").data(i),a=o.enter().append("svg:path").attr("d",(function(t){return t&&t.data&&0!==t.data.length?"M"+t.data.join(",")+"Z":"M 0 0"})).attr("id",(function(t,e){return"nv-path-"+e})).attr("clip-path",(function(t,e){return"url(#nv-clip-"+h+"-"+e+")"}));N&&a.style("fill",d3.rgb(230,230,230)).style("fill-opacity",.4).style("stroke-opacity",1).style("stroke",d3.rgb(200,200,200)),_&&(at.select(".nv-point-clips").selectAll("*").remove(),at.select(".nv-point-clips").selectAll("clipPath").data(t).enter().append("svg:clipPath").attr("id",(function(t,e){return"nv-clip-"+h+"-"+e})).append("svg:circle").attr("cx",(function(t){return t[0]})).attr("cy",(function(t){return t[1]})).attr("r",O));var s=function(t,e,n){if(j)return 0;var r=G[e.series];if(void 0!==r){var i=r.values[e.point];i.color=f(r,e.series),i.x=x(i),i.y=b(i);var o=g.node().getBoundingClientRect(),a=window.pageYOffset||document.documentElement.scrollTop,s=window.pageXOffset||document.documentElement.scrollLeft;n({point:i,series:r,pos:{left:v(x(i,e.point))+o.left+s+u.left+10,top:m(b(i,e.point))+o.top+a+u.top+10},relativePos:[v(x(i,e.point))+u.left,m(b(i,e.point))+u.top],seriesIndex:e.series,pointIndex:e.point,event:d3.event,element:t})}};o.on("click",(function(t){s(this,t,H.elementClick)})).on("dblclick",(function(t){s(this,t,H.elementDblClick)})).on("mouseover",(function(t){s(this,t,H.elementMouseover)})).on("mouseout",(function(t,e){s(this,t,H.elementMouseout)}))}else at.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",(function(t,e){if(j||!G[t.series])return 0;var n=G[t.series],r=n.values[e];H.elementClick({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,event:d3.event,element:this})})).on("dblclick",(function(t,e){if(j||!G[t.series])return 0;var n=G[t.series],r=n.values[e];H.elementDblClick({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e})})).on("mouseover",(function(t,e){if(j||!G[t.series])return 0;var n=G[t.series],r=n.values[e];H.elementMouseover({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,color:f(t,e)})})).on("mouseout",(function(t,e){if(j||!G[t.series])return 0;var n=G[t.series],r=n.values[e];H.elementMouseout({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,color:f(t,e)})}))}at.classed("nv-single-point",V),ut.append("g").attr("class","nv-groups"),ut.append("g").attr("class","nv-point-paths"),st.append("g").attr("class","nv-point-clips"),at.attr("transform","translate("+u.left+","+u.top+")"),lt.append("clipPath").attr("id","nv-edge-clip-"+h).append("rect").attr("transform","translate( -10, -10)"),at.select("#nv-edge-clip-"+h+" rect").attr("width",K+20).attr("height",U>0?U+20:0),ct.attr("clip-path",D?"url(#nv-edge-clip-"+h+")":""),j=!0;var ft=at.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));ft.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),ft.exit().remove(),ft.attr("class",(function(t,e){return(t.classed||"")+" nv-group nv-series-"+e})).classed("nv-noninteractive",!S).classed("hover",(function(t){return t.hover})),ft.watchTransition(Z,"scatter: groups").style("fill",(function(t,e){return f(t,e)})).style("stroke",(function(t,e){return t.pointBorderColor||p||f(t,e)})).style("stroke-opacity",1).style("fill-opacity",.5);var pt=ft.selectAll("path.nv-point").data((function(t){return t.values.map((function(t,e){return[t,e]})).filter((function(t,e){return W(t[0],e)}))}));if(pt.enter().append("path").attr("class",(function(t){return"nv-point nv-point-"+t[1]})).style("fill",(function(t){return t.color})).style("stroke",(function(t){return t.color})).attr("transform",(function(n){return"translate("+r.utils.NaNtoZero(t(x(n[0],n[1])))+","+r.utils.NaNtoZero(e(b(n[0],n[1])))+")"})).attr("d",r.utils.symbol().type((function(t){return w(t[0])})).size((function(t){return y(k(t[0],t[1]))}))),pt.exit().each(Q).remove(),ft.exit().selectAll("path.nv-point").watchTransition(Z,"scatter exit").attr("transform",(function(t){return"translate("+r.utils.NaNtoZero(v(x(t[0],t[1])))+","+r.utils.NaNtoZero(m(b(t[0],t[1])))+")"})).remove(),pt.filter((function(t){return $(t,"x",x,"y",b)||rt||it||ot})).watchTransition(Z,"scatter points").attr("transform",(function(t){return"translate("+r.utils.NaNtoZero(v(x(t[0],t[1])))+","+r.utils.NaNtoZero(m(b(t[0],t[1])))+")"})),pt.filter((function(t){return $(t,"shape",w,"size",k)||rt||it||ot})).watchTransition(Z,"scatter points").attr("d",r.utils.symbol().type((function(t){return w(t[0])})).size((function(t){return y(k(t[0],t[1]))}))),X){var ht=ft.selectAll(".nv-label").data((function(t){return t.values.map((function(t,e){return[t,e]})).filter((function(t,e){return W(t[0],e)}))}));ht.enter().append("text").style("fill",(function(t,e){return t.color})).style("stroke-opacity",0).style("fill-opacity",1).attr("transform",(function(n){return"translate("+(r.utils.NaNtoZero(t(x(n[0],n[1])))+Math.sqrt(y(k(n[0],n[1]))/Math.PI)+2)+","+r.utils.NaNtoZero(e(b(n[0],n[1])))+")"})).text((function(t,e){return t[0].label})),ht.exit().remove(),ft.exit().selectAll("path.nv-label").watchTransition(Z,"scatter exit").attr("transform",(function(t){return"translate("+(r.utils.NaNtoZero(v(x(t[0],t[1])))+Math.sqrt(y(k(t[0],t[1]))/Math.PI)+2)+","+r.utils.NaNtoZero(m(b(t[0],t[1])))+")"})).remove(),ht.each((function(t){d3.select(this).classed("nv-label",!0).classed("nv-label-"+t[1],!1).classed("hover",!1)})),ht.watchTransition(Z,"scatter labels").attr("transform",(function(t){return"translate("+(r.utils.NaNtoZero(v(x(t[0],t[1])))+Math.sqrt(y(k(t[0],t[1]))/Math.PI)+2)+","+r.utils.NaNtoZero(m(b(t[0],t[1])))+")"}))}R?(clearTimeout(l),l=setTimeout(dt,R)):dt(),t=v.copy(),e=m.copy(),n=y.copy(),a=c,s=d})),Z.renderEnd("scatter immediate"),J}return J.dispatch=H,J.options=r.utils.optionsFunc.bind(J),J._calls=new function(){this.clearHighlights=function(){return r.dom.write((function(){g.selectAll(".nv-point.hover").classed("hover",!1)})),null},this.highlightPoint=function(t,e,n){r.dom.write((function(){g.select(".nv-groups").selectAll(".nv-series-"+t).selectAll(".nv-point-"+e).classed("hover",n)}))}},H.on("elementMouseover.point",(function(t){S&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!0)})),H.on("elementMouseout.point",(function(t){S&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!1)})),J._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},xScale:{get:function(){return v},set:function(t){v=t}},yScale:{get:function(){return m},set:function(t){m=t}},pointScale:{get:function(){return y},set:function(t){y=t}},xDomain:{get:function(){return L},set:function(t){L=t}},yDomain:{get:function(){return B},set:function(t){B=t}},pointDomain:{get:function(){return z},set:function(t){z=t}},xRange:{get:function(){return T},set:function(t){T=t}},yRange:{get:function(){return P},set:function(t){P=t}},pointRange:{get:function(){return I},set:function(t){I=t}},forceX:{get:function(){return A},set:function(t){A=t}},forceY:{get:function(){return M},set:function(t){M=t}},forcePoint:{get:function(){return C},set:function(t){C=t}},interactive:{get:function(){return S},set:function(t){S=t}},pointActive:{get:function(){return W},set:function(t){W=t}},padDataOuter:{get:function(){return F},set:function(t){F=t}},padData:{get:function(){return E},set:function(t){E=t}},clipEdge:{get:function(){return D},set:function(t){D=t}},clipVoronoi:{get:function(){return _},set:function(t){_=t}},clipRadius:{get:function(){return O},set:function(t){O=t}},showVoronoi:{get:function(){return N},set:function(t){N=t}},id:{get:function(){return h},set:function(t){h=t}},interactiveUpdateDelay:{get:function(){return R},set:function(t){R=t}},showLabels:{get:function(){return X},set:function(t){X=t}},pointBorderColor:{get:function(){return p},set:function(t){p=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},pointSize:{get:function(){return k},set:function(t){k=d3.functor(t)}},pointShape:{get:function(){return w},set:function(t){w=d3.functor(t)}},margin:{get:function(){return u},set:function(t){u.top=void 0!==t.top?t.top:u.top,u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return G},set:function(t){G=t,Z.reset(G)}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t)}},useVoronoi:{get:function(){return Y},set:function(t){!1===(Y=t)&&(_=!1)}}}),r.utils.initOptions(J),J},r.models.scatterChart=function(){"use strict";var t=r.models.scatter(),e=r.models.axis(),n=r.models.axis(),i=r.models.legend(),o=r.models.distribution(),a=r.models.distribution(),s=r.models.tooltip(),l={top:30,right:20,bottom:50,left:75},u=null,c=null,d=null,f=null,p=r.utils.defaultColor(),h=t.xScale(),g=t.yScale(),v=!1,m=!1,y=!0,x=!0,b=!0,k=!1,w=r.utils.state(),A=null,M=d3.dispatch("stateChange","changeState","renderEnd"),C=null,S=250,W=!1;t.xScale(h).yScale(g),e.orient("bottom").tickPadding(10),n.orient(k?"right":"left").tickPadding(10),o.axis("x"),a.axis("y"),s.headerFormatter((function(t,n){return e.tickFormat()(t,n)})).valueFormatter((function(t,e){return n.tickFormat()(t,e)}));var E=r.utils.renderWatch(M,S);function F(C){return E.reset(),E.models(t),x&&E.models(e),b&&E.models(n),v&&E.models(o),m&&E.models(a),C.each((function(C){f=d3.select(this),r.utils.initSVG(f);var D,_=r.utils.availableWidth(c,f,l),N=r.utils.availableHeight(d,f,l);if(F.update=function(){0===S?f.call(F):f.transition().duration(S).call(F)},F.container=this,w.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(C),F.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(C)).update(),w.disabled=C.map((function(t){return!!t.disabled})),!A)for(D in A={},w)w[D]instanceof Array?A[D]=w[D].slice(0):A[D]=w[D];if(!(C&&C.length&&C.filter((function(t){return t.values.length})).length))return r.utils.noData(F,f),E.renderEnd("scatter immediate"),F;f.selectAll(".nv-noData").remove(),h=t.xScale(),g=t.yScale();var O=f.selectAll("g.nv-wrap.nv-scatterChart").data([C]),L=O.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+t.id()).append("g"),B=O.select("g");if(L.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis"),L.append("g").attr("class","nv-scatterWrap"),L.append("g").attr("class","nv-regressionLinesWrap"),L.append("g").attr("class","nv-distWrap"),L.append("g").attr("class","nv-legendWrap"),k&&B.select(".nv-y.nv-axis").attr("transform","translate("+_+",0)"),y){var T=_;i.width(T),O.select(".nv-legendWrap").datum(C).call(i),u||i.height()===l.top||(l.top=i.height(),N=r.utils.availableHeight(d,f,l)),O.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")}else B.select(".nv-legendWrap").selectAll("*").remove();O.attr("transform","translate("+l.left+","+l.top+")"),t.width(_).height(N).color(C.map((function(t,e){return t.color=t.color||p(t,e),t.color})).filter((function(t,e){return!C[e].disabled}))).showLabels(W),O.select(".nv-scatterWrap").datum(C.filter((function(t){return!t.disabled}))).call(t),O.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+t.id()+")");var P=O.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data((function(t){return t}));P.enter().append("g").attr("class","nv-regLines");var z=P.selectAll(".nv-regLine").data((function(t){return[t]}));z.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0),z.filter((function(t){return t.intercept&&t.slope})).watchTransition(E,"scatterPlusLineChart: regline").attr("x1",h.range()[0]).attr("x2",h.range()[1]).attr("y1",(function(t,e){return g(h.domain()[0]*t.slope+t.intercept)})).attr("y2",(function(t,e){return g(h.domain()[1]*t.slope+t.intercept)})).style("stroke",(function(t,e,n){return p(t,n)})).style("stroke-opacity",(function(t,e){return t.disabled||void 0===t.slope||void 0===t.intercept?0:1})),x&&(e.scale(h)._ticks(r.utils.calcTicksX(_/100,C)).tickSize(-N,0),B.select(".nv-x.nv-axis").attr("transform","translate(0,"+g.range()[0]+")").call(e)),b&&(n.scale(g)._ticks(r.utils.calcTicksY(N/36,C)).tickSize(-_,0),B.select(".nv-y.nv-axis").call(n)),v&&(o.getData(t.x()).scale(h).width(_).color(C.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!C[e].disabled}))),L.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),B.select(".nv-distributionX").attr("transform","translate(0,"+g.range()[0]+")").datum(C.filter((function(t){return!t.disabled}))).call(o)),m&&(a.getData(t.y()).scale(g).width(N).color(C.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!C[e].disabled}))),L.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),B.select(".nv-distributionY").attr("transform","translate("+(k?_:-a.size())+",0)").datum(C.filter((function(t){return!t.disabled}))).call(a)),i.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];M.stateChange(w),F.update()})),M.on("changeState",(function(t){void 0!==t.disabled&&(C.forEach((function(e,n){e.disabled=t.disabled[n]})),w.disabled=t.disabled),F.update()})),t.dispatch.on("elementMouseout.tooltip",(function(e){s.hidden(!0),f.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-distx-"+e.pointIndex).attr("y1",0),f.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-disty-"+e.pointIndex).attr("x2",a.size())})),t.dispatch.on("elementMouseover.tooltip",(function(t){f.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.relativePos[1]-N),f.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.relativePos[0]+o.size()),s.data(t).hidden(!1)})),h.copy(),g.copy()})),E.renderEnd("scatter with line immediate"),F}return F.dispatch=M,F.scatter=t,F.legend=i,F.xAxis=e,F.yAxis=n,F.distX=o,F.distY=a,F.tooltip=s,F.options=r.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},container:{get:function(){return f},set:function(t){f=t}},showDistX:{get:function(){return v},set:function(t){v=t}},showDistY:{get:function(){return m},set:function(t){m=t}},showLegend:{get:function(){return y},set:function(t){y=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return C},set:function(t){C=t}},duration:{get:function(){return S},set:function(t){S=t}},showLabels:{get:function(){return W},set:function(t){W=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,n.orient(t?"right":"left")}},color:{get:function(){return p},set:function(t){p=r.utils.getColor(t),i.color(p),o.color(p),a.color(p)}}}),r.utils.inheritOptions(F,t),r.utils.initOptions(F),F},r.models.sparkline=function(){"use strict";var t,e,n,i,o={top:2,right:0,bottom:2,left:0},a=400,s=32,l=null,u=!0,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=r.utils.getColor(["#000"]),g=!0,v=!0,m=d3.dispatch("renderEnd"),y=r.utils.renderWatch(m);function x(u){return y.reset(),u.each((function(u){var m=a-o.left-o.right,y=s-o.top-o.bottom;l=d3.select(this),r.utils.initSVG(l),c.domain(t||d3.extent(u,f)).range(n||[0,m]),d.domain(e||d3.extent(u,p)).range(i||[y,0]);var x=l.selectAll("g.nv-wrap.nv-sparkline").data([u]);x.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline").append("g"),x.select("g"),x.attr("transform","translate("+o.left+","+o.top+")");var b=x.selectAll("path").data((function(t){return[t]}));b.enter().append("path"),b.exit().remove(),b.style("stroke",(function(t,e){return t.color||h(t,e)})).attr("d",d3.svg.line().x((function(t,e){return c(f(t,e))})).y((function(t,e){return d(p(t,e))})));var k=x.selectAll("circle.nv-point").data((function(t){var e=t.map((function(t,e){return p(t,e)}));function n(e){if(-1!=e){var n=t[e];return n.pointIndex=e,n}return null}var r=n(e.lastIndexOf(d.domain()[1])),i=n(e.indexOf(d.domain()[0])),o=n(e.length-1);return[g?i:null,g?r:null,v?o:null].filter((function(t){return null!=t}))}));k.enter().append("circle"),k.exit().remove(),k.attr("cx",(function(t,e){return c(f(t,t.pointIndex))})).attr("cy",(function(t,e){return d(p(t,t.pointIndex))})).attr("r",2).attr("class",(function(t,e){return f(t,t.pointIndex)==c.domain()[1]?"nv-point nv-currentValue":p(t,t.pointIndex)==d.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"}))})),y.renderEnd("sparkline immediate"),x}return x.options=r.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xDomain:{get:function(){return t},set:function(e){t=e}},yDomain:{get:function(){return e},set:function(t){e=t}},xRange:{get:function(){return n},set:function(t){n=t}},yRange:{get:function(){return i},set:function(t){i=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},animate:{get:function(){return u},set:function(t){u=t}},showMinMaxPoints:{get:function(){return g},set:function(t){g=t}},showCurrentPoint:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=d3.functor(t)}},y:{get:function(){return p},set:function(t){p=d3.functor(t)}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return h},set:function(t){h=r.utils.getColor(t)}}}),x.dispatch=m,r.utils.initOptions(x),x},r.models.sparklinePlus=function(){"use strict";var t,e,n=r.models.sparkline(),i={top:15,right:100,bottom:10,left:50},o=null,a=null,s=[],l=!1,u=d3.format(",r"),c=d3.format(",.2f"),d=!0,f=!0,p=!1,h=null,g=d3.dispatch("renderEnd"),v=r.utils.renderWatch(g);function m(h){return v.reset(),v.models(n),h.each((function(h){var g=d3.select(this);r.utils.initSVG(g);var v=r.utils.availableWidth(o,g,i),y=r.utils.availableHeight(a,g,i);if(m.update=function(){g.call(m)},m.container=this,!h||!h.length)return r.utils.noData(m,g),m;g.selectAll(".nv-noData").remove();var x=n.y()(h[h.length-1],h.length-1);t=n.xScale(),e=n.yScale();var b=g.selectAll("g.nv-wrap.nv-sparklineplus").data([h]),k=b.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus").append("g"),w=b.select("g");k.append("g").attr("class","nv-sparklineWrap"),k.append("g").attr("class","nv-valueWrap"),k.append("g").attr("class","nv-hoverArea"),b.attr("transform","translate("+i.left+","+i.top+")");var A=w.select(".nv-sparklineWrap");if(n.width(v).height(y),A.call(n),d){var M=w.select(".nv-valueWrap").selectAll(".nv-currentValue").data([x]);M.enter().append("text").attr("class","nv-currentValue").attr("dx",p?-8:8).attr("dy",".9em").style("text-anchor",p?"end":"start"),M.attr("x",v+(p?i.right:0)).attr("y",f?function(t){return e(t)}:0).style("fill",n.color()(h[h.length-1],h.length-1)).text(c(x))}function C(){if(!l){var e=w.selectAll(".nv-hoverValue").data(s),r=e.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);e.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),e.attr("transform",(function(e){return"translate("+t(n.x()(h[e],e))+",0)"})).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),s.length&&(r.append("line").attr("x1",0).attr("y1",-i.top).attr("x2",0).attr("y2",y),r.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-i.top).attr("text-anchor","end").attr("dy",".9em"),w.select(".nv-hoverValue .nv-xValue").text(u(n.x()(h[s[0]],s[0]))),r.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-i.top).attr("text-anchor","start").attr("dy",".9em"),w.select(".nv-hoverValue .nv-yValue").text(c(n.y()(h[s[0]],s[0]))))}}k.select(".nv-hoverArea").append("rect").on("mousemove",(function(){if(!l){var e=d3.mouse(this)[0]-i.left;s=[function(t,e){for(var r=Math.abs(n.x()(t[0],0)-e),i=0,o=0;o<t.length;o++)Math.abs(n.x()(t[o],o)-e)<r&&(r=Math.abs(n.x()(t[o],o)-e),i=o);return i}(h,Math.round(t.invert(e)))],C()}})).on("click",(function(){l=!l})).on("mouseout",(function(){s=[],C()})),w.select(".nv-hoverArea rect").attr("transform",(function(t){return"translate("+-i.left+","+-i.top+")"})).attr("width",v+i.left+i.right).attr("height",y+i.top)})),v.renderEnd("sparklinePlus immediate"),m}return m.dispatch=g,m.sparkline=n,m.options=r.utils.optionsFunc.bind(m),m._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},xTickFormat:{get:function(){return u},set:function(t){u=t}},yTickFormat:{get:function(){return c},set:function(t){c=t}},showLastValue:{get:function(){return d},set:function(t){d=t}},alignValue:{get:function(){return f},set:function(t){f=t}},rightAlignValue:{get:function(){return p},set:function(t){p=t}},noData:{get:function(){return h},set:function(t){h=t}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}}}),r.utils.inheritOptions(m,n),r.utils.initOptions(m),m},r.models.stackedArea=function(){"use strict";var t,e,n={top:0,right:0,bottom:0,left:0},i=960,o=500,a=r.utils.defaultColor(),s=Math.floor(1e5*Math.random()),l=null,u=function(t){return t.x},c=function(t){return t.y},d=function(t,e){return!isNaN(c(t,e))&&null!==c(t,e)},f="stack",p="zero",h="default",g="linear",v=!1,m=r.models.scatter(),y=250,x=d3.dispatch("areaClick","areaMouseover","areaMouseout","renderEnd","elementClick","elementMouseover","elementMouseout");m.pointSize(2.2).pointDomain([2.2,2.2]);var b=r.utils.renderWatch(x,y);function k(f){return b.reset(),b.models(m),f.each((function(f){var y=i-n.left-n.right,w=o-n.top-n.bottom;l=d3.select(this),r.utils.initSVG(l),t=m.xScale(),e=m.yScale();var A=f;f.forEach((function(t,e){t.seriesIndex=e,t.values=t.values.map((function(t,n){return t.index=n,t.seriesIndex=e,t}))}));var M=f.filter((function(t){return!t.disabled}));f=d3.layout.stack().order(h).offset(p).values((function(t){return t.values})).x(u).y(c).out((function(t,e,n){t.display={y:n,y0:e}}))(M);var C=l.selectAll("g.nv-wrap.nv-stackedarea").data([f]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea"),W=S.append("defs"),E=S.append("g"),F=C.select("g");E.append("g").attr("class","nv-areaWrap"),E.append("g").attr("class","nv-scatterWrap"),C.attr("transform","translate("+n.left+","+n.top+")"),0==m.forceY().length&&m.forceY().push(0),m.width(y).height(w).x(u).y((function(t){if(void 0!==t.display)return t.display.y+t.display.y0})).color(f.map((function(t,e){return t.color=t.color||a(t,t.seriesIndex),t.color}))),F.select(".nv-scatterWrap").datum(f).call(m),W.append("clipPath").attr("id","nv-edge-clip-"+s).append("rect"),C.select("#nv-edge-clip-"+s+" rect").attr("width",y).attr("height",w),F.attr("clip-path",v?"url(#nv-edge-clip-"+s+")":"");var D=d3.svg.area().defined(d).x((function(e,n){return t(u(e,n))})).y0((function(t){return e(t.display.y0)})).y1((function(t){return e(t.display.y+t.display.y0)})).interpolate(g),_=d3.svg.area().defined(d).x((function(e,n){return t(u(e,n))})).y0((function(t){return e(t.display.y0)})).y1((function(t){return e(t.display.y0)})),N=F.select(".nv-areaWrap").selectAll("path.nv-area").data((function(t){return t}));N.enter().append("path").attr("class",(function(t,e){return"nv-area nv-area-"+e})).attr("d",(function(t,e){return _(t.values,t.seriesIndex)})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),x.areaMouseover({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),x.areaMouseout({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})).on("click",(function(t,e){d3.select(this).classed("hover",!1),x.areaClick({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})),N.exit().remove(),N.style("fill",(function(t,e){return t.color||a(t,t.seriesIndex)})).style("stroke",(function(t,e){return t.color||a(t,t.seriesIndex)})),N.watchTransition(b,"stackedArea path").attr("d",(function(t,e){return D(t.values,e)})),m.dispatch.on("elementMouseover.area",(function(t){F.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!0)})),m.dispatch.on("elementMouseout.area",(function(t){F.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!1)})),k.d3_stackedOffset_stackPercent=function(t){var e,n,r,i=t.length,o=t[0].length,a=[];for(n=0;n<o;++n){for(e=0,r=0;e<A.length;e++)r+=c(A[e].values[n]);if(r)for(e=0;e<i;e++)t[e][n][1]/=r;else for(e=0;e<i;e++)t[e][n][1]=0}for(n=0;n<o;++n)a[n]=0;return a}})),b.renderEnd("stackedArea immediate"),k}return k.dispatch=x,k.scatter=m,m.dispatch.on("elementClick",(function(){x.elementClick.apply(this,arguments)})),m.dispatch.on("elementMouseover",(function(){x.elementMouseover.apply(this,arguments)})),m.dispatch.on("elementMouseout",(function(){x.elementMouseout.apply(this,arguments)})),k.interpolate=function(t){return arguments.length?(g=t,k):g},k.duration=function(t){return arguments.length?(y=t,b.reset(y),m.duration(y),k):y},k.dispatch=x,k.scatter=m,k.options=r.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return i},set:function(t){i=t}},height:{get:function(){return o},set:function(t){o=t}},defined:{get:function(){return d},set:function(t){d=t}},clipEdge:{get:function(){return v},set:function(t){v=t}},offset:{get:function(){return p},set:function(t){p=t}},order:{get:function(){return h},set:function(t){h=t}},interpolate:{get:function(){return g},set:function(t){g=t}},x:{get:function(){return u},set:function(t){u=d3.functor(t)}},y:{get:function(){return c},set:function(t){c=d3.functor(t)}},margin:{get:function(){return n},set:function(t){n.top=void 0!==t.top?t.top:n.top,n.right=void 0!==t.right?t.right:n.right,n.bottom=void 0!==t.bottom?t.bottom:n.bottom,n.left=void 0!==t.left?t.left:n.left}},color:{get:function(){return a},set:function(t){a=r.utils.getColor(t)}},style:{get:function(){return f},set:function(t){switch(f=t){case"stack":k.offset("zero"),k.order("default");break;case"stream":k.offset("wiggle"),k.order("inside-out");break;case"stream-center":k.offset("silhouette"),k.order("inside-out");break;case"expand":k.offset("expand"),k.order("default");break;case"stack_percent":k.offset(k.d3_stackedOffset_stackPercent),k.order("default")}}},duration:{get:function(){return y},set:function(t){y=t,b.reset(y),m.duration(y)}}}),r.utils.inheritOptions(k,m),r.utils.initOptions(k),k},r.models.stackedAreaChart=function(){"use strict";var t,e,n=r.models.stackedArea(),i=r.models.axis(),o=r.models.axis(),a=r.models.legend(),s=r.models.legend(),l=r.interactiveGuideline(),u=r.models.tooltip(),c=r.models.focus(r.models.stackedArea()),d={top:10,right:25,bottom:50,left:60},f=null,p=null,h=null,g=r.utils.defaultColor(),v=!0,m=!0,y="top",x=!0,b=!0,k=!1,w=!1,A=!1,M=!0,C="TOTAL",S=r.utils.state(),W=null,E=null,F=d3.dispatch("stateChange","changeState","renderEnd"),D=250,_=["Stacked","Stream","Expanded"],N={},O=250;S.style=n.style(),i.orient("bottom").tickPadding(7),o.orient(k?"right":"left"),u.headerFormatter((function(t,e){return i.tickFormat()(t,e)})).valueFormatter((function(t,e){return o.tickFormat()(t,e)})),l.tooltip.headerFormatter((function(t,e){return i.tickFormat()(t,e)})).valueFormatter((function(t,e){return null==t?"N/A":o.tickFormat()(t,e)}));var L=null,B=null;s.updateState(!1);var T=r.utils.renderWatch(F),P=(n.style(),d3.format("%"));function z(u){return T.reset(),T.models(n),x&&T.models(i),b&&T.models(o),u.each((function(u){var E=d3.select(this);r.utils.initSVG(E);var T,I=r.utils.availableWidth(p,E,d),V=r.utils.availableHeight(h,E,d)-(w?c.height():0);if(z.update=function(){E.transition().duration(O).call(z)},z.container=this,S.setter(function(t){return function(e){void 0!==e.style&&e.style,void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(u),z.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),style:n.style()}}}(u)).update(),S.disabled=u.map((function(t){return!!t.disabled})),!W)for(T in W={},S)S[T]instanceof Array?W[T]=S[T].slice(0):W[T]=S[T];if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return r.utils.noData(z,E),z;E.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale();var H=E.selectAll("g.nv-wrap.nv-stackedAreaChart").data([u]),Y=H.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),G=H.select("g");Y.append("g").attr("class","nv-legendWrap"),Y.append("g").attr("class","nv-controlsWrap");var R=Y.append("g").attr("class","nv-focus");if(R.append("g").attr("class","nv-background").append("rect"),R.append("g").attr("class","nv-x nv-axis"),R.append("g").attr("class","nv-y nv-axis"),R.append("g").attr("class","nv-stackedWrap"),R.append("g").attr("class","nv-interactive"),Y.append("g").attr("class","nv-focusWrap"),m){var X=v&&"top"===y?I-D:I;if(a.width(X),G.select(".nv-legendWrap").datum(u).call(a),"bottom"===y){var j=10+(x?12:0);d.bottom=Math.max(a.height()+j,d.bottom);var Z=(V=r.utils.availableHeight(h,E,d)-(w?c.height():0))+j;G.select(".nv-legendWrap").attr("transform","translate(0,"+Z+")")}else"top"===y&&(f||d.top==a.height()||(d.top=a.height(),V=r.utils.availableHeight(h,E,d)-(w?c.height():0)),G.select(".nv-legendWrap").attr("transform","translate("+(I-X)+","+-d.top+")"))}else G.select(".nv-legendWrap").selectAll("*").remove();if(v){var q=[{key:N.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=n.style(),style:"stack"},{key:N.stream||"Stream",metaKey:"Stream",disabled:"stream"!=n.style(),style:"stream"},{key:N.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=n.style(),style:"expand"},{key:N.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=n.style(),style:"stack_percent"}];D=_.length/3*260,q=q.filter((function(t){return-1!==_.indexOf(t.metaKey)})),s.width(D).color(["#444","#444","#444"]),G.select(".nv-controlsWrap").datum(q).call(s);var K=Math.max(s.height(),m&&"top"===y?a.height():0);d.top!=K&&(d.top=K,V=r.utils.availableHeight(h,E,d)-(w?c.height():0)),G.select(".nv-controlsWrap").attr("transform","translate(0,"+-d.top+")")}else G.select(".nv-controlsWrap").selectAll("*").remove();H.attr("transform","translate("+d.left+","+d.top+")"),k&&G.select(".nv-y.nv-axis").attr("transform","translate("+I+",0)"),A&&(l.width(I).height(V).margin({left:d.left,top:d.top}).svgContainer(E).xScale(t),H.select(".nv-interactive").call(l)),G.select(".nv-focus .nv-background rect").attr("width",I).attr("height",V),n.width(I).height(V).color(u.map((function(t,e){return t.color||g(t,e)})).filter((function(t,e){return!u[e].disabled})));var U,Q=G.select(".nv-focus .nv-stackedWrap").datum(u.filter((function(t){return!t.disabled})));function $(){x&&G.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+V+")").transition().duration(O).call(i)}function J(){if(b){if("expand"===n.style()||"stack_percent"===n.style()){var t=o.tickFormat();L&&t===P||(L=t),o.tickFormat(P)}else L&&(o.tickFormat(L),L=null);G.select(".nv-focus .nv-y.nv-axis").transition().duration(0).call(o)}}if(x&&i.scale(t)._ticks(r.utils.calcTicksX(I/100,u)).tickSize(-V,0),b&&(U="wiggle"===n.offset()?0:r.utils.calcTicksY(V/36,u),o.scale(e)._ticks(U).tickSize(-I,0)),w){c.width(I),G.select(".nv-focusWrap").attr("transform","translate(0,"+(V+d.bottom+c.margin().top)+")").datum(u.filter((function(t){return!t.disabled}))).call(c);var tt=c.brush.empty()?c.xDomain():c.brush.extent();null!==tt&&et(tt)}else Q.transition().call(n),$(),J();function et(t){G.select(".nv-focus .nv-stackedWrap").datum(u.filter((function(t){return!t.disabled})).map((function(e,r){return{key:e.key,area:e.area,classed:e.classed,values:e.values.filter((function(e,r){return n.x()(e,r)>=t[0]&&n.x()(e,r)<=t[1]})),disableTooltip:e.disableTooltip}}))).transition().duration(O).call(n),$(),J()}n.dispatch.on("areaClick.toggle",(function(t){1===u.filter((function(t){return!t.disabled})).length?u.forEach((function(t){t.disabled=!1})):u.forEach((function(e,n){e.disabled=n!=t.seriesIndex})),S.disabled=u.map((function(t){return!!t.disabled})),F.stateChange(S),z.update()})),a.dispatch.on("stateChange",(function(t){for(var e in t)S[e]=t[e];F.stateChange(S),z.update()})),s.dispatch.on("legendClick",(function(t,e){t.disabled&&(q=q.map((function(t){return t.disabled=!0,t})),t.disabled=!1,n.style(t.style),S.style=n.style(),F.stateChange(S),z.update())})),l.dispatch.on("elementMousemove",(function(t){n.clearHighlights();var e,i,o,a=[],s=0,c=!0,d=!1;if(u.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(l,f){i=r.interactiveBisect(l.values,t.pointXValue,z.x());var p=l.values[i],h=z.y()(p,i);if(null!=h&&h>0&&(n.highlightPoint(f,i,!0),d=!0),f!==u.length-1||d||n.highlightPoint(f,i,!0),void 0!==p){void 0===e&&(e=p),void 0===o&&(o=z.xScale()(z.x()(p,i)));var v="expand"==n.style()?p.display.y:z.y()(p,i);a.push({key:l.key,value:v,color:g(l,l.seriesIndex),point:p}),M&&"expand"!=n.style()&&null!=v&&(s+=v,c=!1)}})),a.reverse(),a.length>2){var f=z.yScale().invert(t.mouseY),p=null;a.forEach((function(t,e){f=Math.abs(f);var n=Math.abs(t.point.display.y0),r=Math.abs(t.point.display.y);f>=n&&f<=r+n&&(p=e)})),null!=p&&(a[p].highlight=!0)}M&&"expand"!=n.style()&&a.length>=2&&!c&&a.push({key:C,value:s,total:!0});var h=z.x()(e,i),v=l.tooltip.valueFormatter();"expand"===n.style()||"stack_percent"===n.style()?(B||(B=v),v=d3.format(".1%")):B&&(v=B,B=null),l.tooltip.valueFormatter(v).data({value:h,series:a})(),l.renderGuideLine(o)})),l.dispatch.on("elementMouseout",(function(t){n.clearHighlights()})),c.dispatch.on("onBrush",(function(t){et(t)})),F.on("changeState",(function(t){void 0!==t.disabled&&u.length===t.disabled.length&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),S.disabled=t.disabled),void 0!==t.style&&(n.style(t.style),t.style),z.update()}))})),T.renderEnd("stacked Area chart immediate"),z}return n.dispatch.on("elementMouseover.tooltip",(function(t){t.point.x=n.x()(t.point),t.point.y=n.y()(t.point),u.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){u.hidden(!0)})),z.dispatch=F,z.stacked=n,z.legend=a,z.controls=s,z.xAxis=i,z.x2Axis=c.xAxis,z.yAxis=o,z.y2Axis=c.yAxis,z.interactiveLayer=l,z.tooltip=u,z.focus=c,z.dispatch=F,z.options=r.utils.optionsFunc.bind(z),z._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return W},set:function(t){W=t}},noData:{get:function(){return E},set:function(t){E=t}},showControls:{get:function(){return v},set:function(t){v=t}},controlLabels:{get:function(){return N},set:function(t){N=t}},controlOptions:{get:function(){return _},set:function(t){_=t}},showTotalInTooltip:{get:function(){return M},set:function(t){M=t}},totalLabel:{get:function(){return C},set:function(t){C=t}},focusEnable:{get:function(){return w},set:function(t){w=t}},focusHeight:{get:function(){return c.height()},set:function(t){c.height(t)}},brushExtent:{get:function(){return c.brushExtent()},set:function(t){c.brushExtent(t)}},margin:{get:function(){return d},set:function(t){void 0!==t.top&&(d.top=t.top,f=t.top),d.right=void 0!==t.right?t.right:d.right,d.bottom=void 0!==t.bottom?t.bottom:d.bottom,d.left=void 0!==t.left?t.left:d.left}},focusMargin:{get:function(){return c.margin},set:function(t){c.margin.top=void 0!==t.top?t.top:c.margin.top,c.margin.right=void 0!==t.right?t.right:c.margin.right,c.margin.bottom=void 0!==t.bottom?t.bottom:c.margin.bottom,c.margin.left=void 0!==t.left?t.left:c.margin.left}},duration:{get:function(){return O},set:function(t){O=t,T.reset(O),n.duration(O),i.duration(O),o.duration(O)}},color:{get:function(){return g},set:function(t){g=r.utils.getColor(t),a.color(g),n.color(g),c.color(g)}},x:{get:function(){return n.x()},set:function(t){n.x(t),c.x(t)}},y:{get:function(){return n.y()},set:function(t){n.y(t),c.y(t)}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,o.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return A},set:function(t){A=!!t,z.interactive(!t),z.useVoronoi(!t),n.scatter.interactive(!t)}}}),r.utils.inheritOptions(z,n),r.utils.initOptions(z),z},r.models.stackedAreaWithFocusChart=function(){return r.models.stackedAreaChart().margin({bottom:30}).focusEnable(!0)},r.models.sunburst=function(){"use strict";var t,e,n,i,o={top:0,right:0,bottom:0,left:0},a=600,s=600,l="count",u={count:function(t){return 1},value:function(t){return t.value||t.size},size:function(t){return t.value||t.size}},c=Math.floor(1e4*Math.random()),d=null,f=r.utils.defaultColor(),p=!1,h=function(t){return"count"===l?t.name+" #"+t.value:t.name+" "+(t.value||t.size)},g=.02,v=function(t,e){return t.name>e.name},m=function(t,e){return void 0!==t.parent?t.name+"-"+t.parent.name+"-"+e:t.name},y=!0,x=500,b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),k=d3.scale.linear().range([0,2*Math.PI]),w=d3.scale.sqrt(),A=d3.layout.partition().sort(v),M={},C=d3.svg.arc().startAngle((function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x)))})).endAngle((function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))})).innerRadius((function(t){return Math.max(0,w(t.y))})).outerRadius((function(t){return Math.max(0,w(t.y+t.dy))}));function S(t){return W(t)>90?180:0}function W(t){return(Math.max(0,Math.min(2*Math.PI,k(t.x)))+Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx))))/2*(180/Math.PI)-90}function E(t){var e=Math.max(0,Math.min(2*Math.PI,k(t.x)));return(Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))-e)/(2*Math.PI)}function F(t){var e=Math.max(0,Math.min(2*Math.PI,k(t.x)));return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))-e>g}function D(e,n){var r=d3.interpolate(k.domain(),[t.x,t.x+t.dx]),o=d3.interpolate(w.domain(),[t.y,1]),a=d3.interpolate(w.range(),[t.y?20:0,i]);return 0===n?function(){return C(e)}:function(t){return k.domain(r(t)),w.domain(o(t)).range(a(t)),C(e)}}function _(t){var e=d3.interpolate({x:t.x0,dx:t.dx0,y:t.y0,dy:t.dy0},t);return function(n){var r=e(n);return t.x0=r.x,t.dx0=r.dx,t.y0=r.y,t.dy0=r.dy,C(r)}}function N(t){t.forEach((function(t){var e=m(t),n=M[e];n?(t.dx0=n.dx,t.x0=n.x,t.dy0=n.dy,t.y0=n.y):(t.dx0=t.dx,t.x0=t.x,t.dy0=t.dy,t.y0=t.y),function(t){var e=m(t);M[e]||(M[e]={});var n=M[e];n.dx=t.dx,n.x=t.x,n.dy=t.dy,n.y=t.y}(t)}))}function O(e){var n=d.selectAll("text"),r=d.selectAll("path");n.transition().attr("opacity",0),t=e,r.transition().duration(x).attrTween("d",D).each("end",(function(t){t.x>=e.x&&t.x<e.x+e.dx&&t.depth>=e.depth&&d3.select(this.parentNode).select("text").transition().duration(x).text((function(t){return h(t)})).attr("opacity",(function(t){return F(t)?1:0})).attr("transform",(function(){var n=this.getBBox().width;if(0===t.depth)return"translate("+n/2*-1+",0)";if(t.depth===e.depth)return"translate("+(w(t.y)+5)+",0)";var r=W(t),i=S(t);return 0===i?"rotate("+r+")translate("+(w(t.y)+5)+",0)":"rotate("+r+")translate("+(w(t.y)+n+5)+",0)rotate("+i+")"}))}))}var L=r.utils.renderWatch(b);function B(t){return L.reset(),t.each((function(t){d=d3.select(this),e=r.utils.availableWidth(a,d,o),n=r.utils.availableHeight(s,d,o),i=Math.min(e,n)/2,w.range([0,i]);var g=d.select("g.nvd3.nv-wrap.nv-sunburst");g[0][0]?g.attr("transform","translate("+(e/2+o.left+o.right)+","+(n/2+o.top+o.bottom)+")"):g=d.append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+c).attr("transform","translate("+(e/2+o.left+o.right)+","+(n/2+o.top+o.bottom)+")"),d.on("click",(function(t,e){b.chartClick({data:t,index:e,pos:d3.event,id:c})})),A.value(u[l]||u.count);var v=A.nodes(t[0]).reverse();N(v);var k=g.selectAll(".arc-container").data(v,m);k.enter().append("g").attr("class","arc-container").append("path").attr("d",C).style("fill",(function(t){return t.color?t.color:f(y?(t.children?t:t.parent).name:t.name)})).style("stroke","#FFF").on("click",(function(t,e){O(t),b.elementClick({data:t,index:e})})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0).style("opacity",.8),b.elementMouseover({data:t,color:d3.select(this).style("fill"),percent:E(t)})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1).style("opacity",1),b.elementMouseout({data:t})})).on("mousemove",(function(t,e){b.elementMousemove({data:t})})),k.each((function(t){d3.select(this).select("path").transition().duration(x).attrTween("d",_)})),p&&(k.selectAll("text").remove(),k.append("text").text((function(t){return h(t)})).transition().duration(x).attr("opacity",(function(t){return F(t)?1:0})).attr("transform",(function(t){var e=this.getBBox().width;if(0===t.depth)return"rotate(0)translate("+e/2*-1+",0)";var n=W(t),r=S(t);return 0===r?"rotate("+n+")translate("+(w(t.y)+5)+",0)":"rotate("+n+")translate("+(w(t.y)+e+5)+",0)rotate("+r+")"}))),O(v[v.length-1]),k.exit().transition().duration(x).attr("opacity",0).each("end",(function(t){var e=m(t);M[e]=void 0})).remove()})),L.renderEnd("sunburst immediate"),B}return B.dispatch=b,B.options=r.utils.optionsFunc.bind(B),B._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},mode:{get:function(){return l},set:function(t){l=t}},id:{get:function(){return c},set:function(t){c=t}},duration:{get:function(){return x},set:function(t){x=t}},groupColorByParent:{get:function(){return y},set:function(t){y=!!t}},showLabels:{get:function(){return p},set:function(t){p=!!t}},labelFormat:{get:function(){return h},set:function(t){h=t}},labelThreshold:{get:function(){return g},set:function(t){g=t}},sort:{get:function(){return v},set:function(t){v=t}},key:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return o},set:function(t){o.top=null!=t.top?t.top:o.top,o.right=null!=t.right?t.right:o.right,o.bottom=null!=t.bottom?t.bottom:o.bottom,o.left=null!=t.left?t.left:o.left}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t)}}}),r.utils.initOptions(B),B},r.models.sunburstChart=function(){"use strict";var t=r.models.sunburst(),e=r.models.tooltip(),n={top:30,right:20,bottom:20,left:20},i=r.utils.defaultColor(),o=!1,a=(Math.round(1e5*Math.random()),null),s=null,l=250,u=d3.dispatch("stateChange","changeState","renderEnd"),c=r.utils.renderWatch(u);function d(e){return c.reset(),c.models(t),e.each((function(e){var i=d3.select(this);r.utils.initSVG(i);var o=r.utils.availableWidth(null,i,n),a=r.utils.availableHeight(null,i,n);if(d.update=function(){0===l?i.call(d):i.transition().duration(l).call(d)},d.container=i,!e||!e.length)return r.utils.noData(d,i),d;i.selectAll(".nv-noData").remove(),t.width(o).height(a).margin(n),i.call(t)})),c.renderEnd("sunburstChart immediate"),d}return e.duration(0).headerEnabled(!1).valueFormatter((function(t){return t})),t.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:t.data.name,value:t.data.value||t.data.size,color:t.color,percent:t.percent},o||(delete t.percent,delete t.series.percent),e.data(t).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){e.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){e()})),d.dispatch=u,d.sunburst=t,d.tooltip=e,d.options=r.utils.optionsFunc.bind(d),d._options=Object.create({},{noData:{get:function(){return s},set:function(t){s=t}},defaultState:{get:function(){return a},set:function(t){a=t}},showTooltipPercent:{get:function(){return o},set:function(t){o=t}},color:{get:function(){return i},set:function(e){i=e,t.color(i)}},duration:{get:function(){return l},set:function(e){l=e,c.reset(l),t.duration(l)}},margin:{get:function(){return n},set:function(e){n.top=void 0!==e.top?e.top:n.top,n.right=void 0!==e.right?e.right:n.right,n.bottom=void 0!==e.bottom?e.bottom:n.bottom,n.left=void 0!==e.left?e.left:n.left,t.margin(n)}}}),r.utils.inheritOptions(d,t),r.utils.initOptions(d),d},r.version="1.8.6"}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[31],{318:function(t,e,n){n(319),t.exports="nvd3"},319:function(t,e,n){!function(t){"use strict";var e=t.nv;e=n(320),angular.module("nvd3",[]).directive("nvd3",["nvd3Utils",function(t){return{restrict:"AE",scope:{data:"=",options:"=",api:"=?",events:"=?",config:"=?",onReady:"&?"},link:function(n,r,i){var o={extended:!1,visible:!0,disabled:!1,refreshDataOnly:!0,deepWatchOptions:!0,deepWatchData:!0,deepWatchDataDepth:2,debounce:10,debounceImmediate:!0};function a(t,e,r){t&&e&&angular.forEach(t,(function(i,o){"_"===o[0]||("dispatch"===o?(void 0!==e[o]&&null!==e[o]||n._config.extended&&(e[o]={}),s(i,e[o])):"tooltip"===o?(void 0!==e[o]&&null!==e[o]||n._config.extended&&(e[o]={}),a(t[o],e[o],r)):"contentGenerator"===o?e[o]&&t[o](e[o]):-1===["axis","clearHighlights","defined","highlightPoint","nvPointerEventsClass","options","rangeBand","rangeBands","scatter","open","close","node"].indexOf(o)&&(void 0===e[o]||null===e[o]?n._config.extended&&(e[o]=i()):t[o](e[o])))}))}function s(t,e){t&&e&&angular.forEach(t,(function(r,i){void 0===e[i]||null===e[i]?n._config.extended&&(e[i]=r.on):t.on(i+"._",e[i])}))}function l(e){var i=t.deepExtend(function(t){switch(t){case"title":return{enable:!1,text:"Write Your Title",className:"h4",css:{width:n.options.chart.width+"px",textAlign:"center"}};case"subtitle":return{enable:!1,text:"Write Your Subtitle",css:{width:n.options.chart.width+"px",textAlign:"center"}};case"caption":return{enable:!1,text:"Figure 1. Write Your Caption text.",css:{width:n.options.chart.width+"px",textAlign:"center"}}}}(e),n.options[e]||{});n._config.extended&&(n.options[e]=i);var o=angular.element("<div></div>").html(i.html||"").addClass(e).addClass(i.className).removeAttr("style").css(i.css);i.html||o.text(i.text),i.enable&&("title"===e?r.prepend(o):"subtitle"===e?angular.element(r[0].querySelector(".title")).after(o):"caption"===e&&r.append(o))}function u(){var e=t.deepExtend({classes:{"with-3d-shadow":!0,"with-transitions":!0,gallery:!1},css:{}},n.options.styles||{});n._config.extended&&(n.options.styles=e),angular.forEach(e.classes,(function(t,e){t?r.addClass(e):r.removeClass(e)})),r.removeAttr("style").css(e.css)}function c(t,e){t!==e&&(n._config.disabled||(n._config.refreshDataOnly?n.api.update():n.api.refresh()))}n.isReady=!1,n._config=angular.extend(o,n.config),n.api={refresh:function(){n.api.updateWithOptions(),n.isReady=!0},refreshWithTimeout:function(t){setTimeout((function(){n.api.refresh()}),t)},update:function(){n.chart&&n.svg?"sunburstChart"===n.options.chart.type?n.svg.datum(angular.copy(n.data)).call(n.chart):n.svg.datum(n.data).call(n.chart):n.api.refresh()},updateWithTimeout:function(t){setTimeout((function(){n.api.update()}),t)},updateWithOptions:function(r){if(arguments.length){if(n.options=r,n._config.deepWatchOptions&&!n._config.disabled)return}else r=n.options;n.api.clearElement(),!1!==angular.isDefined(r)&&n._config.visible&&(n.chart=e.models[r.chart.type](),n.chart.id=Math.random().toString(36).substr(2,15),angular.forEach(n.chart,(function(t,e){"_"===e[0]||["clearHighlights","highlightPoint","id","options","resizeHandler","state","open","close","tooltipContent"].indexOf(e)>=0||("dispatch"===e?(void 0!==r.chart[e]&&null!==r.chart[e]||n._config.extended&&(r.chart[e]={}),s(n.chart[e],r.chart[e])):["bars","bars1","bars2","boxplot","bullet","controls","discretebar","distX","distY","focus","interactiveLayer","legend","lines","lines1","lines2","multibar","pie","scatter","scatters1","scatters2","sparkline","stack1","stack2","sunburst","tooltip","x2Axis","xAxis","y1Axis","y2Axis","y3Axis","y4Axis","yAxis","yAxis1","yAxis2"].indexOf(e)>=0||"stacked"===e&&"stackedAreaChart"===r.chart.type?(void 0!==r.chart[e]&&null!==r.chart[e]||n._config.extended&&(r.chart[e]={}),a(n.chart[e],r.chart[e],r.chart.type)):"focusHeight"===e&&"lineChart"===r.chart.type||"focusHeight"===e&&"lineWithFocusChart"===r.chart.type||("xTickFormat"!==e&&"yTickFormat"!==e||"lineWithFocusChart"!==r.chart.type)&&("tooltips"===e&&"boxPlotChart"===r.chart.type||("tooltipXContent"!==e&&"tooltipYContent"!==e||"scatterChart"!==r.chart.type)&&("x"!==e&&"y"!==e||"forceDirectedGraph"!==r.chart.type)&&(void 0===r.chart[e]||null===r.chart[e]?n._config.extended&&(r.chart[e]="barColor"===e?t()():t()):n.chart[e](r.chart[e]))))})),n.api.updateWithData(),(r.title||n._config.extended)&&l("title"),(r.subtitle||n._config.extended)&&l("subtitle"),(r.caption||n._config.extended)&&l("caption"),(r.styles||n._config.extended)&&u(),e.addGraph((function(){if(n.chart)return n.chart.resizeHandler&&n.chart.resizeHandler.clear(),n.chart.resizeHandler=e.utils.windowResize((function(){n.chart&&n.chart.update&&n.chart.update()})),void 0!==r.chart.zoom&&["scatterChart","lineChart","candlestickBarChart","cumulativeLineChart","historicalBarChart","ohlcBarChart","stackedAreaChart"].indexOf(r.chart.type)>-1&&t.zoom(n,r),n.chart}),r.chart.callback))},updateWithData:function(t){if(arguments.length){if(n.data=t,n._config.deepWatchData&&!n._config.disabled)return}else t="sunburstChart"===n.options.chart.type?angular.copy(n.data):n.data;var e,i;t&&(d3.select(r[0]).select("svg").remove(),n.svg=d3.select(r[0]).insert("svg",".caption"),(e=n.options.chart.height)&&(isNaN(+e)||(e+="px"),n.svg.attr("height",e).style({height:e})),(i=n.options.chart.width)?(isNaN(+i)||(i+="px"),n.svg.attr("width",i).style({width:i})):n.svg.attr("width","100%").style({width:"100%"}),n.svg.datum(t).call(n.chart),n.chart&&n.chart.zoomRender&&n.chart.zoomRender())},clearElement:function(){if(r.find(".title").remove(),r.find(".subtitle").remove(),r.find(".caption").remove(),r.empty(),n.chart&&n.chart.tooltip&&n.chart.tooltip.id&&d3.select("#"+n.chart.tooltip.id()).remove(),n.chart&&n.chart.interactiveLayer&&n.chart.interactiveLayer.tooltip&&n.chart.interactiveLayer.tooltip.id&&d3.select("#"+n.chart.interactiveLayer.tooltip.id()).remove(),e.graphs&&n.chart)for(var t=e.graphs.length-1;t>=0;t--)e.graphs[t]&&e.graphs[t].id===n.chart.id&&e.graphs.splice(t,1);e.tooltip&&e.tooltip.cleanup&&e.tooltip.cleanup(),n.chart&&n.chart.resizeHandler&&n.chart.resizeHandler.clear(),n.chart=null},getScope:function(){return n},getElement:function(){return r}},n._config.deepWatchOptions&&n.$watch("options",t.debounce((function(t){n._config.disabled||n.api.refresh()}),n._config.debounce,n._config.debounceImmediate),!0),n._config.deepWatchData&&(1===n._config.deepWatchDataDepth?n.$watchCollection("data",c):n.$watch("data",c,2===n._config.deepWatchDataDepth)),n.$watch("config",(function(t,e){t!==e&&(n._config=angular.extend(o,t),n.api.refresh())}),!0),n._config.deepWatchOptions||n._config.deepWatchData||n.api.refresh(),angular.forEach(n.events,(function(t,e){n.$on(e,(function(e,r){return t(e,n,r)}))})),r.on("$destroy",(function(){n.api.clearElement()})),n.$watch("isReady",(function(t){t&&n.onReady&&"function"==typeof n.onReady()&&n.onReady()(n,r)}))}}}]).factory("nvd3Utils",(function(){return{debounce:function(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}},deepExtend:function(t){var e=this;return angular.forEach(arguments,(function(n){n!==t&&angular.forEach(n,(function(n,r){t[r]&&t[r].constructor&&t[r].constructor===Object?e.deepExtend(t[r],n):t[r]=n}))})),t},zoom:function(t,e){var n=e.chart.zoom;if(void 0===n.enabled||null===n.enabled||n.enabled){var r,i,o,a,s,l=t.chart.xAxis.scale(),u=t.chart.yAxis.scale(),c=t.chart.xDomain||l.domain,d=t.chart.yDomain||u.domain,f=l.domain().slice(),p=u.domain().slice(),h=n.scale||1,g=n.translate||[0,0],v=n.scaleExtent||[1,10],m=n.useFixedDomain||!1,y=n.useNiceScale||!1,x=n.horizontalOff||!1,b=n.verticalOff||!1,k=n.unzoomEventType||"dblclick.zoom";y&&(l.nice(),u.nice()),r=function(t,e){return t[0]=Math.min(Math.max(t[0],e[0]),e[1]-e[1]/v[1]),t[1]=Math.max(e[0]+e[1]/v[1],Math.min(t[1],e[1])),t},o=function(){if(void 0!==n.zoomed){var e=n.zoomed(l.domain(),u.domain());x||c([e.x1,e.x2]),b||d([e.y1,e.y2])}else x||c(m?r(l.domain(),f):l.domain()),b||d(m?r(u.domain(),p):u.domain());t.chart&&t.chart.update()},a=function(){if(void 0!==n.unzoomed){var e=n.unzoomed(l.domain(),u.domain());x||c([e.x1,e.x2]),b||d([e.y1,e.y2])}else x||c(f),b||d(p);i.scale(h).translate(g),t.chart&&t.chart.update()},s=function(){void 0!==n.zoomend&&n.zoomend()},i=d3.behavior.zoom().x(l).y(u).scaleExtent(v).on("zoom",o).on("zoomend",s),t.svg&&(t.svg.call(i),i.scale(h).translate(g).event(t.svg),"none"!==k&&t.svg.on(k,a)),t.chart&&(t.chart.zoomRender=function(){i.scale(h).translate(g),l=t.chart.xAxis.scale(),u=t.chart.yAxis.scale(),c=t.chart.xDomain||l.domain,d=t.chart.yDomain||u.domain,f=l.domain().slice(),p=u.domain().slice(),i.x(l).y(u),t.svg.call(i),"none"!==k&&t.svg.on(k,a)})}}}}))}(window)},320:function(t,e,n){var r;(r={dev:!1}).tooltip=r.tooltip||{},r.utils=r.utils||{},r.models=r.models||{},r.charts={},r.logs={},r.dom={},"undefined"==typeof d3&&(d3=n(296)),r.dispatch=d3.dispatch("render_start","render_end"),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i}),r.dev&&(r.dispatch.on("render_start",(function(t){r.logs.startTime=+new Date})),r.dispatch.on("render_end",(function(t){r.logs.endTime=+new Date,r.logs.totalTime=r.logs.endTime-r.logs.startTime,r.log("total",r.logs.totalTime)}))),r.log=function(){if(r.dev&&window.console&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(r.dev&&window.console&&"function"==typeof console.log&&Function.prototype.bind){var t=Function.prototype.bind.call(console.log,console);t.apply(console,arguments)}return arguments[arguments.length-1]},r.deprecated=function(t,e){console&&console.warn&&console.warn("nvd3 warning: `"+t+"` has been deprecated. ",e||"")},r.render=function(t){t=t||1,r.render.active=!0,r.dispatch.render_start();var e=function(){for(var n,i,o=0;o<t&&(i=r.render.queue[o]);o++)n=i.generate(),typeof i.callback==typeof Function&&i.callback(n);r.render.queue.splice(0,o),r.render.queue.length?setTimeout(e):(r.dispatch.render_end(),r.render.active=!1)};setTimeout(e)},r.render.active=!1,r.render.queue=[],r.addGraph=function(t){typeof arguments[0]==typeof Function&&(t={generate:arguments[0],callback:arguments[1]}),r.render.queue.push(t),r.render.active||r.render()},t.exports=r,"undefined"!=typeof window&&(window.nv=r),r.dom.write=function(t){return void 0!==window.fastdom?fastdom.mutate(t):t()},r.dom.read=function(t){return void 0!==window.fastdom?fastdom.measure(t):t()},r.interactiveGuideline=function(){"use strict";var t={left:0,top:0},e=null,n=null,i=d3.scale.linear(),o=d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick","elementMouseDown","elementMouseUp"),a=!0,s=null,l=r.models.tooltip(),u=window.ActiveXObject;function c(d){d.each((function(d){var f=d3.select(this),p=e||960,h=n||400,g=f.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([d]);function v(){var e=d3.event.clientX-this.getBoundingClientRect().left,n=d3.event.clientY-this.getBoundingClientRect().top,r=!0,a=!1;if(u&&(e=d3.event.offsetX,n=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(r=!1),d3.event.target.className.baseVal.match("nv-legend")&&(a=!0)),r&&(e-=t.left,n-=t.top),"mouseout"===d3.event.type||e<0||n<0||e>p||n>h||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||a){if(u&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&(void 0===d3.event.relatedTarget.className||d3.event.relatedTarget.className.match(l.nvPointerEventsClass)))return;return o.elementMouseout({mouseX:e,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0)}l.hidden(!1);var s=void 0;if("function"==typeof i.rangeBands){var d=d3.bisect(i.range(),e)-1;if(!(i.range()[d]+i.rangeBand()>=e))return o.elementMouseout({mouseX:e,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0);s=i.domain()[d3.bisect(i.range(),e)-1]}else s=i.invert(e);o.elementMousemove({mouseX:e,mouseY:n,pointXValue:s}),"dblclick"===d3.event.type&&o.elementDblclick({mouseX:e,mouseY:n,pointXValue:s}),"click"===d3.event.type&&o.elementClick({mouseX:e,mouseY:n,pointXValue:s}),"mousedown"===d3.event.type&&o.elementMouseDown({mouseX:e,mouseY:n,pointXValue:s}),"mouseup"===d3.event.type&&o.elementMouseUp({mouseX:e,mouseY:n,pointXValue:s})}g.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer").append("g").attr("class","nv-interactiveGuideLine"),s&&(s.on("touchmove",v).on("mousemove",v,!0).on("mouseout",v,!0).on("mousedown",v,!0).on("mouseup",v,!0).on("dblclick",v).on("click",v),c.guideLine=null,c.renderGuideLine=function(t){a&&(c.guideLine&&c.guideLine.attr("x1")===t||r.dom.write((function(){var e=g.select(".nv-interactiveGuideLine").selectAll("line").data(null!=t?[r.utils.NaNtoZero(t)]:[],String);e.enter().append("line").attr("class","nv-guideline").attr("x1",(function(t){return t})).attr("x2",(function(t){return t})).attr("y1",h).attr("y2",0),e.exit().remove()})))})}))}return l.duration(0).hideDelay(0).hidden(!1),c.dispatch=o,c.tooltip=l,c.margin=function(e){return arguments.length?(t.top=void 0!==e.top?e.top:t.top,t.left=void 0!==e.left?e.left:t.left,c):t},c.width=function(t){return arguments.length?(e=t,c):e},c.height=function(t){return arguments.length?(n=t,c):n},c.xScale=function(t){return arguments.length?(i=t,c):i},c.showGuideLine=function(t){return arguments.length?(a=t,c):a},c.svgContainer=function(t){return arguments.length?(s=t,c):s},c},r.interactiveBisect=function(t,e,n){"use strict";if(!(t instanceof Array))return null;var r;r="function"!=typeof n?function(t){return t.x}:n;var i=d3.bisector((function(t,e){return r(t)-e})).left,o=d3.max([0,i(t,e)-1]),a=r(t[o]);if(void 0===a&&(a=o),a===e)return o;var s=d3.min([o+1,t.length-1]),l=r(t[s]);return void 0===l&&(l=s),Math.abs(l-e)>=Math.abs(a-e)?o:s},r.nearestValueIndex=function(t,e,n){"use strict";var r=1/0,i=null;return t.forEach((function(t,o){var a=Math.abs(e-t);null!=t&&a<=r&&a<n&&(r=a,i=o)})),i},r.models.tooltip=function(){"use strict";var t="nvtooltip-"+Math.floor(1e5*Math.random()),e=null,n="w",i=25,o=0,a=null,s=!0,l=200,u=null,c={left:null,top:null},d=!0,f=100,p=!0,h=function(t,e,n){return t},g=function(t){return t},v=function(t,e){return t},m=function(t,e){if(null===t)return"";var n=d3.select(document.createElement("table"));p&&n.selectAll("thead").data([t]).enter().append("thead").append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(g(t.value));var r=n.selectAll("tbody").data([t]).enter().append("tbody").selectAll("tr").data((function(t){return t.series})).enter().append("tr").classed("highlight",(function(t){return t.highlight}));r.append("td").classed("legend-color-guide",!0).append("div").style("background-color",(function(t){return t.color})),r.append("td").classed("key",!0).classed("total",(function(t){return!!t.total})).html((function(t,e){return v(t.key,e)})),r.append("td").classed("value",!0).html((function(t,e){return h(t.value,e,t)})),r.filter((function(t,e){return void 0!==t.percent})).append("td").classed("percent",!0).html((function(t,e){return"("+d3.format("%")(t.percent)+")"})),r.selectAll("td").each((function(t){if(t.highlight){var e=d3.scale.linear().domain([0,1]).range(["#fff",t.color]);d3.select(this).style("border-bottom-color",e(.6)).style("border-top-color",e(.6))}}));var i=n.node().outerHTML;return void 0!==t.footer&&(i+="<div class='footer'>"+t.footer+"</div>"),i},y=function(){var t={left:null!==d3.event?d3.event.clientX:0,top:null!==d3.event?d3.event.clientY:0};if("none"!=getComputedStyle(document.body).transform){var e=document.body.getBoundingClientRect();t.left-=e.left,t.top-=e.top}return t},x=function(){r.dom.read((function(){var t=y(),e=function(t){var e,r,o,a=u.node().offsetHeight,s=u.node().offsetWidth,l=document.documentElement.clientWidth,c=document.documentElement.clientHeight;switch(n){case"e":e=-s-i,r=-a/2,t.left+e<0&&(e=i),(o=t.top+r)<0&&(r-=o),(o=t.top+r+a)>c&&(r-=o-c);break;case"w":e=i,r=-a/2,t.left+e+s>l&&(e=-s-i),(o=t.top+r)<0&&(r-=o),(o=t.top+r+a)>c&&(r-=o-c);break;case"n":e=-s/2-5,r=i,t.top+r+a>c&&(r=-a-i),(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"s":e=-s/2,r=-a-i,t.top+r<0&&(r=i),(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"center":e=-s/2,r=-a/2;break;default:e=0,r=0}return{left:e,top:r}}(t),r=t.left+e.left,o=t.top+e.top;if(s)u.interrupt().transition().delay(l).duration(0).style("opacity",0);else{var a="translate("+c.left+"px, "+c.top+"px)",d="translate("+Math.round(r)+"px, "+Math.round(o)+"px)",p=d3.interpolateString(a,d),h=u.style("opacity")<.1;u.interrupt().transition().duration(h?0:f).styleTween("transform",(function(t){return p}),"important").styleTween("-webkit-transform",(function(t){return p})).style("-ms-transform",d).style("opacity",1)}c.left=r,c.top=o}))};function b(){if(d&&function(t){if(t&&t.series){if(r.utils.isArray(t.series))return!0;if(r.utils.isObject(t.series))return t.series=[t.series],!0}return!1}(e))return r.dom.write((function(){u&&u.node()||((u=d3.select(document.body).select("#"+t).data([1])).enter().append("div").attr("class","nvtooltip "+(a||"xy-tooltip")).attr("id",t).style("top",0).style("left",0).style("opacity",0).style("position","fixed").selectAll("div, table, td, tr").classed("nv-pointer-events-none",!0).classed("nv-pointer-events-none",!0),u.exit().remove());var n=m(e,u.node());n&&(u.node().innerHTML=n),x()})),b}return b.nvPointerEventsClass="nv-pointer-events-none",b.options=r.utils.optionsFunc.bind(b),b._options=Object.create({},{duration:{get:function(){return f},set:function(t){f=t}},gravity:{get:function(){return n},set:function(t){n=t}},distance:{get:function(){return i},set:function(t){i=t}},snapDistance:{get:function(){return o},set:function(t){o=t}},classes:{get:function(){return a},set:function(t){a=t}},enabled:{get:function(){return d},set:function(t){d=t}},hideDelay:{get:function(){return l},set:function(t){l=t}},contentGenerator:{get:function(){return m},set:function(t){m=t}},valueFormatter:{get:function(){return h},set:function(t){h=t}},headerFormatter:{get:function(){return g},set:function(t){g=t}},keyFormatter:{get:function(){return v},set:function(t){v=t}},headerEnabled:{get:function(){return p},set:function(t){p=t}},position:{get:function(){return y},set:function(t){y=t}},chartContainer:{get:function(){return document.body},set:function(t){r.deprecated("chartContainer","feature removed after 1.8.3")}},fixedTop:{get:function(){return null},set:function(t){r.deprecated("fixedTop","feature removed after 1.8.1")}},offset:{get:function(){return{left:0,top:0}},set:function(t){r.deprecated("offset","use chart.tooltip.distance() instead")}},hidden:{get:function(){return s},set:function(t){s!=t&&(s=!!t,b())}},data:{get:function(){return e},set:function(t){t.point&&(t.value=t.point.x,t.series=t.series||{},t.series.value=t.point.y,t.series.color=t.point.color||t.series.color),e=t}},node:{get:function(){return u.node()},set:function(t){}},id:{get:function(){return t},set:function(t){}}}),r.utils.initOptions(b),b},r.utils.windowSize=function(){var t={width:640,height:480};return window.innerWidth&&window.innerHeight?(t.width=window.innerWidth,t.height=window.innerHeight,t):"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?(t.width=document.documentElement.offsetWidth,t.height=document.documentElement.offsetHeight,t):document.body&&document.body.offsetWidth?(t.width=document.body.offsetWidth,t.height=document.body.offsetHeight,t):t},r.utils.isArray=Array.isArray,r.utils.isObject=function(t){return null!==t&&"object"==typeof t},r.utils.isFunction=function(t){return"function"==typeof t},r.utils.isDate=function(t){return"[object Date]"===toString.call(t)},r.utils.isNumber=function(t){return!isNaN(t)&&"number"==typeof t},r.utils.windowResize=function(t){return window.addEventListener?window.addEventListener("resize",t):r.log("ERROR: Failed to bind to window.resize with: ",t),{callback:t,clear:function(){window.removeEventListener("resize",t)}}},r.utils.getColor=function(t){if(void 0===t)return r.utils.defaultColor();if(r.utils.isArray(t)){var e=d3.scale.ordinal().range(t);return function(t,n){var r=void 0===n?t:n;return t.color||e(r)}}return t},r.utils.defaultColor=function(){return r.utils.getColor(d3.scale.category20().range())},r.utils.customTheme=function(t,e,n){e=e||function(t){return t.key};var i=(n=n||d3.scale.category20().range()).length;return function(o,a){var s=e(o);return r.utils.isFunction(t[s])?t[s]():void 0!==t[s]?t[s]:(i||(i=n.length),n[i-=1])}},r.utils.pjax=function(t,e){var n=function(n){d3.html(n,(function(n){var i=d3.select(e).node();i.parentNode.replaceChild(d3.select(n).select(e).node(),i),r.utils.pjax(t,e)}))};d3.selectAll(t).on("click",(function(){history.pushState(this.href,this.textContent,this.href),n(this.href),d3.event.preventDefault()})),d3.select(window).on("popstate",(function(){d3.event.state&&n(d3.event.state)}))},r.utils.calcApproxTextWidth=function(t){if(r.utils.isFunction(t.style)&&r.utils.isFunction(t.text)){var e=parseInt(t.style("font-size").replace("px",""),10),n=t.text().length;return r.utils.NaNtoZero(n*e*.5)}return 0},r.utils.NaNtoZero=function(t){return!r.utils.isNumber(t)||isNaN(t)||null===t||t===1/0||t===-1/0?0:t},d3.selection.prototype.watchTransition=function(t){var e=[this].concat([].slice.call(arguments,1));return t.transition.apply(t,e)},r.utils.renderWatch=function(t,e){if(!(this instanceof r.utils.renderWatch))return new r.utils.renderWatch(t,e);var n=void 0!==e?e:250,i=[],o=this;this.models=function(t){return(t=[].slice.call(arguments,0)).forEach((function(t){var e;t.__rendered=!1,(e=t).dispatch.on("renderEnd",(function(t){e.__rendered=!0,o.renderEnd("model")})),i.indexOf(t)<0&&i.push(t)})),this},this.reset=function(t){void 0!==t&&(n=t),i=[]},this.transition=function(t,e,r){if(r=(e=arguments.length>1?[].slice.call(arguments,1):[]).length>1?e.pop():void 0!==n?n:250,t.__rendered=!1,i.indexOf(t)<0&&i.push(t),0===r)return t.__rendered=!0,t.delay=function(){return this},t.duration=function(){return this},t;0===t.length||t.every((function(t){return!t.length}))?t.__rendered=!0:t.__rendered=!1;var a=0;return t.transition().duration(r).each((function(){++a})).each("end",(function(n,r){0==--a&&(t.__rendered=!0,o.renderEnd.apply(this,e))}))},this.renderEnd=function(){i.every((function(t){return t.__rendered}))&&(i.forEach((function(t){t.__rendered=!1})),t.renderEnd.apply(this,arguments))}},r.utils.deepExtend=function(t){var e=arguments.length>1?[].slice.call(arguments,1):[];e.forEach((function(e){for(var n in e){var i=r.utils.isArray(t[n]),o=r.utils.isObject(t[n]),a=r.utils.isObject(e[n]);o&&!i&&a?r.utils.deepExtend(t[n],e[n]):t[n]=e[n]}}))},r.utils.state=function(){if(!(this instanceof r.utils.state))return new r.utils.state;var t={},e=function(){},n=function(){return{}},i=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",(function(t){e(t,!0)})),this.getter=function(t){return n=t,this},this.setter=function(t,n){return n||(n=function(){}),e=function(e,r){t(e),r&&n()},this},this.init=function(t){i=i||{},r.utils.deepExtend(i,t)};var o=function(){var e=n();if(JSON.stringify(e)===JSON.stringify(t))return!1;for(var r in e)void 0===t[r]&&(t[r]={}),t[r]=e[r];return!0};this.update=function(){i&&(e(i,!1),i=null),o.call(this)&&this.dispatch.change(t)}},r.utils.optionsFunc=function(t){return t&&d3.map(t).forEach(function(t,e){r.utils.isFunction(this[t])&&this[t](e)}.bind(this)),this},r.utils.calcTicksX=function(t,e){for(var n=1,i=0;i<e.length;i+=1){var o=e[i]&&e[i].values?e[i].values.length:0;n=o>n?o:n}return r.log("Requested number of ticks: ",t),r.log("Calculated max values to be: ",n),t=(t=t>n?t=n-1:t)<1?1:t,t=Math.floor(t),r.log("Calculating tick count as: ",t),t},r.utils.calcTicksY=function(t,e){return r.utils.calcTicksX(t,e)},r.utils.initOption=function(t,e){t._calls&&t._calls[e]?t[e]=t._calls[e]:(t[e]=function(n){return arguments.length?(t._overrides[e]=!0,t._options[e]=n,t):t._options[e]},t["_"+e]=function(n){return arguments.length?(t._overrides[e]||(t._options[e]=n),t):t._options[e]})},r.utils.initOptions=function(t){t._overrides=t._overrides||{};var e=Object.getOwnPropertyNames(t._options||{}),n=Object.getOwnPropertyNames(t._calls||{});for(var i in e=e.concat(n))r.utils.initOption(t,e[i])},r.utils.inheritOptionsD3=function(t,e,n){t._d3options=n.concat(t._d3options||[]),t._d3options=(t._d3options||[]).filter((function(t,e,n){return n.indexOf(t)===e})),n.unshift(e),n.unshift(t),d3.rebind.apply(this,n)},r.utils.arrayUnique=function(t){return t.sort().filter((function(e,n){return!n||e!=t[n-1]}))},r.utils.symbolMap=d3.map(),r.utils.symbol=function(){var t,e=64;function n(n,i){var o=t.call(this,n,i),a=e.call(this,n,i);return-1!==d3.svg.symbolTypes.indexOf(o)?d3.svg.symbol().type(o).size(a)():r.utils.symbolMap.get(o)(a)}return n.type=function(e){return arguments.length?(t=d3.functor(e),n):t},n.size=function(t){return arguments.length?(e=d3.functor(t),n):e},n},r.utils.inheritOptions=function(t,e){var n=Object.getOwnPropertyNames(e._options||{}),i=Object.getOwnPropertyNames(e._calls||{}),o=e._inherited||[],a=e._d3options||[],s=n.concat(i).concat(o).concat(a);s.unshift(e),s.unshift(t),d3.rebind.apply(this,s),t._inherited=r.utils.arrayUnique(n.concat(i).concat(o).concat(n).concat(t._inherited||[])),t._d3options=r.utils.arrayUnique(a.concat(t._d3options||[]))},r.utils.initSVG=function(t){t.classed({"nvd3-svg":!0})},r.utils.sanitizeHeight=function(t,e){return t||parseInt(e.style("height"),10)||400},r.utils.sanitizeWidth=function(t,e){return t||parseInt(e.style("width"),10)||960},r.utils.availableHeight=function(t,e,n){return Math.max(0,r.utils.sanitizeHeight(t,e)-n.top-n.bottom)},r.utils.availableWidth=function(t,e,n){return Math.max(0,r.utils.sanitizeWidth(t,e)-n.left-n.right)},r.utils.noData=function(t,e){var n=t.options(),i=n.margin(),o=n.noData(),a=null==o?["No Data Available."]:[o],s=r.utils.availableHeight(null,e,i),l=r.utils.availableWidth(null,e,i),u=i.left+l/2,c=i.top+s/2;e.selectAll("g").remove();var d=e.selectAll(".nv-noData").data(a);d.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),d.attr("x",u).attr("y",c).text((function(t){return t}))},r.utils.wrapTicks=function(t,e){t.each((function(){for(var t,n=d3.select(this),r=n.text().split(/\s+/).reverse(),i=[],o=0,a=n.attr("y"),s=parseFloat(n.attr("dy")),l=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");t=r.pop();)i.push(t),l.text(i.join(" ")),l.node().getComputedTextLength()>e&&(i.pop(),l.text(i.join(" ")),i=[t],l=n.append("tspan").attr("x",0).attr("y",a).attr("dy",1.1*++o+s+"em").text(t))}))},r.utils.arrayEquals=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!r.arrayEquals(t[n],e[n]))return!1}else if(t[n]!=e[n])return!1;return!0},r.utils.pointIsInArc=function(t,e,n){var r=n.innerRadius()(e),i=n.outerRadius()(e),o=n.startAngle()(e),a=n.endAngle()(e),s=t.x*t.x+t.y*t.y,l=Math.atan2(t.x,-t.y);return l=l<0?l+2*Math.PI:l,r*r<=s&&s<=i*i&&o<=l&&l<=a},r.models.axis=function(){"use strict";var t,e,n=d3.svg.axis(),i=d3.scale.linear(),o={top:0,right:0,bottom:0,left:0},a=75,s=60,l=null,u=!0,c=0,d=!0,f=!1,p=!1,h=null,g=0,v=void 0,m=250,y=d3.dispatch("renderEnd");n.scale(i).orient("bottom").tickFormat((function(t){return t}));var x=r.utils.renderWatch(y,m);function b(s){return x.reset(),s.each((function(s){var m=d3.select(this);r.utils.initSVG(m);var y=m.selectAll("g.nv-wrap.nv-axis").data([s]),b=(y.enter().append("g").attr("class","nvd3 nv-wrap nv-axis").append("g"),y.select("g"));null!==h?n.ticks(h):"top"!=n.orient()&&"bottom"!=n.orient()||n.ticks(Math.abs(i.range()[1]-i.range()[0])/100),b.watchTransition(x,"axis").call(n),e=e||n.scale();var k=n.tickFormat();null==k&&(k=e.tickFormat());var w,A,M,C=b.selectAll("text.nv-axislabel").data([l||null]);switch(C.exit().remove(),void 0!==v&&b.selectAll("g").select("text").style("font-size",v),n.orient()){case"top":C.enter().append("text").attr("class","nv-axislabel"),M=0,1===i.range().length?M=p?2*i.range()[0]+i.rangeBand():0:2===i.range().length?M=p?i.range()[0]+i.range()[1]+i.rangeBand():i.range()[1]:i.range().length>2&&(M=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",0).attr("x",M/2),u&&((A=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")})).append("text"),A.exit().remove(),A.attr("transform",(function(t,e){return"translate("+r.utils.NaNtoZero(i(t))+",0)"})).select("text").attr("dy","-0.5em").attr("y",-n.tickPadding()).attr("text-anchor","middle").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),A.watchTransition(x,"min-max top").attr("transform",(function(t,e){return"translate("+r.utils.NaNtoZero(i.range()[e])+",0)"})));break;case"bottom":w=g+36;var S=30,W=0,E=b.selectAll("g").select("text"),F="";if(c%360){E.attr("transform",""),E.each((function(t,e){var n=this.getBoundingClientRect(),r=n.width;W=n.height,r>S&&(S=r)})),F="rotate("+c+" 0,"+(W/2+n.tickPadding())+")";var D=Math.abs(Math.sin(c*Math.PI/180));w=(D?D*S:S)+30,E.attr("transform",F).style("text-anchor",c%360>0?"start":"end")}else f?E.attr("transform",(function(t,e){return"translate(0,"+(e%2==0?"0":"12")+")"})):E.attr("transform","translate(0,0)");C.enter().append("text").attr("class","nv-axislabel"),M=0,1===i.range().length?M=p?2*i.range()[0]+i.rangeBand():0:2===i.range().length?M=p?i.range()[0]+i.range()[1]+i.rangeBand():i.range()[1]:i.range().length>2&&(M=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",w).attr("x",M/2),u&&((A=y.selectAll("g.nv-axisMaxMin").data([i.domain()[0],i.domain()[i.domain().length-1]])).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")})).append("text"),A.exit().remove(),A.attr("transform",(function(t,e){return"translate("+r.utils.NaNtoZero(i(t)+(p?i.rangeBand()/2:0))+",0)"})).select("text").attr("dy",".71em").attr("y",n.tickPadding()).attr("transform",F).style("text-anchor",c?c%360>0?"start":"end":"middle").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),A.watchTransition(x,"min-max bottom").attr("transform",(function(t,e){return"translate("+r.utils.NaNtoZero(i(t)+(p?i.rangeBand()/2:0))+",0)"})));break;case"right":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"begin").attr("transform",d?"rotate(90)":"").attr("y",d?12-Math.max(o.right,a)-(g||0):-10).attr("x",d?d3.max(i.range())/2:n.tickPadding()),u&&((A=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")})).append("text").style("opacity",0),A.exit().remove(),A.attr("transform",(function(t,e){return"translate(0,"+r.utils.NaNtoZero(i(t))+")"})).select("text").attr("dy",".32em").attr("y",0).attr("x",n.tickPadding()).style("text-anchor","start").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),A.watchTransition(x,"min-max right").attr("transform",(function(t,e){return"translate(0,"+r.utils.NaNtoZero(i.range()[e])+")"})).select("text").style("opacity",1));break;case"left":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"end").attr("transform",d?"rotate(-90)":"").attr("y",d?25-Math.max(o.left,a)-(g||0):-10).attr("x",d?-d3.max(i.range())/2:-n.tickPadding()),u&&((A=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")})).append("text").style("opacity",0),A.exit().remove(),A.attr("transform",(function(t,n){return"translate(0,"+r.utils.NaNtoZero(e(t))+")"})).select("text").attr("dy",".32em").attr("y",0).attr("x",-n.tickPadding()).attr("text-anchor","end").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),A.watchTransition(x,"min-max right").attr("transform",(function(t,e){return"translate(0,"+r.utils.NaNtoZero(i.range()[e])+")"})).select("text").style("opacity",1))}if(C.text((function(t){return t})),!u||"left"!==n.orient()&&"right"!==n.orient()||(b.selectAll("g").each((function(t,e){d3.select(this).select("text").attr("opacity",1),(i(t)<i.range()[1]+10||i(t)>i.range()[0]-10)&&((t>1e-10||t<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))})),i.domain()[0]==i.domain()[1]&&0==i.domain()[0]&&y.selectAll("g.nv-axisMaxMin").style("opacity",(function(t,e){return e?0:1}))),u&&("top"===n.orient()||"bottom"===n.orient())){var _=[];y.selectAll("g.nv-axisMaxMin").each((function(t,e){try{e?_.push(i(t)-this.getBoundingClientRect().width-4):_.push(i(t)+this.getBoundingClientRect().width+4)}catch(n){e?_.push(i(t)-4):_.push(i(t)+4)}})),b.selectAll("g").each((function(t,e){(i(t)<_[0]||i(t)>_[1])&&(t>1e-10||t<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove())}))}b.selectAll(".tick").filter((function(t){return!parseFloat(Math.round(1e5*t)/1e6)&&void 0!==t})).classed("zero",!0),e=i.copy()})),x.renderEnd("axis immediate"),b}return b.axis=n,b.dispatch=y,b.options=r.utils.optionsFunc.bind(b),b._options=Object.create({},{axisLabelDistance:{get:function(){return g},set:function(t){g=t}},staggerLabels:{get:function(){return f},set:function(t){f=t}},rotateLabels:{get:function(){return c},set:function(t){c=t}},rotateYLabel:{get:function(){return d},set:function(t){d=t}},showMaxMin:{get:function(){return u},set:function(t){u=t}},axisLabel:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return s},set:function(t){s=t}},ticks:{get:function(){return h},set:function(t){h=t}},width:{get:function(){return a},set:function(t){a=t}},fontSize:{get:function(){return v},set:function(t){v=t}},tickFormatMaxMin:{get:function(){return t},set:function(e){t=e}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},duration:{get:function(){return m},set:function(t){m=t,x.reset(m)}},scale:{get:function(){return i},set:function(t){i=t,n.scale(i),p="function"==typeof i.rangeBands,r.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"])}}}),r.utils.initOptions(b),r.utils.inheritOptionsD3(b,n,["orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"]),r.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"]),b},r.models.boxPlot=function(){"use strict";var t,e,n,i,o,a,s={top:0,right:0,bottom:0,left:0},l=960,u=500,c=Math.floor(1e4*Math.random()),d=d3.scale.ordinal(),f=d3.scale.linear(),p=function(t){return t.label},h=function(t){return t.values.Q1},g=function(t){return t.values.Q2},v=function(t){return t.values.Q3},m=function(t){return t.values.whisker_low},y=function(t){return t.values.whisker_high},x=function(t){return t.color},b=function(t){return t.values.outliers},k=function(t,e,n){return t},w=function(t,e,n){return t},A=function(t,e,n){},M=r.utils.defaultColor(),C=null,S=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),W=250,E=null,F=r.utils.renderWatch(S,W);function D(c){return F.reset(),c.each((function(c){var D=l-s.left-s.right,_=u-s.top-s.bottom;C=d3.select(this),r.utils.initSVG(C),d.domain(t||c.map((function(t,e){return p(t,e)}))).rangeBands(e||[0,D],.1);var N=[];if(!n){var O=[];c.forEach((function(t,e){var n=h(t),r=v(t),i=m(t),o=y(t),a=b(t);a&&a.forEach((function(t,e){O.push(k(t,e,void 0))})),i&&O.push(i),n&&O.push(n),r&&O.push(r),o&&O.push(o)})),N=[d3.min(O),d3.max(O)]}f.domain(n||N),f.range(i||[_,0]),o=o||d,a=a||f.copy().range([f(0),f(0)]);var L=C.selectAll("g.nv-wrap").data([c]);L.enter().append("g").attr("class","nvd3 nv-wrap"),L.attr("transform","translate("+s.left+","+s.top+")");var B=L.selectAll(".nv-boxplot").data((function(t){return t})),T=B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);B.attr("class","nv-boxplot").attr("transform",(function(t,e,n){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"})).classed("hover",(function(t){return t.hover})),B.watchTransition(F,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay((function(t,e){return e*W/c.length})).attr("transform",(function(t,e){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"})),B.exit().remove(),T.each((function(t,e){var n=d3.select(this);[m,y].forEach((function(r){if(void 0!==r(t)&&null!==r(t)){var i=r===m?"low":"high";n.append("line").style("stroke",x(t)||M(t,e)).attr("class","nv-boxplot-whisker nv-boxplot-"+i),n.append("line").style("stroke",x(t)||M(t,e)).attr("class","nv-boxplot-tick nv-boxplot-"+i)}}))}));var P=function(){return null===E?.9*d.rangeBand():Math.min(75,.9*d.rangeBand())},z=function(){return.45*d.rangeBand()-P()/2},I=function(){return.45*d.rangeBand()+P()/2};[m,y].forEach((function(t){var e=t===m?"low":"high",n=t===m?h:v;B.select("line.nv-boxplot-whisker.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",.45*d.rangeBand()).attr("y1",(function(e,n){return f(t(e))})).attr("x2",.45*d.rangeBand()).attr("y2",(function(t,e){return f(n(t))})),B.select("line.nv-boxplot-tick.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",z).attr("y1",(function(e,n){return f(t(e))})).attr("x2",I).attr("y2",(function(e,n){return f(t(e))}))})),[m,y].forEach((function(t){var e=t===m?"low":"high";T.selectAll(".nv-boxplot-"+e).on("mouseover",(function(e,n,r){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:t(e),color:x(e)||M(e,r)},e:d3.event})})).on("mouseout",(function(e,n,r){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:t(e),color:x(e)||M(e,r)},e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})}))})),T.append("rect").attr("class","nv-boxplot-box").on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),S.elementMouseover({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||M(t,e)},{key:"Q2",value:g(t),color:x(t)||M(t,e)},{key:"Q1",value:h(t),color:x(t)||M(t,e)}],data:t,index:e,e:d3.event})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),S.elementMouseout({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||M(t,e)},{key:"Q2",value:g(t),color:x(t)||M(t,e)},{key:"Q1",value:h(t),color:x(t)||M(t,e)}],data:t,index:e,e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})})),B.select("rect.nv-boxplot-box").watchTransition(F,"nv-boxplot: boxes").attr("y",(function(t,e){return f(v(t))})).attr("width",P).attr("x",z).attr("height",(function(t,e){return Math.abs(f(v(t))-f(h(t)))||1})).style("fill",(function(t,e){return x(t)||M(t,e)})).style("stroke",(function(t,e){return x(t)||M(t,e)})),T.append("line").attr("class","nv-boxplot-median"),B.select("line.nv-boxplot-median").watchTransition(F,"nv-boxplot: boxplots line").attr("x1",z).attr("y1",(function(t,e){return f(g(t))})).attr("x2",I).attr("y2",(function(t,e){return f(g(t))}));var V=B.selectAll(".nv-boxplot-outlier").data((function(t){return b(t)||[]}));V.enter().append("circle").style("fill",(function(t,e,n){return A(t,e,n)||M(t,n)})).style("stroke",(function(t,e,n){return A(t,e,n)||M(t,n)})).style("z-index",9e3).on("mouseover",(function(t,e,n){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:w(t,e,n),color:A(t,e,n)||M(t,n)},e:d3.event})})).on("mouseout",(function(t,e,n){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:w(t,e,n),color:A(t,e,n)||M(t,n)},e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})})),V.attr("class","nv-boxplot-outlier"),V.watchTransition(F,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*d.rangeBand()).attr("cy",(function(t,e,n){return f(k(t,e,n))})).attr("r","3"),V.exit().remove(),o=d.copy(),a=f.copy()})),F.renderEnd("nv-boxplot immediate"),D}return D.dispatch=S,D.options=r.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return u},set:function(t){u=t}},maxBoxWidth:{get:function(){return E},set:function(t){E=t}},x:{get:function(){return p},set:function(t){p=t}},q1:{get:function(){return h},set:function(t){h=t}},q2:{get:function(){return g},set:function(t){g=t}},q3:{get:function(){return v},set:function(t){v=t}},wl:{get:function(){return m},set:function(t){m=t}},wh:{get:function(){return y},set:function(t){y=t}},itemColor:{get:function(){return x},set:function(t){x=t}},outliers:{get:function(){return b},set:function(t){b=t}},outlierValue:{get:function(){return k},set:function(t){k=t}},outlierLabel:{get:function(){return w},set:function(t){w=t}},outlierColor:{get:function(){return A},set:function(t){A=t}},xScale:{get:function(){return d},set:function(t){d=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return t},set:function(e){t=e}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return e},set:function(t){e=t}},yRange:{get:function(){return i},set:function(t){i=t}},id:{get:function(){return c},set:function(t){c=t}},y:{get:function(){return console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead."),{}},set:function(t){console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead.")}},margin:{get:function(){return s},set:function(t){s.top=void 0!==t.top?t.top:s.top,s.right=void 0!==t.right?t.right:s.right,s.bottom=void 0!==t.bottom?t.bottom:s.bottom,s.left=void 0!==t.left?t.left:s.left}},color:{get:function(){return M},set:function(t){M=r.utils.getColor(t)}},duration:{get:function(){return W},set:function(t){W=t,F.reset(W)}}}),r.utils.initOptions(D),D},r.models.boxPlotChart=function(){"use strict";var t,e,n=r.models.boxPlot(),i=r.models.axis(),o=r.models.axis(),a={top:15,right:10,bottom:50,left:60},s=null,l=null,u=r.utils.getColor(),c=!0,d=!0,f=!1,p=!1,h=r.models.tooltip(),g="No Data Available.",v=d3.dispatch("beforeUpdate","renderEnd"),m=250;i.orient("bottom").showMaxMin(!1).tickFormat((function(t){return t})),o.orient(f?"right":"left").tickFormat(d3.format(",.1f")),h.duration(0);var y=r.utils.renderWatch(v,m);function x(u){return y.reset(),y.models(n),c&&y.models(i),d&&y.models(o),u.each((function(u){var h=d3.select(this);r.utils.initSVG(h);var y=(s||parseInt(h.style("width"))||960)-a.left-a.right,b=(l||parseInt(h.style("height"))||400)-a.top-a.bottom;if(x.update=function(){v.beforeUpdate(),h.transition().duration(m).call(x)},x.container=this,!u||!u.length){var k=h.selectAll(".nv-noData").data([g]);return k.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),k.attr("x",a.left+y/2).attr("y",a.top+b/2).text((function(t){return t})),x}h.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale().clamp(!0);var w=h.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([u]),A=w.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),M=A.append("defs"),C=w.select("g");if(A.append("g").attr("class","nv-x nv-axis"),A.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),A.append("g").attr("class","nv-barsWrap"),C.attr("transform","translate("+a.left+","+a.top+")"),f&&C.select(".nv-y.nv-axis").attr("transform","translate("+y+",0)"),n.width(y).height(b),C.select(".nv-barsWrap").datum(u.filter((function(t){return!t.disabled}))).transition().call(n),M.append("clipPath").attr("id","nv-x-label-clip-"+n.id()).append("rect"),C.select("#nv-x-label-clip-"+n.id()+" rect").attr("width",t.rangeBand()*(p?2:1)).attr("height",16).attr("x",-t.rangeBand()/(p?1:2)),c){i.scale(t).ticks(r.utils.calcTicksX(y/100,u)).tickSize(-b,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),C.select(".nv-x.nv-axis").call(i);var S=C.select(".nv-x.nv-axis").selectAll("g");p&&S.selectAll("text").attr("transform",(function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"}))}d&&(o.scale(e).ticks(Math.floor(b/36)).tickSize(-y,0),C.select(".nv-y.nv-axis").call(o)),C.select(".nv-zeroLine line").attr("x1",0).attr("x2",y).attr("y1",e(0)).attr("y2",e(0))})),y.renderEnd("nv-boxplot chart immediate"),x}return n.dispatch.on("elementMouseover.tooltip",(function(t){h.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){h.data(t).hidden(!0)})),n.dispatch.on("elementMousemove.tooltip",(function(t){h()})),x.dispatch=v,x.boxplot=n,x.xAxis=i,x.yAxis=o,x.tooltip=h,x.options=r.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},staggerLabels:{get:function(){return p},set:function(t){p=t}},showXAxis:{get:function(){return c},set:function(t){c=t}},showYAxis:{get:function(){return d},set:function(t){d=t}},tooltipContent:{get:function(){return h},set:function(t){h=t}},noData:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!==t.top?t.top:a.top,a.right=void 0!==t.right?t.right:a.right,a.bottom=void 0!==t.bottom?t.bottom:a.bottom,a.left=void 0!==t.left?t.left:a.left}},duration:{get:function(){return m},set:function(t){m=t,y.reset(m),n.duration(m),i.duration(m),o.duration(m)}},color:{get:function(){return u},set:function(t){u=r.utils.getColor(t),n.color(u)}},rightAlignYAxis:{get:function(){return f},set:function(t){f=t,o.orient(t?"right":"left")}}}),r.utils.inheritOptions(x,n),r.utils.initOptions(x),x},r.models.bullet=function(){"use strict";var t={top:0,right:0,bottom:0,left:0},e="left",n=!1,i=function(t){return t.ranges},o=function(t){return t.markers?t.markers:[]},a=function(t){return t.markerLines?t.markerLines:[0]},s=function(t){return t.measures},l=function(t){return t.rangeLabels?t.rangeLabels:[]},u=function(t){return t.markerLabels?t.markerLabels:[]},c=function(t){return t.markerLineLabels?t.markerLineLabels:[]},d=function(t){return t.measureLabels?t.measureLabels:[]},f=[0],p=380,h=30,g=null,v=null,m=r.utils.getColor(["#1f77b4"]),y=d3.dispatch("elementMouseover","elementMouseout","elementMousemove"),x=["Maximum","Mean","Minimum"],b=["Max","Avg","Min"],k=1e3;function w(t,e){var n=t.slice();t.sort((function(t,r){var i=n.indexOf(t),o=n.indexOf(r);return d3.descending(e[i],e[o])}))}function A(e){return e.each((function(e,v){var A=p-t.left-t.right,M=h-t.top-t.bottom;g=d3.select(this),r.utils.initSVG(g);var C=i.call(this,e,v).slice(),S=o.call(this,e,v).slice(),W=a.call(this,e,v).slice(),E=s.call(this,e,v).slice(),F=l.call(this,e,v).slice(),D=u.call(this,e,v).slice(),_=c.call(this,e,v).slice(),N=d.call(this,e,v).slice();w(F,C),w(D,S),w(_,W),w(N,E),C.sort(d3.descending),S.sort(d3.descending),W.sort(d3.descending),E.sort(d3.descending);var O=d3.scale.linear().domain(d3.extent(d3.merge([f,C]))).range(n?[A,0]:[0,A]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(O.range()),this.__chart__=O,d3.min(C),d3.max(C),C[1];for(var L=g.selectAll("g.nv-wrap.nv-bullet").data([e]),B=L.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet").append("g"),T=L.select("g"),P=(v=0,C.length);v<P;v++){var z="nv-range nv-range"+v;v<=2&&(z=z+" nv-range"+b[v]),B.append("rect").attr("class",z)}B.append("rect").attr("class","nv-measure"),L.attr("transform","translate("+t.left+","+t.top+")");var I=function(t){return Math.abs(O(t)-O(0))},V=function(t){return O(t<0?t:0)};for(v=0,P=C.length;v<P;v++){var H=C[v];T.select("rect.nv-range"+v).datum(H).attr("height",M).transition().duration(k).attr("width",I(H)).attr("x",V(H))}T.select("rect.nv-measure").style("fill",m).attr("height",M/3).attr("y",M/3).on("mouseover",(function(){y.elementMouseover({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).on("mousemove",(function(){y.elementMousemove({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).on("mouseout",(function(){y.elementMouseout({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).transition().duration(k).attr("width",E<0?O(0)-O(E[0]):O(E[0])-O(0)).attr("x",V(E));var Y=M/6,G=S.map((function(t,e){return{value:t,label:D[e]}}));B.selectAll("path.nv-markerTriangle").data(G).enter().append("path").attr("class","nv-markerTriangle").attr("d","M0,"+Y+"L"+Y+","+-Y+" "+-Y+","+-Y+"Z").on("mouseover",(function(t){y.elementMouseover({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[O(t.value),M/2]})})).on("mousemove",(function(t){y.elementMousemove({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){y.elementMouseout({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})),T.selectAll("path.nv-markerTriangle").data(G).transition().duration(k).attr("transform",(function(t){return"translate("+O(t.value)+","+M/2+")"}));var R=W.map((function(t,e){return{value:t,label:_[e]}}));B.selectAll("line.nv-markerLine").data(R).enter().append("line").attr("cursor","").attr("class","nv-markerLine").attr("x1",(function(t){return O(t.value)})).attr("y1","2").attr("x2",(function(t){return O(t.value)})).attr("y2",M-2).on("mouseover",(function(t){y.elementMouseover({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[O(t.value),M/2]})})).on("mousemove",(function(t){y.elementMousemove({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){y.elementMouseout({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})),T.selectAll("line.nv-markerLine").data(R).transition().duration(k).attr("x1",(function(t){return O(t.value)})).attr("x2",(function(t){return O(t.value)})),L.selectAll(".nv-range").on("mouseover",(function(t,e){var n=F[e]||x[e];y.elementMouseover({value:t,label:n,color:d3.select(this).style("fill")})})).on("mousemove",(function(){y.elementMousemove({value:E[0],label:N[0]||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){var n=F[e]||x[e];y.elementMouseout({value:t,label:n,color:d3.select(this).style("fill")})}))})),A}return A.dispatch=y,A.options=r.utils.optionsFunc.bind(A),A._options=Object.create({},{ranges:{get:function(){return i},set:function(t){i=t}},markers:{get:function(){return o},set:function(t){o=t}},measures:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return f},set:function(t){f=t}},width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},tickFormat:{get:function(){return v},set:function(t){v=t}},duration:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},orient:{get:function(){return e},set:function(t){n="right"==(e=t)||"bottom"==e}},color:{get:function(){return m},set:function(t){m=r.utils.getColor(t)}}}),r.utils.initOptions(A),A},r.models.bulletChart=function(){"use strict";var t=r.models.bullet(),e=r.models.tooltip(),n="left",i=!1,o={top:5,right:40,bottom:20,left:120},a=function(t){return t.ranges},s=function(t){return t.markers?t.markers:[]},l=function(t){return t.measures},u=null,c=55,d=null,f=null,p=null,h=d3.dispatch();function g(e){return e.each((function(n,p){var h=d3.select(this);r.utils.initSVG(h);var v=r.utils.availableWidth(u,h,o),m=c-o.top-o.bottom;if(g.update=function(){g(e)},g.container=this,!n||!a.call(this,n,p))return r.utils.noData(g,h),g;h.selectAll(".nv-noData").remove();var y=a.call(this,n,p).slice().sort(d3.descending),x=s.call(this,n,p).slice().sort(d3.descending),b=l.call(this,n,p).slice().sort(d3.descending),k=h.selectAll("g.nv-wrap.nv-bulletChart").data([n]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart").append("g"),A=k.select("g");w.append("g").attr("class","nv-bulletWrap"),w.append("g").attr("class","nv-titles"),k.attr("transform","translate("+o.left+","+o.top+")");var M=d3.scale.linear().domain([0,Math.max(y[0],x[0]||0,b[0])]).range(i?[v,0]:[0,v]),C=this.__chart__||d3.scale.linear().domain([0,1/0]).range(M.range());this.__chart__=M;var S=w.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(c-o.top-o.bottom)/2+")");S.append("text").attr("class","nv-title").text((function(t){return t.title})),S.append("text").attr("class","nv-subtitle").attr("dy","1em").text((function(t){return t.subtitle})),t.width(v).height(m);var W=A.select(".nv-bulletWrap");d3.transition(W).call(t);var E=d||M.tickFormat(v/100),F=A.selectAll("g.nv-tick").data(M.ticks(f||v/50),(function(t){return this.textContent||E(t)})),D=F.enter().append("g").attr("class","nv-tick").attr("transform",(function(t){return"translate("+C(t)+",0)"})).style("opacity",1e-6);D.append("line").attr("y1",m).attr("y2",7*m/6),D.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*m/6).text(E);var _=d3.transition(F).transition().duration(t.duration()).attr("transform",(function(t){return"translate("+M(t)+",0)"})).style("opacity",1);_.select("line").attr("y1",m).attr("y2",7*m/6),_.select("text").attr("y",7*m/6),d3.transition(F.exit()).transition().duration(t.duration()).attr("transform",(function(t){return"translate("+M(t)+",0)"})).style("opacity",1e-6).remove()})),d3.timer.flush(),g}return e.duration(0).headerEnabled(!1),t.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:t.label,value:t.value,color:t.color},e.data(t).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){e.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){e()})),g.bullet=t,g.dispatch=h,g.tooltip=e,g.options=r.utils.optionsFunc.bind(g),g._options=Object.create({},{ranges:{get:function(){return a},set:function(t){a=t}},markers:{get:function(){return s},set:function(t){s=t}},measures:{get:function(){return l},set:function(t){l=t}},width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},tickFormat:{get:function(){return d},set:function(t){d=t}},ticks:{get:function(){return f},set:function(t){f=t}},noData:{get:function(){return p},set:function(t){p=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},orient:{get:function(){return n},set:function(t){i="right"==(n=t)||"bottom"==n}}}),r.utils.inheritOptions(g,t),r.utils.initOptions(g),g},r.models.candlestickBar=function(){"use strict";var t,e,n,i,o,a={top:0,right:0,bottom:0,left:0},s=null,l=null,u=Math.floor(1e4*Math.random()),c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=function(t){return t.open},g=function(t){return t.close},v=function(t){return t.high},m=function(t){return t.low},y=[],x=[],b=!1,k=!0,w=r.utils.defaultColor(),A=!1,M=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");function C(w){return w.each((function(w){t=d3.select(this);var A=r.utils.availableWidth(s,t,a),C=r.utils.availableHeight(l,t,a);r.utils.initSVG(t);var S=A/w[0].values.length*.45;c.domain(e||d3.extent(w[0].values.map(f).concat(y))),b?c.range(i||[.5*A/w[0].values.length,A*(w[0].values.length-.5)/w[0].values.length]):c.range(i||[5+S/2,A-S/2-5]),d.domain(n||[d3.min(w[0].values.map(m).concat(x)),d3.max(w[0].values.map(v).concat(x))]).range(o||[C,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var W=d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([w[0].values]),E=W.enter().append("g").attr("class","nvd3 nv-wrap nv-candlestickBar"),F=E.append("defs"),D=E.append("g"),_=W.select("g");D.append("g").attr("class","nv-ticks"),W.attr("transform","translate("+a.left+","+a.top+")"),t.on("click",(function(t,e){M.chartClick({data:t,index:e,pos:d3.event,id:u})})),F.append("clipPath").attr("id","nv-chart-clip-path-"+u).append("rect"),W.select("#nv-chart-clip-path-"+u+" rect").attr("width",A).attr("height",C),_.attr("clip-path",k?"url(#nv-chart-clip-path-"+u+")":"");var N=W.select(".nv-ticks").selectAll(".nv-tick").data((function(t){return t}));N.exit().remove();var O=N.enter().append("g");N.attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})),O.append("line").attr("class","nv-candlestick-lines").attr("transform",(function(t,e){return"translate("+c(f(t,e))+",0)"})).attr("x1",0).attr("y1",(function(t,e){return d(v(t,e))})).attr("x2",0).attr("y2",(function(t,e){return d(m(t,e))})),O.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",(function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"})).attr("x",0).attr("y",0).attr("width",S).attr("height",(function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)})),N.select(".nv-candlestick-lines").transition().attr("transform",(function(t,e){return"translate("+c(f(t,e))+",0)"})).attr("x1",0).attr("y1",(function(t,e){return d(v(t,e))})).attr("x2",0).attr("y2",(function(t,e){return d(m(t,e))})),N.select(".nv-candlestick-rects").transition().attr("transform",(function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"})).attr("x",0).attr("y",0).attr("width",S).attr("height",(function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)}))})),C}return C.highlightPoint=function(e,n){C.clearHighlights(),t.select(".nv-candlestickBar .nv-tick-0-"+e).classed("hover",n)},C.clearHighlights=function(){t.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},C.dispatch=M,C.options=r.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceX:{get:function(){return y},set:function(t){y=t}},forceY:{get:function(){return x},set:function(t){x=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return k},set:function(t){k=t}},id:{get:function(){return u},set:function(t){u=t}},interactive:{get:function(){return A},set:function(t){A=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return a},set:function(t){a.top=null!=t.top?t.top:a.top,a.right=null!=t.right?t.right:a.right,a.bottom=null!=t.bottom?t.bottom:a.bottom,a.left=null!=t.left?t.left:a.left}},color:{get:function(){return w},set:function(t){w=r.utils.getColor(t)}}}),r.utils.initOptions(C),C},r.models.cumulativeLineChart=function(){"use strict";var t,e,n=r.models.line(),i=r.models.axis(),o=r.models.axis(),a=r.models.legend(),s=r.models.legend(),l=r.interactiveGuideline(),u=r.models.tooltip(),c={top:30,right:30,bottom:50,left:60},d=null,f=r.utils.defaultColor(),p=null,h=null,g=!0,v=!0,m=!0,y=!1,x=!0,b=!1,k=!0,w=n.id(),A=r.utils.state(),M=null,C=null,S=function(t){return t.average},W=d3.dispatch("stateChange","changeState","renderEnd"),E=250,F=!1;A.index=0,A.rescaleY=k,i.orient("bottom").tickPadding(7),o.orient(y?"right":"left"),u.valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.updateState(!1);var D,_=d3.scale.linear(),N={i:0,x:0},O=r.utils.renderWatch(W,E);function L(u){return O.reset(),O.models(n),v&&O.models(i),m&&O.models(o),u.each((function(u){var C=d3.select(this);r.utils.initSVG(C),C.classed("nv-chart-"+w,!0);var O,P=r.utils.availableWidth(p,C,c),z=r.utils.availableHeight(h,C,c);if(L.update=function(){0===E?C.call(L):C.transition().duration(E).call(L)},L.container=this,A.setter(function(t){return function(e){void 0!==e.index&&(N.i=e.index),void 0!==e.rescaleY&&(k=e.rescaleY),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(u),L.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),index:N.i,rescaleY:k}}}(u)).update(),A.disabled=u.map((function(t){return!!t.disabled})),!M)for(O in M={},A)A[O]instanceof Array?M[O]=A[O].slice(0):M[O]=A[O];var I=d3.behavior.drag().on("dragstart",(function(t,e){d3.select(L.container).style("cursor","ew-resize")})).on("drag",(function(t,e){N.x=d3.event.x,N.i=Math.round(_.invert(N.x)),Q()})).on("dragend",(function(t,e){d3.select(L.container).style("cursor","auto"),A.index=N.i,W.stateChange(A)}));if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return r.utils.noData(L,C),L;C.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale(),_.domain([0,u[0].values.length-1]).range([0,P]).clamp(!0),u=function(t,e){return B||(B=n.y()),e.map((function(e,n){if(!e.values)return e;var r=e.values[t];if(null==r)return e;var i=B(r,t);return Math.abs(i)<1e-5&&!F?(e.tempDisabled=!0,e):(e.tempDisabled=!1,e.values=e.values.map((function(t,e){return t.display={y:(B(t,e)-i)/i},t})),e)}))}(N.i,u),void 0===D&&(D=T(u)),k?n.yDomain(null):(n.yDomain(D),n.clipEdge(!0));var V=b?"none":"all",H=C.selectAll("g.nv-wrap.nv-cumulativeLine").data([u]),Y=H.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),G=H.select("g");if(Y.append("g").attr("class","nv-interactive"),Y.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),Y.append("g").attr("class","nv-y nv-axis"),Y.append("g").attr("class","nv-background"),Y.append("g").attr("class","nv-linesWrap").style("pointer-events",V),Y.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),Y.append("g").attr("class","nv-legendWrap"),Y.append("g").attr("class","nv-controlsWrap"),g?(a.width(P),G.select(".nv-legendWrap").datum(u).call(a),d||a.height()===c.top||(c.top=a.height(),z=r.utils.availableHeight(h,C,c)),G.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):G.select(".nv-legendWrap").selectAll("*").remove(),x){var R=[{key:"Re-scale y-axis",disabled:!k}];s.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),G.select(".nv-controlsWrap").datum(R).attr("transform","translate(0,"+-c.top+")").call(s)}else G.select(".nv-controlsWrap").selectAll("*").remove();H.attr("transform","translate("+c.left+","+c.top+")"),y&&G.select(".nv-y.nv-axis").attr("transform","translate("+P+",0)");var X=u.filter((function(t){return t.tempDisabled}));H.select(".tempDisabled").remove(),X.length&&H.append("text").attr("class","tempDisabled").attr("x",P/2).attr("y","-.71em").style("text-anchor","end").text(X.map((function(t){return t.key})).join(", ")+" values cannot be calculated for this time period."),b&&(l.width(P).height(z).margin({left:c.left,top:c.top}).svgContainer(C).xScale(t),H.select(".nv-interactive").call(l)),Y.select(".nv-background").append("rect"),G.select(".nv-background rect").attr("width",P).attr("height",z),n.y((function(t){return t.display.y})).width(P).height(z).color(u.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!u[e].disabled&&!u[e].tempDisabled})));var j=G.select(".nv-linesWrap").datum(u.filter((function(t){return!t.disabled&&!t.tempDisabled})));j.call(n),u.forEach((function(t,e){t.seriesIndex=e}));var Z=u.filter((function(t){return!t.disabled&&!!S(t)})),q=G.select(".nv-avgLinesWrap").selectAll("line").data(Z,(function(t){return t.key})),K=function(t){var n=e(S(t));return n<0?0:n>z?z:n};q.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",(function(t,e){return n.color()(t,t.seriesIndex)})).attr("x1",0).attr("x2",P).attr("y1",K).attr("y2",K),q.style("stroke-opacity",(function(t){var n=e(S(t));return n<0||n>z?0:1})).attr("x1",0).attr("x2",P).attr("y1",K).attr("y2",K),q.exit().remove();var U=j.selectAll(".nv-indexLine").data([N]);function Q(){U.data([N]);var t=L.duration();L.duration(0),L.update(),L.duration(t)}U.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).style("pointer-events","all").call(I),U.attr("transform",(function(t){return"translate("+_(t.i)+",0)"})).attr("height",z),v&&(i.scale(t)._ticks(r.utils.calcTicksX(P/70,u)).tickSize(-z,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),G.select(".nv-x.nv-axis").call(i)),m&&(o.scale(e)._ticks(r.utils.calcTicksY(z/36,u)).tickSize(-P,0),G.select(".nv-y.nv-axis").call(o)),G.select(".nv-background rect").on("click",(function(){N.x=d3.mouse(this)[0],N.i=Math.round(_.invert(N.x)),A.index=N.i,W.stateChange(A),Q()})),n.dispatch.on("elementClick",(function(t){N.i=t.pointIndex,N.x=_(N.i),A.index=N.i,W.stateChange(A),Q()})),s.dispatch.on("legendClick",(function(t,e){t.disabled=!t.disabled,k=!t.disabled,A.rescaleY=k,k||(D=T(u)),W.stateChange(A),L.update()})),a.dispatch.on("stateChange",(function(t){for(var e in t)A[e]=t[e];W.stateChange(A),L.update()})),l.dispatch.on("elementMousemove",(function(t){n.clearHighlights();var e,a,s,c=[];if(u.filter((function(t,e){return t.seriesIndex=e,!(t.disabled||t.tempDisabled)})).forEach((function(i,o){a=r.interactiveBisect(i.values,t.pointXValue,L.x()),n.highlightPoint(o,a,!0);var l=i.values[a];void 0!==l&&(void 0===e&&(e=l),void 0===s&&(s=L.xScale()(L.x()(l,a))),c.push({key:i.key,value:L.y()(l,a),color:f(i,i.seriesIndex)}))})),c.length>2){var d=L.yScale().invert(t.mouseY),p=.03*Math.abs(L.yScale().domain()[0]-L.yScale().domain()[1]),h=r.nearestValueIndex(c.map((function(t){return t.value})),d,p);null!==h&&(c[h].highlight=!0)}var g=i.tickFormat()(L.x()(e,a),a);l.tooltip.valueFormatter((function(t,e){return o.tickFormat()(t)})).data({value:g,series:c})(),l.renderGuideLine(s)})),l.dispatch.on("elementMouseout",(function(t){n.clearHighlights()})),W.on("changeState",(function(t){void 0!==t.disabled&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),A.disabled=t.disabled),void 0!==t.index&&(N.i=t.index,N.x=_(N.i),A.index=t.index,U.data([N])),void 0!==t.rescaleY&&(k=t.rescaleY),L.update()}))})),O.renderEnd("cumulativeLineChart immediate"),L}n.dispatch.on("elementMouseover.tooltip",(function(t){var e={x:L.x()(t.point),y:L.y()(t.point),color:t.point.color};t.point=e,u.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){u.hidden(!0)}));var B=null;function T(t){var e=t.filter((function(t){return!(t.disabled||t.tempDisabled)})).map((function(t,e){return d3.extent(t.values,(function(t){return t.display.y}))}));return[d3.min(e,(function(t){return t[0]})),d3.max(e,(function(t){return t[1]}))]}return L.dispatch=W,L.lines=n,L.legend=a,L.controls=s,L.xAxis=i,L.yAxis=o,L.interactiveLayer=l,L.state=A,L.tooltip=u,L.options=r.utils.optionsFunc.bind(L),L._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showControls:{get:function(){return x},set:function(t){x=t}},showLegend:{get:function(){return g},set:function(t){g=t}},average:{get:function(){return S},set:function(t){S=t}},defaultState:{get:function(){return M},set:function(t){M=t}},noData:{get:function(){return C},set:function(t){C=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},noErrorCheck:{get:function(){return F},set:function(t){F=t}},rescaleY:{get:function(){return k},set:function(t){k=t,L.state.rescaleY=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t),a.color(f)}},useInteractiveGuideline:{get:function(){return b},set:function(t){b=t,!0===t&&(L.interactive(!1),L.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,o.orient(t?"right":"left")}},duration:{get:function(){return E},set:function(t){E=t,n.duration(E),i.duration(E),o.duration(E),O.reset(E)}}}),r.utils.inheritOptions(L,n),r.utils.initOptions(L),L},r.models.discreteBar=function(){"use strict";var t,e,n,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=d3.scale.ordinal(),p=d3.scale.linear(),h=function(t){return t.x},g=function(t){return t.y},v=[0],m=r.utils.defaultColor(),y=!1,x=d3.format(",.2f"),b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),k="discreteBar",w=250,A=r.utils.renderWatch(b,w);function M(d){return A.reset(),d.each((function(d){var w=u-l.left-l.right,M=c-l.top-l.bottom;t=d3.select(this),r.utils.initSVG(t),d.forEach((function(t,e){t.values.forEach((function(t){t.series=e}))}));var C=e&&n?[]:d.map((function(t){return t.values.map((function(t,e){return{x:h(t,e),y:g(t,e),y0:t.y0}}))}));f.domain(e||d3.merge(C).map((function(t){return t.x}))).rangeBands(i||[0,w],.1),p.domain(n||d3.extent(d3.merge(C).map((function(t){return t.y})).concat(v))),y?p.range(o||[M-(p.domain()[0]<0?12:0),p.domain()[1]>0?12:0]):p.range(o||[M,0]),a=a||f,s=s||p.copy().range([p(0),p(0)]);var S=t.selectAll("g.nv-wrap.nv-discretebar").data([d]),W=S.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar").append("g");S.select("g"),W.append("g").attr("class","nv-groups"),S.attr("transform","translate("+l.left+","+l.top+")");var E=S.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));E.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),E.exit().watchTransition(A,"discreteBar: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),E.attr("class",(function(t,e){return"nv-group nv-series-"+e})).classed("hover",(function(t){return t.hover})),E.watchTransition(A,"discreteBar: groups").style("stroke-opacity",1).style("fill-opacity",.75);var F=E.selectAll("g.nv-bar").data((function(t){return t.values}));F.exit().remove();var D=F.enter().append("g").attr("transform",(function(t,e,n){return"translate("+(f(h(t,e))+.05*f.rangeBand())+", "+p(0)+")"})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),b.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),b.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e){b.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){b.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e){b.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}));D.append("rect").attr("height",0).attr("width",.9*f.rangeBand()/d.length),y?(D.append("text").attr("text-anchor","middle"),F.select("text").text((function(t,e){return x(g(t,e))})).watchTransition(A,"discreteBar: bars text").attr("x",.9*f.rangeBand()/2).attr("y",(function(t,e){return g(t,e)<0?p(g(t,e))-p(0)+12:-4}))):F.selectAll("text").remove(),F.attr("class",(function(t,e){return g(t,e)<0?"nv-bar negative":"nv-bar positive"})).style("fill",(function(t,e){return t.color||m(t,e)})).style("stroke",(function(t,e){return t.color||m(t,e)})).select("rect").attr("class",k).watchTransition(A,"discreteBar: bars rect").attr("width",.9*f.rangeBand()/d.length),F.watchTransition(A,"discreteBar: bars").attr("transform",(function(t,e){return"translate("+(f(h(t,e))+.05*f.rangeBand())+", "+(g(t,e)<0?p(0):p(0)-p(g(t,e))<1?p(0)-1:p(g(t,e)))+")"})).select("rect").attr("height",(function(t,e){return Math.max(Math.abs(p(g(t,e))-p(0)),1)})),a=f.copy(),s=p.copy()})),A.renderEnd("discreteBar immediate"),M}return M.dispatch=b,M.options=r.utils.optionsFunc.bind(M),M._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},forceY:{get:function(){return v},set:function(t){v=t}},showValues:{get:function(){return y},set:function(t){y=t}},x:{get:function(){return h},set:function(t){h=t}},y:{get:function(){return g},set:function(t){g=t}},xScale:{get:function(){return f},set:function(t){f=t}},yScale:{get:function(){return p},set:function(t){p=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},valueFormat:{get:function(){return x},set:function(t){x=t}},id:{get:function(){return d},set:function(t){d=t}},rectClass:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},color:{get:function(){return m},set:function(t){m=r.utils.getColor(t)}},duration:{get:function(){return w},set:function(t){w=t,A.reset(w)}}}),r.utils.initOptions(M),M},r.models.discreteBarChart=function(){"use strict";var t,e,n=r.models.discreteBar(),i=r.models.axis(),o=r.models.axis(),a=r.models.legend(),s=r.models.tooltip(),l={top:15,right:10,bottom:50,left:60},u=null,c=null,d=null,f=r.utils.getColor(),p=!1,h=!0,g=!0,v=!1,m=!1,y=!1,x=0,b=null,k=d3.dispatch("beforeUpdate","renderEnd"),w=250;i.orient("bottom").showMaxMin(!1).tickFormat((function(t){return t})),o.orient(v?"right":"left").tickFormat(d3.format(",.1f")),s.duration(0).headerEnabled(!1).valueFormatter((function(t,e){return o.tickFormat()(t,e)})).keyFormatter((function(t,e){return i.tickFormat()(t,e)}));var A=r.utils.renderWatch(k,w);function M(s){return A.reset(),A.models(n),h&&A.models(i),g&&A.models(o),s.each((function(s){var f=d3.select(this);r.utils.initSVG(f);var b=r.utils.availableWidth(c,f,l),A=r.utils.availableHeight(d,f,l);if(M.update=function(){k.beforeUpdate(),f.transition().duration(w).call(M)},M.container=this,!(s&&s.length&&s.filter((function(t){return t.values.length})).length))return r.utils.noData(M,f),M;f.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale().clamp(!0);var C=f.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([s]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),W=S.append("defs"),E=C.select("g");if(S.append("g").attr("class","nv-x nv-axis"),S.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),S.append("g").attr("class","nv-barsWrap"),S.append("g").attr("class","nv-legendWrap"),E.attr("transform","translate("+l.left+","+l.top+")"),p?(a.width(b),E.select(".nv-legendWrap").datum(s).call(a),u||a.height()===l.top||(l.top=a.height(),A=r.utils.availableHeight(d,f,l)),C.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")):E.select(".nv-legendWrap").selectAll("*").remove(),v&&E.select(".nv-y.nv-axis").attr("transform","translate("+b+",0)"),n.width(b).height(A),E.select(".nv-barsWrap").datum(s.filter((function(t){return!t.disabled}))).transition().call(n),W.append("clipPath").attr("id","nv-x-label-clip-"+n.id()).append("rect"),E.select("#nv-x-label-clip-"+n.id()+" rect").attr("width",t.rangeBand()*(m?2:1)).attr("height",16).attr("x",-t.rangeBand()/(m?1:2)),h){i.scale(t)._ticks(r.utils.calcTicksX(b/100,s)).tickSize(-A,0),E.select(".nv-x.nv-axis").attr("transform","translate(0,"+(e.range()[0]+(n.showValues()&&e.domain()[0]<0?16:0))+")"),E.select(".nv-x.nv-axis").call(i);var F=E.select(".nv-x.nv-axis").selectAll("g");m&&F.selectAll("text").attr("transform",(function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"})),x&&F.selectAll(".tick text").attr("transform","rotate("+x+" 0,0)").style("text-anchor",x>0?"start":"end"),y&&E.selectAll(".tick text").call(r.utils.wrapTicks,M.xAxis.rangeBand())}g&&(o.scale(e)._ticks(r.utils.calcTicksY(A/36,s)).tickSize(-b,0),E.select(".nv-y.nv-axis").call(o)),E.select(".nv-zeroLine line").attr("x1",0).attr("x2",v?-b:b).attr("y1",e(0)).attr("y2",e(0))})),A.renderEnd("discreteBar chart immediate"),M}return n.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:M.x()(t.data),value:M.y()(t.data),color:t.color},s.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){s.hidden(!0)})),n.dispatch.on("elementMousemove.tooltip",(function(t){s()})),M.dispatch=k,M.discretebar=n,M.legend=a,M.xAxis=i,M.yAxis=o,M.tooltip=s,M.options=r.utils.optionsFunc.bind(M),M._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},showLegend:{get:function(){return p},set:function(t){p=t}},staggerLabels:{get:function(){return m},set:function(t){m=t}},rotateLabels:{get:function(){return x},set:function(t){x=t}},wrapLabels:{get:function(){return y},set:function(t){y=!!t}},showXAxis:{get:function(){return h},set:function(t){h=t}},showYAxis:{get:function(){return g},set:function(t){g=t}},noData:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return w},set:function(t){w=t,A.reset(w),n.duration(w),i.duration(w),o.duration(w)}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t),n.color(f),a.color(f)}},rightAlignYAxis:{get:function(){return v},set:function(t){v=t,o.orient(t?"right":"left")}}}),r.utils.inheritOptions(M,n),r.utils.initOptions(M),M},r.models.distribution=function(){"use strict";var t,e={top:0,right:0,bottom:0,left:0},n=400,i=8,o="x",a=function(t){return t[o]},s=r.utils.defaultColor(),l=d3.scale.linear(),u=250,c=d3.dispatch("renderEnd"),d=r.utils.renderWatch(c,u);function f(n){return d.reset(),n.each((function(n){"x"===o?(e.left,e.right):(e.top,e.bottom);var u="x"==o?"y":"x",c=d3.select(this);r.utils.initSVG(c),t=t||l;var f=c.selectAll("g.nv-distribution").data([n]),p=(f.enter().append("g").attr("class","nvd3 nv-distribution").append("g"),f.select("g"));f.attr("transform","translate("+e.left+","+e.top+")");var h=p.selectAll("g.nv-dist").data((function(t){return t}),(function(t){return t.key}));h.enter().append("g"),h.attr("class",(function(t,e){return"nv-dist nv-series-"+e})).style("stroke",(function(t,e){return s(t,e)}));var g=h.selectAll("line.nv-dist"+o).data((function(t){return t.values}));g.enter().append("line").attr(o+"1",(function(e,n){return t(a(e,n))})).attr(o+"2",(function(e,n){return t(a(e,n))})),d.transition(h.exit().selectAll("line.nv-dist"+o),"dist exit").attr(o+"1",(function(t,e){return l(a(t,e))})).attr(o+"2",(function(t,e){return l(a(t,e))})).style("stroke-opacity",0).remove(),g.attr("class",(function(t,e){return"nv-dist"+o+" nv-dist"+o+"-"+e})).attr(u+"1",0).attr(u+"2",i),d.transition(g,"dist").attr(o+"1",(function(t,e){return l(a(t,e))})).attr(o+"2",(function(t,e){return l(a(t,e))})),t=l.copy()})),d.renderEnd("distribution immediate"),f}return f.options=r.utils.optionsFunc.bind(f),f.dispatch=c,f.margin=function(t){return arguments.length?(e.top=void 0!==t.top?t.top:e.top,e.right=void 0!==t.right?t.right:e.right,e.bottom=void 0!==t.bottom?t.bottom:e.bottom,e.left=void 0!==t.left?t.left:e.left,f):e},f.width=function(t){return arguments.length?(n=t,f):n},f.axis=function(t){return arguments.length?(o=t,f):o},f.size=function(t){return arguments.length?(i=t,f):i},f.getData=function(t){return arguments.length?(a=d3.functor(t),f):a},f.scale=function(t){return arguments.length?(l=t,f):l},f.color=function(t){return arguments.length?(s=r.utils.getColor(t),f):s},f.duration=function(t){return arguments.length?(u=t,d.reset(u),f):u},f},r.models.focus=function(t){"use strict";t=t||r.models.line();var e,n,i=r.models.axis(),o=r.models.axis(),a=d3.svg.brush(),s={top:10,right:0,bottom:30,left:0},l=r.utils.defaultColor(),u=null,c=70,d=!0,f=!1,p=!1,h=null,g=250,v=d3.dispatch("brush","onBrush","renderEnd"),m=!0;t.interactive(!1),t.pointActive((function(t){return!1}));var y=r.utils.renderWatch(v,g);function x(b){return y.reset(),y.models(t),d&&y.models(i),f&&y.models(o),b.each((function(y){var b=d3.select(this);r.utils.initSVG(b);var k=r.utils.availableWidth(u,b,s),w=c-s.top-s.bottom;x.update=function(){0===g?b.call(x):b.transition().duration(g).call(x)},x.container=this,e=t.xScale(),n=t.yScale();var A=b.selectAll("g.nv-focus").data([y]),M=A.enter().append("g").attr("class","nvd3 nv-focus").append("g"),C=A.select("g");A.attr("transform","translate("+s.left+","+s.top+")"),M.append("g").attr("class","nv-background").append("rect"),M.append("g").attr("class","nv-x nv-axis"),M.append("g").attr("class","nv-y nv-axis"),M.append("g").attr("class","nv-contentWrap"),M.append("g").attr("class","nv-brushBackground"),M.append("g").attr("class","nv-x nv-brush"),p&&C.select(".nv-y.nv-axis").attr("transform","translate("+k+",0)"),C.select(".nv-background rect").attr("width",k).attr("height",w),t.width(k).height(w).color(y.map((function(t,e){return t.color||l(t,e)})).filter((function(t,e){return!y[e].disabled})));var S=C.select(".nv-contentWrap").datum(y.filter((function(t){return!t.disabled})));d3.transition(S).call(t),a.x(e).on("brush",(function(){D(m)})),a.on("brushend",(function(){m||v.onBrush(a.empty()?e.domain():a.extent())})),h&&a.extent(h);var W=C.select(".nv-brushBackground").selectAll("g").data([h||a.extent()]),E=W.enter().append("g");E.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",w),E.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",w);var F=C.select(".nv-x.nv-brush").call(a);function D(t){h=a.empty()?null:a.extent();var n=a.empty()?e.domain():a.extent();v.brush({extent:n,brush:a}),a.empty()||a.extent(h),W.data([a.empty()?e.domain():h]).each((function(t,n){var r=e(t[0])-e.range()[0],i=k-e(t[1]);d3.select(this).select(".left").attr("width",r<0?0:r),d3.select(this).select(".right").attr("x",e(t[1])).attr("width",i<0?0:i)})),t&&v.onBrush(n)}F.selectAll("rect").attr("height",w),F.selectAll(".resize").append("path").attr("d",(function(t){var e=+("e"==t),n=e?1:-1,r=w/3;return"M"+.5*n+","+r+"A6,6 0 0 "+e+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+e+" "+.5*n+","+2*r+"ZM"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)})),D(!0),C.select(".nv-background rect").attr("width",k).attr("height",w),d&&(i.scale(e)._ticks(r.utils.calcTicksX(k/100,y)).tickSize(-w,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),d3.transition(C.select(".nv-x.nv-axis")).call(i)),f&&(o.scale(n)._ticks(r.utils.calcTicksY(w/36,y)).tickSize(-k,0),d3.transition(C.select(".nv-y.nv-axis")).call(o)),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")")})),y.renderEnd("focus immediate"),x}return x.dispatch=v,x.content=t,x.brush=a,x.xAxis=i,x.yAxis=o,x.options=r.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},showXAxis:{get:function(){return d},set:function(t){d=t}},showYAxis:{get:function(){return f},set:function(t){f=t}},brushExtent:{get:function(){return h},set:function(t){h=t}},syncBrushing:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return s},set:function(t){s.top=void 0!==t.top?t.top:s.top,s.right=void 0!==t.right?t.right:s.right,s.bottom=void 0!==t.bottom?t.bottom:s.bottom,s.left=void 0!==t.left?t.left:s.left}},duration:{get:function(){return g},set:function(e){g=e,y.reset(g),t.duration(g),i.duration(g),o.duration(g)}},color:{get:function(){return l},set:function(e){l=r.utils.getColor(e),t.color(l)}},interpolate:{get:function(){return t.interpolate()},set:function(e){t.interpolate(e)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t)}},x:{get:function(){return t.x()},set:function(e){t.x(e)}},y:{get:function(){return t.y()},set:function(e){t.y(e)}},rightAlignYAxis:{get:function(){return p},set:function(t){p=t,o.orient(p?"right":"left")}}}),r.utils.inheritOptions(x,t),r.utils.initOptions(x),x},r.models.forceDirectedGraph=function(){"use strict";var t={top:2,right:0,bottom:2,left:0},e=400,n=32,i=null,o=d3.dispatch("renderEnd"),a=r.utils.getColor(["#000"]),s=r.models.tooltip(),l=null,u=.1,c=.9,d=30,f=-120,p=.1,h=.8,g=.1,v=5,m=function(t){},y=function(t){},x=d3.functor(0),b=d3.functor(0),k=r.utils.renderWatch(o);function w(o){return k.reset(),o.each((function(o){i=d3.select(this),r.utils.initSVG(i);var l=r.utils.availableWidth(e,i,t),x=r.utils.availableHeight(n,i,t);if(i.attr("width",l).attr("height",x),!(o&&o.links&&o.nodes))return r.utils.noData(w,i),w;i.selectAll(".nv-noData").remove(),i.selectAll("*").remove();var b=new Set;o.nodes.forEach((function(t){Object.keys(t).forEach((function(t){b.add(t)}))}));var k=d3.layout.force().nodes(o.nodes).links(o.links).size([l,x]).linkStrength(u).friction(c).linkDistance(d).charge(f).gravity(p).theta(h).alpha(g).start(),A=i.selectAll(".link").data(o.links).enter().append("line").attr("class","nv-force-link").style("stroke-width",(function(t){return Math.sqrt(t.value)})),M=i.selectAll(".node").data(o.nodes).enter().append("g").attr("class","nv-force-node").call(k.drag);M.append("circle").attr("r",v).style("fill",(function(t){return a(t)})).on("mouseover",(function(t){i.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.py),i.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.px);var e=a(t);t.series=[],b.forEach((function(n){t.series.push({color:e,key:n,value:t[n]})})),s.data(t).hidden(!1)})).on("mouseout",(function(t){s.hidden(!0)})),s.headerFormatter((function(t){return"Node"})),y(A),m(M),k.on("tick",(function(){A.attr("x1",(function(t){return t.source.x})).attr("y1",(function(t){return t.source.y})).attr("x2",(function(t){return t.target.x})).attr("y2",(function(t){return t.target.y})),M.attr("transform",(function(t){return"translate("+t.x+", "+t.y+")"}))}))})),w}return w.options=r.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return e},set:function(t){e=t}},height:{get:function(){return n},set:function(t){n=t}},linkStrength:{get:function(){return u},set:function(t){u=t}},friction:{get:function(){return c},set:function(t){c=t}},linkDist:{get:function(){return d},set:function(t){d=t}},charge:{get:function(){return f},set:function(t){f=t}},gravity:{get:function(){return p},set:function(t){p=t}},theta:{get:function(){return h},set:function(t){h=t}},alpha:{get:function(){return g},set:function(t){g=t}},radius:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return a},set:function(t){a=r.utils.getColor(t)}},noData:{get:function(){return l},set:function(t){l=t}},nodeExtras:{get:function(){return m},set:function(t){m=t}},linkExtras:{get:function(){return y},set:function(t){y=t}}}),w.dispatch=o,w.tooltip=s,r.utils.initOptions(w),w},r.models.furiousLegend=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},e=400,n=20,i=function(t){return t.key},o=function(t){return t},a=r.utils.getColor(),s=20,l=!0,u=28,c=!0,d=!0,f=!1,p=!1,h=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),g="classic";function v(m){function y(t,e){return"furious"!=g?"#000":p?t.disengaged?a(t,e):"#fff":p?void 0:t.disabled?a(t,e):"#fff"}function x(t,e){return p&&"furious"==g?t.disengaged?"#fff":a(t,e):t.disabled?"#fff":a(t,e)}return m.each((function(v){var m=e-t.left-t.right,b=d3.select(this);r.utils.initSVG(b);var k=b.selectAll("g.nv-legend").data([v]),w=(k.enter().append("g").attr("class","nvd3 nv-legend").append("g"),k.select("g"));k.attr("transform","translate("+t.left+","+t.top+")");var A,M=w.selectAll(".nv-series").data((function(t){return"furious"!=g?t:t.filter((function(t){return!!p||!t.disengaged}))})),C=M.enter().append("g").attr("class","nv-series");"classic"==g?(C.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),A=M.select("circle")):"furious"==g&&(C.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),A=M.select("rect"),C.append("g").attr("class","nv-check-box").property("innerHTML",'<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr("transform","translate(-10,-8)scale(0.5)"),M.select(".nv-check-box").each((function(t,e){d3.select(this).selectAll("path").attr("stroke",y(t,e))}))),C.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var S,W=M.select("text.nv-legend-text");switch(M.on("mouseover",(function(t,e){h.legendMouseover(t,e)})).on("mouseout",(function(t,e){h.legendMouseout(t,e)})).on("click",(function(t,e){h.legendClick(t,e);var n=M.data();d&&("classic"==g?f?(n.forEach((function(t){t.disabled=!0})),t.disabled=!1):(t.disabled=!t.disabled,n.every((function(t){return t.disabled}))&&n.forEach((function(t){t.disabled=!1}))):"furious"==g&&(p?(t.disengaged=!t.disengaged,t.userDisabled=null==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled):p||(t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter((function(t){return!t.disengaged})).every((function(t){return t.userDisabled}))&&n.forEach((function(t){t.disabled=t.userDisabled=!1})))),h.stateChange({disabled:n.map((function(t){return!!t.disabled})),disengaged:n.map((function(t){return!!t.disengaged}))}))})).on("dblclick",(function(t,e){if(("furious"!=g||!p)&&(h.legendDblclick(t,e),d)){var n=M.data();n.forEach((function(t){t.disabled=!0,"furious"==g&&(t.userDisabled=t.disabled)})),t.disabled=!1,"furious"==g&&(t.userDisabled=t.disabled),h.stateChange({disabled:n.map((function(t){return!!t.disabled}))})}})),M.classed("nv-disabled",(function(t){return t.userDisabled})),M.exit().remove(),W.attr("fill",y).text((function(t){return o(i(t))})),g){case"furious":S=23;break;case"classic":S=20}if(l){var E=[];M.each((function(t,e){var n,a;if(o(i(t))&&o(i(t)).length>s){var l=o(i(t)).substring(0,s);n=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(t)))}else n=d3.select(this).select("text");try{if((a=n.node().getComputedTextLength())<=0)throw Error()}catch(t){a=r.utils.calcApproxTextWidth(n)}E.push(a+u)}));for(var F=0,D=0,_=[];D<m&&F<E.length;)_[F]=E[F],D+=E[F++];for(0===F&&(F=1);D>m&&F>1;){_=[],F--;for(var N=0;N<E.length;N++)E[N]>(_[N%F]||0)&&(_[N%F]=E[N]);D=_.reduce((function(t,e,n,r){return t+e}))}for(var O=[],L=0,B=0;L<F;L++)O[L]=B,B+=_[L];M.attr("transform",(function(t,e){return"translate("+O[e%F]+","+(5+Math.floor(e/F)*S)+")"})),c?w.attr("transform","translate("+(e-t.right-D)+","+t.top+")"):w.attr("transform","translate(0,"+t.top+")"),n=t.top+t.bottom+Math.ceil(E.length/F)*S}else{var T,P=5,z=5,I=0;M.attr("transform",(function(n,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return T=z,e<t.left+t.right+T+i&&(z=T=5,P+=S),(z+=i)>I&&(I=z),"translate("+T+","+P+")"})),w.attr("transform","translate("+(e-t.right-I)+","+t.top+")"),n=t.top+t.bottom+P+15}"furious"==g&&A.attr("width",(function(t,e){return W[0][e].getComputedTextLength()+27})).attr("height",18).attr("y",-9).attr("x",-15),A.style("fill",x).style("stroke",(function(t,e){return t.color||a(t,e)}))})),v}return v.dispatch=h,v.options=r.utils.optionsFunc.bind(v),v._options=Object.create({},{width:{get:function(){return e},set:function(t){e=t}},height:{get:function(){return n},set:function(t){n=t}},key:{get:function(){return i},set:function(t){i=t}},keyFormatter:{get:function(){return o},set:function(t){o=t}},align:{get:function(){return l},set:function(t){l=t}},rightAlign:{get:function(){return c},set:function(t){c=t}},maxKeyLength:{get:function(){return s},set:function(t){s=t}},padding:{get:function(){return u},set:function(t){u=t}},updateState:{get:function(){return d},set:function(t){d=t}},radioButtonMode:{get:function(){return f},set:function(t){f=t}},expanded:{get:function(){return p},set:function(t){p=t}},vers:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return a},set:function(t){a=r.utils.getColor(t)}}}),r.utils.initOptions(v),v},r.models.historicalBar=function(){"use strict";var t,e,n,i,o={top:0,right:0,bottom:0,left:0},a=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=[],g=[0],v=!1,m=!0,y=r.utils.defaultColor(),x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),b=!0,k=r.utils.renderWatch(x,0);function w(A){return A.each((function(w){k.reset(),u=d3.select(this);var A=r.utils.availableWidth(a,u,o),M=r.utils.availableHeight(s,u,o);r.utils.initSVG(u),c.domain(t||d3.extent(w[0].values.map(f).concat(h))),v?c.range(n||[.5*A/w[0].values.length,A*(w[0].values.length-.5)/w[0].values.length]):c.range(n||[0,A]),d.domain(e||d3.extent(w[0].values.map(p).concat(g))).range(i||[M,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var C=u.selectAll("g.nv-wrap.nv-historicalBar-"+l).data([w[0].values]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+l),W=S.append("defs"),E=S.append("g"),F=C.select("g");E.append("g").attr("class","nv-bars"),C.attr("transform","translate("+o.left+","+o.top+")"),u.on("click",(function(t,e){x.chartClick({data:t,index:e,pos:d3.event,id:l})})),W.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect"),C.select("#nv-chart-clip-path-"+l+" rect").attr("width",A).attr("height",M),F.attr("clip-path",m?"url(#nv-chart-clip-path-"+l+")":"");var D=C.select(".nv-bars").selectAll(".nv-bar").data((function(t){return t}),(function(t,e){return f(t,e)}));D.exit().remove(),D.enter().append("rect").attr("x",0).attr("y",(function(t,e){return r.utils.NaNtoZero(d(Math.max(0,p(t,e))))})).attr("height",(function(t,e){return r.utils.NaNtoZero(Math.abs(d(p(t,e))-d(0)))})).attr("transform",(function(t,e){return"translate("+(c(f(t,e))-A/w[0].values.length*.45)+",0)"})).on("mouseover",(function(t,e){b&&(d3.select(this).classed("hover",!0),x.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")}))})).on("mouseout",(function(t,e){b&&(d3.select(this).classed("hover",!1),x.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")}))})).on("mousemove",(function(t,e){b&&x.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){b&&(x.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation())})).on("dblclick",(function(t,e){b&&(x.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation())})),D.attr("fill",(function(t,e){return y(t,e)})).attr("class",(function(t,e,n){return(p(t,e)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+n+"-"+e})).watchTransition(k,"bars").attr("transform",(function(t,e){return"translate("+(c(f(t,e))-A/w[0].values.length*.45)+",0)"})).attr("width",A/w[0].values.length*.9),D.watchTransition(k,"bars").attr("y",(function(t,e){var n=p(t,e)<0?d(0):d(0)-d(p(t,e))<1?d(0)-1:d(p(t,e));return r.utils.NaNtoZero(n)})).attr("height",(function(t,e){return r.utils.NaNtoZero(Math.max(Math.abs(d(p(t,e))-d(0)),1))}))})),k.renderEnd("historicalBar immediate"),w}return w.highlightPoint=function(t,e){u.select(".nv-bars .nv-bar-0-"+t).classed("hover",e)},w.clearHighlights=function(){u.select(".nv-bars .nv-bar.hover").classed("hover",!1)},w.dispatch=x,w.options=r.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return h},set:function(t){h=t}},forceY:{get:function(){return g},set:function(t){g=t}},padData:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return t},set:function(e){t=e}},yDomain:{get:function(){return e},set:function(t){e=t}},xRange:{get:function(){return n},set:function(t){n=t}},yRange:{get:function(){return i},set:function(t){i=t}},clipEdge:{get:function(){return m},set:function(t){m=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return y},set:function(t){y=r.utils.getColor(t)}}}),r.utils.initOptions(w),w},r.models.historicalBarChart=function(t){"use strict";var e,n,i=t||r.models.historicalBar(),o=r.models.axis(),a=r.models.axis(),s=r.models.legend(),l=r.interactiveGuideline(),u=r.models.tooltip(),c={top:30,right:90,bottom:50,left:90},d=null,f=r.utils.defaultColor(),p=null,h=null,g=!1,v=!0,m=!0,y=!1,x=!1,b={},k=null,w=null,A=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),M=250;o.orient("bottom").tickPadding(7),a.orient(y?"right":"left"),u.duration(0).headerEnabled(!1).valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return o.tickFormat()(t,e)}));var C=r.utils.renderWatch(A,0);function S(t){return t.each((function(u){C.reset(),C.models(i),v&&C.models(o),m&&C.models(a);var w=d3.select(this);r.utils.initSVG(w);var W,E=r.utils.availableWidth(p,w,c),F=r.utils.availableHeight(h,w,c);if(S.update=function(){w.transition().duration(M).call(S)},S.container=this,b.disabled=u.map((function(t){return!!t.disabled})),!k)for(W in k={},b)b[W]instanceof Array?k[W]=b[W].slice(0):k[W]=b[W];if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return r.utils.noData(S,w),S;w.selectAll(".nv-noData").remove(),e=i.xScale(),n=i.yScale();var D=w.selectAll("g.nv-wrap.nv-historicalBarChart").data([u]),_=D.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),N=D.select("g");_.append("g").attr("class","nv-x nv-axis"),_.append("g").attr("class","nv-y nv-axis"),_.append("g").attr("class","nv-barsWrap"),_.append("g").attr("class","nv-legendWrap"),_.append("g").attr("class","nv-interactive"),g?(s.width(E),N.select(".nv-legendWrap").datum(u).call(s),d||s.height()===c.top||(c.top=s.height(),F=r.utils.availableHeight(h,w,c)),D.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):N.select(".nv-legendWrap").selectAll("*").remove(),D.attr("transform","translate("+c.left+","+c.top+")"),y&&N.select(".nv-y.nv-axis").attr("transform","translate("+E+",0)"),x&&(l.width(E).height(F).margin({left:c.left,top:c.top}).svgContainer(w).xScale(e),D.select(".nv-interactive").call(l)),i.width(E).height(F).color(u.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!u[e].disabled}))),N.select(".nv-barsWrap").datum(u.filter((function(t){return!t.disabled}))).transition().call(i),v&&(o.scale(e)._ticks(r.utils.calcTicksX(E/100,u)).tickSize(-F,0),N.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),N.select(".nv-x.nv-axis").transition().call(o)),m&&(a.scale(n)._ticks(r.utils.calcTicksY(F/36,u)).tickSize(-E,0),N.select(".nv-y.nv-axis").transition().call(a)),l.dispatch.on("elementMousemove",(function(t){i.clearHighlights();var e,n,s,c=[];u.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(o,a){n=r.interactiveBisect(o.values,t.pointXValue,S.x()),i.highlightPoint(n,!0);var l=o.values[n];void 0!==l&&(void 0===e&&(e=l),void 0===s&&(s=S.xScale()(S.x()(l,n))),c.push({key:o.key,value:S.y()(l,n),color:f(o,o.seriesIndex),data:o.values[n]}))}));var d=o.tickFormat()(S.x()(e,n));l.tooltip.valueFormatter((function(t,e){return a.tickFormat()(t)})).data({value:d,index:n,series:c})(),l.renderGuideLine(s)})),l.dispatch.on("elementMouseout",(function(t){A.tooltipHide(),i.clearHighlights()})),s.dispatch.on("legendClick",(function(e,n){e.disabled=!e.disabled,u.filter((function(t){return!t.disabled})).length||u.map((function(t){return t.disabled=!1,D.selectAll(".nv-series").classed("disabled",!1),t})),b.disabled=u.map((function(t){return!!t.disabled})),A.stateChange(b),t.transition().call(S)})),s.dispatch.on("legendDblclick",(function(t){u.forEach((function(t){t.disabled=!0})),t.disabled=!1,b.disabled=u.map((function(t){return!!t.disabled})),A.stateChange(b),S.update()})),A.on("changeState",(function(t){void 0!==t.disabled&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),b.disabled=t.disabled),S.update()}))})),C.renderEnd("historicalBarChart immediate"),S}return i.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:S.x()(t.data),value:S.y()(t.data),color:t.color},u.data(t).hidden(!1)})),i.dispatch.on("elementMouseout.tooltip",(function(t){u.hidden(!0)})),i.dispatch.on("elementMousemove.tooltip",(function(t){u()})),S.dispatch=A,S.bars=i,S.legend=s,S.xAxis=o,S.yAxis=a,S.interactiveLayer=l,S.tooltip=u,S.options=r.utils.optionsFunc.bind(S),S._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return g},set:function(t){g=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},defaultState:{get:function(){return k},set:function(t){k=t}},noData:{get:function(){return w},set:function(t){w=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t),s.color(f),i.color(f)}},duration:{get:function(){return M},set:function(t){M=t,C.reset(M),a.duration(M),o.duration(M)}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,a.orient(t?"right":"left")}},useInteractiveGuideline:{get:function(){return x},set:function(t){x=t,!0===t&&S.interactive(!1)}}}),r.utils.inheritOptions(S,i),r.utils.initOptions(S),S},r.models.ohlcBarChart=function(){var t=r.models.historicalBarChart(r.models.ohlcBar());return t.useInteractiveGuideline(!0),t.interactiveLayer.tooltip.contentGenerator((function(e){var n=e.series[0].data;return'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+e.value+"</h3><table><tr><td>open:</td><td>"+t.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+t.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+t.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+t.yAxis.tickFormat()(n.low)+"</td></tr></table>"})),t},r.models.candlestickBarChart=function(){var t=r.models.historicalBarChart(r.models.candlestickBar());return t.useInteractiveGuideline(!0),t.interactiveLayer.tooltip.contentGenerator((function(e){var n=e.series[0].data;return'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+e.value+"</h3><table><tr><td>open:</td><td>"+t.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+t.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+t.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+t.yAxis.tickFormat()(n.low)+"</td></tr></table>"})),t},r.models.legend=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},e=400,n=20,i=function(t){return t.key},o=function(t){return t},a=r.utils.getColor(),s=20,l=!0,u=32,c=!0,d=!0,f=!0,p=!1,h=!1,g=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),v="classic";function m(y){function x(t,e){return"furious"!=v?"#000":h?t.disengaged?"#000":"#fff":h?void 0:(t.color||(t.color=a(t,e)),t.disabled?t.color:"#fff")}function b(t,e){return h&&"furious"==v&&t.disengaged?"#eee":t.color||a(t,e)}function k(t,e){return h&&"furious"==v?1:t.disabled?0:1}return y.each((function(a){var m=e-t.left-t.right,y=d3.select(this);r.utils.initSVG(y);var w=y.selectAll("g.nv-legend").data([a]),A=w.enter().append("g").attr("class","nvd3 nv-legend").append("g"),M=w.select("g");c?w.attr("transform","translate("+-t.right+","+t.top+")"):w.attr("transform","translate("+t.left+","+t.top+")");var C,S,W=M.selectAll(".nv-series").data((function(t){return"furious"!=v?t:t.filter((function(t){return!!h||!t.disengaged}))})),E=W.enter().append("g").attr("class","nv-series");switch(v){case"furious":S=23;break;case"classic":S=20}"classic"==v?(E.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),C=W.select(".nv-legend-symbol")):"furious"==v&&(E.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),C=W.select(".nv-legend-symbol"),E.append("g").attr("class","nv-check-box").property("innerHTML",'<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr("transform","translate(-10,-8)scale(0.5)"),W.select(".nv-check-box").each((function(t,e){d3.select(this).selectAll("path").attr("stroke",x(t,e))}))),E.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var F=W.select("text.nv-legend-text");W.on("mouseover",(function(t,e){g.legendMouseover(t,e)})).on("mouseout",(function(t,e){g.legendMouseout(t,e)})).on("click",(function(t,e){g.legendClick(t,e);var n=W.data();d&&("classic"==v?p?(n.forEach((function(t){t.disabled=!0})),t.disabled=!1):(t.disabled=!t.disabled,n.every((function(t){return t.disabled}))&&n.forEach((function(t){t.disabled=!1}))):"furious"==v&&(h?(t.disengaged=!t.disengaged,t.userDisabled=null==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled):h||(t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter((function(t){return!t.disengaged})).every((function(t){return t.userDisabled}))&&n.forEach((function(t){t.disabled=t.userDisabled=!1})))),g.stateChange({disabled:n.map((function(t){return!!t.disabled})),disengaged:n.map((function(t){return!!t.disengaged}))}))})).on("dblclick",(function(t,e){if(f){if("furious"==v&&h)return;if(g.legendDblclick(t,e),d){var n=W.data();n.forEach((function(t){t.disabled=!0,"furious"==v&&(t.userDisabled=t.disabled)})),t.disabled=!1,"furious"==v&&(t.userDisabled=t.disabled),g.stateChange({disabled:n.map((function(t){return!!t.disabled}))})}}})),W.classed("nv-disabled",(function(t){return t.userDisabled})),W.exit().remove(),F.attr("fill",x).text((function(t){return o(i(t))}));var D=0;if(l){var _=[];W.each((function(t,e){var n,a;if(o(i(t))&&o(i(t)).length>s){var l=o(i(t)).substring(0,s);n=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(t)))}else n=d3.select(this).select("text");try{if((a=n.node().getComputedTextLength())<=0)throw Error()}catch(t){a=r.utils.calcApproxTextWidth(n)}_.push(a+u)}));var N=0,O=[];for(D=0;D<m&&N<_.length;)O[N]=_[N],D+=_[N++];for(0===N&&(N=1);D>m&&N>1;){O=[],N--;for(var L=0;L<_.length;L++)_[L]>(O[L%N]||0)&&(O[L%N]=_[L]);D=O.reduce((function(t,e,n,r){return t+e}))}for(var B=[],T=0,P=0;T<N;T++)B[T]=P,P+=O[T];W.attr("transform",(function(t,e){return"translate("+B[e%N]+","+(5+Math.floor(e/N)*S)+")"})),c?M.attr("transform","translate("+(e-t.right-D)+","+t.top+")"):M.attr("transform","translate(0,"+t.top+")"),n=t.top+t.bottom+Math.ceil(_.length/N)*S}else{var z,I=5,V=5,H=0;W.attr("transform",(function(n,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return z=V,e<t.left+t.right+z+i&&(V=z=5,I+=S),(V+=i)>H&&(H=V),D<z+H&&(D=z+H),"translate("+z+","+I+")"})),M.attr("transform","translate("+(e-t.right-H)+","+t.top+")"),n=t.top+t.bottom+I+15}"furious"==v&&(C.attr("width",(function(t,e){return F[0][e].getComputedTextLength()+27})).attr("height",18).attr("y",-9).attr("x",-15),A.insert("rect",":first-child").attr("class","nv-legend-bg").attr("fill","#eee").attr("opacity",0),M.select(".nv-legend-bg").transition().duration(300).attr("x",-S).attr("width",D+S-12).attr("height",n+10).attr("y",-t.top-10).attr("opacity",h?1:0)),C.style("fill",b).style("fill-opacity",k).style("stroke",b)})),m}return m.dispatch=g,m.options=r.utils.optionsFunc.bind(m),m._options=Object.create({},{width:{get:function(){return e},set:function(t){e=t}},height:{get:function(){return n},set:function(t){n=t}},key:{get:function(){return i},set:function(t){i=t}},keyFormatter:{get:function(){return o},set:function(t){o=t}},align:{get:function(){return l},set:function(t){l=t}},maxKeyLength:{get:function(){return s},set:function(t){s=t}},rightAlign:{get:function(){return c},set:function(t){c=t}},padding:{get:function(){return u},set:function(t){u=t}},updateState:{get:function(){return d},set:function(t){d=t}},enableDoubleClick:{get:function(){return f},set:function(t){f=t}},radioButtonMode:{get:function(){return p},set:function(t){p=t}},expanded:{get:function(){return h},set:function(t){h=t}},vers:{get:function(){return v},set:function(t){v=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return a},set:function(t){a=r.utils.getColor(t)}}}),r.utils.initOptions(m),m},r.models.line=function(){"use strict";var t,e,n=r.models.scatter(),i={top:0,right:0,bottom:0,left:0},o=960,a=500,s=null,l=r.utils.defaultColor(),u=function(t){return t.x},c=function(t){return t.y},d=function(t,e){return!isNaN(c(t,e))&&null!==c(t,e)},f=function(t){return t.area},p=!1,h="linear",g=250,v=d3.dispatch("elementClick","elementMouseover","elementMouseout","renderEnd");n.pointSize(16).pointDomain([16,256]);var m,y,x=r.utils.renderWatch(v,g);function b(g){return x.reset(),x.models(n),g.each((function(g){s=d3.select(this);var v=r.utils.availableWidth(o,s,i),b=r.utils.availableHeight(a,s,i);r.utils.initSVG(s),t=n.xScale(),e=n.yScale(),m=m||t,y=y||e;var k=s.selectAll("g.nv-wrap.nv-line").data([g]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),A=w.append("defs"),M=w.append("g"),C=k.select("g");M.append("g").attr("class","nv-groups"),M.append("g").attr("class","nv-scatterWrap"),k.attr("transform","translate("+i.left+","+i.top+")"),n.width(v).height(b);var S=k.select(".nv-scatterWrap");S.call(n),A.append("clipPath").attr("id","nv-edge-clip-"+n.id()).append("rect"),k.select("#nv-edge-clip-"+n.id()+" rect").attr("width",v).attr("height",b>0?b:0),C.attr("clip-path",p?"url(#nv-edge-clip-"+n.id()+")":""),S.attr("clip-path",p?"url(#nv-edge-clip-"+n.id()+")":"");var W=k.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));W.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",(function(t){return t.strokeWidth||1.5})).style("fill-opacity",1e-6),W.exit().remove(),W.attr("class",(function(t,e){return(t.classed||"")+" nv-group nv-series-"+e})).classed("hover",(function(t){return t.hover})).style("fill",(function(t,e){return l(t,e)})).style("stroke",(function(t,e){return l(t,e)})),W.watchTransition(x,"line: groups").style("stroke-opacity",1).style("fill-opacity",(function(t){return t.fillOpacity||.5}));var E=W.selectAll("path.nv-area").data((function(t){return f(t)?[t]:[]}));E.enter().append("path").attr("class","nv-area").attr("d",(function(t){return d3.svg.area().interpolate(h).defined(d).x((function(t,e){return r.utils.NaNtoZero(m(u(t,e)))})).y0((function(t,e){return r.utils.NaNtoZero(y(c(t,e)))})).y1((function(t,n){return y(e.domain()[0]<=0?e.domain()[1]>=0?0:e.domain()[1]:e.domain()[0])})).apply(this,[t.values])})),W.exit().selectAll("path.nv-area").remove(),E.watchTransition(x,"line: areaPaths").attr("d",(function(n){return d3.svg.area().interpolate(h).defined(d).x((function(e,n){return r.utils.NaNtoZero(t(u(e,n)))})).y0((function(t,n){return r.utils.NaNtoZero(e(c(t,n)))})).y1((function(t,n){return e(e.domain()[0]<=0?e.domain()[1]>=0?0:e.domain()[1]:e.domain()[0])})).apply(this,[n.values])}));var F=W.selectAll("path.nv-line").data((function(t){return[t.values]}));F.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(h).defined(d).x((function(t,e){return r.utils.NaNtoZero(m(u(t,e)))})).y((function(t,e){return r.utils.NaNtoZero(y(c(t,e)))}))),F.watchTransition(x,"line: linePaths").attr("d",d3.svg.line().interpolate(h).defined(d).x((function(e,n){return r.utils.NaNtoZero(t(u(e,n)))})).y((function(t,n){return r.utils.NaNtoZero(e(c(t,n)))}))),m=t.copy(),y=e.copy()})),x.renderEnd("line immediate"),b}return b.dispatch=v,b.scatter=n,n.dispatch.on("elementClick",(function(){v.elementClick.apply(this,arguments)})),n.dispatch.on("elementMouseover",(function(){v.elementMouseover.apply(this,arguments)})),n.dispatch.on("elementMouseout",(function(){v.elementMouseout.apply(this,arguments)})),b.options=r.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},defined:{get:function(){return d},set:function(t){d=t}},interpolate:{get:function(){return h},set:function(t){h=t}},clipEdge:{get:function(){return p},set:function(t){p=t}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},duration:{get:function(){return g},set:function(t){g=t,x.reset(g),n.duration(g)}},isArea:{get:function(){return f},set:function(t){f=d3.functor(t)}},x:{get:function(){return u},set:function(t){u=t,n.x(t)}},y:{get:function(){return c},set:function(t){c=t,n.y(t)}},color:{get:function(){return l},set:function(t){l=r.utils.getColor(t),n.color(l)}}}),r.utils.inheritOptions(b,n),r.utils.initOptions(b),b},r.models.lineChart=function(){"use strict";var t,e,n=r.models.line(),i=r.models.axis(),o=r.models.axis(),a=r.models.legend(),s=r.interactiveGuideline(),l=r.models.tooltip(),u=r.models.focus(r.models.line()),c={top:30,right:20,bottom:50,left:60},d=null,f=r.utils.defaultColor(),p=null,h=null,g=!0,v="top",m=!0,y=!0,x=!1,b=!1,k=!1,w=r.utils.state(),A=null,M=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=250;i.orient("bottom").tickPadding(7),o.orient(x?"right":"left"),n.clipEdge(!0).duration(0),l.valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.tooltip.valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)}));var W=r.utils.renderWatch(C,S);function E(l){return W.reset(),W.models(n),m&&W.models(i),y&&W.models(o),l.each((function(l){var M=d3.select(this);r.utils.initSVG(M);var W,F=r.utils.availableWidth(p,M,c),D=r.utils.availableHeight(h,M,c)-(k?u.height():0);if(E.update=function(){0===S?M.call(E):M.transition().duration(S).call(E)},E.container=this,w.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(l),E.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(l)).update(),w.disabled=l.map((function(t){return!!t.disabled})),!A)for(W in A={},w)w[W]instanceof Array?A[W]=w[W].slice(0):A[W]=w[W];if(!(l&&l.length&&l.filter((function(t){return t.values.length})).length))return r.utils.noData(E,M),E;M.selectAll(".nv-noData").remove(),u.dispatch.on("onBrush",(function(t){I(t)})),t=n.xScale(),e=n.yScale();var _=M.selectAll("g.nv-wrap.nv-lineChart").data([l]),N=_.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),O=_.select("g");N.append("g").attr("class","nv-legendWrap");var L=N.append("g").attr("class","nv-focus");L.append("g").attr("class","nv-background").append("rect"),L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis"),L.append("g").attr("class","nv-linesWrap"),L.append("g").attr("class","nv-interactive"),N.append("g").attr("class","nv-focusWrap"),g?(a.width(F),O.select(".nv-legendWrap").datum(l).call(a),"bottom"===v?(c.bottom=i.height()+a.height(),D=r.utils.availableHeight(h,M,c),O.select(".nv-legendWrap").attr("transform","translate(0,"+(D+i.height())+")")):"top"===v&&(d||a.height()===c.top||(c.top=a.height(),D=r.utils.availableHeight(h,M,c)-(k?u.height():0)),_.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")"))):O.select(".nv-legendWrap").selectAll("*").remove(),_.attr("transform","translate("+c.left+","+c.top+")"),x&&O.select(".nv-y.nv-axis").attr("transform","translate("+F+",0)"),b&&(s.width(F).height(D).margin({left:c.left,top:c.top}).svgContainer(M).xScale(t),_.select(".nv-interactive").call(s)),O.select(".nv-focus .nv-background rect").attr("width",F).attr("height",D),n.width(F).height(D).color(l.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!l[e].disabled})));var B=O.select(".nv-linesWrap").datum(l.filter((function(t){return!t.disabled})));function T(){m&&O.select(".nv-focus .nv-x.nv-axis").transition().duration(S).call(i)}function P(){y&&O.select(".nv-focus .nv-y.nv-axis").transition().duration(S).call(o)}if(m&&i.scale(t)._ticks(r.utils.calcTicksX(F/100,l)).tickSize(-D,0),y&&o.scale(e)._ticks(r.utils.calcTicksY(D/36,l)).tickSize(-F,0),O.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+D+")"),k||null!==u.brush.extent()){u.width(F),O.select(".nv-focusWrap").style("display",k?"initial":"none").attr("transform","translate(0,"+(D+c.bottom+u.margin().top)+")").call(u);var z=u.brush.empty()?u.xDomain():u.brush.extent();null!==z&&I(z)}else B.call(n),T(),P();function I(t){O.select(".nv-focus .nv-linesWrap").datum(l.filter((function(t){return!t.disabled})).map((function(e,r){return{key:e.key,area:e.area,classed:e.classed,values:e.values.filter((function(e,r){return n.x()(e,r)>=t[0]&&n.x()(e,r)<=t[1]})),disableTooltip:e.disableTooltip}}))).transition().duration(S).call(n),T(),P()}a.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];C.stateChange(w),E.update()})),s.dispatch.on("elementMousemove",(function(e){n.clearHighlights();var i,a,c,d=[];if(l.filter((function(t,e){return t.seriesIndex=e,!t.disabled&&!t.disableTooltip})).forEach((function(o,s){var l=null!==u.brush.extent()?u.brush.empty()?u.xScale().domain():u.brush.extent():t.domain(),p=o.values.filter((function(t,e){return l[0]<=l[1]?n.x()(t,e)>=l[0]&&n.x()(t,e)<=l[1]:n.x()(t,e)>=l[1]&&n.x()(t,e)<=l[0]})),h=p[a=r.interactiveBisect(p,e.pointXValue,n.x())],g=E.y()(h,a);null!==g&&n.highlightPoint(s,a,!0),void 0!==h&&(void 0===i&&(i=h),void 0===c&&(c=E.xScale()(E.x()(h,a))),d.push({key:o.key,value:g,color:f(o,o.seriesIndex),data:h}))})),d.length>2){var p=E.yScale().invert(e.mouseY),h=.03*Math.abs(E.yScale().domain()[0]-E.yScale().domain()[1]),g=r.nearestValueIndex(d.map((function(t){return t.value})),p,h);null!==g&&(d[g].highlight=!0)}s.tooltip.valueFormatter(s.tooltip.valueFormatter()||function(t,e){return null==t?"N/A":o.tickFormat()(t)}).data({value:E.x()(i,a),index:a,series:d})(),s.renderGuideLine(c)})),s.dispatch.on("elementClick",(function(t){var e,i=[];l.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(n){var o=r.interactiveBisect(n.values,t.pointXValue,E.x()),a=n.values[o];if(void 0!==a){void 0===e&&(e=E.xScale()(E.x()(a,o)));var s=E.yScale()(E.y()(a,o));i.push({point:a,pointIndex:o,pos:[e,s],seriesIndex:n.seriesIndex,series:n})}})),n.dispatch.elementClick(i)})),s.dispatch.on("elementMouseout",(function(t){n.clearHighlights()})),C.on("changeState",(function(t){void 0!==t.disabled&&l.length===t.disabled.length&&(l.forEach((function(e,n){e.disabled=t.disabled[n]})),w.disabled=t.disabled),E.update()}))})),W.renderEnd("lineChart immediate"),E}return n.dispatch.on("elementMouseover.tooltip",(function(t){t.series.disableTooltip||l.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){l.hidden(!0)})),E.dispatch=C,E.lines=n,E.legend=a,E.focus=u,E.xAxis=i,E.x2Axis=u.xAxis,E.yAxis=o,E.y2Axis=u.yAxis,E.interactiveLayer=s,E.tooltip=l,E.state=w,E.dispatch=C,E.options=r.utils.optionsFunc.bind(E),E._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return g},set:function(t){g=t}},legendPosition:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return m},set:function(t){m=t}},showYAxis:{get:function(){return y},set:function(t){y=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return M},set:function(t){M=t}},focusEnable:{get:function(){return k},set:function(t){k=t}},focusHeight:{get:function(){return u.height()},set:function(t){u.height(t)}},focusShowAxisX:{get:function(){return u.showXAxis()},set:function(t){u.showXAxis(t)}},focusShowAxisY:{get:function(){return u.showYAxis()},set:function(t){u.showYAxis(t)}},brushExtent:{get:function(){return u.brushExtent()},set:function(t){u.brushExtent(t)}},focusMargin:{get:function(){return u.margin},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),u.margin.right=void 0!==t.right?t.right:u.margin.right,u.margin.bottom=void 0!==t.bottom?t.bottom:u.margin.bottom,u.margin.left=void 0!==t.left?t.left:u.margin.left}},margin:{get:function(){return c},set:function(t){c.top=void 0!==t.top?t.top:c.top,c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return S},set:function(t){S=t,W.reset(S),n.duration(S),u.duration(S),i.duration(S),o.duration(S)}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t),a.color(f),n.color(f),u.color(f)}},interpolate:{get:function(){return n.interpolate()},set:function(t){n.interpolate(t),u.interpolate(t)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t),u.xTickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t),u.yTickFormat(t)}},x:{get:function(){return n.x()},set:function(t){n.x(t),u.x(t)}},y:{get:function(){return n.y()},set:function(t){n.y(t),u.y(t)}},rightAlignYAxis:{get:function(){return x},set:function(t){x=t,o.orient(x?"right":"left")}},useInteractiveGuideline:{get:function(){return b},set:function(t){(b=t)&&(n.interactive(!1),n.useVoronoi(!1))}}}),r.utils.inheritOptions(E,n),r.utils.initOptions(E),E},r.models.lineWithFocusChart=function(){return r.models.lineChart().margin({bottom:30}).focusEnable(!0)},r.models.linePlusBarChart=function(){"use strict";var t,e,n,i,o,a,s,l=r.models.line(),u=r.models.line(),c=r.models.historicalBar(),d=r.models.historicalBar(),f=r.models.axis(),p=r.models.axis(),h=r.models.axis(),g=r.models.axis(),v=r.models.axis(),m=r.models.axis(),y=r.models.legend(),x=d3.svg.brush(),b=r.models.tooltip(),k={top:30,right:30,bottom:30,left:60},w=null,A={top:0,right:30,bottom:20,left:60},M=null,C=null,S=function(t){return t.x},W=function(t){return t.y},E=r.utils.defaultColor(),F=!0,D=!0,_=!1,N=!0,O=50,L=null,B=null,T=d3.dispatch("brush","stateChange","changeState"),P=0,z=r.utils.state(),I=null,V=" (left axis)",H=" (right axis)",Y=!1;l.clipEdge(!0),u.interactive(!1),u.pointActive((function(t){return!1})),f.orient("bottom").tickPadding(5),h.orient("left"),g.orient("right"),p.orient("bottom").tickPadding(5),v.orient("left"),m.orient("right"),b.headerEnabled(!0).headerFormatter((function(t,e){return f.tickFormat()(t,e)}));var G=function(t){return t.every((function(t){return t.disabled}))};function R(b){return b.each((function(b){var B=d3.select(this);r.utils.initSVG(B);var X,j=r.utils.availableWidth(M,B,k),Z=r.utils.availableHeight(C,B,k)-(D?O:0),q=O-A.top-A.bottom;if(R.update=function(){B.transition().duration(P).call(R)},R.container=this,z.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(b),R.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(b)).update(),z.disabled=b.map((function(t){return!!t.disabled})),!I)for(X in I={},z)z[X]instanceof Array?I[X]=z[X].slice(0):I[X]=z[X];if(!(b&&b.length&&b.filter((function(t){return t.values.length})).length))return r.utils.noData(R,B),R;B.selectAll(".nv-noData").remove();var K=b.filter((function(t){return!t.disabled&&t.bar})),U=b.filter((function(t){return!t.bar}));e=K.length&&!Y?c.xScale():l.xScale(),n=p.scale(),i=Y?l.yScale():c.yScale(),o=Y?c.yScale():l.yScale(),a=Y?u.yScale():d.yScale(),s=Y?d.yScale():u.yScale();var Q=b.filter((function(t){return!t.disabled&&(Y?!t.bar:t.bar)})).map((function(t){return t.values.map((function(t,e){return{x:S(t,e),y:W(t,e)}}))})),$=b.filter((function(t){return!t.disabled&&(Y?t.bar:!t.bar)})).map((function(t){return t.values.map((function(t,e){return{x:S(t,e),y:W(t,e)}}))}));e.range([0,j]),n.domain(d3.extent(d3.merge(Q.concat($)),(function(t){return t.x}))).range([0,j]);var J=B.selectAll("g.nv-wrap.nv-linePlusBar").data([b]),tt=J.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),et=J.select("g");tt.append("g").attr("class","nv-legendWrap");var nt=tt.append("g").attr("class","nv-focus");nt.append("g").attr("class","nv-x nv-axis"),nt.append("g").attr("class","nv-y1 nv-axis"),nt.append("g").attr("class","nv-y2 nv-axis"),nt.append("g").attr("class","nv-barsWrap"),nt.append("g").attr("class","nv-linesWrap");var rt=tt.append("g").attr("class","nv-context");if(rt.append("g").attr("class","nv-x nv-axis"),rt.append("g").attr("class","nv-y1 nv-axis"),rt.append("g").attr("class","nv-y2 nv-axis"),rt.append("g").attr("class","nv-barsWrap"),rt.append("g").attr("class","nv-linesWrap"),rt.append("g").attr("class","nv-brushBackground"),rt.append("g").attr("class","nv-x nv-brush"),F){var it=y.align()?j/2:j,ot=y.align()?it:0;y.width(it),et.select(".nv-legendWrap").datum(b.map((function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=Y?t.originalKey+(t.bar?H:V):t.originalKey+(t.bar?V:H),t}))).call(y),w||y.height()===k.top||(k.top=y.height(),Z=r.utils.availableHeight(C,B,k)-O),et.select(".nv-legendWrap").attr("transform","translate("+ot+","+-k.top+")")}else et.select(".nv-legendWrap").selectAll("*").remove();J.attr("transform","translate("+k.left+","+k.top+")"),et.select(".nv-context").style("display",D?"initial":"none"),d.width(j).height(q).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&b[e].bar}))),u.width(j).height(q).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&!b[e].bar})));var at=et.select(".nv-context .nv-barsWrap").datum(K.length?K:[{values:[]}]),st=et.select(".nv-context .nv-linesWrap").datum(G(U)?[{values:[]}]:U.filter((function(t){return!t.disabled})));et.select(".nv-context").attr("transform","translate(0,"+(Z+k.bottom+A.top)+")"),at.transition().call(d),st.transition().call(u),N&&(p._ticks(r.utils.calcTicksX(j/100,b)).tickSize(-q,0),et.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+a.range()[0]+")"),et.select(".nv-context .nv-x.nv-axis").transition().call(p)),_&&(v.scale(a)._ticks(q/36).tickSize(-j,0),m.scale(s)._ticks(q/36).tickSize(K.length?0:-j,0),et.select(".nv-context .nv-y3.nv-axis").style("opacity",K.length?1:0).attr("transform","translate(0,"+n.range()[0]+")"),et.select(".nv-context .nv-y2.nv-axis").style("opacity",U.length?1:0).attr("transform","translate("+n.range()[1]+",0)"),et.select(".nv-context .nv-y1.nv-axis").transition().call(v),et.select(".nv-context .nv-y2.nv-axis").transition().call(m)),x.x(n).on("brush",dt),L&&x.extent(L);var lt=et.select(".nv-brushBackground").selectAll("g").data([L||x.extent()]),ut=lt.enter().append("g");ut.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",q),ut.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",q);var ct=et.select(".nv-x.nv-brush").call(x);function dt(){L=x.empty()?null:x.extent(),t=x.empty()?n.domain():x.extent(),T.brush({extent:t,brush:x}),x.empty()||x.extent(L),lt.data([x.empty()?n.domain():L]).each((function(t,e){var r=n(t[0])-n.range()[0],i=n.range()[1]-n(t[1]);d3.select(this).select(".left").attr("width",r<0?0:r),d3.select(this).select(".right").attr("x",n(t[1])).attr("width",i<0?0:i)})),c.width(j).height(Z).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&b[e].bar}))),l.width(j).height(Z).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&!b[e].bar})));var a=et.select(".nv-focus .nv-barsWrap").datum(K.length?K.map((function(e,n){return{key:e.key,values:e.values.filter((function(e,n){return c.x()(e,n)>=t[0]&&c.x()(e,n)<=t[1]}))}})):[{values:[]}]),s=et.select(".nv-focus .nv-linesWrap").datum(G(U)?[{values:[]}]:U.filter((function(t){return!t.disabled})).map((function(e,n){return{area:e.area,fillOpacity:e.fillOpacity,strokeWidth:e.strokeWidth,key:e.key,values:e.values.filter((function(e,n){return l.x()(e,n)>=t[0]&&l.x()(e,n)<=t[1]}))}})));e=K.length&&!Y?c.xScale():l.xScale(),f.scale(e)._ticks(r.utils.calcTicksX(j/100,b)).tickSize(-Z,0),f.domain([Math.ceil(t[0]),Math.floor(t[1])]),et.select(".nv-x.nv-axis").transition().duration(P).call(f),a.transition().duration(P).call(c),s.transition().duration(P).call(l),et.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+i.range()[0]+")"),h.scale(i)._ticks(r.utils.calcTicksY(Z/36,b)).tickSize(-j,0),g.scale(o)._ticks(r.utils.calcTicksY(Z/36,b)),Y?g.tickSize(U.length?0:-j,0):g.tickSize(K.length?0:-j,0);var u=K.length?1:0,d=U.length&&!G(U)?1:0,p=Y?d:u,v=Y?u:d;et.select(".nv-focus .nv-y1.nv-axis").style("opacity",p),et.select(".nv-focus .nv-y2.nv-axis").style("opacity",v).attr("transform","translate("+e.range()[1]+",0)"),et.select(".nv-focus .nv-y1.nv-axis").transition().duration(P).call(h),et.select(".nv-focus .nv-y2.nv-axis").transition().duration(P).call(g)}ct.selectAll("rect").attr("height",q),ct.selectAll(".resize").append("path").attr("d",(function(t){var e=+("e"==t),n=e?1:-1,r=q/3;return"M"+.5*n+","+r+"A6,6 0 0 "+e+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+e+" "+.5*n+","+2*r+"ZM"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)})),y.dispatch.on("stateChange",(function(t){for(var e in t)z[e]=t[e];T.stateChange(z),R.update()})),T.on("changeState",(function(t){void 0!==t.disabled&&(b.forEach((function(e,n){e.disabled=t.disabled[n]})),z.disabled=t.disabled),R.update()})),dt()})),R}return l.dispatch.on("elementMouseover.tooltip",(function(t){b.duration(100).valueFormatter((function(t,e){return(Y?{main:h,focus:v}:{main:g,focus:m}).main.tickFormat()(t,e)})).data(t).hidden(!1)})),l.dispatch.on("elementMouseout.tooltip",(function(t){b.hidden(!0)})),c.dispatch.on("elementMouseover.tooltip",(function(t){t.value=R.x()(t.data),t.series={value:R.y()(t.data),color:t.color},b.duration(0).valueFormatter((function(t,e){return(Y?{main:g,focus:m}:{main:h,focus:v}).main.tickFormat()(t,e)})).data(t).hidden(!1)})),c.dispatch.on("elementMouseout.tooltip",(function(t){b.hidden(!0)})),c.dispatch.on("elementMousemove.tooltip",(function(t){b()})),R.dispatch=T,R.legend=y,R.lines=l,R.lines2=u,R.bars=c,R.bars2=d,R.xAxis=f,R.x2Axis=p,R.y1Axis=h,R.y2Axis=g,R.y3Axis=v,R.y4Axis=m,R.tooltip=b,R.options=r.utils.optionsFunc.bind(R),R._options=Object.create({},{width:{get:function(){return M},set:function(t){M=t}},height:{get:function(){return C},set:function(t){C=t}},showLegend:{get:function(){return F},set:function(t){F=t}},brushExtent:{get:function(){return L},set:function(t){L=t}},noData:{get:function(){return B},set:function(t){B=t}},focusEnable:{get:function(){return D},set:function(t){D=t}},focusHeight:{get:function(){return O},set:function(t){O=t}},focusShowAxisX:{get:function(){return N},set:function(t){N=t}},focusShowAxisY:{get:function(){return _},set:function(t){_=t}},legendLeftAxisHint:{get:function(){return V},set:function(t){V=t}},legendRightAxisHint:{get:function(){return H},set:function(t){H=t}},margin:{get:function(){return k},set:function(t){void 0!==t.top&&(k.top=t.top,w=t.top),k.right=void 0!==t.right?t.right:k.right,k.bottom=void 0!==t.bottom?t.bottom:k.bottom,k.left=void 0!==t.left?t.left:k.left}},focusMargin:{get:function(){return A},set:function(t){A.top=void 0!==t.top?t.top:A.top,A.right=void 0!==t.right?t.right:A.right,A.bottom=void 0!==t.bottom?t.bottom:A.bottom,A.left=void 0!==t.left?t.left:A.left}},duration:{get:function(){return P},set:function(t){P=t}},color:{get:function(){return E},set:function(t){E=r.utils.getColor(t),y.color(E)}},x:{get:function(){return S},set:function(t){S=t,l.x(t),u.x(t),c.x(t),d.x(t)}},y:{get:function(){return W},set:function(t){W=t,l.y(t),u.y(t),c.y(t),d.y(t)}},switchYAxisOrder:{get:function(){return Y},set:function(t){if(Y!==t){var e=h;h=g,g=e;var n=v;v=m,m=n}Y=t,h.orient("left"),g.orient("right"),v.orient("left"),m.orient("right")}}}),r.utils.inheritOptions(R,l),r.utils.initOptions(R),R},r.models.multiBar=function(){"use strict";var t,e,n,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=d3.scale.ordinal(),f=d3.scale.linear(),p=Math.floor(1e4*Math.random()),h=null,g=function(t){return t.x},v=function(t){return t.y},m=[0],y=!0,x=!1,b="zero",k=r.utils.defaultColor(),w=!1,A=null,M=500,C=.1,S=.75,W=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=r.utils.renderWatch(W,M),F=0;function D(_){return E.reset(),_.each((function(D){var _=u-l.left-l.right,N=c-l.top-l.bottom;h=d3.select(this),r.utils.initSVG(h);var O=0;if(w&&D.length&&(w=[{values:D[0].values.map((function(t){return{x:t.x,y:0,series:t.series,size:.01}}))}]),x){var L=d3.layout.stack().offset(b).values((function(t){return t.values})).y(v)(!D.length&&w?w:D);L.forEach((function(t,e){t.nonStackable?(D[e].nonStackableSeries=O++,L[e]=D[e]):e>0&&L[e-1].nonStackable&&L[e].values.map((function(t,n){t.y0-=L[e-1].values[n].y,t.y1=t.y0+t.y}))})),D=L}D.forEach((function(t,e){t.values.forEach((function(n){n.series=e,n.key=t.key}))})),x&&D.length>0&&D[0].values.map((function(t,e){var n=0,r=0;D.map((function(t,i){if(!D[i].nonStackable){var o=t.values[e];o.size=Math.abs(o.y),o.y<0?(o.y1=r,r-=o.size):(o.y1=o.size+n,n+=o.size)}}))}));var B=e&&n?[]:D.map((function(t,e){return t.values.map((function(t,n){return{x:g(t,n),y:v(t,n),y0:t.y0,y1:t.y1,idx:e}}))}));d.domain(e||d3.merge(B).map((function(t){return t.x}))).rangeBands(i||[0,_],C),f.domain(n||d3.extent(d3.merge(B).map((function(t){var e=t.y;return x&&!D[t.idx].nonStackable&&(e=t.y>0?t.y1:t.y1+t.y),e})).concat(m))).range(o||[N,0]),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]-.01*d.domain()[0],d.domain()[1]+.01*d.domain()[1]]):d.domain([-1,1])),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]+.01*f.domain()[0],f.domain()[1]-.01*f.domain()[1]]):f.domain([-1,1])),a=a||d,s=s||f;var T=h.selectAll("g.nv-wrap.nv-multibar").data([D]),P=T.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),z=P.append("defs"),I=P.append("g"),V=T.select("g");I.append("g").attr("class","nv-groups"),T.attr("transform","translate("+l.left+","+l.top+")"),z.append("clipPath").attr("id","nv-edge-clip-"+p).append("rect"),T.select("#nv-edge-clip-"+p+" rect").attr("width",_).attr("height",N),V.attr("clip-path",y?"url(#nv-edge-clip-"+p+")":"");var H=T.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t,e){return e}));H.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var Y=E.transition(H.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,M)).attr("y",(function(t,e,n){var r=s(0)||0;return x&&D[t.series]&&!D[t.series].nonStackable&&(r=s(t.y0)),r})).attr("height",0).remove();Y.delay&&Y.delay((function(t,e){return e*(M/(F+1))-e})),H.attr("class",(function(t,e){return"nv-group nv-series-"+e})).classed("hover",(function(t){return t.hover})).style("fill",(function(t,e){return k(t,e)})).style("stroke",(function(t,e){return k(t,e)})),H.style("stroke-opacity",1).style("fill-opacity",S);var G=H.selectAll("rect.nv-bar").data((function(t){return w&&!D.length?w.values:t.values}));G.exit().remove(),G.enter().append("rect").attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})).attr("x",(function(t,e,n){return x&&!D[n].nonStackable?0:n*d.rangeBand()/D.length})).attr("y",(function(t,e,n){return s(x&&!D[n].nonStackable?t.y0:0)||0})).attr("height",0).attr("width",(function(t,e,n){return d.rangeBand()/(x&&!D[n].nonStackable?1:D.length)})).attr("transform",(function(t,e){return"translate("+d(g(t,e))+",0)"})),G.style("fill",(function(t,e,n){return k(t,n,e)})).style("stroke",(function(t,e,n){return k(t,n,e)})).on("mouseover",(function(t,e,n){d3.select(this).classed("hover",!0),W.elementMouseover({data:t,index:e,series:D[n],color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e,n){d3.select(this).classed("hover",!1),W.elementMouseout({data:t,index:e,series:D[n],color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e,n){W.elementMousemove({data:t,index:e,series:D[n],color:d3.select(this).style("fill")})})).on("click",(function(t,e,n){W.elementClick({data:t,index:e,series:D[n],color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e,n){W.elementDblClick({data:t,index:e,series:D[n],color:d3.select(this).style("fill")}),d3.event.stopPropagation()})),G.attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})).attr("transform",(function(t,e){return"translate("+d(g(t,e))+",0)"})),A&&(t||(t=D.map((function(){return!0}))),G.style("fill",(function(e,n,r){return d3.rgb(A(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})).style("stroke",(function(e,n,r){return d3.rgb(A(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})));var R=G.watchTransition(E,"multibar",Math.min(250,M)).delay((function(t,e){return e*M/D[0].values.length}));x?R.attr("y",(function(t,e,n){return D[n].nonStackable?v(t,e)<0?f(0):f(0)-f(v(t,e))<-1?f(0)-1:f(v(t,e))||0:f(t.y1)})).attr("height",(function(t,e,n){return D[n].nonStackable?Math.max(Math.abs(f(v(t,e))-f(0)),0)||0:Math.max(Math.abs(f(t.y+t.y0)-f(t.y0)),0)})).attr("x",(function(t,e,n){var r=0;return D[n].nonStackable&&(r=t.series*d.rangeBand()/D.length,D.length!==O&&(r=D[n].nonStackableSeries*d.rangeBand()/(2*O))),r})).attr("width",(function(t,e,n){if(D[n].nonStackable){var r=d.rangeBand()/O;return D.length!==O&&(r=d.rangeBand()/(2*O)),r}return d.rangeBand()})):R.attr("x",(function(t,e){return t.series*d.rangeBand()/D.length})).attr("width",d.rangeBand()/D.length).attr("y",(function(t,e){return v(t,e)<0?f(0):f(0)-f(v(t,e))<1?f(0)-1:f(v(t,e))||0})).attr("height",(function(t,e){return Math.max(Math.abs(f(v(t,e))-f(0)),1)||0})),a=d.copy(),s=f.copy(),D[0]&&D[0].values&&(F=D[0].values.length)})),E.renderEnd("multibar immediate"),D}return D.dispatch=W,D.options=r.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},xScale:{get:function(){return d},set:function(t){d=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceY:{get:function(){return m},set:function(t){m=t}},stacked:{get:function(){return x},set:function(t){x=t}},stackOffset:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return y},set:function(t){y=t}},disabled:{get:function(){return t},set:function(e){t=e}},id:{get:function(){return p},set:function(t){p=t}},hideable:{get:function(){return w},set:function(t){w=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return S},set:function(t){S=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return M},set:function(t){M=t,E.reset(M)}},color:{get:function(){return k},set:function(t){k=r.utils.getColor(t)}},barColor:{get:function(){return A},set:function(t){A=t?r.utils.getColor(t):null}}}),r.utils.initOptions(D),D},r.models.multiBarChart=function(){"use strict";var t,e,n=r.models.multiBar(),i=r.models.axis(),o=r.models.axis(),a=r.interactiveGuideline(),s=r.models.legend(),l=r.models.legend(),u=r.models.tooltip(),c={top:30,right:20,bottom:50,left:60},d=null,f=null,p=null,h=r.utils.defaultColor(),g=!0,v={},m=!0,y=null,x=!0,b=!0,k=!1,w=!0,A=!1,M=!1,C=0,S=r.utils.state(),W=null,E=null,F=d3.dispatch("stateChange","changeState","renderEnd"),D=function(){return g?180:0},_=250,N=!1;S.stacked=!1,n.stacked(!1),i.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat((function(t){return t})),o.orient(k?"right":"left").tickFormat(d3.format(",.1f")),u.duration(0).valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),a.tooltip.valueFormatter((function(t,e){return null==t?"N/A":o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),a.tooltip.valueFormatter((function(t,e){return null==t?"N/A":o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),a.tooltip.duration(0).valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),l.updateState(!1);var O=r.utils.renderWatch(F),L=!1;function B(E){return O.reset(),O.models(n),x&&O.models(i),b&&O.models(o),E.each((function(E){var O=d3.select(this);r.utils.initSVG(O);var T,P=r.utils.availableWidth(f,O,c),z=r.utils.availableHeight(p,O,c);if(B.update=function(){0===_?O.call(B):O.transition().duration(_).call(B)},B.container=this,S.setter(function(t){return function(e){void 0!==e.stacked&&(L=e.stacked),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(E),B.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),stacked:L}}}(E)).update(),S.disabled=E.map((function(t){return!!t.disabled})),!W)for(T in W={},S)S[T]instanceof Array?W[T]=S[T].slice(0):W[T]=S[T];if(!(E&&E.length&&E.filter((function(t){return t.values.length})).length))return r.utils.noData(B,O),B;O.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale();var I=O.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([E]),V=I.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),H=I.select("g");if(V.append("g").attr("class","nv-x nv-axis"),V.append("g").attr("class","nv-y nv-axis"),V.append("g").attr("class","nv-barsWrap"),V.append("g").attr("class","nv-legendWrap"),V.append("g").attr("class","nv-controlsWrap"),V.append("g").attr("class","nv-interactive"),m?"bottom"===y?(s.width(P-c.right),H.select(".nv-legendWrap").datum(E).call(s),c.bottom=i.height()+s.height(),z=r.utils.availableHeight(p,O,c),H.select(".nv-legendWrap").attr("transform","translate(0,"+(z+i.height())+")")):(s.width(P-D()),H.select(".nv-legendWrap").datum(E).call(s),d||s.height()===c.top||(c.top=s.height(),z=r.utils.availableHeight(p,O,c)),H.select(".nv-legendWrap").attr("transform","translate("+D()+","+-c.top+")")):H.select(".nv-legendWrap").selectAll("*").remove(),g){var Y=[{key:v.grouped||"Grouped",disabled:n.stacked()},{key:v.stacked||"Stacked",disabled:!n.stacked()}];l.width(D()).color(["#444","#444","#444"]),H.select(".nv-controlsWrap").datum(Y).attr("transform","translate(0,"+-c.top+")").call(l)}else H.select(".nv-controlsWrap").selectAll("*").remove();if(I.attr("transform","translate("+c.left+","+c.top+")"),k&&H.select(".nv-y.nv-axis").attr("transform","translate("+P+",0)"),n.disabled(E.map((function(t){return t.disabled}))).width(P).height(z).color(E.map((function(t,e){return t.color||h(t,e)})).filter((function(t,e){return!E[e].disabled}))),H.select(".nv-barsWrap").datum(E.filter((function(t){return!t.disabled}))).call(n),x){i.scale(t)._ticks(r.utils.calcTicksX(P/100,E)).tickSize(-z,0),H.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),H.select(".nv-x.nv-axis").call(i);var G=H.select(".nv-x.nv-axis > g").selectAll("g");if(G.selectAll("line, text").style("opacity",1),A){var R=function(t,e){return"translate("+t+","+e+")"};G.selectAll("text").attr("transform",(function(t,e,n){return R(0,n%2==0?5:17)}));var X=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;H.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",(function(t,e){return R(0,0===e||X%2!=0?17:5)}))}M&&H.selectAll(".tick text").call(r.utils.wrapTicks,B.xAxis.rangeBand()),w&&G.filter((function(t,e){return e%Math.ceil(E[0].values.length/(P/100))!=0})).selectAll("text, line").style("opacity",0),C&&G.selectAll(".tick text").attr("transform","rotate("+C+" 0,0)").style("text-anchor",C>0?"start":"end"),H.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}b&&(o.scale(e)._ticks(r.utils.calcTicksY(z/36,E)).tickSize(-P,0),H.select(".nv-y.nv-axis").call(o)),N&&(a.width(P).height(z).margin({left:c.left,top:c.top}).svgContainer(O).xScale(t),I.select(".nv-interactive").call(a)),s.dispatch.on("stateChange",(function(t){for(var e in t)S[e]=t[e];F.stateChange(S),B.update()})),l.dispatch.on("legendClick",(function(t,e){if(t.disabled){switch(Y=Y.map((function(t){return t.disabled=!0,t})),t.disabled=!1,t.key){case"Grouped":case v.grouped:n.stacked(!1);break;case"Stacked":case v.stacked:n.stacked(!0)}S.stacked=n.stacked(),F.stateChange(S),B.update()}})),F.on("changeState",(function(t){void 0!==t.disabled&&(E.forEach((function(e,n){e.disabled=t.disabled[n]})),S.disabled=t.disabled),void 0!==t.stacked&&(n.stacked(t.stacked),S.stacked=t.stacked,L=t.stacked),B.update()})),N?(a.dispatch.on("elementMousemove",(function(e){if(null!=e.pointXValue){var n,r,i,o,s=[];E.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(a,l){r=t.domain().indexOf(e.pointXValue);var u=a.values[r];void 0!==u&&(o=u.x,void 0===n&&(n=u),void 0===i&&(i=e.mouseX),s.push({key:a.key,value:B.y()(u,r),color:h(a,a.seriesIndex),data:a.values[r]}))})),a.tooltip.data({value:o,index:r,series:s})(),a.renderGuideLine(i)}})),a.dispatch.on("elementMouseout",(function(t){a.tooltip.hidden(!0)}))):(n.dispatch.on("elementMouseover.tooltip",(function(t){t.value=B.x()(t.data),t.series={key:t.data.key,value:B.y()(t.data),color:t.color},u.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){u.hidden(!0)})),n.dispatch.on("elementMousemove.tooltip",(function(t){u()})))})),O.renderEnd("multibarchart immediate"),B}return B.dispatch=F,B.multibar=n,B.legend=s,B.controls=l,B.xAxis=i,B.yAxis=o,B.state=S,B.tooltip=u,B.interactiveLayer=a,B.options=r.utils.optionsFunc.bind(B),B._options=Object.create({},{width:{get:function(){return f},set:function(t){f=t}},height:{get:function(){return p},set:function(t){p=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},showControls:{get:function(){return g},set:function(t){g=t}},controlLabels:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return W},set:function(t){W=t}},noData:{get:function(){return E},set:function(t){E=t}},reduceXTicks:{get:function(){return w},set:function(t){w=t}},rotateLabels:{get:function(){return C},set:function(t){C=t}},staggerLabels:{get:function(){return A},set:function(t){A=t}},wrapLabels:{get:function(){return M},set:function(t){M=!!t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return _},set:function(t){_=t,n.duration(_),i.duration(_),o.duration(_),O.reset(_)}},color:{get:function(){return h},set:function(t){h=r.utils.getColor(t),s.color(h)}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,o.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return N},set:function(t){N=t}},barColor:{get:function(){return n.barColor},set:function(t){n.barColor(t),s.color((function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()}))}}}),r.utils.inheritOptions(B,n),r.utils.initOptions(B),B},r.models.multiBarHorizontal=function(){"use strict";var t,e,n,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=null,p=d3.scale.ordinal(),h=d3.scale.linear(),g=function(t){return t.x},v=function(t){return t.y},m=function(t){return t.yErr},y=[0],x=r.utils.defaultColor(),b=null,k=!1,w=!1,A=60,M=.1,C=.75,S=d3.format(",.2f"),W=250,E=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),F=r.utils.renderWatch(E,W);function D(d){return F.reset(),d.each((function(d){var W=u-l.left-l.right,D=c-l.top-l.bottom;f=d3.select(this),r.utils.initSVG(f),k&&(d=d3.layout.stack().offset("zero").values((function(t){return t.values})).y(v)(d)),d.forEach((function(t,e){t.values.forEach((function(n){n.series=e,n.key=t.key}))})),k&&d[0].values.map((function(t,e){var n=0,r=0;d.map((function(t){var i=t.values[e];i.size=Math.abs(i.y),i.y<0?(i.y1=r-i.size,r-=i.size):(i.y1=n,n+=i.size)}))}));var _=e&&n?[]:d.map((function(t){return t.values.map((function(t,e){return{x:g(t,e),y:v(t,e),y0:t.y0,y1:t.y1}}))}));p.domain(e||d3.merge(_).map((function(t){return t.x}))).rangeBands(i||[0,D],M),h.domain(n||d3.extent(d3.merge(_).map((function(t){return k?t.y>0?t.y1+t.y:t.y1:t.y})).concat(y))),w&&!k?h.range(o||[h.domain()[0]<0?A:0,W-(h.domain()[1]>0?A:0)]):h.range(o||[0,W]),a=a||p,s=s||d3.scale.linear().domain(h.domain()).range([h(0),h(0)]);var N=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([d]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),L=(O.append("defs"),O.append("g"));N.select("g"),L.append("g").attr("class","nv-groups"),N.attr("transform","translate("+l.left+","+l.top+")");var B=N.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t,e){return e}));B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),B.exit().watchTransition(F,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),B.attr("class",(function(t,e){return"nv-group nv-series-"+e})).classed("hover",(function(t){return t.hover})).style("fill",(function(t,e){return x(t,e)})).style("stroke",(function(t,e){return x(t,e)})),B.watchTransition(F,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",C);var T=B.selectAll("g.nv-bar").data((function(t){return t.values}));T.exit().remove();var P=T.enter().append("g").attr("transform",(function(t,e,n){return"translate("+s(k?t.y0:0)+","+(k?0:n*p.rangeBand()/d.length+p(g(t,e)))+")"}));P.append("rect").attr("width",0).attr("height",p.rangeBand()/(k?1:d.length)),T.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),E.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),E.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){E.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e){E.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){E.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e){E.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()})),m(d[0],0)&&(P.append("polyline"),T.select("polyline").attr("fill","none").attr("points",(function(t,e){var n=m(t,e),r=.8*p.rangeBand()/(2*(k?1:d.length));return[[(n=(n=n.length?n:[-Math.abs(n),Math.abs(n)]).map((function(n){return h(n+(v(t,e)<0?0:v(t,e)))-h(0)})))[0],-r],[n[0],r],[n[0],0],[n[1],0],[n[1],-r],[n[1],r]].map((function(t){return t.join(",")})).join(" ")})).attr("transform",(function(t,e){return"translate(0, "+p.rangeBand()/(2*(k?1:d.length))+")"}))),P.append("text"),w&&!k?(T.select("text").attr("text-anchor",(function(t,e){return v(t,e)<0?"end":"start"})).attr("y",p.rangeBand()/(2*d.length)).attr("dy",".32em").text((function(t,e){var n=S(v(t,e)),r=m(t,e);return void 0===r?n:r.length?n+"+"+S(Math.abs(r[1]))+"-"+S(Math.abs(r[0])):n+"±"+S(Math.abs(r))})),T.watchTransition(F,"multibarhorizontal: bars").select("text").attr("x",(function(t,e){return v(t,e)<0?-4:h(v(t,e))-h(0)+4}))):T.selectAll("text").text(""),T.selectAll("text.nv-bar-label").text(""),T.attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})),b&&(t||(t=d.map((function(){return!0}))),T.style("fill",(function(e,n,r){return d3.rgb(b(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})).style("stroke",(function(e,n,r){return d3.rgb(b(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()}))),k?T.watchTransition(F,"multibarhorizontal: bars").attr("transform",(function(t,e){return"translate("+h(t.y1)+","+p(g(t,e))+")"})).select("rect").attr("width",(function(t,e){return Math.abs(h(v(t,e)+t.y0)-h(t.y0))||0})).attr("height",p.rangeBand()):T.watchTransition(F,"multibarhorizontal: bars").attr("transform",(function(t,e){return"translate("+(v(t,e)<0?h(v(t,e)):h(0))+","+(t.series*p.rangeBand()/d.length+p(g(t,e)))+")"})).select("rect").attr("height",p.rangeBand()/d.length).attr("width",(function(t,e){return Math.max(Math.abs(h(v(t,e))-h(0)),1)||0})),a=p.copy(),s=h.copy()})),F.renderEnd("multibarHorizontal immediate"),D}return D.dispatch=E,D.options=r.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},yErr:{get:function(){return m},set:function(t){m=t}},xScale:{get:function(){return p},set:function(t){p=t}},yScale:{get:function(){return h},set:function(t){h=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceY:{get:function(){return y},set:function(t){y=t}},stacked:{get:function(){return k},set:function(t){k=t}},showValues:{get:function(){return w},set:function(t){w=t}},disabled:{get:function(){return t},set:function(e){t=e}},id:{get:function(){return d},set:function(t){d=t}},valueFormat:{get:function(){return S},set:function(t){S=t}},valuePadding:{get:function(){return A},set:function(t){A=t}},groupSpacing:{get:function(){return M},set:function(t){M=t}},fillOpacity:{get:function(){return C},set:function(t){C=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return W},set:function(t){W=t,F.reset(W)}},color:{get:function(){return x},set:function(t){x=r.utils.getColor(t)}},barColor:{get:function(){return b},set:function(t){b=t?r.utils.getColor(t):null}}}),r.utils.initOptions(D),D},r.models.multiBarHorizontalChart=function(){"use strict";var t,e,n=r.models.multiBarHorizontal(),i=r.models.axis(),o=r.models.axis(),a=r.models.legend().height(30),s=r.models.legend().height(30),l=r.models.tooltip(),u={top:30,right:20,bottom:50,left:60},c=null,d=null,f=null,p=r.utils.defaultColor(),h=!0,g="top",v={},m=!0,y="top",x=!0,b=!0,k=!1,w=r.utils.state(),A=null,M=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=function(){return h?180:0},W=250;w.stacked=!1,n.stacked(k),i.orient("left").tickPadding(5).showMaxMin(!1).tickFormat((function(t){return t})),o.orient("bottom").tickFormat(d3.format(",.1f")),l.duration(0).valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.updateState(!1);var E=r.utils.renderWatch(C,W);function F(l){return E.reset(),E.models(n),x&&E.models(i),b&&E.models(o),l.each((function(l){var M=d3.select(this);r.utils.initSVG(M);var E,D=r.utils.availableWidth(d,M,u),_=r.utils.availableHeight(f,M,u);if(F.update=function(){M.transition().duration(W).call(F)},F.container=this,k=n.stacked(),w.setter(function(t){return function(e){void 0!==e.stacked&&(k=e.stacked),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(l),F.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),stacked:k}}}(l)).update(),w.disabled=l.map((function(t){return!!t.disabled})),!A)for(E in A={},w)w[E]instanceof Array?A[E]=w[E].slice(0):A[E]=w[E];if(!(l&&l.length&&l.filter((function(t){return t.values.length})).length))return r.utils.noData(F,M),F;M.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale().clamp(!0);var N=M.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([l]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),L=N.select("g");if(O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),O.append("g").attr("class","nv-barsWrap"),O.append("g").attr("class","nv-legendWrap"),O.append("g").attr("class","nv-controlsWrap"),m?(a.width(D-S()),L.select(".nv-legendWrap").datum(l).call(a),"bottom"===y?(u.bottom=i.height()+a.height(),_=r.utils.availableHeight(f,M,u),L.select(".nv-legendWrap").attr("transform","translate("+S()+","+(_+i.height())+")")):"top"===y&&(c||a.height()===u.top||(u.top=a.height(),_=r.utils.availableHeight(f,M,u)),L.select(".nv-legendWrap").attr("transform","translate("+S()+","+-u.top+")"))):L.select(".nv-legendWrap").selectAll("*").remove(),h){var B=[{key:v.grouped||"Grouped",disabled:n.stacked()},{key:v.stacked||"Stacked",disabled:!n.stacked()}];s.width(S()).color(["#444","#444","#444"]),"bottom"===g?(u.bottom=i.height()+a.height(),_=r.utils.availableHeight(f,M,u),L.select(".nv-controlsWrap").datum(B).attr("transform","translate(0,"+(_+i.height())+")").call(s)):"top"===g&&L.select(".nv-controlsWrap").datum(B).attr("transform","translate(0,"+-u.top+")").call(s)}else L.select(".nv-controlsWrap").selectAll("*").remove();N.attr("transform","translate("+u.left+","+u.top+")"),n.disabled(l.map((function(t){return t.disabled}))).width(D).height(_).color(l.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!l[e].disabled}))),L.select(".nv-barsWrap").datum(l.filter((function(t){return!t.disabled}))).transition().call(n),x&&(i.scale(t)._ticks(r.utils.calcTicksY(_/24,l)).tickSize(-D,0),L.select(".nv-x.nv-axis").call(i),L.select(".nv-x.nv-axis").selectAll("g").selectAll("line, text")),b&&(o.scale(e)._ticks(r.utils.calcTicksX(D/100,l)).tickSize(-_,0),L.select(".nv-y.nv-axis").attr("transform","translate(0,"+_+")"),L.select(".nv-y.nv-axis").call(o)),L.select(".nv-zeroLine line").attr("x1",e(0)).attr("x2",e(0)).attr("y1",0).attr("y2",-_),a.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];C.stateChange(w),F.update()})),s.dispatch.on("legendClick",(function(t,e){if(t.disabled){switch(B=B.map((function(t){return t.disabled=!0,t})),t.disabled=!1,t.key){case"Grouped":case v.grouped:n.stacked(!1);break;case"Stacked":case v.stacked:n.stacked(!0)}w.stacked=n.stacked(),C.stateChange(w),k=n.stacked(),F.update()}})),C.on("changeState",(function(t){void 0!==t.disabled&&(l.forEach((function(e,n){e.disabled=t.disabled[n]})),w.disabled=t.disabled),void 0!==t.stacked&&(n.stacked(t.stacked),w.stacked=t.stacked,k=t.stacked),F.update()}))})),E.renderEnd("multibar horizontal chart immediate"),F}return n.dispatch.on("elementMouseover.tooltip",(function(t){t.value=F.x()(t.data),t.series={key:t.data.key,value:F.y()(t.data),color:t.color},l.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){l.hidden(!0)})),n.dispatch.on("elementMousemove.tooltip",(function(t){l()})),F.dispatch=C,F.multibar=n,F.legend=a,F.controls=s,F.xAxis=i,F.yAxis=o,F.state=w,F.tooltip=l,F.options=r.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return d},set:function(t){d=t}},height:{get:function(){return f},set:function(t){f=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},controlsPosition:{get:function(){return g},set:function(t){g=t}},showControls:{get:function(){return h},set:function(t){h=t}},controlLabels:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return M},set:function(t){M=t}},margin:{get:function(){return u},set:function(t){void 0!==t.top&&(u.top=t.top,c=t.top),u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return W},set:function(t){W=t,E.reset(W),n.duration(W),i.duration(W),o.duration(W)}},color:{get:function(){return p},set:function(t){p=r.utils.getColor(t),a.color(p)}},barColor:{get:function(){return n.barColor},set:function(t){n.barColor(t),a.color((function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()}))}}}),r.utils.inheritOptions(F,n),r.utils.initOptions(F),F},r.models.multiChart=function(){"use strict";var t,e,n={top:30,right:20,bottom:50,left:60},i=null,o=r.utils.defaultColor(),a=null,s=null,l=!0,u=null,c=function(t){return t.x},d=function(t){return t.y},f="linear",p=!0,h=r.interactiveGuideline(),g=!1,v=" (right axis)",m=250,y=d3.scale.linear(),x=d3.scale.linear(),b=d3.scale.linear(),k=r.models.line().yScale(x).duration(m),w=r.models.line().yScale(b).duration(m),A=r.models.scatter().yScale(x).duration(m),M=r.models.scatter().yScale(b).duration(m),C=r.models.multiBar().stacked(!1).yScale(x).duration(m),S=r.models.multiBar().stacked(!1).yScale(b).duration(m),W=r.models.stackedArea().yScale(x).duration(m),E=r.models.stackedArea().yScale(b).duration(m),F=r.models.axis().scale(y).orient("bottom").tickPadding(5).duration(m),D=r.models.axis().scale(x).orient("left").duration(m),_=r.models.axis().scale(b).orient("right").duration(m),N=r.models.legend().height(30),O=r.models.tooltip(),L=d3.dispatch(),B=[k,w,A,M,C,S,W,E];function T(u){return u.each((function(u){var p=d3.select(this);r.utils.initSVG(p),T.update=function(){p.transition().call(T)},T.container=this;var m=r.utils.availableWidth(a,p,n),L=r.utils.availableHeight(s,p,n),P=u.filter((function(t){return"line"==t.type&&1==t.yAxis})),z=u.filter((function(t){return"line"==t.type&&2==t.yAxis})),I=u.filter((function(t){return"scatter"==t.type&&1==t.yAxis})),V=u.filter((function(t){return"scatter"==t.type&&2==t.yAxis})),H=u.filter((function(t){return"bar"==t.type&&1==t.yAxis})),Y=u.filter((function(t){return"bar"==t.type&&2==t.yAxis})),G=u.filter((function(t){return"area"==t.type&&1==t.yAxis})),R=u.filter((function(t){return"area"==t.type&&2==t.yAxis}));if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return r.utils.noData(T,p),T;p.selectAll(".nv-noData").remove();var X=u.filter((function(t){return!t.disabled&&1==t.yAxis})).map((function(t){return t.values.map((function(t,e){return{x:c(t),y:d(t)}}))})),j=u.filter((function(t){return!t.disabled&&2==t.yAxis})).map((function(t){return t.values.map((function(t,e){return{x:c(t),y:d(t)}}))}));y.domain(d3.extent(d3.merge(X.concat(j)),(function(t){return t.x}))).range([0,m]);var Z=p.selectAll("g.wrap.multiChart").data([u]),q=Z.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");q.append("g").attr("class","nv-x nv-axis"),q.append("g").attr("class","nv-y1 nv-axis"),q.append("g").attr("class","nv-y2 nv-axis"),q.append("g").attr("class","stack1Wrap"),q.append("g").attr("class","stack2Wrap"),q.append("g").attr("class","bars1Wrap"),q.append("g").attr("class","bars2Wrap"),q.append("g").attr("class","scatters1Wrap"),q.append("g").attr("class","scatters2Wrap"),q.append("g").attr("class","lines1Wrap"),q.append("g").attr("class","lines2Wrap"),q.append("g").attr("class","legendWrap"),q.append("g").attr("class","nv-interactive");var K=Z.select("g"),U=u.map((function(t,e){return u[e].color||o(t,e)}));if(l){var Q=N.align()?m/2:m,$=N.align()?Q:0;N.width(Q),N.color(U),K.select(".legendWrap").datum(u.map((function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=t.originalKey+(1==t.yAxis?"":v),t}))).call(N),i||N.height()===n.top||(n.top=N.height(),L=r.utils.availableHeight(s,p,n)),K.select(".legendWrap").attr("transform","translate("+$+","+-n.top+")")}else K.select(".legendWrap").selectAll("*").remove();k.width(m).height(L).interpolate(f).color(U.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"line"==u[e].type}))),w.width(m).height(L).interpolate(f).color(U.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"line"==u[e].type}))),A.width(m).height(L).color(U.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"scatter"==u[e].type}))),M.width(m).height(L).color(U.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"scatter"==u[e].type}))),C.width(m).height(L).color(U.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"bar"==u[e].type}))),S.width(m).height(L).color(U.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"bar"==u[e].type}))),W.width(m).height(L).interpolate(f).color(U.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"area"==u[e].type}))),E.width(m).height(L).interpolate(f).color(U.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"area"==u[e].type}))),K.attr("transform","translate("+n.left+","+n.top+")");var J=K.select(".lines1Wrap").datum(P.filter((function(t){return!t.disabled}))),tt=K.select(".scatters1Wrap").datum(I.filter((function(t){return!t.disabled}))),et=K.select(".bars1Wrap").datum(H.filter((function(t){return!t.disabled}))),nt=K.select(".stack1Wrap").datum(G.filter((function(t){return!t.disabled}))),rt=K.select(".lines2Wrap").datum(z.filter((function(t){return!t.disabled}))),it=K.select(".scatters2Wrap").datum(V.filter((function(t){return!t.disabled}))),ot=K.select(".bars2Wrap").datum(Y.filter((function(t){return!t.disabled}))),at=K.select(".stack2Wrap").datum(R.filter((function(t){return!t.disabled}))),st=[];C.stacked()&&H.length&&(st=H.filter((function(t){return!t.disabled})).map((function(t){return t.values}))).length>0&&(st=st.reduce((function(t,e){return t.map((function(t,n){return{x:t.x,y:t.y+e[n].y}}))}))),H.length&&st.push({x:0,y:0});var lt=[];function ut(t){var e=2===t.series.yAxis?_:D;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},O.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function ct(t){var e=2===t.series.yAxis?_:D;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},O.duration(100).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function dt(t){var e=2===t.series.yAxis?_:D;t.point.x=W.x()(t.point),t.point.y=W.y()(t.point),O.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function ft(t){var e=2===t.series.yAxis?_:D;t.value=C.x()(t.data),t.series={value:C.y()(t.data),color:t.color,key:t.data.key},O.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function pt(){for(var t=0,e=B.length;t<e;t++){var n=B[t];try{n.clearHighlights()}catch(t){}}}S.stacked()&&Y.length&&(lt=Y.filter((function(t){return!t.disabled})).map((function(t){return t.values}))).length>0&&(lt=lt.reduce((function(t,e){return t.map((function(t,n){return{x:t.x,y:t.y+e[n].y}}))}))),Y.length&&lt.push({x:0,y:0}),x.domain(t||d3.extent(d3.merge(X).concat(st),(function(t){return t.y}))).range([0,L]),b.domain(e||d3.extent(d3.merge(j).concat(lt),(function(t){return t.y}))).range([0,L]),k.yDomain(x.domain()),A.yDomain(x.domain()),C.yDomain(x.domain()),W.yDomain(x.domain()),w.yDomain(b.domain()),M.yDomain(b.domain()),S.yDomain(b.domain()),E.yDomain(b.domain()),G.length&&d3.transition(nt).call(W),R.length&&d3.transition(at).call(E),H.length&&d3.transition(et).call(C),Y.length&&d3.transition(ot).call(S),P.length&&d3.transition(J).call(k),z.length&&d3.transition(rt).call(w),I.length&&d3.transition(tt).call(A),V.length&&d3.transition(it).call(M),F._ticks(r.utils.calcTicksX(m/100,u)).tickSize(-L,0),K.select(".nv-x.nv-axis").attr("transform","translate(0,"+L+")"),d3.transition(K.select(".nv-x.nv-axis")).call(F),D._ticks(r.utils.calcTicksY(L/36,u)).tickSize(-m,0),d3.transition(K.select(".nv-y1.nv-axis")).call(D),_._ticks(r.utils.calcTicksY(L/36,u)).tickSize(-m,0),d3.transition(K.select(".nv-y2.nv-axis")).call(_),K.select(".nv-y1.nv-axis").classed("nv-disabled",!X.length).attr("transform","translate("+y.range()[0]+",0)"),K.select(".nv-y2.nv-axis").classed("nv-disabled",!j.length).attr("transform","translate("+y.range()[1]+",0)"),N.dispatch.on("stateChange",(function(t){T.update()})),g&&(h.width(m).height(L).margin({left:n.left,top:n.top}).svgContainer(p).xScale(y),Z.select(".nv-interactive").call(h)),g?(h.dispatch.on("elementMousemove",(function(t){pt();var e,n,i,a=[];u.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(s,l){var u=y.domain(),c=s.values.filter((function(t,e){return T.x()(t,e)>=u[0]&&T.x()(t,e)<=u[1]})),d=c[n=r.interactiveBisect(c,t.pointXValue,T.x())],f=T.y()(d,n);null!==f&&function(t,e,n){for(var r=0,i=B.length;r<i;r++){var o=B[r];try{o.highlightPoint(t,e,n)}catch(t){}}}(l,n,!0),void 0!==d&&(void 0===e&&(e=d),void 0===i&&(i=y(T.x()(d,n))),a.push({key:s.key,value:f,color:o(s,s.seriesIndex),data:d,yAxis:2==s.yAxis?_:D}))})),h.tooltip.headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter(h.tooltip.valueFormatter()||function(t,e){var n=a[e].yAxis;return null==t?"N/A":n.tickFormat()(t)}).data({value:T.x()(e,n),index:n,series:a})(),h.renderGuideLine(i)})),h.dispatch.on("elementMouseout",(function(t){pt()}))):(k.dispatch.on("elementMouseover.tooltip",ut),w.dispatch.on("elementMouseover.tooltip",ut),k.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),w.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),A.dispatch.on("elementMouseover.tooltip",ct),M.dispatch.on("elementMouseover.tooltip",ct),A.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),M.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),W.dispatch.on("elementMouseover.tooltip",dt),E.dispatch.on("elementMouseover.tooltip",dt),W.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),E.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),C.dispatch.on("elementMouseover.tooltip",ft),S.dispatch.on("elementMouseover.tooltip",ft),C.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),S.dispatch.on("elementMouseout.tooltip",(function(t){O.hidden(!0)})),C.dispatch.on("elementMousemove.tooltip",(function(t){O()})),S.dispatch.on("elementMousemove.tooltip",(function(t){O()})))})),T}return T.dispatch=L,T.legend=N,T.lines1=k,T.lines2=w,T.scatters1=A,T.scatters2=M,T.bars1=C,T.bars2=S,T.stack1=W,T.stack2=E,T.xAxis=F,T.yAxis1=D,T.yAxis2=_,T.tooltip=O,T.interactiveLayer=h,T.options=r.utils.optionsFunc.bind(T),T._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},yDomain1:{get:function(){return t},set:function(e){t=e}},yDomain2:{get:function(){return e},set:function(t){e=t}},noData:{get:function(){return u},set:function(t){u=t}},interpolate:{get:function(){return f},set:function(t){f=t}},legendRightAxisHint:{get:function(){return v},set:function(t){v=t}},margin:{get:function(){return n},set:function(t){void 0!==t.top&&(n.top=t.top,i=t.top),n.right=void 0!==t.right?t.right:n.right,n.bottom=void 0!==t.bottom?t.bottom:n.bottom,n.left=void 0!==t.left?t.left:n.left}},color:{get:function(){return o},set:function(t){o=r.utils.getColor(t)}},x:{get:function(){return c},set:function(t){c=t,k.x(t),w.x(t),A.x(t),M.x(t),C.x(t),S.x(t),W.x(t),E.x(t)}},y:{get:function(){return d},set:function(t){d=t,k.y(t),w.y(t),A.y(t),M.y(t),W.y(t),E.y(t),C.y(t),S.y(t)}},useVoronoi:{get:function(){return p},set:function(t){p=t,k.useVoronoi(t),w.useVoronoi(t),W.useVoronoi(t),E.useVoronoi(t)}},useInteractiveGuideline:{get:function(){return g},set:function(t){(g=t)&&(k.interactive(!1),k.useVoronoi(!1),w.interactive(!1),w.useVoronoi(!1),W.interactive(!1),W.useVoronoi(!1),E.interactive(!1),E.useVoronoi(!1),A.interactive(!1),M.interactive(!1))}},duration:{get:function(){return m},set:function(t){m=t,[k,w,W,E,A,M,F,D,_].forEach((function(t){t.duration(m)}))}}}),r.utils.initOptions(T),T},r.models.ohlcBar=function(){"use strict";var t,e,n,i,o={top:0,right:0,bottom:0,left:0},a=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=function(t){return t.open},g=function(t){return t.close},v=function(t){return t.high},m=function(t){return t.low},y=[],x=[],b=!1,k=!0,w=r.utils.defaultColor(),A=!1,M=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");function C(A){return A.each((function(A){u=d3.select(this);var C=r.utils.availableWidth(a,u,o),S=r.utils.availableHeight(s,u,o);r.utils.initSVG(u);var W=C/A[0].values.length*.9;c.domain(t||d3.extent(A[0].values.map(f).concat(y))),b?c.range(n||[.5*C/A[0].values.length,C*(A[0].values.length-.5)/A[0].values.length]):c.range(n||[5+W/2,C-W/2-5]),d.domain(e||[d3.min(A[0].values.map(m).concat(x)),d3.max(A[0].values.map(v).concat(x))]).range(i||[S,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var E=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([A[0].values]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),D=F.append("defs"),_=F.append("g"),N=E.select("g");_.append("g").attr("class","nv-ticks"),E.attr("transform","translate("+o.left+","+o.top+")"),u.on("click",(function(t,e){M.chartClick({data:t,index:e,pos:d3.event,id:l})})),D.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect"),E.select("#nv-chart-clip-path-"+l+" rect").attr("width",C).attr("height",S),N.attr("clip-path",k?"url(#nv-chart-clip-path-"+l+")":"");var O=E.select(".nv-ticks").selectAll(".nv-tick").data((function(t){return t}));O.exit().remove(),O.enter().append("path").attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})).attr("d",(function(t,e){return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-W/2+",0l"+W/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(t,e)))+"l"+W/2+",0l"+-W/2+",0z"})).attr("transform",(function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"})).attr("fill",(function(t,e){return w[0]})).attr("stroke",(function(t,e){return w[0]})).attr("x",0).attr("y",(function(t,e){return d(Math.max(0,p(t,e)))})).attr("height",(function(t,e){return Math.abs(d(p(t,e))-d(0))})),O.attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})),d3.transition(O).attr("transform",(function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"})).attr("d",(function(t,e){var n=C/A[0].values.length*.9;return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-n/2+",0l"+n/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(t,e)))+"l"+n/2+",0l"+-n/2+",0z"}))})),C}return C.highlightPoint=function(t,e){C.clearHighlights(),u.select(".nv-ohlcBar .nv-tick-0-"+t).classed("hover",e)},C.clearHighlights=function(){u.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},C.dispatch=M,C.options=r.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return t},set:function(e){t=e}},yDomain:{get:function(){return e},set:function(t){e=t}},xRange:{get:function(){return n},set:function(t){n=t}},yRange:{get:function(){return i},set:function(t){i=t}},forceX:{get:function(){return y},set:function(t){y=t}},forceY:{get:function(){return x},set:function(t){x=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return k},set:function(t){k=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return A},set:function(t){A=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return o},set:function(t){o.top=null!=t.top?t.top:o.top,o.right=null!=t.right?t.right:o.right,o.bottom=null!=t.bottom?t.bottom:o.bottom,o.left=null!=t.left?t.left:o.left}},color:{get:function(){return w},set:function(t){w=r.utils.getColor(t)}}}),r.utils.initOptions(C),C},r.models.parallelCoordinates=function(){"use strict";var t,e,n,i={top:30,right:0,bottom:10,left:0},o=null,a=null,s=null,l=null,u=d3.scale.ordinal(),c={},d="undefined values",f=[],p=[],h=[],g=!0,v=r.utils.defaultColor(),m=[],y=[],x=[],b=[],k=1,w=d3.svg.line(),A=d3.svg.axis(),M=d3.dispatch("brushstart","brush","brushEnd","dimensionsOrder","stateChange","elementClick","elementMouseover","elementMouseout","elementMousemove","renderEnd","activeChanged"),C=r.utils.renderWatch(M);function S(W){return C.reset(),W.each((function(C){var S=d3.select(this);if(s=r.utils.availableWidth(o,S,i),l=r.utils.availableHeight(a,S,i),r.utils.initSVG(S),void 0===C[0].values){var W=[];C.forEach((function(t){var e={};Object.keys(t).forEach((function(n){"name"!==n&&(e[n]=t[n])})),W.push({key:t.name,values:e})})),C=W}var E=C.map((function(t){return t.values}));0===y.length&&(y=C),h=f.sort((function(t,e){return t.currentPosition-e.currentPosition})).map((function(t){return t.key})),p=f.filter((function(t){return!t.disabled})),u.rangePoints([0,s],1).domain(p.map((function(t){return t.key})));var F={},D=!1,_=[];h.forEach((function(t){var e=d3.extent(E,(function(e){return+e[t]})),n=e[0],r=e[1],i=!1;(isNaN(n)||isNaN(r))&&(i=!0,n=0,r=0),n===r&&(n-=1,r+=1);var o=m.filter((function(e){return e.dimension==t}));0!==o.length&&(i?(n=c[t].domain()[0],r=c[t].domain()[1]):!o[0].hasOnlyNaN&&g?(n=n>o[0].extent[0]?o[0].extent[0]:n,r=r<o[0].extent[1]?o[0].extent[1]:r):o[0].hasNaN&&(r=r<o[0].extent[1]?o[0].extent[1]:r,F[t]=c[t].domain()[1],D=!0)),c[t]=d3.scale.linear().domain([n,r]).range([.9*(l-12),0]),b=[],c[t].brush=d3.svg.brush().y(c[t]).on("brushstart",j).on("brush",Z).on("brushend",q)}));var N=S.selectAll("g.nv-wrap.nv-parallelCoordinates").data([C]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinates").append("g"),L=N.select("g");O.append("g").attr("class","nv-parallelCoordinates background"),O.append("g").attr("class","nv-parallelCoordinates foreground"),O.append("g").attr("class","nv-parallelCoordinates missingValuesline"),N.attr("transform","translate("+i.left+","+i.top+")"),w.interpolate("cardinal").tension(k),A.orient("left");var B,T,P=d3.behavior.drag().on("dragstart",(function(t){x[t.key]=this.parentNode.__origin__=u(t.key),e.attr("visibility","hidden")})).on("drag",(function(e){x[e.key]=Math.min(s,Math.max(0,this.parentNode.__origin__+=d3.event.x)),t.attr("d",R),p.sort((function(t,e){return U(t.key)-U(e.key)})),p.forEach((function(t,e){return t.currentPosition=e})),u.domain(p.map((function(t){return t.key}))),n.attr("transform",(function(t){return"translate("+U(t.key)+")"}))})).on("dragend",(function(n,r){delete this.parentNode.__origin__,delete x[n.key],d3.select(this.parentNode).attr("transform","translate("+u(n.key)+")"),t.attr("d",R),e.attr("d",R).attr("visibility",null),M.dimensionsOrder(p)})),z=u.range()[1]-u.range()[0];if(z=isNaN(z)?u.range()[0]:z,!isNaN(z)){var I=[0+z/2,l-12,s-z/2,l-12];(B=N.select(".missingValuesline").selectAll("line").data([I])).enter().append("line"),B.exit().remove(),B.attr("x1",(function(t){return t[0]})).attr("y1",(function(t){return t[1]})).attr("x2",(function(t){return t[2]})).attr("y2",(function(t){return t[3]})),(T=N.select(".missingValuesline").selectAll("text").data([d])).append("text").data([d]),T.enter().append("text"),T.exit().remove(),T.attr("y",l).attr("x",s-92-z/2).text((function(t){return t}))}(e=N.select(".background").selectAll("path").data(C)).enter().append("path"),e.exit().remove(),e.attr("d",R),(t=N.select(".foreground").selectAll("path").data(C)).enter().append("path"),t.exit().remove(),t.attr("d",R).style("stroke-width",(function(t,e){return isNaN(t.strokeWidth)&&(t.strokeWidth=1),t.strokeWidth})).attr("stroke",(function(t,e){return t.color||v(t,e)})),t.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0).style("stroke-width",t.strokeWidth+2+"px").style("stroke-opacity",1),M.elementMouseover({label:t.name,color:t.color||v(t,e),values:t.values,dimensions:p})})),t.on("mouseout",(function(t,e){d3.select(this).classed("hover",!1).style("stroke-width",t.strokeWidth+"px").style("stroke-opacity",.7),M.elementMouseout({label:t.name,index:e})})),t.on("mousemove",(function(t,e){M.elementMousemove()})),t.on("click",(function(t){M.elementClick({id:t.id})}));var V=(n=L.selectAll(".dimension").data(p)).enter().append("g").attr("class","nv-parallelCoordinates dimension");n.attr("transform",(function(t){return"translate("+u(t.key)+",0)"})),V.append("g").attr("class","nv-axis"),V.append("text").attr("class","nv-label").style("cursor","move").attr("dy","-1em").attr("text-anchor","middle").on("mouseover",(function(t,e){M.elementMouseover({label:t.tooltip||t.key,color:t.color})})).on("mouseout",(function(t,e){M.elementMouseout({label:t.tooltip})})).on("mousemove",(function(t,e){M.elementMousemove()})).call(P),V.append("g").attr("class","nv-brushBackground"),n.exit().remove(),n.select(".nv-label").text((function(t){return t.key})),X(g);var H=h.filter((function(t){return!c[t].brush.empty()})),Y=H.map((function(t){return c[t].brush.extent()})),G=y.slice(0);function R(t){return w(p.map((function(e){if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key]))||D){var n=c[e.key].domain(),r=c[e.key].range(),i=n[0]-(n[1]-n[0])/9;if(b.indexOf(e.key)<0){var o=d3.scale.linear().domain([i,n[1]]).range([l-12,r[1]]);c[e.key].brush.y(o),b.push(e.key)}if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key])))return[u(e.key),c[e.key](i)]}return void 0!==B&&(b.length>0||D?(B.style("display","inline"),T.style("display","inline")):(B.style("display","none"),T.style("display","none"))),[u(e.key),c[e.key](t.values[e.key])]})))}function X(t){m.forEach((function(e){var n=c[e.dimension].brush.y().domain();e.hasOnlyNaN&&(e.extent[1]=(c[e.dimension].domain()[1]-n[0])*(e.extent[1]-e.extent[0])/(F[e.dimension]-e.extent[0])+n[0]),e.hasNaN&&(e.extent[0]=n[0]),t&&c[e.dimension].brush.extent(e.extent)})),n.select(".nv-brushBackground").each((function(t){d3.select(this).call(c[t.key].brush)})).selectAll("rect").attr("x",-8).attr("width",16),K()}function j(){!1===g&&(g=!0,X(!0))}function Z(){H=h.filter((function(t){return!c[t].brush.empty()})),Y=H.map((function(t){return c[t].brush.extent()})),m=[],H.forEach((function(t,e){m[e]={dimension:t,extent:Y[e],hasNaN:!1,hasOnlyNaN:!1}})),y=[],t.style("display",(function(t){var e=H.every((function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||Y[n][0]!=c[e].brush.y().domain()[0])||Y[n][0]<=t.values[e]&&t.values[e]<=Y[n][1]&&!isNaN(parseFloat(t.values[e]))}));return e&&y.push(t),e?null:"none"})),K(),M.brush({filters:m,active:y})}function q(){var t=H.length>0;m.forEach((function(t){t.extent[0]===c[t.dimension].brush.y().domain()[0]&&b.indexOf(t.dimension)>=0&&(t.hasNaN=!0),t.extent[1]<c[t.dimension].domain()[0]&&(t.hasOnlyNaN=!0)})),M.brushEnd(y,t)}function K(){n.select(".nv-axis").each((function(t,e){var n=m.filter((function(e){return e.dimension==t.key}));_[t.key]=c[t.key].domain(),0!=n.length&&g&&(_[t.key]=[],n[0].extent[1]>c[t.key].domain()[0]&&(_[t.key]=[n[0].extent[1]]),n[0].extent[0]>=c[t.key].domain()[0]&&_[t.key].push(n[0].extent[0])),d3.select(this).call(A.scale(c[t.key]).tickFormat(t.format).tickValues(_[t.key]))}))}function U(t){var e=x[t];return null==e?u(t):e}y=[],t.style("display",(function(t){var e=H.every((function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||Y[n][0]!=c[e].brush.y().domain()[0])||Y[n][0]<=t.values[e]&&t.values[e]<=Y[n][1]&&!isNaN(parseFloat(t.values[e]))}));return e&&y.push(t),e?null:"none"})),(m.length>0||!r.utils.arrayEquals(y,G))&&M.activeChanged(y)})),S}return S.dispatch=M,S.options=r.utils.optionsFunc.bind(S),S._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},dimensionData:{get:function(){return f},set:function(t){f=t}},displayBrush:{get:function(){return g},set:function(t){g=t}},filters:{get:function(){return m},set:function(t){m=t}},active:{get:function(){return y},set:function(t){y=t}},lineTension:{get:function(){return k},set:function(t){k=t}},undefinedValuesLabel:{get:function(){return d},set:function(t){d=t}},dimensions:{get:function(){return f.map((function(t){return t.key}))},set:function(t){r.deprecated("dimensions","use dimensionData instead"),0===f.length?t.forEach((function(t){f.push({key:t})})):t.forEach((function(t,e){f[e].key=t}))}},dimensionNames:{get:function(){return f.map((function(t){return t.key}))},set:function(t){r.deprecated("dimensionNames","use dimensionData instead"),h=[],0===f.length?t.forEach((function(t){f.push({key:t})})):t.forEach((function(t,e){f[e].key=t}))}},dimensionFormats:{get:function(){return f.map((function(t){return t.format}))},set:function(t){r.deprecated("dimensionFormats","use dimensionData instead"),0===f.length?t.forEach((function(t){f.push({format:t})})):t.forEach((function(t,e){f[e].format=t}))}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return v},set:function(t){v=r.utils.getColor(t)}}}),r.utils.initOptions(S),S},r.models.parallelCoordinatesChart=function(){"use strict";var t=r.models.parallelCoordinates(),e=r.models.legend(),n=r.models.tooltip(),i=(r.models.tooltip(),{top:0,right:0,bottom:0,left:0}),o=null,a=null,s=null,l=!0,u=r.utils.defaultColor(),c=r.utils.state(),d=[],f=!0,p=null,h=null,g="undefined",v=d3.dispatch("dimensionsOrder","brushEnd","stateChange","changeState","renderEnd"),m=r.utils.renderWatch(v);function y(n){return m.reset(),m.models(t),n.each((function(n){var u=d3.select(this);r.utils.initSVG(u);var h,g=r.utils.availableWidth(a,u,i),m=r.utils.availableHeight(s,u,i);if(y.update=function(){u.call(y)},y.container=this,c.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(d),y.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(d)).update(),c.disabled=d.map((function(t){return!!t.disabled})),(d=d.map((function(t){return t.disabled=!!t.disabled,t}))).forEach((function(t,e){t.originalPosition=isNaN(t.originalPosition)?e:t.originalPosition,t.currentPosition=isNaN(t.currentPosition)?e:t.currentPosition})),!p)for(h in p={},c)c[h]instanceof Array?p[h]=c[h].slice(0):p[h]=c[h];if(!n||!n.length)return r.utils.noData(y,u),y;u.selectAll(".nv-noData").remove();var x=u.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").data([n]),b=x.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinatesChart").append("g"),k=x.select("g");b.append("g").attr("class","nv-parallelCoordinatesWrap"),b.append("g").attr("class","nv-legendWrap"),k.select("rect").attr("width",g).attr("height",m>0?m:0),l?(e.width(g).color((function(t){return"rgb(188,190,192)"})),k.select(".nv-legendWrap").datum(d.sort((function(t,e){return t.originalPosition-e.originalPosition}))).call(e),o||e.height()===i.top||(i.top=e.height(),m=r.utils.availableHeight(s,u,i)),x.select(".nv-legendWrap").attr("transform","translate( 0 ,"+-i.top+")")):k.select(".nv-legendWrap").selectAll("*").remove(),x.attr("transform","translate("+i.left+","+i.top+")"),t.width(g).height(m).dimensionData(d).displayBrush(f),k.select(".nv-parallelCoordinatesWrap ").datum(n).transition().call(t),t.dispatch.on("brushEnd",(function(t,e){e?(f=!0,v.brushEnd(t)):f=!1})),e.dispatch.on("stateChange",(function(t){for(var e in t)c[e]=t[e];v.stateChange(c),y.update()})),t.dispatch.on("dimensionsOrder",(function(t){d.sort((function(t,e){return t.currentPosition-e.currentPosition}));var e=!1;d.forEach((function(t,n){t.currentPosition=n,t.currentPosition!==t.originalPosition&&(e=!0)})),v.dimensionsOrder(d,e)})),v.on("changeState",(function(t){void 0!==t.disabled&&(d.forEach((function(e,n){e.disabled=t.disabled[n]})),c.disabled=t.disabled),y.update()}))})),m.renderEnd("parraleleCoordinateChart immediate"),y}return n.contentGenerator((function(t){var e='<table><thead><tr><td class="legend-color-guide"><div style="background-color:'+t.color+'"></div></td><td><strong>'+t.key+"</strong></td></tr></thead>";return 0!==t.series.length&&(e+='<tbody><tr><td height ="10px"></td></tr>',t.series.forEach((function(t){e=e+'<tr><td class="legend-color-guide"><div style="background-color:'+t.color+'"></div></td><td class="key">'+t.key+'</td><td class="value">'+t.value+"</td></tr>"})),e+="</tbody>"),e+="</table>"})),t.dispatch.on("elementMouseover.tooltip",(function(t){var e={key:t.label,color:t.color,series:[]};t.values&&(Object.keys(t.values).forEach((function(n){var r,i=t.dimensions.filter((function(t){return t.key===n}))[0];i&&(r=isNaN(t.values[n])||isNaN(parseFloat(t.values[n]))?g:i.format(t.values[n]),e.series.push({idx:i.currentPosition,key:n,value:r,color:i.color}))})),e.series.sort((function(t,e){return t.idx-e.idx}))),n.data(e).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){n.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(){n()})),y.dispatch=v,y.parallelCoordinates=t,y.legend=e,y.tooltip=n,y.options=r.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},defaultState:{get:function(){return p},set:function(t){p=t}},dimensionData:{get:function(){return d},set:function(t){d=t}},displayBrush:{get:function(){return f},set:function(t){f=t}},noData:{get:function(){return h},set:function(t){h=t}},nanValue:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,o=t.top),i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return u},set:function(n){u=r.utils.getColor(n),e.color(u),t.color(u)}}}),r.utils.inheritOptions(y,t),r.utils.initOptions(y),y},r.models.pie=function(){"use strict";var t={top:0,right:0,bottom:0,left:0},e=500,n=500,i=function(t){return t.x},o=function(t){return t.y},a=Math.floor(1e4*Math.random()),s=null,l=r.utils.defaultColor(),u=d3.format(",.2f"),c=!0,d=!1,f="key",p=.02,h=!1,g=!1,v=!1,m=!0,y=0,x=!1,b=!1,k=!1,w=!1,A=0,M=.5,C=250,S=[],W=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=[],F=[],D=r.utils.renderWatch(W);function _(N){return D.reset(),N.each((function(_){var N=e-t.left-t.right,O=n-t.top-t.bottom,L=Math.min(N,O)/2,B=[],T=[];if(s=d3.select(this),0===S.length)for(var P=L-L/10,z=M*L,I=0;I<_[0].length;I++)B.push(P),T.push(z);else m?(B=S.map((function(t){return(t.outer-t.outer/10)*L})),T=S.map((function(t){return(t.inner-t.inner/10)*L})),M=d3.min(S.map((function(t){return t.inner-t.inner/10})))):(B=S.map((function(t){return t.outer*L})),T=S.map((function(t){return t.inner*L})),M=d3.min(S.map((function(t){return t.inner}))));r.utils.initSVG(s);var V=s.selectAll(".nv-wrap.nv-pie").data(_),H=V.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+a).append("g"),Y=V.select("g"),G=H.append("g").attr("class","nv-pie");for(H.append("g").attr("class","nv-pieLabels"),V.attr("transform","translate("+t.left+","+t.top+")"),Y.select(".nv-pie").attr("transform","translate("+N/2+","+O/2+")"),Y.select(".nv-pieLabels").attr("transform","translate("+N/2+","+O/2+")"),s.on("click",(function(t,e){W.chartClick({data:t,index:e,pos:d3.event,id:a})})),E=[],F=[],I=0;I<_[0].length;I++){var R=d3.svg.arc().outerRadius(B[I]),X=d3.svg.arc().outerRadius(B[I]+5);!1!==b&&(R.startAngle(b),X.startAngle(b)),!1!==w&&(R.endAngle(w),X.endAngle(w)),g&&(R.innerRadius(T[I]),X.innerRadius(T[I])),R.cornerRadius&&A&&(R.cornerRadius(A),X.cornerRadius(A)),E.push(R),F.push(X)}var j=d3.layout.pie().sort(null).value((function(t){return t.disabled?0:o(t)}));j.padAngle&&k&&j.padAngle(k),g&&v&&(G.append("text").attr("class","nv-pie-title"),V.select(".nv-pie-title").style("text-anchor","middle").text((function(t){return v})).style("font-size",Math.min(N,O)*M*2/(v.length+2)+"px").attr("dy","0.35em").attr("transform",(function(t,e){return"translate(0, "+y+")"})));var Z=V.select(".nv-pie").selectAll(".nv-slice").data(j),q=V.select(".nv-pieLabels").selectAll(".nv-label").data(j);Z.exit().remove(),q.exit().remove();var K=Z.enter().append("g");if(K.attr("class","nv-slice"),K.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),m&&d3.select(this).select("path").transition().duration(70).attr("d",F[e]),W.elementMouseover({data:t.data,index:e,color:d3.select(this).style("fill"),percent:(t.endAngle-t.startAngle)/(2*Math.PI)})})),K.on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),m&&d3.select(this).select("path").transition().duration(50).attr("d",E[e]),W.elementMouseout({data:t.data,index:e})})),K.on("mousemove",(function(t,e){W.elementMousemove({data:t.data,index:e})})),K.on("click",(function(t,e){W.elementClick({data:t.data,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this})})),K.on("dblclick",(function(t,e){W.elementDblClick({data:t.data,index:e,color:d3.select(this).style("fill")})})),Z.attr("fill",(function(t,e){return l(t.data,e)})),Z.attr("stroke",(function(t,e){return l(t.data,e)})),K.append("path").each((function(t){this._current=t})),Z.select("path").transition().duration(C).attr("d",(function(t,e){return E[e](t)})).attrTween("d",(function(t,e){t.endAngle=isNaN(t.endAngle)?0:t.endAngle,t.startAngle=isNaN(t.startAngle)?0:t.startAngle,g||(t.innerRadius=0);var n=d3.interpolate(this._current,t);return this._current=n(0),function(t){return E[e](n(t))}})),c){var U=[];for(I=0;I<_[0].length;I++)U.push(E[I]),d?g&&(U[I]=d3.svg.arc().outerRadius(E[I].outerRadius()),!1!==b&&U[I].startAngle(b),!1!==w&&U[I].endAngle(w)):g||U[I].innerRadius(0);q.enter().append("g").classed("nv-label",!0).each((function(t,e){var n=d3.select(this);n.attr("transform",(function(t,e){if(x){t.outerRadius=B[e]+10,t.innerRadius=B[e]+15;var n=(t.startAngle+t.endAngle)/2*(180/Math.PI);return(t.startAngle+t.endAngle)/2<Math.PI?n-=90:n+=90,"translate("+U[e].centroid(t)+") rotate("+n+")"}return t.outerRadius=L+10,t.innerRadius=L+15,"translate("+U[e].centroid(t)+")"})),n.append("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3),n.append("text").style("text-anchor",x?(t.startAngle+t.endAngle)/2<Math.PI?"start":"end":"middle").style("fill","#000")}));var Q={},$=function(t){return 140*Math.floor(t[0]/140)+","+14*Math.floor(t[1]/14)},J=function(t){return(t.endAngle-t.startAngle)/(2*Math.PI)};q.watchTransition(D,"pie labels").attr("transform",(function(t,e){if(x){t.outerRadius=B[e]+10,t.innerRadius=B[e]+15;var n=(t.startAngle+t.endAngle)/2*(180/Math.PI);return(t.startAngle+t.endAngle)/2<Math.PI?n-=90:n+=90,"translate("+U[e].centroid(t)+") rotate("+n+")"}t.outerRadius=L+10,t.innerRadius=L+15;var r=U[e].centroid(t),i=J(t);if(t.value&&i>=p){var o=$(r);Q[o]&&(r[1]-=14),Q[$(r)]=!0}return"translate("+r+")"})),q.select(".nv-label text").style("text-anchor",(function(t,e){return x?(t.startAngle+t.endAngle)/2<Math.PI?"start":"end":"middle"})).text((function(t,e){var n=J(t),r="";if(!t.value||n<p)return"";if("function"==typeof f)r=f(t,e,{key:i(t.data),value:o(t.data),percent:u(n)});else switch(f){case"key":r=i(t.data);break;case"value":r=u(o(t.data));break;case"percent":r=d3.format("%")(n)}return r})),h&&q.each((function(t,e){if(this.getBBox){var n=this.getBBox(),i=U[e].centroid(t),o={x:i[0]+n.x,y:i[1]+n.y},a={x:o.x+n.width,y:o.y},s={x:o.x,y:o.y+n.height},l={x:o.x+n.width,y:o.y+n.height};t.visible=r.utils.pointIsInArc(o,t,R)&&r.utils.pointIsInArc(a,t,R)&&r.utils.pointIsInArc(s,t,R)&&r.utils.pointIsInArc(l,t,R)}})).style("display",(function(t){return t.visible?null:"none"}))}})),D.renderEnd("pie immediate"),_}return _.dispatch=W,_.options=r.utils.optionsFunc.bind(_),_._options=Object.create({},{arcsRadius:{get:function(){return S},set:function(t){S=t}},width:{get:function(){return e},set:function(t){e=t}},height:{get:function(){return n},set:function(t){n=t}},showLabels:{get:function(){return c},set:function(t){c=t}},title:{get:function(){return v},set:function(t){v=t}},titleOffset:{get:function(){return y},set:function(t){y=t}},labelThreshold:{get:function(){return p},set:function(t){p=t}},hideOverlapLabels:{get:function(){return h},set:function(t){h=t}},valueFormat:{get:function(){return u},set:function(t){u=t}},x:{get:function(){return i},set:function(t){i=t}},id:{get:function(){return a},set:function(t){a=t}},endAngle:{get:function(){return w},set:function(t){w=t}},startAngle:{get:function(){return b},set:function(t){b=t}},padAngle:{get:function(){return k},set:function(t){k=t}},cornerRadius:{get:function(){return A},set:function(t){A=t}},donutRatio:{get:function(){return M},set:function(t){M=t}},labelsOutside:{get:function(){return d},set:function(t){d=t}},labelSunbeamLayout:{get:function(){return x},set:function(t){x=t}},donut:{get:function(){return g},set:function(t){g=t}},growOnHover:{get:function(){return m},set:function(t){m=t}},pieLabelsOutside:{get:function(){return d},set:function(t){d=t,r.deprecated("pieLabelsOutside","use labelsOutside instead")}},donutLabelsOutside:{get:function(){return d},set:function(t){d=t,r.deprecated("donutLabelsOutside","use labelsOutside instead")}},labelFormat:{get:function(){return u},set:function(t){u=t,r.deprecated("labelFormat","use valueFormat instead")}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},duration:{get:function(){return C},set:function(t){C=t,D.reset(C)}},y:{get:function(){return o},set:function(t){o=d3.functor(t)}},color:{get:function(){return l},set:function(t){l=r.utils.getColor(t)}},labelType:{get:function(){return f},set:function(t){f=t||"key"}}}),r.utils.initOptions(_),_},r.models.pieChart=function(){"use strict";var t=r.models.pie(),e=r.models.legend(),n=r.models.tooltip(),i={top:30,right:20,bottom:20,left:20},o=null,a=null,s=null,l=!1,u=!0,c="top",d=r.utils.defaultColor(),f=r.utils.state(),p=null,h=null,g=250,v=d3.dispatch("stateChange","changeState","renderEnd");n.duration(0).headerEnabled(!1).valueFormatter((function(e,n){return t.valueFormat()(e,n)}));var m=r.utils.renderWatch(v);function y(n){return m.reset(),m.models(t),n.each((function(n){var l=d3.select(this);r.utils.initSVG(l);var d,h=r.utils.availableWidth(a,l,i),g=r.utils.availableHeight(s,l,i);if(y.update=function(){l.transition().call(y)},y.container=this,f.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(n),y.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(n)).update(),f.disabled=n.map((function(t){return!!t.disabled})),!p)for(d in p={},f)f[d]instanceof Array?p[d]=f[d].slice(0):p[d]=f[d];if(!n||!n.length)return r.utils.noData(y,l),y;l.selectAll(".nv-noData").remove();var m=l.selectAll("g.nv-wrap.nv-pieChart").data([n]),x=m.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),b=m.select("g");if(x.append("g").attr("class","nv-pieWrap"),x.append("g").attr("class","nv-legendWrap"),u)if("top"===c)e.width(h).key(t.x()),m.select(".nv-legendWrap").datum(n).call(e),o||e.height()===i.top||(i.top=e.height(),g=r.utils.availableHeight(s,l,i)),m.select(".nv-legendWrap").attr("transform","translate(0,"+-i.top+")");else if("right"===c){var k=r.models.legend().width();h/2<k&&(k=h/2),e.height(g).key(t.x()),e.width(k),h-=e.width(),m.select(".nv-legendWrap").datum(n).call(e).attr("transform","translate("+h+",0)")}else"bottom"===c&&(e.width(h).key(t.x()),m.select(".nv-legendWrap").datum(n).call(e),i.bottom=e.height(),g=r.utils.availableHeight(s,l,i),m.select(".nv-legendWrap").attr("transform","translate(0,"+g+")"));else b.select(".nv-legendWrap").selectAll("*").remove();m.attr("transform","translate("+i.left+","+i.top+")"),t.width(h).height(g);var w=b.select(".nv-pieWrap").datum([n]);d3.transition(w).call(t),e.dispatch.on("stateChange",(function(t){for(var e in t)f[e]=t[e];v.stateChange(f),y.update()})),v.on("changeState",(function(t){void 0!==t.disabled&&(n.forEach((function(e,n){e.disabled=t.disabled[n]})),f.disabled=t.disabled),y.update()}))})),m.renderEnd("pieChart immediate"),y}return t.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:y.x()(t.data),value:y.y()(t.data),color:t.color,percent:t.percent},l||(delete t.percent,delete t.series.percent),n.data(t).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){n.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){n()})),y.legend=e,y.dispatch=v,y.pie=t,y.tooltip=n,y.options=r.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},noData:{get:function(){return h},set:function(t){h=t}},showTooltipPercent:{get:function(){return l},set:function(t){l=t}},showLegend:{get:function(){return u},set:function(t){u=t}},legendPosition:{get:function(){return c},set:function(t){c=t}},defaultState:{get:function(){return p},set:function(t){p=t}},color:{get:function(){return d},set:function(n){d=n,e.color(d),t.color(d)}},duration:{get:function(){return g},set:function(e){g=e,m.reset(g),t.duration(g)}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,o=t.top),i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}}}),r.utils.inheritOptions(y,t),r.utils.initOptions(y),y},r.models.sankey=function(){"use strict";var t={},e=24,n=8,i=[1,1],o=[],a=[],s=!0,l=function(t){o.forEach((function(t){t.sourceLinks=[],t.targetLinks=[]})),a.forEach((function(t){var e=t.source,n=t.target;"number"==typeof e&&(e=t.source=o[t.source]),"number"==typeof n&&(n=t.target=o[t.target]),e.sourceLinks.push(t),n.targetLinks.push(t)})),o.forEach((function(t){t.value=Math.max(d3.sum(t.sourceLinks,f),d3.sum(t.targetLinks,f))})),function(){for(var t,n,r=o,a=0;r.length&&a<o.length;)t=[],r.forEach((function(n){n.x=a,n.dx=e,n.sourceLinks.forEach((function(e){t.indexOf(e.target)<0&&t.push(e.target)}))})),r=t,++a;s&&function(t){o.forEach((function(e){e.sourceLinks.length||(e.x=t-1)}))}(a),n=(i[0]-e)/(a-1),o.forEach((function(t){t.x*=n}))}(),function(t){var e,r=d3.nest().key((function(t){return t.x})).sortKeys(d3.ascending).entries(o).map((function(t){return t.values}));e=d3.min(r,(function(t){return(i[1]-(t.length-1)*n)/d3.sum(t,f)})),r.forEach((function(t){t.forEach((function(t,n){t.y=n,t.dy=t.value*e}))})),a.forEach((function(t){t.dy=t.value*e})),p(),d();for(var s=1;t>0;--t)u(s*=.99),p(),d(),l(s),p(),d();function l(t){function e(t){return(t.source.y+t.sy+t.dy/2)*t.value}r.forEach((function(n,r){n.forEach((function(n){if(n.targetLinks.length){var r=d3.sum(n.targetLinks,e)/d3.sum(n.targetLinks,f);n.y+=(r-c(n))*t}}))}))}function u(t){function e(t){return(t.target.y+t.ty+t.dy/2)*t.value}r.slice().reverse().forEach((function(n){n.forEach((function(n){if(n.sourceLinks.length){var r=d3.sum(n.sourceLinks,e)/d3.sum(n.sourceLinks,f);n.y+=(r-c(n))*t}}))}))}function p(){r.forEach((function(t){var e,r,o,a=0,s=t.length;for(t.sort(h),o=0;o<s;++o)(r=a-(e=t[o]).y)>0&&(e.y+=r),a=e.y+e.dy+n;if((r=a-n-i[1])>0)for(a=e.y-=r,o=s-2;o>=0;--o)(r=(e=t[o]).y+e.dy+n-a)>0&&(e.y-=r),a=e.y}))}function h(t,e){return t.y-e.y}}(t)},u=function(){var t=.5;function e(e){var n=e.source.x+e.source.dx,r=e.target.x,i=d3.interpolateNumber(n,r),o=i(t),a=i(1-t),s=e.source.y+e.sy+e.dy/2,l=e.target.y+e.ty+e.dy/2;return"M"+n+","+s+"C"+o+","+s+" "+a+","+l+" "+r+","+l}return e.curvature=function(n){return arguments.length?(t=+n,e):t},e},c=function(t){return t.y+t.dy/2};function d(){function t(t,e){return t.source.y-e.source.y}function e(t,e){return t.target.y-e.target.y}o.forEach((function(n){n.sourceLinks.sort(e),n.targetLinks.sort(t)})),o.forEach((function(t){var e=0,n=0;t.sourceLinks.forEach((function(t){t.sy=e,e+=t.dy})),t.targetLinks.forEach((function(t){t.ty=n,n+=t.dy}))}))}function f(t){return t.value}return t.options=r.utils.optionsFunc.bind(t),t._options=Object.create({},{nodeWidth:{get:function(){return e},set:function(t){e=+t}},nodePadding:{get:function(){return n},set:function(t){n=t}},nodes:{get:function(){return o},set:function(t){o=t}},links:{get:function(){return a},set:function(t){a=t}},size:{get:function(){return i},set:function(t){i=t}},sinksRight:{get:function(){return s},set:function(t){s=t}},layout:{get:function(){l(32)},set:function(t){l(t)}},relayout:{get:function(){d()},set:function(t){}},center:{get:function(){return c()},set:function(t){"function"==typeof t&&(c=t)}},link:{get:function(){return u()},set:function(t){return"function"==typeof t&&(u=t),u()}}}),r.utils.initOptions(t),t},r.models.sankeyChart=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},e=r.models.sankey(),n=600,i=400,o=36,a=40,s="units",l=void 0,u=d3.format(",.0f"),c=function(t){return u(t)+" "+s},d=d3.scale.category20(),f=function(t){return t.source.name+" → "+t.target.name+"\n"+c(t.value)},p=function(t){return t.color=d(t.name.replace(/ .*/,""))},h=function(t){return d3.rgb(t.color).darker(2)},g=function(t){return t.name+"\n"+c(t.value)},v=function(t,e){t.append("text").attr("x",0).attr("y",0).attr("class","nvd3-sankey-chart-error").attr("text-anchor","middle").text(e)};function m(t){return t.each((function(r){var s={nodes:[{node:1,name:"Test 1"},{node:2,name:"Test 2"},{node:3,name:"Test 3"},{node:4,name:"Test 4"},{node:5,name:"Test 5"},{node:6,name:"Test 6"}],links:[{source:0,target:1,value:2295},{source:0,target:5,value:1199},{source:1,target:2,value:1119},{source:1,target:5,value:1176},{source:2,target:3,value:487},{source:2,target:5,value:632},{source:3,target:4,value:301},{source:3,target:5,value:186}]},u=!1,c=!1;if(("object"==typeof r.nodes&&r.nodes.length)>=0&&("object"==typeof r.links&&r.links.length)>=0&&(u=!0),r.nodes&&r.nodes.length>0&&r.links&&r.links.length>0&&(c=!0),!u)return console.error("NVD3 Sankey chart error:","invalid data format for",r),console.info("Valid data format is: ",s,JSON.stringify(s)),v(t,"Error loading chart, data is invalid"),!1;if(!c)return v(t,"No data available"),!1;var d=t.append("svg").attr("width",n).attr("height",i).append("g").attr("class","nvd3 nv-wrap nv-sankeyChart");e.nodeWidth(o).nodePadding(a).size([n,i]);var m=e.link();e.nodes(r.nodes).links(r.links).layout(32).center(l);var y=d.append("g").selectAll(".link").data(r.links).enter().append("path").attr("class","link").attr("d",m).style("stroke-width",(function(t){return Math.max(1,t.dy)})).sort((function(t,e){return e.dy-t.dy}));y.append("title").text(f);var x=d.append("g").selectAll(".node").data(r.nodes).enter().append("g").attr("class","node").attr("transform",(function(t){return"translate("+t.x+","+t.y+")"})).call(d3.behavior.drag().origin((function(t){return t})).on("dragstart",(function(){this.parentNode.appendChild(this)})).on("drag",(function(t){d3.select(this).attr("transform","translate("+t.x+","+(t.y=Math.max(0,Math.min(i-t.dy,d3.event.y)))+")"),e.relayout(),y.attr("d",m)})));x.append("rect").attr("height",(function(t){return t.dy})).attr("width",e.nodeWidth()).style("fill",p).style("stroke",h).append("title").text(g),x.append("text").attr("x",-6).attr("y",(function(t){return t.dy/2})).attr("dy",".35em").attr("text-anchor","end").attr("transform",null).text((function(t){return t.name})).filter((function(t){return t.x<n/2})).attr("x",6+e.nodeWidth()).attr("text-anchor","start")})),m}return m.options=r.utils.optionsFunc.bind(m),m._options=Object.create({},{units:{get:function(){return s},set:function(t){s=t}},width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return i},set:function(t){i=t}},format:{get:function(){return c},set:function(t){c=t}},linkTitle:{get:function(){return f},set:function(t){f=t}},nodeWidth:{get:function(){return o},set:function(t){o=t}},nodePadding:{get:function(){return a},set:function(t){a=t}},center:{get:function(){return l},set:function(t){l=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},nodeStyle:{get:function(){return{}},set:function(t){p=void 0!==t.fillColor?t.fillColor:p,h=void 0!==t.strokeColor?t.strokeColor:h,g=void 0!==t.title?t.title:g}}}),r.utils.initOptions(m),m},r.models.scatter=function(){"use strict";var t,e,n,i,o,a,s,l,u={top:0,right:0,bottom:0,left:0},c=null,d=null,f=r.utils.defaultColor(),p=null,h=Math.floor(1e5*Math.random()),g=null,v=d3.scale.linear(),m=d3.scale.linear(),y=d3.scale.linear(),x=function(t){return t.x},b=function(t){return t.y},k=function(t){return t.size||1},w=function(t){return t.shape||"circle"},A=[],M=[],C=[],S=!0,W=function(t){return!t.notActive},E=!1,F=.1,D=!1,_=!0,N=!1,O=function(){return 25},L=null,B=null,T=null,P=null,z=null,I=null,V=!1,H=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),Y=!0,G=250,R=300,X=!1,j=!1,Z=r.utils.renderWatch(H,G),q=[16,256],K={};function U(t){var e;return e=t[0].series+":"+t[1],K[e]=K[e]||{}}function Q(t){var e;e=t[0].series+":"+t[1],delete K[e]}function $(t){var e,n,r,i=U(t),o=!1;for(e=1;e<arguments.length;e+=2)n=arguments[e],r=arguments[e+1](t[0],t[1]),i[n]===r&&i.hasOwnProperty(n)||(i[n]=r,o=!0);return o}function J(G){return Z.reset(),G.each((function(G){g=d3.select(this);var K=r.utils.availableWidth(c,g,u),U=r.utils.availableHeight(d,g,u);r.utils.initSVG(g),G.forEach((function(t,e){t.values.forEach((function(t){t.series=e}))}));var tt="function"==typeof J.yScale().base,et=L&&B&&z?[]:d3.merge(G.map((function(t){return t.values.map((function(t,e){return{x:x(t,e),y:b(t,e),size:k(t,e)}}))})));if(v.domain(L||d3.extent(et.map((function(t){return t.x})).concat(A))),E&&G[0]?v.range(T||[(K*F+K)/(2*G[0].values.length),K-K*(1+F)/(2*G[0].values.length)]):v.range(T||[0,K]),tt){var nt=d3.min(et.map((function(t){if(0!==t.y)return t.y})));m.clamp(!0).domain(B||d3.extent(et.map((function(t){return 0!==t.y?t.y:.1*nt})).concat(M))).range(P||[U,0])}else m.domain(B||d3.extent(et.map((function(t){return t.y})).concat(M))).range(P||[U,0]);y.domain(z||d3.extent(et.map((function(t){return t.size})).concat(C))).range(I||q),V=v.domain()[0]===v.domain()[1]||m.domain()[0]===m.domain()[1],v.domain()[0]===v.domain()[1]&&(v.domain()[0]?v.domain([v.domain()[0]-.01*v.domain()[0],v.domain()[1]+.01*v.domain()[1]]):v.domain([-1,1])),m.domain()[0]===m.domain()[1]&&(m.domain()[0]?m.domain([m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]):m.domain([-1,1])),isNaN(v.domain()[0])&&v.domain([-1,1]),isNaN(m.domain()[0])&&m.domain([-1,1]),t=t||v,e=e||m,n=n||y;var rt=v(1)!==t(1)||m(1)!==e(1)||y(1)!==n(1);s=s||d;var it=(a=a||c)!==c||s!==d,ot=(i=i||[])[0]!==v.domain()[0]||i[1]!==v.domain()[1];i=v.domain(),o=o||[],ot=ot||o[0]!==m.domain()[0]||o[1]!==m.domain()[1],o=m.domain();var at=g.selectAll("g.nv-wrap.nv-scatter").data([G]),st=at.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+h),lt=st.append("defs"),ut=st.append("g"),ct=at.select("g");function dt(){if(j=!1,!S)return!1;if(!0===Y){at.select(".nv-point-paths").selectAll("path").remove();var t=d3.merge(G.map((function(t,e){return t.values.map((function(t,n){var i=x(t,n),o=b(t,n);return[r.utils.NaNtoZero(v(i))+1e-4*Math.random(),r.utils.NaNtoZero(m(o))+1e-4*Math.random(),e,n,t]})).filter((function(t,e){return W(t[4],e)}))})));if(0==t.length)return!1;t.length<3&&(t.push([v.range()[0]-20,m.range()[0]-20,null,null]),t.push([v.range()[1]+20,m.range()[1]+20,null,null]),t.push([v.range()[0]-20,m.range()[0]+20,null,null]),t.push([v.range()[1]+20,m.range()[1]-20,null,null]));var e=d3.geom.polygon([[-10,-10],[-10,d+10],[c+10,d+10],[c+10,-10]]);t=t.sort((function(t,e){return t[0]-e[0]||t[1]-e[1]}));for(var n=0;n<t.length-1;)Math.abs(t[n][0]-t[n+1][0])<1e-4&&Math.abs(t[n][1]-t[n+1][1])<1e-4?t.splice(n+1,1):n++;var i=d3.geom.voronoi(t).map((function(n,r){return{data:e.clip(n),series:t[r][2],point:t[r][3]}})),o=at.select(".nv-point-paths").selectAll("path").data(i),a=o.enter().append("svg:path").attr("d",(function(t){return t&&t.data&&0!==t.data.length?"M"+t.data.join(",")+"Z":"M 0 0"})).attr("id",(function(t,e){return"nv-path-"+e})).attr("clip-path",(function(t,e){return"url(#nv-clip-"+h+"-"+e+")"}));N&&a.style("fill",d3.rgb(230,230,230)).style("fill-opacity",.4).style("stroke-opacity",1).style("stroke",d3.rgb(200,200,200)),_&&(at.select(".nv-point-clips").selectAll("*").remove(),at.select(".nv-point-clips").selectAll("clipPath").data(t).enter().append("svg:clipPath").attr("id",(function(t,e){return"nv-clip-"+h+"-"+e})).append("svg:circle").attr("cx",(function(t){return t[0]})).attr("cy",(function(t){return t[1]})).attr("r",O));var s=function(t,e,n){if(j)return 0;var r=G[e.series];if(void 0!==r){var i=r.values[e.point];i.color=f(r,e.series),i.x=x(i),i.y=b(i);var o=g.node().getBoundingClientRect(),a=window.pageYOffset||document.documentElement.scrollTop,s=window.pageXOffset||document.documentElement.scrollLeft;n({point:i,series:r,pos:{left:v(x(i,e.point))+o.left+s+u.left+10,top:m(b(i,e.point))+o.top+a+u.top+10},relativePos:[v(x(i,e.point))+u.left,m(b(i,e.point))+u.top],seriesIndex:e.series,pointIndex:e.point,event:d3.event,element:t})}};o.on("click",(function(t){s(this,t,H.elementClick)})).on("dblclick",(function(t){s(this,t,H.elementDblClick)})).on("mouseover",(function(t){s(this,t,H.elementMouseover)})).on("mouseout",(function(t,e){s(this,t,H.elementMouseout)}))}else at.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",(function(t,e){if(j||!G[t.series])return 0;var n=G[t.series],r=n.values[e];H.elementClick({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,event:d3.event,element:this})})).on("dblclick",(function(t,e){if(j||!G[t.series])return 0;var n=G[t.series],r=n.values[e];H.elementDblClick({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e})})).on("mouseover",(function(t,e){if(j||!G[t.series])return 0;var n=G[t.series],r=n.values[e];H.elementMouseover({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,color:f(t,e)})})).on("mouseout",(function(t,e){if(j||!G[t.series])return 0;var n=G[t.series],r=n.values[e];H.elementMouseout({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,color:f(t,e)})}))}at.classed("nv-single-point",V),ut.append("g").attr("class","nv-groups"),ut.append("g").attr("class","nv-point-paths"),st.append("g").attr("class","nv-point-clips"),at.attr("transform","translate("+u.left+","+u.top+")"),lt.append("clipPath").attr("id","nv-edge-clip-"+h).append("rect").attr("transform","translate( -10, -10)"),at.select("#nv-edge-clip-"+h+" rect").attr("width",K+20).attr("height",U>0?U+20:0),ct.attr("clip-path",D?"url(#nv-edge-clip-"+h+")":""),j=!0;var ft=at.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));ft.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),ft.exit().remove(),ft.attr("class",(function(t,e){return(t.classed||"")+" nv-group nv-series-"+e})).classed("nv-noninteractive",!S).classed("hover",(function(t){return t.hover})),ft.watchTransition(Z,"scatter: groups").style("fill",(function(t,e){return f(t,e)})).style("stroke",(function(t,e){return t.pointBorderColor||p||f(t,e)})).style("stroke-opacity",1).style("fill-opacity",.5);var pt=ft.selectAll("path.nv-point").data((function(t){return t.values.map((function(t,e){return[t,e]})).filter((function(t,e){return W(t[0],e)}))}));if(pt.enter().append("path").attr("class",(function(t){return"nv-point nv-point-"+t[1]})).style("fill",(function(t){return t.color})).style("stroke",(function(t){return t.color})).attr("transform",(function(n){return"translate("+r.utils.NaNtoZero(t(x(n[0],n[1])))+","+r.utils.NaNtoZero(e(b(n[0],n[1])))+")"})).attr("d",r.utils.symbol().type((function(t){return w(t[0])})).size((function(t){return y(k(t[0],t[1]))}))),pt.exit().each(Q).remove(),ft.exit().selectAll("path.nv-point").watchTransition(Z,"scatter exit").attr("transform",(function(t){return"translate("+r.utils.NaNtoZero(v(x(t[0],t[1])))+","+r.utils.NaNtoZero(m(b(t[0],t[1])))+")"})).remove(),pt.filter((function(t){return $(t,"x",x,"y",b)||rt||it||ot})).watchTransition(Z,"scatter points").attr("transform",(function(t){return"translate("+r.utils.NaNtoZero(v(x(t[0],t[1])))+","+r.utils.NaNtoZero(m(b(t[0],t[1])))+")"})),pt.filter((function(t){return $(t,"shape",w,"size",k)||rt||it||ot})).watchTransition(Z,"scatter points").attr("d",r.utils.symbol().type((function(t){return w(t[0])})).size((function(t){return y(k(t[0],t[1]))}))),X){var ht=ft.selectAll(".nv-label").data((function(t){return t.values.map((function(t,e){return[t,e]})).filter((function(t,e){return W(t[0],e)}))}));ht.enter().append("text").style("fill",(function(t,e){return t.color})).style("stroke-opacity",0).style("fill-opacity",1).attr("transform",(function(n){return"translate("+(r.utils.NaNtoZero(t(x(n[0],n[1])))+Math.sqrt(y(k(n[0],n[1]))/Math.PI)+2)+","+r.utils.NaNtoZero(e(b(n[0],n[1])))+")"})).text((function(t,e){return t[0].label})),ht.exit().remove(),ft.exit().selectAll("path.nv-label").watchTransition(Z,"scatter exit").attr("transform",(function(t){return"translate("+(r.utils.NaNtoZero(v(x(t[0],t[1])))+Math.sqrt(y(k(t[0],t[1]))/Math.PI)+2)+","+r.utils.NaNtoZero(m(b(t[0],t[1])))+")"})).remove(),ht.each((function(t){d3.select(this).classed("nv-label",!0).classed("nv-label-"+t[1],!1).classed("hover",!1)})),ht.watchTransition(Z,"scatter labels").attr("transform",(function(t){return"translate("+(r.utils.NaNtoZero(v(x(t[0],t[1])))+Math.sqrt(y(k(t[0],t[1]))/Math.PI)+2)+","+r.utils.NaNtoZero(m(b(t[0],t[1])))+")"}))}R?(clearTimeout(l),l=setTimeout(dt,R)):dt(),t=v.copy(),e=m.copy(),n=y.copy(),a=c,s=d})),Z.renderEnd("scatter immediate"),J}return J.dispatch=H,J.options=r.utils.optionsFunc.bind(J),J._calls=new function(){this.clearHighlights=function(){return r.dom.write((function(){g.selectAll(".nv-point.hover").classed("hover",!1)})),null},this.highlightPoint=function(t,e,n){r.dom.write((function(){g.select(".nv-groups").selectAll(".nv-series-"+t).selectAll(".nv-point-"+e).classed("hover",n)}))}},H.on("elementMouseover.point",(function(t){S&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!0)})),H.on("elementMouseout.point",(function(t){S&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!1)})),J._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},xScale:{get:function(){return v},set:function(t){v=t}},yScale:{get:function(){return m},set:function(t){m=t}},pointScale:{get:function(){return y},set:function(t){y=t}},xDomain:{get:function(){return L},set:function(t){L=t}},yDomain:{get:function(){return B},set:function(t){B=t}},pointDomain:{get:function(){return z},set:function(t){z=t}},xRange:{get:function(){return T},set:function(t){T=t}},yRange:{get:function(){return P},set:function(t){P=t}},pointRange:{get:function(){return I},set:function(t){I=t}},forceX:{get:function(){return A},set:function(t){A=t}},forceY:{get:function(){return M},set:function(t){M=t}},forcePoint:{get:function(){return C},set:function(t){C=t}},interactive:{get:function(){return S},set:function(t){S=t}},pointActive:{get:function(){return W},set:function(t){W=t}},padDataOuter:{get:function(){return F},set:function(t){F=t}},padData:{get:function(){return E},set:function(t){E=t}},clipEdge:{get:function(){return D},set:function(t){D=t}},clipVoronoi:{get:function(){return _},set:function(t){_=t}},clipRadius:{get:function(){return O},set:function(t){O=t}},showVoronoi:{get:function(){return N},set:function(t){N=t}},id:{get:function(){return h},set:function(t){h=t}},interactiveUpdateDelay:{get:function(){return R},set:function(t){R=t}},showLabels:{get:function(){return X},set:function(t){X=t}},pointBorderColor:{get:function(){return p},set:function(t){p=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},pointSize:{get:function(){return k},set:function(t){k=d3.functor(t)}},pointShape:{get:function(){return w},set:function(t){w=d3.functor(t)}},margin:{get:function(){return u},set:function(t){u.top=void 0!==t.top?t.top:u.top,u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return G},set:function(t){G=t,Z.reset(G)}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t)}},useVoronoi:{get:function(){return Y},set:function(t){!1===(Y=t)&&(_=!1)}}}),r.utils.initOptions(J),J},r.models.scatterChart=function(){"use strict";var t=r.models.scatter(),e=r.models.axis(),n=r.models.axis(),i=r.models.legend(),o=r.models.distribution(),a=r.models.distribution(),s=r.models.tooltip(),l={top:30,right:20,bottom:50,left:75},u=null,c=null,d=null,f=null,p=r.utils.defaultColor(),h=t.xScale(),g=t.yScale(),v=!1,m=!1,y=!0,x=!0,b=!0,k=!1,w=r.utils.state(),A=null,M=d3.dispatch("stateChange","changeState","renderEnd"),C=null,S=250,W=!1;t.xScale(h).yScale(g),e.orient("bottom").tickPadding(10),n.orient(k?"right":"left").tickPadding(10),o.axis("x"),a.axis("y"),s.headerFormatter((function(t,n){return e.tickFormat()(t,n)})).valueFormatter((function(t,e){return n.tickFormat()(t,e)}));var E=r.utils.renderWatch(M,S);function F(C){return E.reset(),E.models(t),x&&E.models(e),b&&E.models(n),v&&E.models(o),m&&E.models(a),C.each((function(C){f=d3.select(this),r.utils.initSVG(f);var D,_=r.utils.availableWidth(c,f,l),N=r.utils.availableHeight(d,f,l);if(F.update=function(){0===S?f.call(F):f.transition().duration(S).call(F)},F.container=this,w.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(C),F.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(C)).update(),w.disabled=C.map((function(t){return!!t.disabled})),!A)for(D in A={},w)w[D]instanceof Array?A[D]=w[D].slice(0):A[D]=w[D];if(!(C&&C.length&&C.filter((function(t){return t.values.length})).length))return r.utils.noData(F,f),E.renderEnd("scatter immediate"),F;f.selectAll(".nv-noData").remove(),h=t.xScale(),g=t.yScale();var O=f.selectAll("g.nv-wrap.nv-scatterChart").data([C]),L=O.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+t.id()).append("g"),B=O.select("g");if(L.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis"),L.append("g").attr("class","nv-scatterWrap"),L.append("g").attr("class","nv-regressionLinesWrap"),L.append("g").attr("class","nv-distWrap"),L.append("g").attr("class","nv-legendWrap"),k&&B.select(".nv-y.nv-axis").attr("transform","translate("+_+",0)"),y){var T=_;i.width(T),O.select(".nv-legendWrap").datum(C).call(i),u||i.height()===l.top||(l.top=i.height(),N=r.utils.availableHeight(d,f,l)),O.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")}else B.select(".nv-legendWrap").selectAll("*").remove();O.attr("transform","translate("+l.left+","+l.top+")"),t.width(_).height(N).color(C.map((function(t,e){return t.color=t.color||p(t,e),t.color})).filter((function(t,e){return!C[e].disabled}))).showLabels(W),O.select(".nv-scatterWrap").datum(C.filter((function(t){return!t.disabled}))).call(t),O.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+t.id()+")");var P=O.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data((function(t){return t}));P.enter().append("g").attr("class","nv-regLines");var z=P.selectAll(".nv-regLine").data((function(t){return[t]}));z.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0),z.filter((function(t){return t.intercept&&t.slope})).watchTransition(E,"scatterPlusLineChart: regline").attr("x1",h.range()[0]).attr("x2",h.range()[1]).attr("y1",(function(t,e){return g(h.domain()[0]*t.slope+t.intercept)})).attr("y2",(function(t,e){return g(h.domain()[1]*t.slope+t.intercept)})).style("stroke",(function(t,e,n){return p(t,n)})).style("stroke-opacity",(function(t,e){return t.disabled||void 0===t.slope||void 0===t.intercept?0:1})),x&&(e.scale(h)._ticks(r.utils.calcTicksX(_/100,C)).tickSize(-N,0),B.select(".nv-x.nv-axis").attr("transform","translate(0,"+g.range()[0]+")").call(e)),b&&(n.scale(g)._ticks(r.utils.calcTicksY(N/36,C)).tickSize(-_,0),B.select(".nv-y.nv-axis").call(n)),v&&(o.getData(t.x()).scale(h).width(_).color(C.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!C[e].disabled}))),L.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),B.select(".nv-distributionX").attr("transform","translate(0,"+g.range()[0]+")").datum(C.filter((function(t){return!t.disabled}))).call(o)),m&&(a.getData(t.y()).scale(g).width(N).color(C.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!C[e].disabled}))),L.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),B.select(".nv-distributionY").attr("transform","translate("+(k?_:-a.size())+",0)").datum(C.filter((function(t){return!t.disabled}))).call(a)),i.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];M.stateChange(w),F.update()})),M.on("changeState",(function(t){void 0!==t.disabled&&(C.forEach((function(e,n){e.disabled=t.disabled[n]})),w.disabled=t.disabled),F.update()})),t.dispatch.on("elementMouseout.tooltip",(function(e){s.hidden(!0),f.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-distx-"+e.pointIndex).attr("y1",0),f.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-disty-"+e.pointIndex).attr("x2",a.size())})),t.dispatch.on("elementMouseover.tooltip",(function(t){f.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.relativePos[1]-N),f.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.relativePos[0]+o.size()),s.data(t).hidden(!1)})),h.copy(),g.copy()})),E.renderEnd("scatter with line immediate"),F}return F.dispatch=M,F.scatter=t,F.legend=i,F.xAxis=e,F.yAxis=n,F.distX=o,F.distY=a,F.tooltip=s,F.options=r.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},container:{get:function(){return f},set:function(t){f=t}},showDistX:{get:function(){return v},set:function(t){v=t}},showDistY:{get:function(){return m},set:function(t){m=t}},showLegend:{get:function(){return y},set:function(t){y=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return C},set:function(t){C=t}},duration:{get:function(){return S},set:function(t){S=t}},showLabels:{get:function(){return W},set:function(t){W=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,n.orient(t?"right":"left")}},color:{get:function(){return p},set:function(t){p=r.utils.getColor(t),i.color(p),o.color(p),a.color(p)}}}),r.utils.inheritOptions(F,t),r.utils.initOptions(F),F},r.models.sparkline=function(){"use strict";var t,e,n,i,o={top:2,right:0,bottom:2,left:0},a=400,s=32,l=null,u=!0,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=r.utils.getColor(["#000"]),g=!0,v=!0,m=d3.dispatch("renderEnd"),y=r.utils.renderWatch(m);function x(u){return y.reset(),u.each((function(u){var m=a-o.left-o.right,y=s-o.top-o.bottom;l=d3.select(this),r.utils.initSVG(l),c.domain(t||d3.extent(u,f)).range(n||[0,m]),d.domain(e||d3.extent(u,p)).range(i||[y,0]);var x=l.selectAll("g.nv-wrap.nv-sparkline").data([u]);x.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline").append("g"),x.select("g"),x.attr("transform","translate("+o.left+","+o.top+")");var b=x.selectAll("path").data((function(t){return[t]}));b.enter().append("path"),b.exit().remove(),b.style("stroke",(function(t,e){return t.color||h(t,e)})).attr("d",d3.svg.line().x((function(t,e){return c(f(t,e))})).y((function(t,e){return d(p(t,e))})));var k=x.selectAll("circle.nv-point").data((function(t){var e=t.map((function(t,e){return p(t,e)}));function n(e){if(-1!=e){var n=t[e];return n.pointIndex=e,n}return null}var r=n(e.lastIndexOf(d.domain()[1])),i=n(e.indexOf(d.domain()[0])),o=n(e.length-1);return[g?i:null,g?r:null,v?o:null].filter((function(t){return null!=t}))}));k.enter().append("circle"),k.exit().remove(),k.attr("cx",(function(t,e){return c(f(t,t.pointIndex))})).attr("cy",(function(t,e){return d(p(t,t.pointIndex))})).attr("r",2).attr("class",(function(t,e){return f(t,t.pointIndex)==c.domain()[1]?"nv-point nv-currentValue":p(t,t.pointIndex)==d.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"}))})),y.renderEnd("sparkline immediate"),x}return x.options=r.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xDomain:{get:function(){return t},set:function(e){t=e}},yDomain:{get:function(){return e},set:function(t){e=t}},xRange:{get:function(){return n},set:function(t){n=t}},yRange:{get:function(){return i},set:function(t){i=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},animate:{get:function(){return u},set:function(t){u=t}},showMinMaxPoints:{get:function(){return g},set:function(t){g=t}},showCurrentPoint:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=d3.functor(t)}},y:{get:function(){return p},set:function(t){p=d3.functor(t)}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return h},set:function(t){h=r.utils.getColor(t)}}}),x.dispatch=m,r.utils.initOptions(x),x},r.models.sparklinePlus=function(){"use strict";var t,e,n=r.models.sparkline(),i={top:15,right:100,bottom:10,left:50},o=null,a=null,s=[],l=!1,u=d3.format(",r"),c=d3.format(",.2f"),d=!0,f=!0,p=!1,h=null,g=d3.dispatch("renderEnd"),v=r.utils.renderWatch(g);function m(h){return v.reset(),v.models(n),h.each((function(h){var g=d3.select(this);r.utils.initSVG(g);var v=r.utils.availableWidth(o,g,i),y=r.utils.availableHeight(a,g,i);if(m.update=function(){g.call(m)},m.container=this,!h||!h.length)return r.utils.noData(m,g),m;g.selectAll(".nv-noData").remove();var x=n.y()(h[h.length-1],h.length-1);t=n.xScale(),e=n.yScale();var b=g.selectAll("g.nv-wrap.nv-sparklineplus").data([h]),k=b.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus").append("g"),w=b.select("g");k.append("g").attr("class","nv-sparklineWrap"),k.append("g").attr("class","nv-valueWrap"),k.append("g").attr("class","nv-hoverArea"),b.attr("transform","translate("+i.left+","+i.top+")");var A=w.select(".nv-sparklineWrap");if(n.width(v).height(y),A.call(n),d){var M=w.select(".nv-valueWrap").selectAll(".nv-currentValue").data([x]);M.enter().append("text").attr("class","nv-currentValue").attr("dx",p?-8:8).attr("dy",".9em").style("text-anchor",p?"end":"start"),M.attr("x",v+(p?i.right:0)).attr("y",f?function(t){return e(t)}:0).style("fill",n.color()(h[h.length-1],h.length-1)).text(c(x))}function C(){if(!l){var e=w.selectAll(".nv-hoverValue").data(s),r=e.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);e.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),e.attr("transform",(function(e){return"translate("+t(n.x()(h[e],e))+",0)"})).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),s.length&&(r.append("line").attr("x1",0).attr("y1",-i.top).attr("x2",0).attr("y2",y),r.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-i.top).attr("text-anchor","end").attr("dy",".9em"),w.select(".nv-hoverValue .nv-xValue").text(u(n.x()(h[s[0]],s[0]))),r.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-i.top).attr("text-anchor","start").attr("dy",".9em"),w.select(".nv-hoverValue .nv-yValue").text(c(n.y()(h[s[0]],s[0]))))}}k.select(".nv-hoverArea").append("rect").on("mousemove",(function(){if(!l){var e=d3.mouse(this)[0]-i.left;s=[function(t,e){for(var r=Math.abs(n.x()(t[0],0)-e),i=0,o=0;o<t.length;o++)Math.abs(n.x()(t[o],o)-e)<r&&(r=Math.abs(n.x()(t[o],o)-e),i=o);return i}(h,Math.round(t.invert(e)))],C()}})).on("click",(function(){l=!l})).on("mouseout",(function(){s=[],C()})),w.select(".nv-hoverArea rect").attr("transform",(function(t){return"translate("+-i.left+","+-i.top+")"})).attr("width",v+i.left+i.right).attr("height",y+i.top)})),v.renderEnd("sparklinePlus immediate"),m}return m.dispatch=g,m.sparkline=n,m.options=r.utils.optionsFunc.bind(m),m._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},xTickFormat:{get:function(){return u},set:function(t){u=t}},yTickFormat:{get:function(){return c},set:function(t){c=t}},showLastValue:{get:function(){return d},set:function(t){d=t}},alignValue:{get:function(){return f},set:function(t){f=t}},rightAlignValue:{get:function(){return p},set:function(t){p=t}},noData:{get:function(){return h},set:function(t){h=t}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}}}),r.utils.inheritOptions(m,n),r.utils.initOptions(m),m},r.models.stackedArea=function(){"use strict";var t,e,n={top:0,right:0,bottom:0,left:0},i=960,o=500,a=r.utils.defaultColor(),s=Math.floor(1e5*Math.random()),l=null,u=function(t){return t.x},c=function(t){return t.y},d=function(t,e){return!isNaN(c(t,e))&&null!==c(t,e)},f="stack",p="zero",h="default",g="linear",v=!1,m=r.models.scatter(),y=250,x=d3.dispatch("areaClick","areaMouseover","areaMouseout","renderEnd","elementClick","elementMouseover","elementMouseout");m.pointSize(2.2).pointDomain([2.2,2.2]);var b=r.utils.renderWatch(x,y);function k(f){return b.reset(),b.models(m),f.each((function(f){var y=i-n.left-n.right,w=o-n.top-n.bottom;l=d3.select(this),r.utils.initSVG(l),t=m.xScale(),e=m.yScale();var A=f;f.forEach((function(t,e){t.seriesIndex=e,t.values=t.values.map((function(t,n){return t.index=n,t.seriesIndex=e,t}))}));var M=f.filter((function(t){return!t.disabled}));f=d3.layout.stack().order(h).offset(p).values((function(t){return t.values})).x(u).y(c).out((function(t,e,n){t.display={y:n,y0:e}}))(M);var C=l.selectAll("g.nv-wrap.nv-stackedarea").data([f]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea"),W=S.append("defs"),E=S.append("g"),F=C.select("g");E.append("g").attr("class","nv-areaWrap"),E.append("g").attr("class","nv-scatterWrap"),C.attr("transform","translate("+n.left+","+n.top+")"),0==m.forceY().length&&m.forceY().push(0),m.width(y).height(w).x(u).y((function(t){if(void 0!==t.display)return t.display.y+t.display.y0})).color(f.map((function(t,e){return t.color=t.color||a(t,t.seriesIndex),t.color}))),F.select(".nv-scatterWrap").datum(f).call(m),W.append("clipPath").attr("id","nv-edge-clip-"+s).append("rect"),C.select("#nv-edge-clip-"+s+" rect").attr("width",y).attr("height",w),F.attr("clip-path",v?"url(#nv-edge-clip-"+s+")":"");var D=d3.svg.area().defined(d).x((function(e,n){return t(u(e,n))})).y0((function(t){return e(t.display.y0)})).y1((function(t){return e(t.display.y+t.display.y0)})).interpolate(g),_=d3.svg.area().defined(d).x((function(e,n){return t(u(e,n))})).y0((function(t){return e(t.display.y0)})).y1((function(t){return e(t.display.y0)})),N=F.select(".nv-areaWrap").selectAll("path.nv-area").data((function(t){return t}));N.enter().append("path").attr("class",(function(t,e){return"nv-area nv-area-"+e})).attr("d",(function(t,e){return _(t.values,t.seriesIndex)})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),x.areaMouseover({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),x.areaMouseout({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})).on("click",(function(t,e){d3.select(this).classed("hover",!1),x.areaClick({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})),N.exit().remove(),N.style("fill",(function(t,e){return t.color||a(t,t.seriesIndex)})).style("stroke",(function(t,e){return t.color||a(t,t.seriesIndex)})),N.watchTransition(b,"stackedArea path").attr("d",(function(t,e){return D(t.values,e)})),m.dispatch.on("elementMouseover.area",(function(t){F.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!0)})),m.dispatch.on("elementMouseout.area",(function(t){F.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!1)})),k.d3_stackedOffset_stackPercent=function(t){var e,n,r,i=t.length,o=t[0].length,a=[];for(n=0;n<o;++n){for(e=0,r=0;e<A.length;e++)r+=c(A[e].values[n]);if(r)for(e=0;e<i;e++)t[e][n][1]/=r;else for(e=0;e<i;e++)t[e][n][1]=0}for(n=0;n<o;++n)a[n]=0;return a}})),b.renderEnd("stackedArea immediate"),k}return k.dispatch=x,k.scatter=m,m.dispatch.on("elementClick",(function(){x.elementClick.apply(this,arguments)})),m.dispatch.on("elementMouseover",(function(){x.elementMouseover.apply(this,arguments)})),m.dispatch.on("elementMouseout",(function(){x.elementMouseout.apply(this,arguments)})),k.interpolate=function(t){return arguments.length?(g=t,k):g},k.duration=function(t){return arguments.length?(y=t,b.reset(y),m.duration(y),k):y},k.dispatch=x,k.scatter=m,k.options=r.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return i},set:function(t){i=t}},height:{get:function(){return o},set:function(t){o=t}},defined:{get:function(){return d},set:function(t){d=t}},clipEdge:{get:function(){return v},set:function(t){v=t}},offset:{get:function(){return p},set:function(t){p=t}},order:{get:function(){return h},set:function(t){h=t}},interpolate:{get:function(){return g},set:function(t){g=t}},x:{get:function(){return u},set:function(t){u=d3.functor(t)}},y:{get:function(){return c},set:function(t){c=d3.functor(t)}},margin:{get:function(){return n},set:function(t){n.top=void 0!==t.top?t.top:n.top,n.right=void 0!==t.right?t.right:n.right,n.bottom=void 0!==t.bottom?t.bottom:n.bottom,n.left=void 0!==t.left?t.left:n.left}},color:{get:function(){return a},set:function(t){a=r.utils.getColor(t)}},style:{get:function(){return f},set:function(t){switch(f=t){case"stack":k.offset("zero"),k.order("default");break;case"stream":k.offset("wiggle"),k.order("inside-out");break;case"stream-center":k.offset("silhouette"),k.order("inside-out");break;case"expand":k.offset("expand"),k.order("default");break;case"stack_percent":k.offset(k.d3_stackedOffset_stackPercent),k.order("default")}}},duration:{get:function(){return y},set:function(t){y=t,b.reset(y),m.duration(y)}}}),r.utils.inheritOptions(k,m),r.utils.initOptions(k),k},r.models.stackedAreaChart=function(){"use strict";var t,e,n=r.models.stackedArea(),i=r.models.axis(),o=r.models.axis(),a=r.models.legend(),s=r.models.legend(),l=r.interactiveGuideline(),u=r.models.tooltip(),c=r.models.focus(r.models.stackedArea()),d={top:10,right:25,bottom:50,left:60},f=null,p=null,h=null,g=r.utils.defaultColor(),v=!0,m=!0,y="top",x=!0,b=!0,k=!1,w=!1,A=!1,M=!0,C="TOTAL",S=r.utils.state(),W=null,E=null,F=d3.dispatch("stateChange","changeState","renderEnd"),D=250,_=["Stacked","Stream","Expanded"],N={},O=250;S.style=n.style(),i.orient("bottom").tickPadding(7),o.orient(k?"right":"left"),u.headerFormatter((function(t,e){return i.tickFormat()(t,e)})).valueFormatter((function(t,e){return o.tickFormat()(t,e)})),l.tooltip.headerFormatter((function(t,e){return i.tickFormat()(t,e)})).valueFormatter((function(t,e){return null==t?"N/A":o.tickFormat()(t,e)}));var L=null,B=null;s.updateState(!1);var T=r.utils.renderWatch(F),P=(n.style(),d3.format("%"));function z(u){return T.reset(),T.models(n),x&&T.models(i),b&&T.models(o),u.each((function(u){var E=d3.select(this);r.utils.initSVG(E);var T,I=r.utils.availableWidth(p,E,d),V=r.utils.availableHeight(h,E,d)-(w?c.height():0);if(z.update=function(){E.transition().duration(O).call(z)},z.container=this,S.setter(function(t){return function(e){void 0!==e.style&&e.style,void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(u),z.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),style:n.style()}}}(u)).update(),S.disabled=u.map((function(t){return!!t.disabled})),!W)for(T in W={},S)S[T]instanceof Array?W[T]=S[T].slice(0):W[T]=S[T];if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return r.utils.noData(z,E),z;E.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale();var H=E.selectAll("g.nv-wrap.nv-stackedAreaChart").data([u]),Y=H.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),G=H.select("g");Y.append("g").attr("class","nv-legendWrap"),Y.append("g").attr("class","nv-controlsWrap");var R=Y.append("g").attr("class","nv-focus");if(R.append("g").attr("class","nv-background").append("rect"),R.append("g").attr("class","nv-x nv-axis"),R.append("g").attr("class","nv-y nv-axis"),R.append("g").attr("class","nv-stackedWrap"),R.append("g").attr("class","nv-interactive"),Y.append("g").attr("class","nv-focusWrap"),m){var X=v&&"top"===y?I-D:I;if(a.width(X),G.select(".nv-legendWrap").datum(u).call(a),"bottom"===y){var j=10+(x?12:0);d.bottom=Math.max(a.height()+j,d.bottom);var Z=(V=r.utils.availableHeight(h,E,d)-(w?c.height():0))+j;G.select(".nv-legendWrap").attr("transform","translate(0,"+Z+")")}else"top"===y&&(f||d.top==a.height()||(d.top=a.height(),V=r.utils.availableHeight(h,E,d)-(w?c.height():0)),G.select(".nv-legendWrap").attr("transform","translate("+(I-X)+","+-d.top+")"))}else G.select(".nv-legendWrap").selectAll("*").remove();if(v){var q=[{key:N.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=n.style(),style:"stack"},{key:N.stream||"Stream",metaKey:"Stream",disabled:"stream"!=n.style(),style:"stream"},{key:N.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=n.style(),style:"expand"},{key:N.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=n.style(),style:"stack_percent"}];D=_.length/3*260,q=q.filter((function(t){return-1!==_.indexOf(t.metaKey)})),s.width(D).color(["#444","#444","#444"]),G.select(".nv-controlsWrap").datum(q).call(s);var K=Math.max(s.height(),m&&"top"===y?a.height():0);d.top!=K&&(d.top=K,V=r.utils.availableHeight(h,E,d)-(w?c.height():0)),G.select(".nv-controlsWrap").attr("transform","translate(0,"+-d.top+")")}else G.select(".nv-controlsWrap").selectAll("*").remove();H.attr("transform","translate("+d.left+","+d.top+")"),k&&G.select(".nv-y.nv-axis").attr("transform","translate("+I+",0)"),A&&(l.width(I).height(V).margin({left:d.left,top:d.top}).svgContainer(E).xScale(t),H.select(".nv-interactive").call(l)),G.select(".nv-focus .nv-background rect").attr("width",I).attr("height",V),n.width(I).height(V).color(u.map((function(t,e){return t.color||g(t,e)})).filter((function(t,e){return!u[e].disabled})));var U,Q=G.select(".nv-focus .nv-stackedWrap").datum(u.filter((function(t){return!t.disabled})));function $(){x&&G.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+V+")").transition().duration(O).call(i)}function J(){if(b){if("expand"===n.style()||"stack_percent"===n.style()){var t=o.tickFormat();L&&t===P||(L=t),o.tickFormat(P)}else L&&(o.tickFormat(L),L=null);G.select(".nv-focus .nv-y.nv-axis").transition().duration(0).call(o)}}if(x&&i.scale(t)._ticks(r.utils.calcTicksX(I/100,u)).tickSize(-V,0),b&&(U="wiggle"===n.offset()?0:r.utils.calcTicksY(V/36,u),o.scale(e)._ticks(U).tickSize(-I,0)),w){c.width(I),G.select(".nv-focusWrap").attr("transform","translate(0,"+(V+d.bottom+c.margin().top)+")").datum(u.filter((function(t){return!t.disabled}))).call(c);var tt=c.brush.empty()?c.xDomain():c.brush.extent();null!==tt&&et(tt)}else Q.transition().call(n),$(),J();function et(t){G.select(".nv-focus .nv-stackedWrap").datum(u.filter((function(t){return!t.disabled})).map((function(e,r){return{key:e.key,area:e.area,classed:e.classed,values:e.values.filter((function(e,r){return n.x()(e,r)>=t[0]&&n.x()(e,r)<=t[1]})),disableTooltip:e.disableTooltip}}))).transition().duration(O).call(n),$(),J()}n.dispatch.on("areaClick.toggle",(function(t){1===u.filter((function(t){return!t.disabled})).length?u.forEach((function(t){t.disabled=!1})):u.forEach((function(e,n){e.disabled=n!=t.seriesIndex})),S.disabled=u.map((function(t){return!!t.disabled})),F.stateChange(S),z.update()})),a.dispatch.on("stateChange",(function(t){for(var e in t)S[e]=t[e];F.stateChange(S),z.update()})),s.dispatch.on("legendClick",(function(t,e){t.disabled&&(q=q.map((function(t){return t.disabled=!0,t})),t.disabled=!1,n.style(t.style),S.style=n.style(),F.stateChange(S),z.update())})),l.dispatch.on("elementMousemove",(function(t){n.clearHighlights();var e,i,o,a=[],s=0,c=!0,d=!1;if(u.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(l,f){i=r.interactiveBisect(l.values,t.pointXValue,z.x());var p=l.values[i],h=z.y()(p,i);if(null!=h&&h>0&&(n.highlightPoint(f,i,!0),d=!0),f!==u.length-1||d||n.highlightPoint(f,i,!0),void 0!==p){void 0===e&&(e=p),void 0===o&&(o=z.xScale()(z.x()(p,i)));var v="expand"==n.style()?p.display.y:z.y()(p,i);a.push({key:l.key,value:v,color:g(l,l.seriesIndex),point:p}),M&&"expand"!=n.style()&&null!=v&&(s+=v,c=!1)}})),a.reverse(),a.length>2){var f=z.yScale().invert(t.mouseY),p=null;a.forEach((function(t,e){f=Math.abs(f);var n=Math.abs(t.point.display.y0),r=Math.abs(t.point.display.y);f>=n&&f<=r+n&&(p=e)})),null!=p&&(a[p].highlight=!0)}M&&"expand"!=n.style()&&a.length>=2&&!c&&a.push({key:C,value:s,total:!0});var h=z.x()(e,i),v=l.tooltip.valueFormatter();"expand"===n.style()||"stack_percent"===n.style()?(B||(B=v),v=d3.format(".1%")):B&&(v=B,B=null),l.tooltip.valueFormatter(v).data({value:h,series:a})(),l.renderGuideLine(o)})),l.dispatch.on("elementMouseout",(function(t){n.clearHighlights()})),c.dispatch.on("onBrush",(function(t){et(t)})),F.on("changeState",(function(t){void 0!==t.disabled&&u.length===t.disabled.length&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),S.disabled=t.disabled),void 0!==t.style&&(n.style(t.style),t.style),z.update()}))})),T.renderEnd("stacked Area chart immediate"),z}return n.dispatch.on("elementMouseover.tooltip",(function(t){t.point.x=n.x()(t.point),t.point.y=n.y()(t.point),u.data(t).hidden(!1)})),n.dispatch.on("elementMouseout.tooltip",(function(t){u.hidden(!0)})),z.dispatch=F,z.stacked=n,z.legend=a,z.controls=s,z.xAxis=i,z.x2Axis=c.xAxis,z.yAxis=o,z.y2Axis=c.yAxis,z.interactiveLayer=l,z.tooltip=u,z.focus=c,z.dispatch=F,z.options=r.utils.optionsFunc.bind(z),z._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return W},set:function(t){W=t}},noData:{get:function(){return E},set:function(t){E=t}},showControls:{get:function(){return v},set:function(t){v=t}},controlLabels:{get:function(){return N},set:function(t){N=t}},controlOptions:{get:function(){return _},set:function(t){_=t}},showTotalInTooltip:{get:function(){return M},set:function(t){M=t}},totalLabel:{get:function(){return C},set:function(t){C=t}},focusEnable:{get:function(){return w},set:function(t){w=t}},focusHeight:{get:function(){return c.height()},set:function(t){c.height(t)}},brushExtent:{get:function(){return c.brushExtent()},set:function(t){c.brushExtent(t)}},margin:{get:function(){return d},set:function(t){void 0!==t.top&&(d.top=t.top,f=t.top),d.right=void 0!==t.right?t.right:d.right,d.bottom=void 0!==t.bottom?t.bottom:d.bottom,d.left=void 0!==t.left?t.left:d.left}},focusMargin:{get:function(){return c.margin},set:function(t){c.margin.top=void 0!==t.top?t.top:c.margin.top,c.margin.right=void 0!==t.right?t.right:c.margin.right,c.margin.bottom=void 0!==t.bottom?t.bottom:c.margin.bottom,c.margin.left=void 0!==t.left?t.left:c.margin.left}},duration:{get:function(){return O},set:function(t){O=t,T.reset(O),n.duration(O),i.duration(O),o.duration(O)}},color:{get:function(){return g},set:function(t){g=r.utils.getColor(t),a.color(g),n.color(g),c.color(g)}},x:{get:function(){return n.x()},set:function(t){n.x(t),c.x(t)}},y:{get:function(){return n.y()},set:function(t){n.y(t),c.y(t)}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,o.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return A},set:function(t){A=!!t,z.interactive(!t),z.useVoronoi(!t),n.scatter.interactive(!t)}}}),r.utils.inheritOptions(z,n),r.utils.initOptions(z),z},r.models.stackedAreaWithFocusChart=function(){return r.models.stackedAreaChart().margin({bottom:30}).focusEnable(!0)},r.models.sunburst=function(){"use strict";var t,e,n,i,o={top:0,right:0,bottom:0,left:0},a=600,s=600,l="count",u={count:function(t){return 1},value:function(t){return t.value||t.size},size:function(t){return t.value||t.size}},c=Math.floor(1e4*Math.random()),d=null,f=r.utils.defaultColor(),p=!1,h=function(t){return"count"===l?t.name+" #"+t.value:t.name+" "+(t.value||t.size)},g=.02,v=function(t,e){return t.name>e.name},m=function(t,e){return void 0!==t.parent?t.name+"-"+t.parent.name+"-"+e:t.name},y=!0,x=500,b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),k=d3.scale.linear().range([0,2*Math.PI]),w=d3.scale.sqrt(),A=d3.layout.partition().sort(v),M={},C=d3.svg.arc().startAngle((function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x)))})).endAngle((function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))})).innerRadius((function(t){return Math.max(0,w(t.y))})).outerRadius((function(t){return Math.max(0,w(t.y+t.dy))}));function S(t){return W(t)>90?180:0}function W(t){return(Math.max(0,Math.min(2*Math.PI,k(t.x)))+Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx))))/2*(180/Math.PI)-90}function E(t){var e=Math.max(0,Math.min(2*Math.PI,k(t.x)));return(Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))-e)/(2*Math.PI)}function F(t){var e=Math.max(0,Math.min(2*Math.PI,k(t.x)));return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))-e>g}function D(e,n){var r=d3.interpolate(k.domain(),[t.x,t.x+t.dx]),o=d3.interpolate(w.domain(),[t.y,1]),a=d3.interpolate(w.range(),[t.y?20:0,i]);return 0===n?function(){return C(e)}:function(t){return k.domain(r(t)),w.domain(o(t)).range(a(t)),C(e)}}function _(t){var e=d3.interpolate({x:t.x0,dx:t.dx0,y:t.y0,dy:t.dy0},t);return function(n){var r=e(n);return t.x0=r.x,t.dx0=r.dx,t.y0=r.y,t.dy0=r.dy,C(r)}}function N(t){t.forEach((function(t){var e=m(t),n=M[e];n?(t.dx0=n.dx,t.x0=n.x,t.dy0=n.dy,t.y0=n.y):(t.dx0=t.dx,t.x0=t.x,t.dy0=t.dy,t.y0=t.y),function(t){var e=m(t);M[e]||(M[e]={});var n=M[e];n.dx=t.dx,n.x=t.x,n.dy=t.dy,n.y=t.y}(t)}))}function O(e){var n=d.selectAll("text"),r=d.selectAll("path");n.transition().attr("opacity",0),t=e,r.transition().duration(x).attrTween("d",D).each("end",(function(t){t.x>=e.x&&t.x<e.x+e.dx&&t.depth>=e.depth&&d3.select(this.parentNode).select("text").transition().duration(x).text((function(t){return h(t)})).attr("opacity",(function(t){return F(t)?1:0})).attr("transform",(function(){var n=this.getBBox().width;if(0===t.depth)return"translate("+n/2*-1+",0)";if(t.depth===e.depth)return"translate("+(w(t.y)+5)+",0)";var r=W(t),i=S(t);return 0===i?"rotate("+r+")translate("+(w(t.y)+5)+",0)":"rotate("+r+")translate("+(w(t.y)+n+5)+",0)rotate("+i+")"}))}))}var L=r.utils.renderWatch(b);function B(t){return L.reset(),t.each((function(t){d=d3.select(this),e=r.utils.availableWidth(a,d,o),n=r.utils.availableHeight(s,d,o),i=Math.min(e,n)/2,w.range([0,i]);var g=d.select("g.nvd3.nv-wrap.nv-sunburst");g[0][0]?g.attr("transform","translate("+(e/2+o.left+o.right)+","+(n/2+o.top+o.bottom)+")"):g=d.append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+c).attr("transform","translate("+(e/2+o.left+o.right)+","+(n/2+o.top+o.bottom)+")"),d.on("click",(function(t,e){b.chartClick({data:t,index:e,pos:d3.event,id:c})})),A.value(u[l]||u.count);var v=A.nodes(t[0]).reverse();N(v);var k=g.selectAll(".arc-container").data(v,m);k.enter().append("g").attr("class","arc-container").append("path").attr("d",C).style("fill",(function(t){return t.color?t.color:f(y?(t.children?t:t.parent).name:t.name)})).style("stroke","#FFF").on("click",(function(t,e){O(t),b.elementClick({data:t,index:e})})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0).style("opacity",.8),b.elementMouseover({data:t,color:d3.select(this).style("fill"),percent:E(t)})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1).style("opacity",1),b.elementMouseout({data:t})})).on("mousemove",(function(t,e){b.elementMousemove({data:t})})),k.each((function(t){d3.select(this).select("path").transition().duration(x).attrTween("d",_)})),p&&(k.selectAll("text").remove(),k.append("text").text((function(t){return h(t)})).transition().duration(x).attr("opacity",(function(t){return F(t)?1:0})).attr("transform",(function(t){var e=this.getBBox().width;if(0===t.depth)return"rotate(0)translate("+e/2*-1+",0)";var n=W(t),r=S(t);return 0===r?"rotate("+n+")translate("+(w(t.y)+5)+",0)":"rotate("+n+")translate("+(w(t.y)+e+5)+",0)rotate("+r+")"}))),O(v[v.length-1]),k.exit().transition().duration(x).attr("opacity",0).each("end",(function(t){var e=m(t);M[e]=void 0})).remove()})),L.renderEnd("sunburst immediate"),B}return B.dispatch=b,B.options=r.utils.optionsFunc.bind(B),B._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},mode:{get:function(){return l},set:function(t){l=t}},id:{get:function(){return c},set:function(t){c=t}},duration:{get:function(){return x},set:function(t){x=t}},groupColorByParent:{get:function(){return y},set:function(t){y=!!t}},showLabels:{get:function(){return p},set:function(t){p=!!t}},labelFormat:{get:function(){return h},set:function(t){h=t}},labelThreshold:{get:function(){return g},set:function(t){g=t}},sort:{get:function(){return v},set:function(t){v=t}},key:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return o},set:function(t){o.top=null!=t.top?t.top:o.top,o.right=null!=t.right?t.right:o.right,o.bottom=null!=t.bottom?t.bottom:o.bottom,o.left=null!=t.left?t.left:o.left}},color:{get:function(){return f},set:function(t){f=r.utils.getColor(t)}}}),r.utils.initOptions(B),B},r.models.sunburstChart=function(){"use strict";var t=r.models.sunburst(),e=r.models.tooltip(),n={top:30,right:20,bottom:20,left:20},i=r.utils.defaultColor(),o=!1,a=(Math.round(1e5*Math.random()),null),s=null,l=250,u=d3.dispatch("stateChange","changeState","renderEnd"),c=r.utils.renderWatch(u);function d(e){return c.reset(),c.models(t),e.each((function(e){var i=d3.select(this);r.utils.initSVG(i);var o=r.utils.availableWidth(null,i,n),a=r.utils.availableHeight(null,i,n);if(d.update=function(){0===l?i.call(d):i.transition().duration(l).call(d)},d.container=i,!e||!e.length)return r.utils.noData(d,i),d;i.selectAll(".nv-noData").remove(),t.width(o).height(a).margin(n),i.call(t)})),c.renderEnd("sunburstChart immediate"),d}return e.duration(0).headerEnabled(!1).valueFormatter((function(t){return t})),t.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:t.data.name,value:t.data.value||t.data.size,color:t.color,percent:t.percent},o||(delete t.percent,delete t.series.percent),e.data(t).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){e.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){e()})),d.dispatch=u,d.sunburst=t,d.tooltip=e,d.options=r.utils.optionsFunc.bind(d),d._options=Object.create({},{noData:{get:function(){return s},set:function(t){s=t}},defaultState:{get:function(){return a},set:function(t){a=t}},showTooltipPercent:{get:function(){return o},set:function(t){o=t}},color:{get:function(){return i},set:function(e){i=e,t.color(i)}},duration:{get:function(){return l},set:function(e){l=e,c.reset(l),t.duration(l)}},margin:{get:function(){return n},set:function(e){n.top=void 0!==e.top?e.top:n.top,n.right=void 0!==e.right?e.right:n.right,n.bottom=void 0!==e.bottom?e.bottom:n.bottom,n.left=void 0!==e.left?e.left:n.left,t.margin(n)}}}),r.utils.inheritOptions(d,t),r.utils.initOptions(d),d},r.version="1.8.6"}}]);