-
-
Save hamilton/67d7904af5cd696ec2b12450b69bd657 to your computer and use it in GitHub Desktop.
by-neighborhood
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date,nbrhd,count | |
1997-01-01,Inner Richmond,121 | |
1997-01-01,Japantown,7 | |
1997-01-01,Glen Park,16 | |
1997-01-01,Western Addition,45 | |
1997-01-01,Outer Richmond,144 | |
1997-01-01,Tenderloin,56 | |
1997-01-01,Financial District/South Beach,6 | |
1997-01-01,Excelsior,56 | |
1997-01-01,Presidio Heights,36 | |
1997-01-01,Bernal Heights,100 | |
1997-01-01,Lakeshore,77 | |
1997-01-01,Portola,22 | |
1997-01-01,Potrero Hill,50 | |
1997-01-01,Treasure Island,2 | |
1997-01-01,Pacific Heights,86 | |
1997-01-01,Hayes Valley,104 | |
1997-01-01,OV/Merced/Ingleside,36 | |
1997-01-01,Visitacion Valley,21 | |
1997-01-01,Mission Bay,3 | |
1997-01-01,Castro/Upper Market,157 | |
1997-01-01,Sunset/Parkside,155 | |
1997-01-01,Nob Hill,86 | |
1997-01-01,South of Market,34 | |
1997-01-01,Chinatown,12 | |
1997-01-01,West of Twin Peaks,54 | |
1997-01-01,Noe Valley,88 | |
1997-01-01,North Beach,47 | |
1997-01-01,Marina,92 | |
1997-01-01,Haight Ashbury,123 | |
1997-01-01,Lincoln Park,4 | |
1997-01-01,Bayview Hunters Point,29 | |
1997-01-01,Seacliff,3 | |
1997-01-01,Lone Mountain/USF,107 | |
1997-01-01,Presidio,1 | |
1997-01-01,Mission,276 | |
1997-01-01,Inner Sunset,74 | |
1997-01-01,Russian Hill,76 | |
1997-01-01,Outer Mission,33 | |
1997-01-01,Twin Peaks,28 | |
1998-01-01,Inner Richmond,73 | |
1998-01-01,Japantown,7 | |
1998-01-01,Glen Park,41 | |
1998-01-01,Western Addition,26 | |
1998-01-01,Outer Richmond,150 | |
1998-01-01,Inner Sunset,110 | |
1998-01-01,Financial District/South Beach,14 | |
1998-01-01,OV/Merced/Ingleside,64 | |
1998-01-01,Presidio Heights,37 | |
1998-01-01,Bernal Heights,90 | |
1998-01-01,Lakeshore,89 | |
1998-01-01,Portola,69 | |
1998-01-01,Potrero Hill,66 | |
1998-01-01,Pacific Heights,91 | |
1998-01-01,Hayes Valley,178 | |
1998-01-01,Excelsior,76 | |
1998-01-01,Visitacion Valley,31 | |
1998-01-01,Mission Bay,1 | |
1998-01-01,Castro/Upper Market,146 | |
1998-01-01,Sunset/Parkside,209 | |
1998-01-01,Nob Hill,64 | |
1998-01-01,South of Market,43 | |
1998-01-01,Chinatown,23 | |
1998-01-01,West of Twin Peaks,67 | |
1998-01-01,Noe Valley,131 | |
1998-01-01,North Beach,73 | |
1998-01-01,Marina,116 | |
1998-01-01,Haight Ashbury,107 | |
1998-01-01,Lincoln Park,1 | |
1998-01-01,Bayview Hunters Point,61 | |
1998-01-01,Seacliff,3 | |
1998-01-01,Lone Mountain/USF,79 | |
1998-01-01,Mission,347 | |
1998-01-01,Tenderloin,65 | |
1998-01-01,Russian Hill,72 | |
1998-01-01,Outer Mission,42 | |
1998-01-01,Twin Peaks,21 | |
1999-01-01,Inner Richmond,69 | |
1999-01-01,Japantown,4 | |
1999-01-01,Glen Park,31 | |
1999-01-01,Western Addition,54 | |
1999-01-01,Outer Richmond,126 | |
1999-01-01,Inner Sunset,82 | |
1999-01-01,Financial District/South Beach,52 | |
1999-01-01,Excelsior,76 | |
1999-01-01,Presidio Heights,44 | |
1999-01-01,Bernal Heights,77 | |
1999-01-01,Lakeshore,70 | |
1999-01-01,Portola,31 | |
1999-01-01,Potrero Hill,69 | |
1999-01-01,Treasure Island,1 | |
1999-01-01,Pacific Heights,73 | |
1999-01-01,Hayes Valley,110 | |
1999-01-01,OV/Merced/Ingleside,42 | |
1999-01-01,Visitacion Valley,21 | |
1999-01-01,Marina,80 | |
1999-01-01,Sunset/Parkside,185 | |
1999-01-01,Nob Hill,59 | |
1999-01-01,South of Market,62 | |
1999-01-01,Chinatown,22 | |
1999-01-01,West of Twin Peaks,45 | |
1999-01-01,Noe Valley,89 | |
1999-01-01,North Beach,88 | |
1999-01-01,Castro/Upper Market,135 | |
1999-01-01,Haight Ashbury,104 | |
1999-01-01,Bayview Hunters Point,85 | |
1999-01-01,Seacliff,4 | |
1999-01-01,Lone Mountain/USF,65 | |
1999-01-01,Mission,309 | |
1999-01-01,Tenderloin,64 | |
1999-01-01,Russian Hill,83 | |
1999-01-01,Outer Mission,49 | |
1999-01-01,Twin Peaks,17 | |
2000-01-01,Inner Richmond,78 | |
2000-01-01,Japantown,5 | |
2000-01-01,Glen Park,20 | |
2000-01-01,Western Addition,34 | |
2000-01-01,Outer Richmond,161 | |
2000-01-01,Inner Sunset,81 | |
2000-01-01,Financial District/South Beach,19 | |
2000-01-01,OV/Merced/Ingleside,67 | |
2000-01-01,Presidio Heights,55 | |
2000-01-01,Bernal Heights,92 | |
2000-01-01,South of Market,43 | |
2000-01-01,Portola,31 | |
2000-01-01,Potrero Hill,56 | |
2000-01-01,Pacific Heights,92 | |
2000-01-01,Hayes Valley,137 | |
2000-01-01,Excelsior,74 | |
2000-01-01,Visitacion Valley,43 | |
2000-01-01,Castro/Upper Market,108 | |
2000-01-01,Sunset/Parkside,185 | |
2000-01-01,McLaren Park,1 | |
2000-01-01,Nob Hill,88 | |
2000-01-01,Lakeshore,7 | |
2000-01-01,Chinatown,24 | |
2000-01-01,West of Twin Peaks,41 | |
2000-01-01,Noe Valley,95 | |
2000-01-01,North Beach,58 | |
2000-01-01,Marina,69 | |
2000-01-01,Haight Ashbury,104 | |
2000-01-01,Lincoln Park,2 | |
2000-01-01,Bayview Hunters Point,89 | |
2000-01-01,Seacliff,2 | |
2000-01-01,Lone Mountain/USF,64 | |
2000-01-01,Mission,264 | |
2000-01-01,Tenderloin,80 | |
2000-01-01,Russian Hill,82 | |
2000-01-01,Outer Mission,60 | |
2000-01-01,Twin Peaks,33 | |
2001-01-01,Inner Richmond,82 | |
2001-01-01,Japantown,4 | |
2001-01-01,Glen Park,11 | |
2001-01-01,Western Addition,41 | |
2001-01-01,Outer Richmond,127 | |
2001-01-01,Inner Sunset,87 | |
2001-01-01,Financial District/South Beach,6 | |
2001-01-01,OV/Merced/Ingleside,54 | |
2001-01-01,Presidio Heights,33 | |
2001-01-01,Bernal Heights,64 | |
2001-01-01,South of Market,44 | |
2001-01-01,Portola,34 | |
2001-01-01,Potrero Hill,28 | |
2001-01-01,Pacific Heights,66 | |
2001-01-01,Hayes Valley,95 | |
2001-01-01,Excelsior,90 | |
2001-01-01,Visitacion Valley,45 | |
2001-01-01,Castro/Upper Market,118 | |
2001-01-01,Sunset/Parkside,166 | |
2001-01-01,Nob Hill,57 | |
2001-01-01,Lakeshore,7 | |
2001-01-01,Chinatown,27 | |
2001-01-01,West of Twin Peaks,48 | |
2001-01-01,Noe Valley,67 | |
2001-01-01,North Beach,51 | |
2001-01-01,Marina,67 | |
2001-01-01,Haight Ashbury,59 | |
2001-01-01,Bayview Hunters Point,74 | |
2001-01-01,Lone Mountain/USF,57 | |
2001-01-01,Presidio,4 | |
2001-01-01,Mission,278 | |
2001-01-01,Tenderloin,63 | |
2001-01-01,Russian Hill,50 | |
2001-01-01,Outer Mission,41 | |
2001-01-01,Twin Peaks,14 | |
2002-01-01,Inner Richmond,61 | |
2002-01-01,Japantown,5 | |
2002-01-01,Glen Park,17 | |
2002-01-01,Western Addition,26 | |
2002-01-01,Outer Richmond,82 | |
2002-01-01,Inner Sunset,57 | |
2002-01-01,Financial District/South Beach,11 | |
2002-01-01,OV/Merced/Ingleside,30 | |
2002-01-01,Presidio Heights,32 | |
2002-01-01,Bernal Heights,64 | |
2002-01-01,South of Market,34 | |
2002-01-01,Portola,13 | |
2002-01-01,Potrero Hill,30 | |
2002-01-01,Pacific Heights,68 | |
2002-01-01,Hayes Valley,51 | |
2002-01-01,Excelsior,56 | |
2002-01-01,Visitacion Valley,25 | |
2002-01-01,Marina,78 | |
2002-01-01,Sunset/Parkside,127 | |
2002-01-01,Nob Hill,61 | |
2002-01-01,Lakeshore,4 | |
2002-01-01,West of Twin Peaks,43 | |
2002-01-01,Chinatown,9 | |
2002-01-01,Noe Valley,48 | |
2002-01-01,North Beach,29 | |
2002-01-01,Castro/Upper Market,93 | |
2002-01-01,Haight Ashbury,76 | |
2002-01-01,Lincoln Park,1 | |
2002-01-01,Bayview Hunters Point,47 | |
2002-01-01,Seacliff,3 | |
2002-01-01,Lone Mountain/USF,34 | |
2002-01-01,Presidio,2 | |
2002-01-01,Mission,182 | |
2002-01-01,Tenderloin,75 | |
2002-01-01,Russian Hill,30 | |
2002-01-01,Outer Mission,24 | |
2002-01-01,Twin Peaks,9 | |
2003-01-01,Inner Richmond,42 | |
2003-01-01,Japantown,1 | |
2003-01-01,Glen Park,10 | |
2003-01-01,Western Addition,18 | |
2003-01-01,Outer Richmond,56 | |
2003-01-01,Inner Sunset,51 | |
2003-01-01,Financial District/South Beach,10 | |
2003-01-01,Excelsior,42 | |
2003-01-01,Presidio Heights,17 | |
2003-01-01,Bernal Heights,51 | |
2003-01-01,South of Market,29 | |
2003-01-01,Portola,8 | |
2003-01-01,Potrero Hill,24 | |
2003-01-01,Treasure Island,5 | |
2003-01-01,Pacific Heights,35 | |
2003-01-01,Hayes Valley,52 | |
2003-01-01,OV/Merced/Ingleside,46 | |
2003-01-01,Visitacion Valley,17 | |
2003-01-01,Marina,42 | |
2003-01-01,Sunset/Parkside,79 | |
2003-01-01,Nob Hill,66 | |
2003-01-01,Lakeshore,3 | |
2003-01-01,Chinatown,10 | |
2003-01-01,West of Twin Peaks,43 | |
2003-01-01,Noe Valley,53 | |
2003-01-01,North Beach,51 | |
2003-01-01,Castro/Upper Market,86 | |
2003-01-01,Haight Ashbury,63 | |
2003-01-01,Lincoln Park,1 | |
2003-01-01,Bayview Hunters Point,42 | |
2003-01-01,Seacliff,2 | |
2003-01-01,Lone Mountain/USF,33 | |
2003-01-01,Mission,176 | |
2003-01-01,Tenderloin,152 | |
2003-01-01,Russian Hill,14 | |
2003-01-01,Outer Mission,21 | |
2003-01-01,Twin Peaks,17 | |
2004-01-01,Inner Richmond,37 | |
2004-01-01,Japantown,1 | |
2004-01-01,Glen Park,8 | |
2004-01-01,Western Addition,18 | |
2004-01-01,Outer Richmond,79 | |
2004-01-01,Inner Sunset,35 | |
2004-01-01,Financial District/South Beach,6 | |
2004-01-01,Excelsior,37 | |
2004-01-01,Presidio Heights,20 | |
2004-01-01,Bernal Heights,45 | |
2004-01-01,South of Market,30 | |
2004-01-01,Portola,15 | |
2004-01-01,Potrero Hill,32 | |
2004-01-01,Treasure Island,28 | |
2004-01-01,Pacific Heights,39 | |
2004-01-01,Hayes Valley,45 | |
2004-01-01,OV/Merced/Ingleside,33 | |
2004-01-01,Visitacion Valley,14 | |
2004-01-01,Castro/Upper Market,88 | |
2004-01-01,Sunset/Parkside,65 | |
2004-01-01,Nob Hill,62 | |
2004-01-01,Lakeshore,7 | |
2004-01-01,Chinatown,22 | |
2004-01-01,West of Twin Peaks,29 | |
2004-01-01,Noe Valley,48 | |
2004-01-01,North Beach,27 | |
2004-01-01,Marina,75 | |
2004-01-01,Haight Ashbury,47 | |
2004-01-01,Lincoln Park,1 | |
2004-01-01,Bayview Hunters Point,31 | |
2004-01-01,Seacliff,1 | |
2004-01-01,Lone Mountain/USF,36 | |
2004-01-01,Mission,223 | |
2004-01-01,Tenderloin,79 | |
2004-01-01,Russian Hill,16 | |
2004-01-01,Outer Mission,12 | |
2004-01-01,Twin Peaks,13 | |
2005-01-01,Inner Richmond,33 | |
2005-01-01,Glen Park,6 | |
2005-01-01,Western Addition,21 | |
2005-01-01,Outer Richmond,81 | |
2005-01-01,Inner Sunset,40 | |
2005-01-01,Financial District/South Beach,10 | |
2005-01-01,OV/Merced/Ingleside,32 | |
2005-01-01,Presidio Heights,29 | |
2005-01-01,Bernal Heights,48 | |
2005-01-01,South of Market,68 | |
2005-01-01,Portola,8 | |
2005-01-01,Potrero Hill,21 | |
2005-01-01,Treasure Island,4 | |
2005-01-01,Pacific Heights,55 | |
2005-01-01,Hayes Valley,43 | |
2005-01-01,Excelsior,32 | |
2005-01-01,Visitacion Valley,14 | |
2005-01-01,Marina,29 | |
2005-01-01,Sunset/Parkside,74 | |
2005-01-01,Nob Hill,75 | |
2005-01-01,Lakeshore,22 | |
2005-01-01,Chinatown,11 | |
2005-01-01,West of Twin Peaks,27 | |
2005-01-01,Noe Valley,42 | |
2005-01-01,North Beach,21 | |
2005-01-01,Castro/Upper Market,102 | |
2005-01-01,Haight Ashbury,59 | |
2005-01-01,Bayview Hunters Point,25 | |
2005-01-01,Lone Mountain/USF,22 | |
2005-01-01,Mission,215 | |
2005-01-01,Tenderloin,171 | |
2005-01-01,Russian Hill,28 | |
2005-01-01,Outer Mission,23 | |
2005-01-01,Twin Peaks,23 | |
2006-01-01,Portola,16 | |
2006-01-01,Japantown,3 | |
2006-01-01,Glen Park,9 | |
2006-01-01,Western Addition,34 | |
2006-01-01,Outer Richmond,67 | |
2006-01-01,Tenderloin,102 | |
2006-01-01,Financial District/South Beach,10 | |
2006-01-01,Excelsior,30 | |
2006-01-01,Presidio Heights,21 | |
2006-01-01,Bernal Heights,37 | |
2006-01-01,Lakeshore,17 | |
2006-01-01,Inner Richmond,40 | |
2006-01-01,Potrero Hill,14 | |
2006-01-01,Treasure Island,7 | |
2006-01-01,Pacific Heights,46 | |
2006-01-01,Hayes Valley,49 | |
2006-01-01,OV/Merced/Ingleside,25 | |
2006-01-01,Visitacion Valley,9 | |
2006-01-01,Marina,27 | |
2006-01-01,Sunset/Parkside,79 | |
2006-01-01,Nob Hill,78 | |
2006-01-01,South of Market,35 | |
2006-01-01,West of Twin Peaks,36 | |
2006-01-01,Chinatown,9 | |
2006-01-01,Noe Valley,69 | |
2006-01-01,North Beach,52 | |
2006-01-01,Castro/Upper Market,116 | |
2006-01-01,Haight Ashbury,51 | |
2006-01-01,Lincoln Park,5 | |
2006-01-01,Bayview Hunters Point,31 | |
2006-01-01,Seacliff,3 | |
2006-01-01,Lone Mountain/USF,26 | |
2006-01-01,Mission,186 | |
2006-01-01,Inner Sunset,32 | |
2006-01-01,Russian Hill,46 | |
2006-01-01,Outer Mission,20 | |
2006-01-01,Twin Peaks,9 | |
2007-01-01,Inner Richmond,50 | |
2007-01-01,Japantown,4 | |
2007-01-01,Glen Park,12 | |
2007-01-01,Western Addition,16 | |
2007-01-01,Outer Richmond,65 | |
2007-01-01,Tenderloin,118 | |
2007-01-01,Financial District/South Beach,7 | |
2007-01-01,Excelsior,52 | |
2007-01-01,Presidio Heights,15 | |
2007-01-01,Bernal Heights,20 | |
2007-01-01,South of Market,45 | |
2007-01-01,Portola,14 | |
2007-01-01,Potrero Hill,11 | |
2007-01-01,Treasure Island,3 | |
2007-01-01,Pacific Heights,45 | |
2007-01-01,Hayes Valley,74 | |
2007-01-01,OV/Merced/Ingleside,29 | |
2007-01-01,Visitacion Valley,15 | |
2007-01-01,Mission Bay,2 | |
2007-01-01,Marina,49 | |
2007-01-01,Sunset/Parkside,100 | |
2007-01-01,McLaren Park,1 | |
2007-01-01,Nob Hill,71 | |
2007-01-01,Lakeshore,11 | |
2007-01-01,Chinatown,20 | |
2007-01-01,West of Twin Peaks,13 | |
2007-01-01,Noe Valley,45 | |
2007-01-01,North Beach,33 | |
2007-01-01,Castro/Upper Market,46 | |
2007-01-01,Haight Ashbury,47 | |
2007-01-01,Lincoln Park,2 | |
2007-01-01,Bayview Hunters Point,43 | |
2007-01-01,Lone Mountain/USF,24 | |
2007-01-01,Mission,163 | |
2007-01-01,Inner Sunset,69 | |
2007-01-01,Russian Hill,53 | |
2007-01-01,Outer Mission,24 | |
2007-01-01,Twin Peaks,23 | |
2008-01-01,Inner Richmond,52 | |
2008-01-01,Glen Park,8 | |
2008-01-01,Western Addition,24 | |
2008-01-01,Outer Richmond,96 | |
2008-01-01,Tenderloin,91 | |
2008-01-01,Financial District/South Beach,5 | |
2008-01-01,OV/Merced/Ingleside,27 | |
2008-01-01,Presidio Heights,19 | |
2008-01-01,Bernal Heights,46 | |
2008-01-01,South of Market,66 | |
2008-01-01,Portola,11 | |
2008-01-01,Potrero Hill,17 | |
2008-01-01,Treasure Island,1 | |
2008-01-01,Pacific Heights,39 | |
2008-01-01,Hayes Valley,75 | |
2008-01-01,Excelsior,56 | |
2008-01-01,Visitacion Valley,11 | |
2008-01-01,Mission Bay,1 | |
2008-01-01,Castro/Upper Market,90 | |
2008-01-01,Sunset/Parkside,71 | |
2008-01-01,Nob Hill,46 | |
2008-01-01,Lakeshore,13 | |
2008-01-01,West of Twin Peaks,23 | |
2008-01-01,Chinatown,16 | |
2008-01-01,Noe Valley,25 | |
2008-01-01,North Beach,38 | |
2008-01-01,Marina,40 | |
2008-01-01,Haight Ashbury,50 | |
2008-01-01,Bayview Hunters Point,41 | |
2008-01-01,Seacliff,1 | |
2008-01-01,Lone Mountain/USF,28 | |
2008-01-01,Presidio,1 | |
2008-01-01,Mission,151 | |
2008-01-01,Inner Sunset,48 | |
2008-01-01,Russian Hill,30 | |
2008-01-01,Outer Mission,16 | |
2008-01-01,Twin Peaks,23 | |
2009-01-01,Inner Richmond,20 | |
2009-01-01,Japantown,3 | |
2009-01-01,Glen Park,5 | |
2009-01-01,Western Addition,21 | |
2009-01-01,Outer Richmond,53 | |
2009-01-01,Tenderloin,101 | |
2009-01-01,Financial District/South Beach,13 | |
2009-01-01,Excelsior,49 | |
2009-01-01,Presidio Heights,12 | |
2009-01-01,Bernal Heights,30 | |
2009-01-01,Lakeshore,9 | |
2009-01-01,Portola,27 | |
2009-01-01,Potrero Hill,15 | |
2009-01-01,Treasure Island,20 | |
2009-01-01,Pacific Heights,38 | |
2009-01-01,Hayes Valley,46 | |
2009-01-01,OV/Merced/Ingleside,77 | |
2009-01-01,Visitacion Valley,9 | |
2009-01-01,Mission Bay,3 | |
2009-01-01,Castro/Upper Market,45 | |
2009-01-01,Sunset/Parkside,65 | |
2009-01-01,McLaren Park,2 | |
2009-01-01,Nob Hill,18 | |
2009-01-01,South of Market,42 | |
2009-01-01,Chinatown,13 | |
2009-01-01,West of Twin Peaks,13 | |
2009-01-01,Noe Valley,33 | |
2009-01-01,North Beach,17 | |
2009-01-01,Marina,13 | |
2009-01-01,Haight Ashbury,53 | |
2009-01-01,Bayview Hunters Point,44 | |
2009-01-01,Lone Mountain/USF,12 | |
2009-01-01,Mission,118 | |
2009-01-01,Inner Sunset,63 | |
2009-01-01,Russian Hill,22 | |
2009-01-01,Outer Mission,25 | |
2009-01-01,Twin Peaks,7 | |
2010-01-01,Portola,6 | |
2010-01-01,Japantown,1 | |
2010-01-01,Glen Park,10 | |
2010-01-01,Western Addition,19 | |
2010-01-01,Outer Richmond,51 | |
2010-01-01,Inner Sunset,34 | |
2010-01-01,Financial District/South Beach,8 | |
2010-01-01,OV/Merced/Ingleside,31 | |
2010-01-01,Presidio Heights,13 | |
2010-01-01,Bernal Heights,35 | |
2010-01-01,Golden Gate Park,1 | |
2010-01-01,South of Market,149 | |
2010-01-01,Inner Richmond,16 | |
2010-01-01,Potrero Hill,10 | |
2010-01-01,Treasure Island,7 | |
2010-01-01,Pacific Heights,23 | |
2010-01-01,Hayes Valley,33 | |
2010-01-01,Excelsior,20 | |
2010-01-01,Visitacion Valley,22 | |
2010-01-01,Mission Bay,1 | |
2010-01-01,Marina,50 | |
2010-01-01,Sunset/Parkside,58 | |
2010-01-01,McLaren Park,1 | |
2010-01-01,Nob Hill,29 | |
2010-01-01,Lakeshore,172 | |
2010-01-01,Chinatown,23 | |
2010-01-01,West of Twin Peaks,28 | |
2010-01-01,Noe Valley,31 | |
2010-01-01,North Beach,19 | |
2010-01-01,Castro/Upper Market,42 | |
2010-01-01,Haight Ashbury,41 | |
2010-01-01,Bayview Hunters Point,46 | |
2010-01-01,Lone Mountain/USF,23 | |
2010-01-01,Mission,114 | |
2010-01-01,Tenderloin,122 | |
2010-01-01,Russian Hill,10 | |
2010-01-01,Outer Mission,16 | |
2010-01-01,Twin Peaks,19 | |
2011-01-01,Inner Richmond,19 | |
2011-01-01,Japantown,4 | |
2011-01-01,Glen Park,13 | |
2011-01-01,Western Addition,17 | |
2011-01-01,Outer Richmond,50 | |
2011-01-01,Inner Sunset,31 | |
2011-01-01,Financial District/South Beach,6 | |
2011-01-01,OV/Merced/Ingleside,20 | |
2011-01-01,Presidio Heights,11 | |
2011-01-01,Bernal Heights,43 | |
2011-01-01,Golden Gate Park,2 | |
2011-01-01,Lakeshore,206 | |
2011-01-01,Portola,13 | |
2011-01-01,Potrero Hill,23 | |
2011-01-01,Pacific Heights,35 | |
2011-01-01,Hayes Valley,44 | |
2011-01-01,Excelsior,29 | |
2011-01-01,Visitacion Valley,12 | |
2011-01-01,Mission Bay,5 | |
2011-01-01,Castro/Upper Market,37 | |
2011-01-01,Sunset/Parkside,63 | |
2011-01-01,McLaren Park,1 | |
2011-01-01,Nob Hill,33 | |
2011-01-01,South of Market,37 | |
2011-01-01,Chinatown,34 | |
2011-01-01,West of Twin Peaks,23 | |
2011-01-01,Noe Valley,54 | |
2011-01-01,North Beach,26 | |
2011-01-01,Marina,39 | |
2011-01-01,Haight Ashbury,31 | |
2011-01-01,Bayview Hunters Point,36 | |
2011-01-01,Seacliff,4 | |
2011-01-01,Lone Mountain/USF,18 | |
2011-01-01,Mission,127 | |
2011-01-01,Tenderloin,50 | |
2011-01-01,Russian Hill,37 | |
2011-01-01,Outer Mission,30 | |
2011-01-01,Twin Peaks,13 | |
2012-01-01,Portola,25 | |
2012-01-01,Japantown,3 | |
2012-01-01,Glen Park,4 | |
2012-01-01,Western Addition,27 | |
2012-01-01,Outer Richmond,71 | |
2012-01-01,Inner Sunset,34 | |
2012-01-01,Financial District/South Beach,20 | |
2012-01-01,OV/Merced/Ingleside,22 | |
2012-01-01,Presidio Heights,11 | |
2012-01-01,Bernal Heights,33 | |
2012-01-01,South of Market,268 | |
2012-01-01,Inner Richmond,38 | |
2012-01-01,Potrero Hill,26 | |
2012-01-01,Pacific Heights,46 | |
2012-01-01,Hayes Valley,36 | |
2012-01-01,Excelsior,40 | |
2012-01-01,Visitacion Valley,14 | |
2012-01-01,Mission Bay,3 | |
2012-01-01,Marina,61 | |
2012-01-01,Sunset/Parkside,122 | |
2012-01-01,Nob Hill,69 | |
2012-01-01,Lakeshore,9 | |
2012-01-01,Chinatown,17 | |
2012-01-01,West of Twin Peaks,26 | |
2012-01-01,Noe Valley,31 | |
2012-01-01,North Beach,29 | |
2012-01-01,Castro/Upper Market,50 | |
2012-01-01,Haight Ashbury,52 | |
2012-01-01,Bayview Hunters Point,48 | |
2012-01-01,Lone Mountain/USF,54 | |
2012-01-01,Mission,170 | |
2012-01-01,Tenderloin,62 | |
2012-01-01,Russian Hill,59 | |
2012-01-01,Outer Mission,19 | |
2012-01-01,Twin Peaks,15 | |
2013-01-01,Inner Richmond,48 | |
2013-01-01,Japantown,1 | |
2013-01-01,Glen Park,11 | |
2013-01-01,Western Addition,33 | |
2013-01-01,Outer Richmond,86 | |
2013-01-01,Tenderloin,88 | |
2013-01-01,Financial District/South Beach,15 | |
2013-01-01,OV/Merced/Ingleside,38 | |
2013-01-01,Presidio Heights,14 | |
2013-01-01,Bernal Heights,53 | |
2013-01-01,Golden Gate Park,1 | |
2013-01-01,South of Market,123 | |
2013-01-01,Portola,10 | |
2013-01-01,Potrero Hill,19 | |
2013-01-01,Pacific Heights,57 | |
2013-01-01,Hayes Valley,35 | |
2013-01-01,Excelsior,65 | |
2013-01-01,Visitacion Valley,14 | |
2013-01-01,Marina,67 | |
2013-01-01,Sunset/Parkside,110 | |
2013-01-01,McLaren Park,3 | |
2013-01-01,Nob Hill,96 | |
2013-01-01,Lakeshore,97 | |
2013-01-01,Chinatown,16 | |
2013-01-01,West of Twin Peaks,52 | |
2013-01-01,Noe Valley,36 | |
2013-01-01,North Beach,86 | |
2013-01-01,Castro/Upper Market,71 | |
2013-01-01,Haight Ashbury,40 | |
2013-01-01,Lincoln Park,1 | |
2013-01-01,Bayview Hunters Point,53 | |
2013-01-01,Lone Mountain/USF,39 | |
2013-01-01,Mission,239 | |
2013-01-01,Inner Sunset,56 | |
2013-01-01,Russian Hill,38 | |
2013-01-01,Outer Mission,22 | |
2013-01-01,Twin Peaks,14 | |
2014-01-01,Portola,31 | |
2014-01-01,Japantown,6 | |
2014-01-01,Glen Park,6 | |
2014-01-01,Western Addition,50 | |
2014-01-01,Outer Richmond,120 | |
2014-01-01,Inner Sunset,42 | |
2014-01-01,Financial District/South Beach,9 | |
2014-01-01,OV/Merced/Ingleside,45 | |
2014-01-01,Presidio Heights,16 | |
2014-01-01,Bernal Heights,45 | |
2014-01-01,South of Market,67 | |
2014-01-01,Inner Richmond,42 | |
2014-01-01,Potrero Hill,36 | |
2014-01-01,Pacific Heights,77 | |
2014-01-01,Hayes Valley,61 | |
2014-01-01,Excelsior,76 | |
2014-01-01,Visitacion Valley,35 | |
2014-01-01,Mission Bay,1 | |
2014-01-01,Castro/Upper Market,103 | |
2014-01-01,Sunset/Parkside,128 | |
2014-01-01,Nob Hill,93 | |
2014-01-01,Lakeshore,85 | |
2014-01-01,Chinatown,31 | |
2014-01-01,West of Twin Peaks,29 | |
2014-01-01,Noe Valley,54 | |
2014-01-01,North Beach,52 | |
2014-01-01,Marina,61 | |
2014-01-01,Haight Ashbury,42 | |
2014-01-01,Lincoln Park,3 | |
2014-01-01,Bayview Hunters Point,60 | |
2014-01-01,Seacliff,5 | |
2014-01-01,Lone Mountain/USF,37 | |
2014-01-01,Mission,202 | |
2014-01-01,Tenderloin,103 | |
2014-01-01,Russian Hill,64 | |
2014-01-01,Outer Mission,39 | |
2014-01-01,Twin Peaks,9 | |
2015-01-01,Inner Richmond,53 | |
2015-01-01,Japantown,4 | |
2015-01-01,Glen Park,2 | |
2015-01-01,Western Addition,41 | |
2015-01-01,Outer Richmond,133 | |
2015-01-01,Tenderloin,164 | |
2015-01-01,Financial District/South Beach,7 | |
2015-01-01,Excelsior,88 | |
2015-01-01,Presidio Heights,15 | |
2015-01-01,Bernal Heights,75 | |
2015-01-01,Golden Gate Park,1 | |
2015-01-01,Lakeshore,82 | |
2015-01-01,Portola,31 | |
2015-01-01,Potrero Hill,36 | |
2015-01-01,Pacific Heights,59 | |
2015-01-01,Hayes Valley,72 | |
2015-01-01,OV/Merced/Ingleside,46 | |
2015-01-01,Visitacion Valley,29 | |
2015-01-01,Mission Bay,2 | |
2015-01-01,Marina,68 | |
2015-01-01,Sunset/Parkside,161 | |
2015-01-01,Nob Hill,67 | |
2015-01-01,South of Market,47 | |
2015-01-01,West of Twin Peaks,43 | |
2015-01-01,Chinatown,31 | |
2015-01-01,Noe Valley,41 | |
2015-01-01,North Beach,50 | |
2015-01-01,Castro/Upper Market,75 | |
2015-01-01,Haight Ashbury,58 | |
2015-01-01,Bayview Hunters Point,75 | |
2015-01-01,Seacliff,2 | |
2015-01-01,Lone Mountain/USF,42 | |
2015-01-01,Mission,176 | |
2015-01-01,Inner Sunset,47 | |
2015-01-01,Russian Hill,67 | |
2015-01-01,Outer Mission,51 | |
2015-01-01,Twin Peaks,21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.mg-active-datapoint { | |
fill: black; | |
font-size: 0.9rem; | |
font-weight: 400; | |
opacity: 0.8; | |
} | |
.mg-area1-color { | |
fill: #0000ff; | |
} | |
.mg-area2-color { | |
fill: #05b378; | |
} | |
.mg-area3-color { | |
fill: #db4437; | |
} | |
.mg-area4-color { | |
fill: #f8b128; | |
} | |
.mg-area5-color { | |
fill: #5c5c5c; | |
} | |
text.mg-barplot-group-label { | |
font-weight:900; | |
} | |
.mg-barplot rect.mg-bar { | |
shape-rendering: auto; | |
} | |
.mg-barplot rect.mg-bar.default-bar { | |
fill: #b6b6fc; | |
} | |
.mg-barplot rect.mg-bar.default-active { | |
fill: #9e9efc; | |
} | |
.mg-barplot .mg-bar-prediction { | |
fill: #5b5b5b; | |
} | |
.mg-barplot .mg-bar-baseline { | |
stroke: #5b5b5b; | |
stroke-width: 2; | |
} | |
.mg-bar-target-element { | |
font-size:11px; | |
padding-left:5px; | |
padding-right:5px; | |
font-weight:300; | |
} | |
.mg-baselines line { | |
opacity: 1; | |
shape-rendering: auto; | |
stroke: #b3b2b2; | |
stroke-width: 1px; | |
} | |
.mg-baselines text { | |
fill: black; | |
font-size: 0.9rem; | |
opacity: 0.6; | |
stroke: none; | |
} | |
.mg-baselines-small text { | |
font-size: 0.6rem; | |
} | |
.mg-category-guides line { | |
stroke: #b3b2b2; | |
} | |
.mg-header { | |
cursor: default; | |
font-size: 1.2rem; | |
} | |
.mg-header .mg-chart-description { | |
fill: #ccc; | |
font-family: FontAwesome; | |
font-size: 1.2rem; | |
} | |
.mg-header .mg-warning { | |
fill: #ccc; | |
font-family: FontAwesome; | |
font-size: 1.2rem; | |
} | |
.mg-points circle { | |
opacity: 0.65; | |
} | |
.mg-popover { | |
font-size: 0.95rem; | |
} | |
.mg-popover-content { | |
cursor: auto; | |
line-height: 17px; | |
} | |
.mg-data-table { | |
margin-top: 30px; | |
} | |
.mg-data-table thead tr th { | |
border-bottom: 1px solid darkgray; | |
cursor: default; | |
font-size: 1.1rem; | |
font-weight: normal; | |
padding: 5px 5px 8px 5px; | |
text-align: right; | |
} | |
.mg-data-table thead tr th .fa { | |
color: #ccc; | |
padding-left: 4px; | |
} | |
.mg-data-table thead tr th .popover { | |
font-size: 1rem; | |
font-weight: normal; | |
} | |
.mg-data-table .secondary-title { | |
color: darkgray; | |
} | |
.mg-data-table tbody tr td { | |
margin: 2px; | |
padding: 5px; | |
vertical-align: top; | |
} | |
.mg-data-table tbody tr td.table-text { | |
opacity: 0.8; | |
padding-left: 30px; | |
} | |
.mg-y-axis line.mg-extended-yax-ticks { | |
opacity: 0.4; | |
} | |
.mg-x-axis line.mg-extended-xax-ticks { | |
opacity: 0.4; | |
} | |
.mg-histogram .axis path, | |
.mg-histogram .axis line { | |
fill: none; | |
opacity: 0.7; | |
shape-rendering: auto; | |
stroke: #ccc; | |
} | |
tspan.hist-symbol { | |
fill: #9e9efc; | |
} | |
.mg-histogram .mg-bar rect { | |
fill: #b6b6fc; | |
shape-rendering: auto; | |
} | |
.mg-histogram .mg-bar rect.active { | |
fill: #9e9efc; | |
} | |
.mg-least-squares-line { | |
stroke: red; | |
stroke-width: 1px; | |
} | |
.mg-lowess-line { | |
fill: none; | |
stroke: red; | |
} | |
.mg-line1-color { | |
stroke: #4040e8; | |
} | |
.mg-hover-line1-color { | |
fill: #4040e8; | |
} | |
.mg-line2-color { | |
stroke: #05b378; | |
} | |
.mg-hover-line2-color { | |
fill: #05b378; | |
} | |
.mg-line3-color { | |
stroke: #db4437; | |
} | |
.mg-hover-line3-color { | |
fill: #db4437; | |
} | |
.mg-line4-color { | |
stroke: #f8b128; | |
} | |
.mg-hover-line4-color { | |
fill: #f8b128; | |
} | |
.mg-line5-color { | |
stroke: #5c5c5c; | |
} | |
.mg-hover-line5-color { | |
fill: #5c5c5c; | |
} | |
.mg-line-legend text { | |
font-size: 0.9rem; | |
font-weight: 300; | |
stroke: none; | |
} | |
.mg-line1-legend-color { | |
color: #4040e8; | |
fill: #4040e8; | |
} | |
.mg-line2-legend-color { | |
color: #05b378; | |
fill: #05b378; | |
} | |
.mg-line3-legend-color { | |
color: #db4437; | |
fill: #db4437; | |
} | |
.mg-line4-legend-color { | |
color: #f8b128; | |
fill: #f8b128; | |
} | |
.mg-line5-legend-color { | |
color: #5c5c5c; | |
fill: #5c5c5c; | |
} | |
.mg-main-area-solid svg .mg-main-area { | |
fill: #ccccff; | |
opacity: 1; | |
} | |
.mg-markers line { | |
opacity: 1; | |
shape-rendering: auto; | |
stroke: #b3b2b2; | |
stroke-width: 1px; | |
} | |
.mg-markers text { | |
fill: black; | |
font-size: 0.8rem; | |
opacity: 0.6; | |
} | |
.mg-missing-text { | |
opacity: 0.9; | |
} | |
.mg-missing-background { | |
stroke: blue; | |
fill: none; | |
stroke-dasharray: 10,5; | |
stroke-opacity: 0.05; | |
stroke-width: 2; | |
} | |
.mg-missing .mg-main-line { | |
opacity: 0.1; | |
} | |
.mg-missing .mg-main-area { | |
opacity: 0.03; | |
} | |
path.mg-main-area { | |
opacity: 0.2; | |
stroke: none; | |
} | |
path.mg-confidence-band { | |
fill: #ccc; | |
opacity: 0.4; | |
stroke: none; | |
} | |
path.mg-main-line { | |
fill: none; | |
opacity: 0.8; | |
stroke-width: 1.1px; | |
} | |
.mg-points circle { | |
fill-opacity: 0.4; | |
stroke-opacity: 1; | |
} | |
circle.mg-points-mono { | |
fill: #0000ff; | |
stroke: #0000ff; | |
} | |
tspan.mg-points-mono { | |
fill: #0000ff; | |
stroke: #0000ff; | |
} | |
/* a selected point in a scatterplot */ | |
.mg-points circle.selected { | |
fill-opacity: 1; | |
stroke-opacity: 1; | |
} | |
.mg-voronoi path { | |
fill: none; | |
pointer-events: all; | |
stroke: none; | |
stroke-opacity: 0.1; | |
} | |
.mg-x-rug-mono, | |
.mg-y-rug-mono { | |
stroke: black; | |
} | |
.mg-x-axis line, | |
.mg-y-axis line { | |
opacity: 1; | |
shape-rendering: auto; | |
stroke: #b3b2b2; | |
stroke-width: 1px; | |
} | |
.mg-x-axis text, | |
.mg-y-axis text, | |
.mg-histogram .axis text { | |
fill: black; | |
font-size: 0.9rem; | |
opacity: 0.6; | |
} | |
.mg-x-axis .label, | |
.mg-y-axis .label, | |
.mg-axis .label { | |
font-size: 0.8rem; | |
text-transform: uppercase; | |
font-weight: 400; | |
} | |
.mg-x-axis-small text, | |
.mg-y-axis-small text, | |
.mg-active-datapoint-small { | |
font-size: 0.6rem; | |
} | |
.mg-x-axis-small .label, | |
.mg-y-axis-small .label { | |
font-size: 0.65rem; | |
} | |
.mg-european-hours { | |
} | |
.mg-year-marker text { | |
fill: black; | |
font-size: 0.7rem; | |
opacity: 0.6; | |
} | |
.mg-year-marker line { | |
opacity: 1; | |
shape-rendering: auto; | |
stroke: #b3b2b2; | |
stroke-width: 1px; | |
} | |
.mg-year-marker-small text { | |
font-size: 0.6rem; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(t,e){"function"==typeof define&&define.amd?define(["d3"],e):"object"==typeof exports?module.exports=e(require("d3")):t.MG=e(t.d3)}(this,function(t){function e(){return"undefined"!=typeof jQuery||"undefined"!=typeof $}function r(t){var e;switch(t.processed.x_time_frame){case"millis":e=MG.time_format(t.utc_time,"%b %e, %Y %H:%M:%S.%L");break;case"seconds":e=MG.time_format(t.utc_time,"%b %e, %Y %H:%M:%S");break;case"less-than-a-day":e=MG.time_format(t.utc_time,"%b %e, %Y %I:%M%p");break;case"four-days":e=MG.time_format(t.utc_time,"%b %e, %Y %I:%M%p");break;default:e=MG.time_format(t.utc_time,"%b %e, %Y")}return e}function a(t,e){return t[e.x_accessor]>=e.processed.min_x&&t[e.x_accessor]<=e.processed.max_x&&t[e.y_accessor]>=e.processed.min_y&&t[e.y_accessor]<=e.processed.max_y}function n(t){return"[object Array]"===Object.prototype.toString.call(t)}function o(t){return"[object Function]"===Object.prototype.toString.call(t)}function i(t){return n(t)&&0===t.length}function s(t){return"[object Object]"===Object.prototype.toString.call(t)}function c(e){var r=e.map(function(t){return n(t)===!0&&t.length>0});return t.sum(r)===e.length}function l(e){var r=e.map(function(t){return s(t)===!0});return t.sum(r)===e.length}function u(t){return i(t)||l(t)}function f(t,e){return t.map(function(t){return t[e]})}function d(t){return t.reduce(function(t,e){return t[e]=t[e]+1||1,t},{})}function p(t){return t.height-t.bottom}function _(t){return p(t)-t.buffer}function m(t){return t.top}function g(t){return m(t)+t.buffer}function h(t){return t.left}function x(t){return h(t)+t.buffer}function y(t){return t.width-t.right}function v(t){return y(t)-t.buffer}function b(t){t.exit().remove()}function w(t,e){t.selectAll(e).remove()}function k(t,e){return t.append("g").classed(e,!0)}function M(t,e){var r=R(t.target),a=Y(t.data),n=r.selectAll("line."+e).data(a);return n.enter().append("line").attr("class",e).attr("opacity",.3),b(n),b(n),n}function G(t,e,r){e.color_accessor?(t.attr("stroke",e.scalefns.colorf),t.classed(r,!1)):(t.attr("stroke",null),t.classed(r,!0))}function A(e,r){r&&e.attr({dy:0,transform:function(){var e=t.select(this);return"rotate("+r+" "+e.attr("x")+","+e.attr("y")+")"}})}function D(t){if(t=t.node(),!t)return!1;for(var e=0;e<t.length;e++)if(C(t[e],t))return!0;return!1}function O(e,r){if(e&&1!=e.length)for(var a=0;a<e.length;a++)if(C(e[a],e)){var n=t.select(e[a]),o=+n.attr("y");o+8>=r.top&&(o=r.top-16),n.attr("y",o)}}function F(e,r){if(e&&1!=e.length){e.sort(function(e,r){return t.select(r).attr("y")-t.select(e).attr("y")}),e.reverse();for(var a,n,o,i=0;i<e.length;i++){n=t.select(e[i]).text();for(var s=0;s<e.length;s++)if(o=t.select(e[s]).text(),a=z(e[i],e[s]),a!==!1&&n!==o){var c=t.select(e[i]),l=+c.attr("y");l+=a,c.attr("y",l)}}}}function z(t,e){var r=t.getBoundingClientRect(),a=e.getBoundingClientRect();return r.top<=a.bottom&&r.top>=a.top&&a.bottom-r.top}function C(t,e){for(var r=t.getBoundingClientRect(),a=0;a<e.length;a++)if(e[a]!=t){var n=e[a].getBoundingClientRect();if(r.top===n.top&&!(n.left>r.right||n.right<r.left))return!0}return!1}function T(t,e){var r=Y(t.data);return r=r[0][t[e+"_accessor"]],"string"==typeof r?"categorical":"numerical"}function R(e){return t.select(e).select("svg")}function Y(t){var e=[];return e.concat.apply(e,t)}function E(){return"undefined"==typeof MG._next_elem_id&&(MG._next_elem_id=0),"mg-"+MG._next_elem_id++}function P(t){if("string"==typeof t)return L(t);if(t instanceof window.HTMLElement){var e=t.getAttribute("data-mg-uid");return e||(e=E(),t.setAttribute("data-mg-uid",e)),e}return console.warn("The specified target should be a string or an HTMLElement.",t),L(t)}function L(t){return t.replace(/[^a-zA-Z0-9 _-]+/g,"").replace(/ +?/g,"")}function S(e,r){return Number(t.select(e).style(r).replace(/px/g,""))}function j(t){return S(t,"width")}function X(t){return S(t,"height")}function U(t){return Sr(Array.prototype.slice.call(arguments,1),function(e){if(e)for(var r in e)void 0===t[r]&&(t[r]=e[r])}),t}function N(t){return"[object Date]"===Object.prototype.toString.call(t)}function B(t){return"[object Object]"===Object.prototype.toString.call(t)}function I(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function H(t){return"[object Function]"===Object.prototype.toString.call(t)}function q(t,e){var r,a=[],n=[];for(r=0;r<e.length;r++)a[e[r]]=!0;for(r=0;r<t.length;r++)a[t[r]]||n.push(t[r]);return n}function V(t,e){console.warn("Deprecation: "+t+(e?". This feature will be removed in "+e+".":" the near future.")),console.trace()}function W(t,e,r){var a,n=0;for(t.textContent=e,a=t.getBBox();a.width>r&&(t.textContent=e.slice(0,--n)+"...",a=t.getBBox(),"..."!==t.textContent););}function Q(e,r,a,n){e.each(function(){for(var e,o=t.select(this),i=o.text().split(a||/\s+/).reverse(),s=[],c=0,l=1.1,u=(o.attr("y"),0),f=o.text(null).append("tspan").attr("x",0).attr("y",u+"em").attr(n||{});e=i.pop();)s.push(e),f.text(s.join(" ")),(null===r||f.node().getComputedTextLength()>r)&&(s.pop(),f.text(s.join(" ")),s=[e],f=o.append("tspan").attr("x",0).attr("y",++c*l+u+"em").attr(n||{}).text(e))})}function Z(t,e,r){MG.charts[t]={descriptor:e,defaults:r||{}}}function K(r){"use strict";var a=R(r.target);if(a.select(".mg-header").remove(),r.target&&r.title){var n=a.insert("text").attr("class","mg-header").attr("x",r.center_title_full_width?r.width/2:(r.width+r.left-r.right)/2).attr("y",r.title_y_position).attr("text-anchor","middle").attr("dy","0.55em");if(n.append("tspan").attr("class","mg-chart-title").text(r.title),r.show_tooltips&&r.description&&e()){n.append("tspan").attr("class","mg-chart-description").attr("dx","0.3em").text("");var o=$(n.node());o.popover({html:!0,animation:!1,placement:"top",content:r.description,container:r.target,trigger:"manual",template:'<div class="popover mg-popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'}).on("mouseenter",function(){t.selectAll(r.target).selectAll(".mg-popover").remove(),$(this).popover("show"),$(t.select(r.target).select(".popover").node()).on("mouseleave",function(){o.popover("hide")})}).on("mouseleave",function(){setTimeout(function(){$(".popover:hover").length||o.popover("hide")},120)})}else r.show_tooltips&&r.description&&"undefined"==typeof $&&(r.error="In order to enable tooltips, please make sure you include jQuery.")}r.error&&Pr(r)}function J(t,e,r,a,n){t.scalefns[e]=function(e){return void 0===n?t.scales[r](e[a]):t.scales[r](e[a])+n}}function tt(t,e){return"bottom"===t||"top"===t?[x(e),v(e)]:"left"===t||"right"===t?[_(e),e.top]:void 0}function et(e){var r={};return r.use_inflator=!1,r.zero_bottom=!1,r.scaleType="numerical",this.namespace=function(t){return r.namespace=t,r.namespace_accessor_name=r.namespace+"_accessor",r.scale_name=r.namespace.toUpperCase(),r.scalefn_name=r.namespace+"f",this},this.scaleName=function(t){return r.scale_name=t.toUpperCase(),r.scalefn_name=t+"f",this},this.inflateDomain=function(t){return r.use_inflator=t,this},this.zeroBottom=function(t){return r.zero_bottom=t,this},this.numericalDomainFromData=function(){var a=[];arguments.length>0&&(a=arguments);for(var n,o=0;o<e.data.length;o++)e.data[o].length>0&&(n=e.data[o]);r.is_time_series=!!N(n[0][e[r.namespace_accessor_name]]),J(e,r.scalefn_name,r.scale_name,e[r.namespace_accessor_name]),rt(e,r,a,r.use_inflator);var i=e.utc_time?t.scaleUtc():t.scaleTime();return e.scales[r.scale_name]=r.is_time_series?i:H(e[r.namespace+"_scale_type"])?e.y_scale_type():"log"===e[r.namespace+"_scale_type"]?t.scaleLog():t.scaleLinear(),e.scales[r.scale_name].domain([e.processed["min_"+r.namespace],e.processed["max_"+r.namespace]]),r.scaleType="numerical",this},this.categoricalDomain=function(a){return e.scales[r.scale_name]=t.scaleOrdinal().domain(a),J(e,r.scalefn_name,r.scale_name,e[r.namespace_accessor_name]),this},this.categoricalDomainFromData=function(){var a=Y(e.data);return r.categoricalVariables=t.set(a.map(function(t){return t[e[r.namespace_accessor_name]]})).values(),e.scales[r.scale_name]=t.scaleBand().domain(r.categoricalVariables),r.scaleType="categorical",this},this.numericalRange=function(t){return"string"==typeof t?e.scales[r.scale_name].range(tt(t,e)):e.scales[r.scale_name].range(t),this},this.categoricalRangeBands=function(t,a){void 0===a&&(a=!1);var n=r.namespace,o=e[n+"_padding_percentage"],i=e[n+"_outer_padding_percentage"];return"string"==typeof t?e.scales[r.scale_name].range(tt(t,e)).paddingInner(o).paddingOuter(i):e.scales[r.scale_name].range(t).paddingInner(o).paddingOuter(i),J(e,r.scalefn_name,r.scale_name,e[r.namespace_accessor_name],a?e.scales[r.scale_name].bandwidth()/2:0),this},this.categoricalRange=function(t){return e.scales[r.scale_name].range(t),J(e,r.scalefn_name,r.scale_name,e[r.namespace_accessor_name]),this},this.categoricalColorRange=function(){return e.scales[r.scale_name]=e.scales[r.scale_name].domain().length>10?t.scaleOrdinal(t.schemeCategory20):t.scaleOrdinal(t.schemeCategory10),e.scales[r.scale_name].domain(r.categoricalVariables),J(e,r.scalefn_name,r.scale_name,e[r.namespace_accessor_name]),this},this.clamp=function(t){return e.scales[r.scale_name].clamp(t),this},this}function rt(e,r,a){var n=r.namespace,o=r.namespace_accessor_name,i=r.use_inflator,s=r.zero_bottom,c=e[o],l=Y(e.data).map(function(t){return t[c]}).concat(Y(a));"log"===e[n+"_scale_type"]&&(l=l.filter(function(t){return t>0}));var u=t.extent(l),f=u[0],d=u[1];s&&!e["min_"+n+"_from_data"]&&f>0&&!r.is_time_series&&(f="log"===e[n+"_scale_type"]?1:0),"log"!==e[n+"_scale_type"]&&f<0&&!r.is_time_series&&(f-=(f-f*e.inflator)*i),r.is_time_series||(d=d<0?d+(d-d*e.inflator)*i:d*(i?e.inflator:1)),f=e["min_"+n]||f,d=e["max_"+n]||d,f!==d||e["min_"+n]&&e["max_"+n]||(N(f)?(d=new Date(MG.clone(f).setDate(f.getDate()+1)),f=new Date(MG.clone(f).setDate(f.getDate()-1))):"number"==typeof f&&(f-=1,d=f+1,_e(e))),e.processed["min_"+n]=f,e.processed["max_"+n]=d,MG.call_hook("x_axis.process_min_max",e,e.processed.min_x,e.processed.max_x),MG.call_hook("y_axis.process_min_max",e,e.processed.min_y,e.processed.max_y)}function at(e,r){return t.set(e.map(function(t){return t[r]})).values()}function nt(e){var r;return null===e.color_domain?"number"===e.color_type?r=t.extent(e.data[0],function(t){return t[e.color_accessor]}):"category"===e.color_type&&(r=at(e.data[0],e.color_accessor)):r=e.color_domain,r}function ot(t){var e;return e=null===t.color_range?"number"===t.color_type?["blue","red"]:null:t.color_range}function it(t,e){function r(t){return 1e3===t?3:1e6===t?7:Math.log(t)/Math.LN10}var a=t[e+"_accessor"],n=t.scales[e.toUpperCase()].ticks(t[e+"ax_count"]),o=t.processed["max_"+e];"log"===t[e+"_scale_type"]&&(n=n.filter(function(t){return Math.abs(r(t))%1<1e-6||Math.abs(r(t))%1>1-1e-6}));var i=n.length,s=!0;t.data.forEach(function(t,e){t.forEach(function(t,e){if(t[a]%1!==0)return s=!1,!1})}),s&&i>o&&"count"===t.format&&(n=n.filter(function(t){return t%1===0})),t.processed[e+"_ticks"]=n}function st(t,e){var r=e.position,a=e.namespace,n={};return"left"===r&&(n.x1=h(t)+1,n.x2=h(t)+t.rug_buffer_size,n.y1=t.scalefns[a+"f"],n.y2=t.scalefns[a+"f"]),"right"===r&&(n.x1=y(t)-1,n.x2=y(t)-t.rug_buffer_size,n.y1=t.scalefns[a+"f"],n.y2=t.scalefns[a+"f"]),"top"===r&&(n.x1=t.scalefns[a+"f"],n.x2=t.scalefns[a+"f"],n.y1=m(t)+1,n.y2=m(t)+t.rug_buffer_size),"bottom"===r&&(n.x1=t.scalefns[a+"f"],n.x2=t.scalefns[a+"f"],n.y1=p(t)-1,n.y2=p(t)-t.rug_buffer_size),n}function ct(t,e){var r=e.namespace,a=e.position,n=t.processed[r+"_ticks"].length,o=t.processed[r+"_ticks"],i=t.scales[r.toUpperCase()],s={};return"left"===a&&(s.x1=h(t),s.x2=h(t),s.y1=i(o[0]).toFixed(2),s.y2=i(o[n-1]).toFixed(2)),"right"===a&&(s.x1=y(t),s.x2=y(t),s.y1=i(o[0]).toFixed(2),s.y2=i(o[n-1]).toFixed(2)),"top"===a&&(s.x1=h(t),s.x2=y(t),s.y1=m(t),s.y2=m(t)),"bottom"===a&&(s.x1=h(t),s.x2=y(t),s.y1=p(t),s.y2=p(t)),"left"!==a&&"right"!==a||(t.axes_not_compact?(s.y1=p(t),s.y2=m(t)):n&&(s.y1=i(o[0]).toFixed(2),s.y2=i(o[n-1]).toFixed(2))),s}function lt(t,e){var r=e.position,a=e.namespace,n=t[a+"ax_tick_length"],o=t.scales[a.toUpperCase()],i={};return"left"===r&&(i.x=h(t)-3*n/2,i.y=function(t){return o(t).toFixed(2)},i.dx=-3,i.dy=".35em",i.textAnchor="end",i.text=function(e){return At(t)(e)}),"right"===r&&(i.x=y(t)+3*n/2,i.y=function(t){return o(t).toFixed(2)},i.dx=3,i.dy=".35em",i.textAnchor="start",i.text=function(e){return At(t)(e)}),"top"===r&&(i.x=function(t){return o(t).toFixed(2)},i.y=(m(t)-7*n/3).toFixed(2),i.dx=0,i.dy="0em",i.textAnchor="middle",i.text=function(e){return ae(t)(e)}),"bottom"===r&&(i.x=function(t){return o(t).toFixed(2)},i.y=(p(t)+7*n/3).toFixed(2),i.dx=0,i.dy=".50em",i.textAnchor="middle",i.text=function(e){return ae(t)(e)}),i}function ut(t){var e=t.chart_type;t.processed.xax_format||(t.xax_format?t.processed.xax_format=t.xax_format:"line"===e||"point"===e||"histogram"===e?t.processed.xax_format=ae(t):"bar"===e&&(t.processed.xax_format=Ht(t)))}function ft(t,e,r){if(e.time_series&&(e.show_years||e.show_secondary_x_label)){var a=ue(e);dt(e,r,t,a.timeframe,a.yformat,a.secondary)}}function dt(t,e,r,a,n,o){var i=o(t.processed.min_x,t.processed.max_x);if(0===i.length){var s=t.scales.X.ticks(t.xax_count)[0];i=[s]}var c=k(r,"mg-year-marker");"default"===a&&t.show_year_markers&&pt(t,e,c,i,n),"years"!=a&&_t(t,e,c,i,n)}function pt(t,e,r,a,n){r.selectAll(".mg-year-marker").data(a).enter().append("line").attr("x1",function(e){return t.scales.X(e).toFixed(2)}).attr("x2",function(e){return t.scales.X(e).toFixed(2)}).attr("y1",m(t)).attr("y2",p(t))}function _t(e,r,a,n,o){var i,s,c,l,u,f=r.position,d=r.namespace,_=e.scales[d.toUpperCase()],g=t.select(e.target).select(".mg-x-axis text").node().getBoundingClientRect();"top"===f&&(i=function(t,e){return _(t).toFixed(2)},s=m(e)-7*e.xax_tick_length/3-g.height,c=".50em",l="middle",u=function(t){return o(new Date(t))}),"bottom"===f&&(i=function(t,e){return _(t).toFixed(2)},s=p(e)+7*e.xax_tick_length/3+.8*g.height,c=".50em",l="middle",u=function(t){return o(new Date(t))}),a.selectAll(".mg-year-marker").data(n).enter().append("text").attr("x",i).attr("y",s).attr("dy",c).attr("text-anchor",l).text(u)}function mt(e,r,a){var n=a.namespace,o=lt(r,a),i=r.processed[n+"_ticks"],s=e.selectAll(".mg-yax-labels").data(i).enter().append("text").attr("x",o.x).attr("dx",o.dx).attr("y",o.y).attr("dy",o.dy).attr("text-anchor",o.textAnchor).text(o.text);if("x"==n&&(ut(r),r.time_series&&r.european_clock?(s.append("tspan").classed("mg-european-hours",!0).text(function(e,r){var a=new Date(e);return 0===r?t.timeFormat("%H")(a):""}),s.append("tspan").classed("mg-european-minutes-seconds",!0).text(function(t,e){var a=new Date(t);return":"+r.processed.xax_format(a)})):s.text(function(t){return r.xax_units+r.processed.xax_format(t)}),ft(e,r,a)),D(s)){s.filter(function(t,e){return(e+1)%2===0}).remove();var c=R(r.target);c.selectAll(".mg-"+n+"ax-ticks").filter(function(t,e){return(e+1)%2===0}).remove()}}function gt(t,e,r){var a,n,o,i,s=r.namespace,c=r.position,l=e.scales[s.toUpperCase()],u=e.processed[s+"_ticks"],f="mg-"+s+"ax-ticks",d="mg-extended-"+s+"ax-ticks",_=e[s+"_extended_ticks"],g=e[s+"ax_tick_length"];"left"===c&&(a=h(e),n=_?y(e):h(e)-g,o=function(t){return l(t).toFixed(2)},i=function(t){return l(t).toFixed(2)}),"right"===c&&(a=y(e),n=_?h(e):y(e)+g,o=function(t){return l(t).toFixed(2)},i=function(t){return l(t).toFixed(2)}),"top"===c&&(a=function(t){return l(t).toFixed(2)},n=function(t){return l(t).toFixed(2)},o=m(e),i=_?p(e):m(e)-g),"bottom"===c&&(a=function(t){return l(t).toFixed(2)},n=function(t){return l(t).toFixed(2)},o=p(e),i=_?m(e):p(e)+g),t.selectAll("."+f).data(u).enter().append("line").classed(d,_).attr("x1",a).attr("x2",n).attr("y1",o).attr("y2",i)}function ht(t,e,r){var a=r.namespace,n=e.processed[a+"_ticks"].length,o=ct(e,r);e[a+"_extended_ticks"]||e[a+"_extended_ticks"]||!n||t.append("line").attr("x1",o.x1).attr("x2",o.x2).attr("y1",o.y1).attr("y2",o.y2)}function xt(t,e){var r=R(t.target),a=Y(t.data),n=r.selectAll("line."+e).data(a);return n.enter().append("svg:line").attr("class",e).attr("opacity",.3),b(n),b(n),n}function yt(t,e){"use strict";t.rug_buffer_size="point"===t.chart_type?t.buffer/2:2*t.buffer/3;var r=xt(t,"mg-"+e.namespace+"-rug"),a=st(t,e);r.attr("x1",a.x1).attr("x2",a.x2).attr("y1",a.y1).attr("y2",a.y2),G(r,t,"mg-"+e.namespace+"-rug-mono")}function vt(t,e,r){var a=e.namespace,n=e.position,o=t.scales[a.toUpperCase()],i=t.scales[(a+"group").toUpperCase()],s={};return s.cat={},s.group={},"left"===n&&(s.cat.x=x(t)-t.buffer,s.cat.y=function(t){return i(r)+o(t)+o.bandwidth()/2},s.cat.dy=".35em",s.cat.textAnchor="end",s.group.x=x(t)-t.buffer,s.group.y=i(r)+(i.bandwidth?i.bandwidth()/2:0),s.group.dy=".35em",s.group.textAnchor=(t["rotate_"+a+"_labels"],"end")),"right"===n&&(s.cat.x=v(t)-t.buffer,s.cat.y=function(t){return i(r)+o(t)+o.bandwidth()/2},s.cat.dy=".35em",s.cat.textAnchor="start",s.group.x=v(t)-t.buffer,s.group.y=i(r)+(i.bandwidth?i.bandwidth()/2:0),s.group.dy=".35em",s.group.textAnchor="start"),"top"===n&&(s.cat.x=function(t){return i(r)+o(t)+o.bandwidth()/2},s.cat.y=g(t)+t.buffer,s.cat.dy=".35em",s.cat.textAnchor=t["rotate_"+a+"_labels"]?"start":"middle",s.group.x=i(r)+(i.bandwidth?i.bandwidth()/2:0),s.group.y=g(t)+t.buffer,s.group.dy=".35em",s.group.textAnchor=t["rotate_"+a+"_labels"]?"start":"middle"),"bottom"===n&&(s.cat.x=function(t){return i(r)+o(t)+o.bandwidth()/2},s.cat.y=_(t)+t.buffer,s.cat.dy=".35em",s.cat.textAnchor=t["rotate_"+a+"_labels"]?"start":"middle",s.group.x=i(r)+(i.bandwidth?i.bandwidth()/2-o.bandwidth()/2:0),s.group.y=_(t)+t.buffer,s.group.dy=".35em",s.group.textAnchor=t["rotate_"+a+"_labels"]?"start":"middle"),s}function bt(t,e){var r=e.namespace,a="mg-"+r+"-axis",n=t.scales[r.toUpperCase()],o=t.scales[(r+"group").toUpperCase()],i=r+"group_accessor",s=R(t.target);w(s,"."+a);var c,l=k(s,a),u=o.domain&&o.domain()?o.domain():["1"];u.forEach(function(a){var o=vt(t,e,a);if(c=k(l,"mg-group-"+L(a)),null!==t[i])var s=c.append("text").classed("mg-barplot-group-label",!0).attr("x",o.group.x).attr("y",o.group.y).attr("dy",o.group.dy).attr("text-anchor",o.group.textAnchor).text(a);else var s=c.selectAll("text").data(n.domain()).enter().append("text").attr("x",o.cat.x).attr("y",o.cat.y).attr("dy",o.cat.dy).attr("text-anchor",o.cat.textAnchor).text(String);t["rotate_"+r+"_labels"]&&kt(s,t["rotate_"+r+"_labels"])})}function wt(t,e){var r,a,n,o,i=e.namespace,s=(t.scalefns[i+"f"],t.scalefns[i+"groupf"],t.scales[(i+"group").toUpperCase()]),c=t.scales[i.toUpperCase()],l=e.position,u=R(t.target),f=s.domain&&s.domain()?s.domain():[null];w(u,".mg-category-guides");var d=k(u,"mg-category-guides");f.forEach(function(e){c.domain().forEach(function(i){"left"!==l&&"right"!==l||(r=x(t),a=v(t),n=c(i)+s(e)+c.bandwidth()/2,o=c(i)+s(e)+c.bandwidth()/2),"top"!==l&&"bottom"!==l||(r=c(i)+s(e)+c.bandwidth()/2*(null===e),a=c(i)+s(e)+c.bandwidth()/2*(null===e),n=_(t),o=g(t)),d.append("line").attr("x1",r).attr("x2",a).attr("y1",n).attr("y2",o).attr("stroke-dasharray","2,1")});var i=s(e)+c(c.domain()[0])+c.bandwidth()/2*(null===e||"top"!==l&&"bottom"!=l),u=s(e)+c(c.domain()[c.domain().length-1])+c.bandwidth()/2*(null===e||"top"!==l&&"bottom"!=l);"left"!==l&&"right"!==l||(x11=x(t),x21=x(t),y11=i,y21=u,x12=v(t),x22=v(t),y12=i,y22=u),"bottom"!==l&&"top"!==l||(x11=i,x21=u,y11=_(t),y21=_(t),x12=i,x22=u,y12=g(t),y22=g(t)),d.append("line").attr("x1",x11).attr("x2",x21).attr("y1",y11).attr("y2",y21).attr("stroke-dasharray","2,1"),d.append("line").attr("x1",x12).attr("x2",x22).attr("y1",y12).attr("y2",y22).attr("stroke-dasharray","2,1")})}function kt(e,r){r&&e.attr("transform",function(){var e=t.select(this);return"rotate("+r+" "+e.attr("x")+","+e.attr("y")+")"})}function Mt(t){var e={};return e.type="numerical",this.namespace=function(t){return e.namespace=t,this},this.rug=function(t){return e.rug=t,this},this.label=function(t){return e.label=t,this},this.type=function(t){return e.type=t,this},this.position=function(t){return e.position=t,this},this.zeroLine=function(t){return e.zeroLine=t,this},this.draw=function(){return jr[e.type](t,e),this},this}function Gt(t){"use strict";if(t.y_rug){t.rug_buffer_size="point"===t.chart_type?t.buffer/2:2*t.buffer/3;var e=M(t,"mg-y-rug");e.attr("x1",t.left+1).attr("x2",t.left+t.rug_buffer_size).attr("y1",t.scalefns.yf).attr("y2",t.scalefns.yf),G(e,t,"mg-y-rug-mono")}}function At(e){var r=e.yax_format;return r||("count"===e.format?(e.processed.max_y<1e-4?e.decimals=6:e.processed.max_y<.1&&(e.decimals=4),r=function(r){var a;return a=r<1&&r>-1&&0!==r?t.format(",."+e.decimals+"f"):r<1e3?t.format(",.0f"):t.format(",.2s"),e.yax_units_append?a(r)+e.yax_units:e.yax_units+a(r)}):r=function(e){var r=t.format(".0%");return r(e)}),r}function Dt(t){var e=R(t.target),r=t.scales.X.domain();if(0>=r[0]&&r[1]>=0){var a=t.scales.Y.range(),n=t.categorical_groups.length?t.scales.YGROUP(t.categorical_groups[t.categorical_groups.length-1]):t.scales.YGROUP();e.append("svg:line").attr("x1",t.scales.X(0)).attr("x2",t.scales.X(0)).attr("y1",a[0]+g(t)).attr("y2",a[a.length-1]+n).attr("stroke","black").attr("opacity",.2)}}function Ot(t,e){e.y_label&&t.append("text").attr("class","label").attr("x",function(){return-1*(g(e)+(_(e)-g(e))/2)}).attr("y",function(){return e.left/2}).attr("dy","0.4em").attr("text-anchor","middle").text(function(t){return e.y_label}).attr("transform",function(t){return"rotate(-90)"})}function Ft(t,e){var r=e.processed.y_ticks.length;if(!e.x_extended_ticks&&!e.y_extended_ticks&&r){var a,n;e.axes_not_compact&&"bar"!==e.chart_type?(a=e.height-e.bottom,n=e.top):r?(a=e.scales.Y(e.processed.y_ticks[0]).toFixed(2),n=e.scales.Y(e.processed.y_ticks[r-1]).toFixed(2)):(a=0,n=0),t.append("line").attr("x1",e.left).attr("x2",e.left).attr("y1",a).attr("y2",n)}}function zt(t,e){t.selectAll(".mg-yax-ticks").data(e.processed.y_ticks).enter().append("line").classed("mg-extended-yax-ticks",e.y_extended_ticks).attr("x1",e.left).attr("x2",function(){return e.y_extended_ticks?e.width-e.right:e.left-e.yax_tick_length}).attr("y1",function(t){return e.scales.Y(t).toFixed(2)}).attr("y2",function(t){return e.scales.Y(t).toFixed(2)})}function Ct(t,e){var r=At(e);t.selectAll(".mg-yax-labels").data(e.processed.y_ticks).enter().append("text").attr("x",e.left-3*e.yax_tick_length/2).attr("dx",-3).attr("y",function(t){return e.scales.Y(t).toFixed(2)}).attr("dy",".35em").attr("text-anchor","end").text(function(t){var e=r(t);return e})}function Tt(t){t.processed||(t.processed={});var e=R(t.target);if(MG.call_hook("y_axis.process_min_max",t,t.processed.min_y,t.processed.max_y),w(e,".mg-y-axis"),!t.y_axis)return this;var r=k(e,"mg-y-axis");return Ot(r,t),ir(t,"y"),Ft(r,t),zt(r,t),Ct(r,t),t.y_rug&&Gt(t),this}function Rt(t){var e=R(t.target);w(e,".mg-y-axis");var r,a=k(e,"mg-y-axis");(t.categorical_groups.length?t.categorical_groups:["1"]).forEach(function(e){if(r=k(a,"mg-group-"+L(e)),null!==t.ygroup_accessor)Et(r,e,t);else{var n=Yt(r,e,t);A(n,t.rotate_y_labels)}})}function Yt(t,e,r){return t.selectAll("text").data(r.scales.Y.domain()).enter().append("svg:text").attr("x",r.left-r.buffer).attr("y",function(t){return r.scales.YGROUP(e)+r.scales.Y(t)+r.scales.Y.bandwidth()/2}).attr("dy",".35em").attr("text-anchor","end").text(String)}function Et(t,e,r){t.append("svg:text").classed("mg-barplot-group-label",!0).attr("x",r.left-r.buffer).attr("y",r.scales.YGROUP(e)+r.scales.YGROUP.bandwidth()/2).attr("dy",".35em").attr("text-anchor","end").text(e)}function $t(t){var e=R(t.target),r=t.scales.YGROUP.domain();r[0],r[r.length-1];e.select(".mg-category-guides").selectAll("mg-group-lines").data(r).enter().append("line").attr("x1",x(t)).attr("x2",x(t)).attr("y1",function(e){return t.scales.YGROUP(e)}).attr("y2",function(e){return t.scales.YGROUP(e)+t.ygroup_height}).attr("stroke-width",1)}function Pt(t){var e=R(t.target),r=[];t.data[0].forEach(function(a){r.indexOf(a[t.y_accessor])===-1&&e.select(".mg-category-guides").append("line").attr("x1",x(t)).attr("x2",v(t)).attr("y1",t.scalefns.yf(a)+t.scalefns.ygroupf(a)).attr("y2",t.scalefns.yf(a)+t.scalefns.ygroupf(a)).attr("stroke-dasharray","2,1")})}function Lt(t){return t.y_axis?(Rt(t),t.show_bar_zero&&Dt(t),t.ygroup_accessor&&$t(t),t.y_categorical_show_guides&&Pt(t),this):this}function St(t){"use strict";if(t.x_rug){t.rug_buffer_size="point"===t.chart_type?t.buffer/2:t.buffer;var e=M(t,"mg-x-rug");e.attr("x1",t.scalefns.xf).attr("x2",t.scalefns.xf).attr("y1",t.height-t.bottom-t.rug_buffer_size).attr("y2",t.height-t.bottom),G(e,t,"mg-x-rug-mono")}}function jt(t){t.processed||(t.processed={})}function Xt(t){"use strict";var e=R(t.target);if(jt(t),me(t),w(e,".mg-x-axis"),!t.x_axis)return this;var r=k(e,"mg-x-axis");return ne(r,t),se(r,t),t.x_label&&It(r,t),t.x_rug&&St(t),this}function Ut(t){var e=R(t.target),r=0;"bar"===t.chart_type&&(r=t.buffer+5),mg_add_categorical_scale(t,"X",t.categorical_variables.reverse(),t.left,v(t)-r),J(t,"xf","X","value"),w(e,".mg-x-axis");var a=k(e,"mg-x-axis");return t.x_axis?(Nt(a,t,r),this):this}function Nt(t,e,r){var a=t.selectAll("text").data(e.categorical_variables).enter().append("text");a.attr("x",function(t){return e.scales.X(t)+e.scales.X.bandwidth()/2+e.buffer*e.bar_outer_padding_percentage+r/2}).attr("y",_(e)).attr("dy",".35em").attr("text-anchor","middle").text(String),e.truncate_x_labels&&a.each(function(t,r){var a=this,n=e.scales.X.bandwidth();W(a,t,n)}),A(a,e.rotate_x_labels)}function nt(e){var r;return null===e.color_domain?"number"===e.color_type?r=t.extent(e.data[0],function(t){return t[e.color_accessor]}):"category"===e.color_type&&(r=t.set(e.data[0].map(function(t){return t[e.color_accessor]})).values(),r.sort()):r=e.color_domain,r}function ot(t){var e;return e=null===t.color_range?"number"===t.color_type?["blue","red"]:null:t.color_range}function Bt(t){var e;return e=null===t.size_range?[1,5]:t.size_range}function It(e,r){r.x_label&&e.append("text").attr("class","label").attr("x",function(){return x(r)+(v(r)-x(r))/2}).attr("dx",null!=r.x_label_nudge_x?r.x_label_nudge_x:0).attr("y",function(){var e=t.select(r.target).select(".mg-x-axis text").node().getBoundingClientRect();return p(r)+r.xax_tick_length*(7/3)+.8*e.height+10}).attr("dy",".5em").attr("text-anchor","middle").text(function(t){return r.x_label})}function Ht(e){return function(r){if(r<1&&r>-1&&0!==r)return e.xax_units+r.toFixed(e.decimals);var a=t.format(",.0f");return e.xax_units+a(r)}}function qt(t){var e;return e=Vt(t)?"millis":Wt(t)?"seconds":Qt(t)?"less-than-a-day":Zt(t)?"four-days":Kt(t)?"many-days":Jt(t)?"many-months":te(t)?"years":"default"}function Vt(t){return t<10}function Wt(t){return t<60}function Qt(t){return t/3600<=24}function Zt(t){return t/3600<=96}function Kt(t){return t/86400<=93}function Jt(t){return t/86400<730}function te(t){return t/86400>=730}function ee(t,e){var r;return r=Vt(e)?MG.time_format(t,"%M:%S.%L"):Wt(e)?MG.time_format(t,"%M:%S"):Qt(e)?MG.time_format(t,"%H:%M"):Zt(e)?MG.time_format(t,"%H:%M"):Kt(e)?MG.time_format(t,"%b %d"):Jt(e)?MG.time_format(t,"%b"):MG.time_format(t,"%Y")}function re(t){var e,r,a;t.time_series&&(e=(t.processed.max_x-t.processed.min_x)/1e3,a=qt(e),r=ee(t.utc_time,e)),t.processed.main_x_time_format=r,t.processed.x_time_frame=a}function ae(e){if(e.xax_format)return e.xax_format;var r=e.processed.original_data||e.data,a=Y(r)[0],n=a[e.processed.original_x_accessor||e.x_accessor];return void 0===n&&(n=a),function(r){if(re(e),N(n))return e.processed.main_x_time_format(new Date(r));if("number"==typeof n){var a,o=r%1!==0;return a=o?t.format(",."+e.decimals+"f"):r<1e3?t.format(",.0f"):t.format(",.2s"),e.xax_units+a(r)}return e.xax_units+r}}function ne(t,e){ir(e,"x"),oe(e,t),ie(e,t)}function oe(t,e){var r=(t.processed.x_ticks.length,t.scales.X.ticks(t.xax_count).length-1);t.x_extended_ticks||e.append("line").attr("x1",function(){return 0===t.xax_count?x(t):t.axes_not_compact&&"bar"!==t.chart_type?t.left:t.scales.X(t.scales.X.ticks(t.xax_count)[0]).toFixed(2)}).attr("x2",function(){return 0===t.xax_count||t.axes_not_compact&&"bar"!==t.chart_type?y(t):t.scales.X(t.scales.X.ticks(t.xax_count)[r]).toFixed(2)}).attr("y1",t.height-t.bottom).attr("y2",t.height-t.bottom)}function ie(t,e){e.selectAll(".mg-xax-ticks").data(t.processed.x_ticks).enter().append("line").attr("x1",function(e){return t.scales.X(e).toFixed(2)}).attr("x2",function(e){return t.scales.X(e).toFixed(2)}).attr("y1",t.height-t.bottom).attr("y2",function(){return t.x_extended_ticks?t.top:t.height-t.bottom+t.xax_tick_length}).attr("class",function(){if(t.x_extended_ticks)return"mg-extended-xax-ticks"}).classed("mg-xax-ticks",!0)}function se(t,e){ce(e,t),le(e,t)}function ce(e,r){var a=r.selectAll(".mg-xax-labels").data(e.processed.x_ticks).enter().append("text").attr("x",function(t){return e.scales.X(t).toFixed(2)}).attr("y",(e.height-e.bottom+7*e.xax_tick_length/3).toFixed(2)).attr("dy",".50em").attr("text-anchor","middle");if(e.time_series&&e.european_clock?(a.append("tspan").classed("mg-european-hours",!0).text(function(e,r){var a=new Date(e);return 0===r?t.timeFormat("%H")(a):""}),a.append("tspan").classed("mg-european-minutes-seconds",!0).text(function(t,r){var a=new Date(t);return":"+e.processed.xax_format(a)})):a.text(function(t){return e.xax_units+e.processed.xax_format(t)}),D(a)){a.filter(function(t,e){return(e+1)%2===0}).remove();var n=R(e.target);n.selectAll(".mg-xax-ticks").filter(function(t,e){return(e+1)%2===0}).remove()}}function le(t,e){if(t.time_series&&(t.show_years||t.show_secondary_x_label)){var r=ue(t);fe(t,e,r.timeframe,r.yformat,r.secondary)}}function ue(e){var r={};switch(r.timeframe=e.processed.x_time_frame,r.timeframe){case"millis":case"seconds":r.secondary=t.timeDays,e.european_clock?r.yformat=MG.time_format(e.utc_time,"%b %d"):r.yformat=MG.time_format(e.utc_time,"%I %p");break;case"less-than-a-day":r.secondary=t.timeDays,r.yformat=MG.time_format(e.utc_time,"%b %d");break;case"four-days":r.secondary=t.timeDays,r.yformat=MG.time_format(e.utc_time,"%b %d");break;case"many-days":r.secondary=t.timeYears,r.yformat=MG.time_format(e.utc_time,"%Y");break;case"many-months":r.secondary=t.timeYears,r.yformat=MG.time_format(e.utc_time,"%Y");break;default:r.secondary=t.timeYears,r.yformat=MG.time_format(e.utc_time,"%Y")}return r}function fe(t,e,r,a,n){var o=n(t.processed.min_x,t.processed.max_x);if(0===o.length){var i=t.scales.X.ticks(t.xax_count)[0];o=[i]}var s=k(e,"mg-year-marker");"default"===r&&t.show_year_markers&&de(t,s,o,a),"years"!=r&&pe(t,s,o,a)}function de(t,e,r,a){e.selectAll(".mg-year-marker").data(r).enter().append("line").attr("x1",function(e){return t.scales.X(e).toFixed(2)}).attr("x2",function(e){return t.scales.X(e).toFixed(2)}).attr("y1",m(t)).attr("y2",p(t))}function pe(e,r,a,n){r.selectAll(".mg-year-marker").data(a).enter().append("text").attr("x",function(t,r){return e.scales.X(t).toFixed(2)}).attr("y",function(){var r=t.select(e.target).select(".mg-x-axis text").node().getBoundingClientRect();return p(e)+7*e.xax_tick_length/3+.8*r.height}).attr("dy",".50em").attr("text-anchor","middle").text(function(t){return n(new Date(t))})}function _e(t){t.xax_count=2}function me(t){var e=t.chart_type;t.processed.xax_format||(t.xax_format?t.processed.xax_format=t.xax_format:"line"===e||"point"===e||"histogram"===e?t.processed.xax_format=ae(t):"bar"===e&&(t.processed.xax_format=Ht(t)))}function ge(t){var e={target:null,title:null,description:null};return t||(t={}),t.processed||(t.processed={}),t=U(t,e)}function he(t){var e=Y(t.processed.original_data||t.data)[0];t.time_series=N(e[t.processed.original_x_accessor||t.x_accessor])}function xe(t){var e=t.width;t.full_width&&(e=j(t.target)),"categorical"===t.x_axis_type&&null===e&&(e=Re(t,"x")),t.width=e}function ye(t){var e=t.height;t.full_height&&(e=X(t.target)),"categorical"===t.y_axis_type&&null===e&&(e=Re(t,"y")),t.height=e}function ve(t,e){(!t.selectAll(".mg-main-line").empty()&&"line"!==e.chart_type||!t.selectAll(".mg-points").empty()&&"point"!==e.chart_type||!t.selectAll(".mg-histogram").empty()&&"histogram"!==e.chart_type||!t.selectAll(".mg-barplot").empty()&&"bar"!==e.chart_type)&&t.remove(); | |
}function be(e,r){return R(r.target).empty()&&(e=t.select(r.target).append("svg").classed("linked",r.linked).attr("width",r.width).attr("height",r.height)),e}function we(t,e){t.selectAll(".mg-clip-path").remove(),t.append("defs").attr("class","mg-clip-path").append("clipPath").attr("id","mg-plot-window-"+P(e.target)).append("svg:rect").attr("x",h(e)).attr("y",m(e)).attr("width",e.width-e.left-e.right-e.buffer).attr("height",e.height-e.top-e.bottom-e.buffer+1)}function ke(t,e){e.width!==Number(t.attr("width"))&&t.attr("width",e.width),e.height!==Number(t.attr("height"))&&t.attr("height",e.height)}function Me(t,e){t.attr("viewBox","0 0 "+e.width+" "+e.height),(e.full_width||e.full_height)&&t.attr("preserveAspectRatio","xMinYMin meet")}function Ge(t){t.classed("mg-missing",!1),t.selectAll(".mg-missing-text").remove(),t.selectAll(".mg-missing-pane").remove()}function Ae(t,e){var r=0;if(t.selectAll(".mg-main-line").nodes().length>=e.data.length)if(e.custom_line_color_map.length>0){var a=function(t){for(var e=new Array(t),r=0;r<e.length;r++)e[r]=r+1;return e},n=q(a(e.max_data_size),e.custom_line_color_map);for(r=0;r<n.length;r++)t.selectAll(".mg-main-line.mg-line"+n[r]+"-color").remove()}else{var o=e.data.length,i=t.selectAll(".mg-main-line").nodes()?t.selectAll(".mg-main-line").nodes().length:0;for(r=i;r>o;r--)t.selectAll(".mg-main-line.mg-line"+r+"-color").remove()}}function De(t,e){if(t.empty())return void console.warn('The specified target element "'+e.target+'" could not be found in the page. The chart will not be rendered.')}function Oe(t,e){var r="x"===e?t.width:t.height;Fe(t,e),ze(t,e),Ce(t,e,r),r&&Te(t,e)}function Fe(e,r){var a=r+"group_accessor",n=e[a];if(e.categorical_groups=[],n){var o=e.data[0];e.categorical_groups=t.set(o.map(function(t){return t[n]})).values()}}function ze(e,r){var a=r+"group_accessor",n=e[a];if(e.total_bars=e.data[0].length,n){var o=d(f(e.data[0],n));o=t.max(Object.keys(o).map(function(t){return o[t]})),e.bars_per_group=o}else e.bars_per_group=e.data[0].length}function Ce(t,e,r){var a=e+"group_height";if(r){var n="y"===e?(t.height-t.top-t.bottom-2*t.buffer)/(t.categorical_groups.length||1):(t.width-t.left-t.right-2*t.buffer)/(t.categorical_groups.length||1);t[a]=n}else{var o=(1+t[e+"_padding_percentage"])*t.bar_thickness;t[a]=t.bars_per_group*o+2*t[e+"_outer_padding_percentage"]*o}}function Te(t,e){var r=t[e+"group_height"]/(t.bars_per_group+t[e+"_outer_padding_percentage"]);t.bar_thickness=r-r*t[e+"_padding_percentage"]}function Re(t,e){var r=t[e+"group_height"]*(t.categorical_groups.length||1),a="y"===e?t.top+t.bottom+2*t.buffer:t.left+t.right+2*t.buffer;return r+a+t.categorical_groups.length*t[e+"group_height"]*(t[e+"group_padding_percentage"]+t[e+"group_outer_padding_percentage"])}function Ye(e){"use strict";e=arguments[0],e=ge(e);var r=t.select(e.target);De(r,e);var a=r.selectAll("svg");return"categorical"===e.y_axis_type&&Oe(e,"y"),"categorical"===e.x_axis_type&&Oe(e,"x"),he(e),xe(e),ye(e),ve(a,e),a=be(a,e),we(a,e),ke(a,e),Me(a,e),Ge(a),K(e),Ae(a,e),this}function Ee(t){return t.label}function $e(t){t.selectAll(".mg-markers").remove(),t.selectAll(".mg-baselines").remove()}function Pe(t){return function(e){return t.scales.X(e[t.x_accessor])>=x(t)&&t.scales.X(e[t.x_accessor])<=v(t)}}function Le(t){return function(e){return t.scales.X(e[t.x_accessor])}}function Se(t){var e=Le(t);return function(t){return e(t).toFixed(2)}}function je(t){var e=t.scales.Y;return function(t){return e(t.value).toFixed(2)}}function Xe(t,e,r,a,n,o){var i;t&&(i=a.append("g").attr("class",e),n(i,r),o(i,r))}function Ue(t,e){Xe(t.markers,"mg-markers",t,e,Be,Ie)}function Ne(t,e){Xe(t.baselines,"mg-baselines",t,e,He,qe)}function Be(t,e){var r=Se(e);t.selectAll(".mg-markers").data(e.markers.filter(Pe(e))).enter().append("line").attr("x1",r).attr("x2",r).attr("y1",e.top).attr("y2",_(e)).attr("class",function(t){return t.lineclass}).attr("stroke-dasharray","3,1")}function Ie(e,r){e.selectAll(".mg-markers").data(r.markers.filter(Pe(r))).enter().append("text").attr("class",function(t){return t.textclass||""}).classed("mg-marker-text",!0).attr("x",Le(r)).attr("y","bottom"===r.x_axis_position?.95*m(r):p(r)+r.buffer).attr("text-anchor","middle").text(Ee).each(function(e){e.click&&t.select(this).style("cursor","pointer").on("click",e.click)}),O(e.selectAll(".mg-marker-text").nodes(),r)}function He(t,e){var r=je(e);t.selectAll(".mg-baselines").data(e.baselines).enter().append("line").attr("x1",x(e)).attr("x2",v(e)).attr("y1",r).attr("y2",r)}function qe(t,e){var r=je(e);t.selectAll(".mg-baselines").data(e.baselines).enter().append("text").attr("x",v(e)).attr("y",r).attr("dy",-3).attr("text-anchor","end").text(Ee)}function Ve(t){"use strict";var e=R(t.target);return $e(e),Ue(t,e),Ne(t,e),this}function We(t){t.selectAll(".mg-active-datapoint-container").selectAll("*").remove()}function Qe(e,r){e.select(".mg-active-datapoint").remove();var a="right"===r.mouseover_align?"end":"left"===r.mouseover_align?"start":"middle",n="right"===r.mouseover_align?v(r):"left"===r.mouseover_align?x(r):(r.width-r.left-r.right)/2+r.left,o=e.select(".mg-active-datapoint-container").append("text").attr("class","mg-active-datapoint").attr("xml:space","preserve").attr("text-anchor",a),i=.75,s="bottom"===r.x_axis_position?m(r)*i:p(r)+3*r.buffer;if(r.markers){var c;e.selectAll(".mg-marker-text").each(function(){c?c!==t.select(this).attr("y")&&(i=.56):c=t.select(this).attr("y")})}o.attr("transform","translate("+n+","+s+")")}function Ze(t,e){var r="",a=null;return 3===arguments.length&&(a=arguments[2]),r=t.append("tspan").text(e),null!==a&&r.classed(a,!0),this.tspan=r,this.bold=function(){return this.tspan.attr("font-weight","bold"),this},this.font_size=function(t){return this.tspan.attr("font-size",t),this},this.x=function(t){return this.tspan.attr("x",t),this},this.y=function(t){return this.tspan.attr("y",t),this},this.elem=function(){return this.tspan},this}function Ke(t){var e=t.select(".mg-active-datapoint");return e.selectAll("*").remove(),e}function Je(t,e,r){var a=1.1;this.rargs=r;var n=e.append("tspan").attr("x",0).attr("y",t*a+"em");return this.text=function(t){return Ze(n,t)},this}function tr(t,e){return this.row_number=0,this.rargs=e,Qe(e.svg,t),this.text_container=Ke(e.svg),this.mouseover_row=function(t){var e=this,r=Je(e.row_number,e.text_container,t);return e.row_number+=1,r},this}function er(){function e(){n.forEach(function(e){var r=t.select(e).select("svg");if(!r.empty()&&(r.node().parentNode.offsetWidth>0||r.node().parentNode.offsetHeight>0)){var a=0!==r.attr("width")?r.attr("height")/r.attr("width"):0,n=j(e);r.attr("width",n),r.attr("height",a*n)}})}function r(t){var r=n.indexOf(t);r!==-1&&n.splice(r,1),0===n.length&&window.removeEventListener("resize",e,!0)}var a,n=[];return"undefined"!=typeof MutationObserver?a=MutationObserver:"undefined"!=typeof WebKitMutationObserver&&(a=WebKitMutationObserver),{add_target:function(o){if(0===n.length&&window.addEventListener("resize",e,!0),n.indexOf(o)===-1&&(n.push(o),a)){var i=new a(function(e){var a=t.select(o).node();a&&!e.some(function(t){for(var e=0;e<t.removedNodes.length;e++)if(t.removedNodes[e]===a)return!0})||(i.disconnect(),r(o))});i.observe(t.select(o).node().parentNode,{childList:!0})}}}}function rr(t){ar(t)}function ar(t){(t.full_width||t.full_height)&&Xr.add_target(t.target)}function nr(t,e,r){var a=tr(t,{svg:e}),n=a.mouseover_row();if(null!==t.color_accessor&&"category"===t.color_type){var o=r[t.color_accessor];n.text(o+" ").bold().elem().attr("fill",t.scalefns.colorf(r))}or(t,n.text("● ").elem(),r),n.text(Fr(t,r)),n.text(zr(t,r,t.time_series===!1))}function or(t,e,r){null!==t.color_accessor?(e.attr("fill",t.scalefns.colorf(r)),e.attr("stroke",t.scalefns.colorf(r))):e.classed("mg-points-mono",!0)}function ir(t,e){function r(t){return 1e3===t?3:1e6===t?7:Math.log(t)/Math.LN10}var a,n,o;"x"===e?(a=t.x_accessor,n=t.scales.X.ticks(t.xax_count),o=t.processed.max_x):"y"===e&&(a=t.y_accessor,n=t.scales.Y.ticks(t.yax_count),o=t.processed.max_y),("x"===e&&"log"===t.x_scale_type||"y"===e&&"log"===t.y_scale_type)&&(n=n.filter(function(t){return Math.abs(r(t))%1<1e-6||Math.abs(r(t))%1>1-1e-6}));var i=n.length,s=!0;t.data.forEach(function(t,e){t.forEach(function(t,e){if(t[a]%1!==0)return s=!1,!1})}),s&&i>o&&"count"===t.format&&(n=n.filter(function(t){return t%1===0})),"x"===e?t.processed.x_ticks=n:"y"===e&&(t.processed.y_ticks=n)}function sr(t){"use strict";if(t.data=MG.clone(t.data),t.single_object=!1,t.array_of_objects=!1,t.array_of_arrays=!1,t.nested_array_of_arrays=!1,t.nested_array_of_objects=!1,c(t.data)?(t.nested_array_of_objects=t.data.map(function(t){return u(t)}),t.nested_array_of_arrays=t.data.map(function(t){return c(t)})):(t.array_of_objects=l(t.data),t.array_of_arrays=c(t.data)),"line"===t.chart_type?(t.array_of_objects||t.array_of_arrays)&&(t.data=[t.data]):I(t.data[0])||(t.data=[t.data]),lr(t),ur(t),void 0!==t.color&&(t.colors=t.color),null!==t.colors&&"string"==typeof t.colors&&(t.colors=[t.colors]),"line"===t.chart_type&&t.x_sort===!0)for(var e=0;e<t.data.length;e++)t.data[e].sort(function(e,r){return e[t.x_accessor]-r[t.x_accessor]});return this}function cr(t,e){I(t[e])&&(t.data=t.data.map(function(r){return t[e].map(function(t){return r.map(function(r){if(r=MG.clone(r),void 0!==r[t])return r["multiline_"+e]=r[t],r}).filter(function(t){return void 0!==t})})})[0],t[e]="multiline_"+e)}function lr(t){cr(t,"x_accessor")}function ur(t){cr(t,"y_accessor")}function fr(e){"use strict";var r,a=t.sum(e.data.map(function(t){return t.length>0&&N(t[0][e.x_accessor])}))>0;if((e.missing_is_zero||e.missing_is_hidden)&&"line"===e.chart_type&&a)for(var n=0;n<e.data.length;n++)if(!(e.data[n].length<=1)){var o=e.data[n][0],i=e.data[n][e.data[n].length-1],s=[],c=MG.clone(o[e.x_accessor]).setDate(o[e.x_accessor].getDate()+1),l=e.min_x?e.min_x:c,u=e.max_x?e.max_x:i[e.x_accessor];if(r=qt((u-l)/1e3),["four-days","many-days","many-months","years","default"].indexOf(r)!==-1&&null===e.missing_is_hidden_accessor)for(var f=new Date(l);f<=u;f.setDate(f.getDate()+1)){var d={};f.setHours(0,0,0,0),Date.parse(f)===Date.parse(new Date(c))&&s.push(MG.clone(e.data[n][0]));var p=null;e.data[n].forEach(function(t,r){if(Date.parse(t[e.x_accessor])===Date.parse(new Date(f)))return p=t,!1}),p?p[e.missing_is_hidden_accessor]||null===p[e.y_accessor]?(p._missing=!0,s.push(p)):s.push(p):(d[e.x_accessor]=new Date(f),d[e.y_accessor]=0,d._missing=!0,s.push(d))}else for(var _=0;_<e.data[n].length;_+=1){var m=MG.clone(e.data[n][_]);m._missing=e.data[n][_][e.missing_is_hidden_accessor],s.push(m)}e.data[n]=s}return this}function dr(e){"use strict";var r,a=e.data[0];if(e.binned===!1){if("object"==typeof a[0])r=a.map(function(t){return t[e.x_accessor]});else{if("number"!=typeof a[0])return void console.log("TypeError: expected an array of numbers, found "+typeof a[0]);r=a}var n=t.histogram();e.bins&&n.thresholds(e.bins);var o=n(r);e.processed_data=o.map(function(t){return{x:t.x0,y:t.length}})}else{e.processed_data=a.map(function(t){return{x:t[e.x_accessor],y:t[e.y_accessor]}});for(var i,s,c=0;c<e.processed_data.length;c++)i=e.processed_data[c],c===e.processed_data.length-1?i.dx=e.processed_data[c-1].dx:(s=e.processed_data[c+1],i.dx=s.x-i.x)}return e.processed||(e.processed={}),e.processed.original_data=e.data,e.processed.original_x_accessor=e.x_accessor,e.processed.original_y_accessor=e.y_accessor,e.data=[e.processed_data],e.x_accessor=e.processed_x_accessor,e.y_accessor=e.processed_y_accessor,this}function pr(t){"use strict";"vertical"===t.bar_orientation?t.x_accessor:t.y_accessor,"vertical"===t.bar_orientation?t.y_accessor:t.x_accessor;return this}function _r(t){"use strict";var e=t.data[0],r=e.map(function(e){return e[t.x_accessor]}),a=e.map(function(e){return e[t.y_accessor]});return t.least_squares&&(t.ls_line=yr(r,a)),this}function mr(e){var r=R(e.target),a=e.data[0],n=t.min(a,function(t){return t[e.x_accessor]}),o=t.max(a,function(t){return t[e.x_accessor]});t.select(e.target).selectAll(".mg-least-squares-line").remove(),r.append("svg:line").attr("x1",e.scales.X(n)).attr("x2",e.scales.X(o)).attr("y1",e.scales.Y(e.ls_line.fit(n))).attr("y2",e.scales.Y(e.ls_line.fit(o))).attr("class","mg-least-squares-line")}function gr(e){var r=R(e.target),a=e.lowess_line,n=t.svg.line().x(function(t){return e.scales.X(t.x)}).y(function(t){return e.scales.Y(t.y)}).interpolate(e.interpolate);r.append("path").attr("d",n(a)).attr("class","mg-lowess-line")}function hr(e,r,a,n){var o,i,s=[];t.mean(r);for(i=0;i<e.length;i+=1)s.push(1);o=Ar(e,r,a,n,s);var c=o.x,l=o.y;for(i=0;i<100;i+=1){s=t.zip(l,r).map(function(t){return Math.abs(t[1]-t[0])});var u=t.quantile(s.sort(),.5);s=s.map(function(t){return br(t/(6*u))}),o=Ar(e,r,a,n,s),c=o.x,l=o.y}return t.zip(c,l).map(function(t){var e={};return e.x=t[0],e.y=t[1],e})}function xr(t,e,r,a){for(var n=[],o=0;o<t.length;o+=1)n.push(1);Ar(t,e,r,a,n)}function yr(e,r){var a,n,o,i;e.length;a=N(e[0])?e.map(function(t){return t.getTime()}):e,n=N(r[0])?r.map(function(t){return t.getTime()}):r;for(var s=t.mean(a),c=t.mean(n),l=0,u=0,f=0;f<a.length;f++)o=a[f],i=n[f],l+=(o-s)*(i-c),u+=(o-s)*(o-s);var d=l/u,p=c-d*s;return{x0:p,beta:d,fit:function(t){return p+t*d}}}function vr(t,e){return t>=0&&t<=1?Math.pow(1-Math.pow(t,e),e):0}function br(t){return vr(t,2)}function wr(t){return vr(t,3)}function kr(e){var r=t.sum(e.map(function(t){return t.w}));return{xbar:t.sum(e.map(function(t){return t.w*t.x}))/r,ybar:t.sum(e.map(function(t){return t.w*t.y}))/r}}function Mr(e,r,a){var n=t.sum(e.map(function(t){return Math.pow(t.w,2)*(t.x-r)*(t.y-a)})),o=t.sum(e.map(function(t){return Math.pow(t.w,2)*Math.pow(t.x-r,2)}));return n/o}function Gr(t){var e,r,a=kr(t);r=a.xbar,e=a.ybar;var n=Mr(t,r,e);return{beta:n,xbar:r,ybar:e,x0:e-n*r}}function Ar(e,r,a,n,o){var i=Math.floor(e.length*a),s=e.slice();s.sort(function(t,e){return t<e?-1:t>e?1:0});for(var c,l,u,f,d,p=t.quantile(s,.98),_=t.quantile(s,.02),m=t.zip(e,r,o).sort(),g=Math.abs(p-_)/n,h=_,x=p,y=t.range(h,x,g),v=[],b=0;b<y.length;b+=1){l=y[b],c=m.map(function(t){return[Math.abs(t[0]-l),t[0],t[1],t[2]]}).sort().slice(0,i),d=t.max(c)[0],c=c.map(function(t){return{w:wr(t[0]/d)*t[3],x:t[1],y:t[2]}});var w=Gr(c);f=w.x0,u=w.beta,v.push(f+u*l)}return{x:y,y:v}}function Dr(e){var r;return r="count"===e.format?function(r){var a,n=r%1!==0;return a=n?t.format(",."+e.decimals+"f"):t.format(",.0f"),e.yax_units_append?a(r)+e.yax_units:e.yax_units+a(r)}:function(r){var a=(e.decimals?"."+e.decimals:"")+"%",n=t.format(a);return n(r)}}function Or(t,e,a,n,o){var i,s,c=r(t);return s="string"==typeof e[n]?function(t){return t}:Dr(t),i=null!==a?o?Ur(a,e,n,t.utc):Nr(a,e,n):o?c(new Date((+e[n])))+" ":(t.time_series?"":n+": ")+s(e[n])+" "}function Fr(t,e){return Or(t,e,t.x_mouseover,t.x_accessor,t.time_series)}function zr(t,e){return Or(t,e,t.y_mouseover,t.y_accessor,!1)}function Cr(t,e){return Or(t,e,t.x_mouseover,"key",t.time_series)}function Tr(e,r){return function(){for(var a=this,n=a.cloneNode(),o=a.getTotalLength()||0,i=(n.setAttribute("d",e),n).getTotalLength()||0,s=[0],c=0,l=r/Math.max(o,i);(c+=l)<1;)s.push(c);s.push(1);var u=s.map(function(e){var r=a.getPointAtLength(e*o),s=n.getPointAtLength(e*i);return t.interpolate([r.x,r.y],[s.x,s.y])});return function(t){return t<1?"M"+u.map(function(e){return e(t)}).join("L"):e}}}function Rr(e){var r=MG.virtual_window,a=t.select(r.document),n=r.document.createElement("div"),o=global.d3,i=global.window,s=global.document;global.d3=a,global.window=r,global.document=r.document;var c;try{e(n)}catch(l){c=l}if(global.d3=o,global.window=i,global.document=s,c)throw c;return a.select(function(){return n}).html()}function Yr(e){var r=document.createElement("div");return e(r),t.select(r).html()}function Er(t){switch(typeof window){case"undefined":return Rr(t);default:return Yr(t)}}function $r(t,e){if(!MG.virtual_window||e){var r=t.jsdom({html:"",features:{QuerySelector:!0}});MG.virtual_window=r.defaultView}}function Pr(e){console.error("ERROR : ",e.target," : ",e.error),t.select(e.target).select(".mg-chart-title").append("tspan").attr("class","fa fa-x fa-exclamation-circle mg-warning").attr("dx","0.3em").text("")}function Lr(t){console.error("INTERNAL ERROR : ",t.target," : ",t.internal_error)}("undefined"==typeof window?global:window).MG={version:"2.11"},MG.convert={},MG.convert.date=function(e,r,a){a="undefined"==typeof a?"%Y-%m-%d":a;var n=t.timeParse(a);return e=e.map(function(t){return t[r]=n(t[r].trim()),t})},MG.convert.number=function(t,e){return t=t.map(function(t){return t[e]=Number(t[e]),t})},MG.time_format=function(e,r){return e?t.utcFormat(r):t.timeFormat(r)};var Sr=function(t,e,r){var a={};if(null===t)return t;if(Array.prototype.forEach&&t.forEach===Array.prototype.forEach)t.forEach(e,r);else if(t.length===+t.length){for(var n=0,o=t.length;n<o;n++)if(e.call(r,t[n],n,t)===a)return}else for(var i in t)if(e.call(r,t[i],i,t)===a)return;return t};MG.merge_with_defaults=U,MG.clone=function(t){var e;if(null===t||"object"!=typeof t)return t;if(N(t))return e=new Date,e.setTime(t.getTime()),e;if(I(t)){e=[];for(var r=0,a=t.length;r<a;r++)e[r]=MG.clone(t[r]);return e}if(B(t)){e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=MG.clone(t[n]));return e}throw new Error("Unable to copy obj! Its type isn't supported.")},MG.arr_diff=q,MG.warn_deprecation=V,MG.truncate_text=W,MG.wrap_text=Q,MG.register=Z,MG._hooks={},MG.add_hook=function(t,e,r){var a;MG._hooks[t]||(MG._hooks[t]=[]),a=MG._hooks[t];var n=a.filter(function(t){return t.func===e}).length>0;if(n)throw"That function is already registered.";a.push({func:e,context:r})},MG.call_hook=function(t){var e,r=MG._hooks[t],a=[].slice.apply(arguments,[1]);return r&&r.forEach(function(t){if(t.func){var r=e||a;r&&r.constructor!==Array&&(r=[r]),r=[].concat.apply([],r),e=t.func.apply(t.context,r)}}),e||a},MG.globals={},MG.deprecations={rollover_callback:{replacement:"mouseover",version:"2.0"},rollout_callback:{replacement:"mouseout",version:"2.0"},x_rollover_format:{replacement:"x_mouseover",version:"2.10"},y_rollover_format:{replacement:"y_mouseover",version:"2.10"},show_years:{replacement:"show_secondary_x_label",version:"2.1"},xax_start_at_min:{replacement:"axes_not_compact",version:"2.7"},interpolate_tension:{replacement:"interpolate",version:"2.10"}},MG.globals.link=!1,MG.globals.version="1.1",MG.charts={},MG.data_graphic=function(e){"use strict";var r={missing_is_zero:!1,missing_is_hidden:!1,missing_is_hidden_accessor:null,legend:"",legend_target:"",error:"",animate_on_load:!1,top:65,title_y_position:10,center_title_full_width:!1,bottom:45,right:10,left:50,buffer:8,width:350,height:220,full_width:!1,full_height:!1,small_height_threshold:120,small_width_threshold:160,xax_count:6,xax_tick_length:5,axes_not_compact:!0,yax_count:3,yax_tick_length:5,x_extended_ticks:!1,y_extended_ticks:!1,y_scale_type:"linear",max_x:null,max_y:null,min_x:null,min_y:null,min_y_from_data:!1,point_size:2.5,x_accessor:"date",xax_units:"",x_label:"",x_sort:!0,x_axis:!0,y_axis:!0,x_axis_position:"bottom",y_axis_position:"left",x_axis_type:null,y_axis_type:null,ygroup_accessor:null,xgroup_accessor:null,y_padding_percentage:.05,y_outer_padding_percentage:.1,ygroup_padding_percentage:.25,ygroup_outer_padding_percentage:0,x_padding_percentage:.05,x_outer_padding_percentage:.1,xgroup_padding_percentage:.25,xgroup_outer_padding_percentage:0,y_categorical_show_guides:!1,x_categorical_show_guide:!1,rotate_x_labels:0,rotate_y_labels:0,y_accessor:"value",y_label:"",yax_units:"",yax_units_append:!1,x_rug:!1,y_rug:!1,mouseover_align:"right",x_mouseover:null,y_mouseover:null,transition_on_update:!0,mouseover:null,click:null,show_rollover_text:!0,show_confidence_band:null,xax_format:null,area:!0,chart_type:"line",data:[],decimals:2,format:"count",inflator:10/9,linked:!1,linked_format:"%Y-%m-%d",list:!1,baselines:null,markers:null,scalefns:{},scales:{},utc_time:!1,european_clock:!1,show_year_markers:!1,show_secondary_x_label:!0,target:"#viz",interpolate:t.curveCatmullRom.alpha(0),custom_line_color_map:[],colors:null,max_data_size:null,aggregate_rollover:!1,show_tooltips:!0};MG.call_hook("global.defaults",r),e||(e={});var a=MG.charts[e.chart_type||r.chart_type];U(e,a.defaults,r),e.list&&(e.x_accessor=0,e.y_accessor=1);for(var n in MG.deprecations)if(e.hasOwnProperty(n)){var o=MG.deprecations[n],i="Use of `args."+n+"` has been deprecated",s=o.replacement;if(s&&(e[s]?i+=". The replacement - `args."+s+"` - has already been defined. This definition will be discarded.":e[s]=e[n]),o.warned)continue;o.warned=!0,s&&(i+=" in favor of `args."+s+"`"),V(i,o.version)}return MG.call_hook("global.before_init",e),new a.descriptor(e),e.data},e()&&(+function(t){"use strict";function e(e){return this.each(function(){var a=t(this),n=a.data("bs.tooltip"),o="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||a.data("bs.tooltip",n=new r(this,o)),"string"==typeof e&&n[e]())})}var r=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};r.VERSION="3.3.5",r.TRANSITION_DURATION=150,r.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},r.prototype.init=function(e,r,a){if(this.enabled=!0,this.type=e,this.$element=t(r),this.options=this.getOptions(a),this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),o=n.length;o--;){var i=n[o];if("click"==i)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=i){var s="hover"==i?"mouseenter":"focusin",c="hover"==i?"mouseleave":"focusout";this.$element.on(s+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(c+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},r.prototype.getDefaults=function(){return r.DEFAULTS},r.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},r.prototype.getDelegateOptions=function(){var e={},r=this.getDefaults();return this._options&&t.each(this._options,function(t,a){r[t]!=a&&(e[t]=a)}),e},r.prototype.enter=function(e){var r=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return r||(r=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,r)),e instanceof t.Event&&(r.inState["focusin"==e.type?"focus":"hover"]=!0),r.tip().hasClass("in")||"in"==r.hoverState?void(r.hoverState="in"):(clearTimeout(r.timeout),r.hoverState="in",r.options.delay&&r.options.delay.show?void(r.timeout=setTimeout(function(){"in"==r.hoverState&&r.show()},r.options.delay.show)):r.show())},r.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},r.prototype.leave=function(e){var r=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(r||(r=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,r)),e instanceof t.Event&&(r.inState["focusout"==e.type?"focus":"hover"]=!1),!r.isInStateTrue())return clearTimeout(r.timeout),r.hoverState="out",r.options.delay&&r.options.delay.hide?void(r.timeout=setTimeout(function(){"out"==r.hoverState&&r.hide()},r.options.delay.hide)):r.hide()},r.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var a=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!a)return;var n=this,o=this.tip(),i=this.getUID(this.type);this.setContent(),o.attr("id",i),this.$element.attr("aria-describedby",i),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,c=/\s?auto?\s?/i,l=c.test(s);l&&(s=s.replace(c,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(this.options.container):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var u=this.getPosition(),f=o[0].offsetWidth,d=o[0].offsetHeight;if(l){var p=s,_=this.getPosition(this.$viewport);s="bottom"==s&&u.bottom+d>_.bottom?"top":"top"==s&&u.top-d<_.top?"bottom":"right"==s&&u.right+f>_.width?"left":"left"==s&&u.left-f<_.left?"right":s,o.removeClass(p).addClass(s)}var m=this.getCalculatedOffset(s,u,f,d);this.applyPlacement(m,s);var g=function(){var t=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==t&&n.leave(n)};t.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",g).emulateTransitionEnd(r.TRANSITION_DURATION):g()}},r.prototype.applyPlacement=function(e,r){var a=this.tip(),n=a[0].offsetWidth,o=a[0].offsetHeight,i=parseInt(a.css("margin-top"),10),s=parseInt(a.css("margin-left"),10);isNaN(i)&&(i=0),isNaN(s)&&(s=0),e.top+=i,e.left+=s,t.offset.setOffset(a[0],t.extend({using:function(t){a.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),a.addClass("in");var c=a[0].offsetWidth,l=a[0].offsetHeight;"top"==r&&l!=o&&(e.top=e.top+o-l);var u=this.getViewportAdjustedDelta(r,e,c,l);u.left?e.left+=u.left:e.top+=u.top;var f=/top|bottom/.test(r),d=f?2*u.left-n+c:2*u.top-o+l,p=f?"offsetWidth":"offsetHeight";a.offset(e),this.replaceArrow(d,a[0][p],f)},r.prototype.replaceArrow=function(t,e,r){this.arrow().css(r?"left":"top",50*(1-t/e)+"%").css(r?"top":"left","")},r.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},r.prototype.hide=function(e){function a(){"in"!=n.hoverState&&o.detach(),n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),e&&e()}var n=this,o=t(this.$tip),i=t.Event("hide.bs."+this.type);if(this.$element.trigger(i),!i.isDefaultPrevented())return o.removeClass("in"),t.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",a).emulateTransitionEnd(r.TRANSITION_DURATION):a(),this.hoverState=null,this},r.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},r.prototype.hasContent=function(){return this.getTitle()},r.prototype.getPosition=function(e){e=e||this.$element;var r=e[0],a="BODY"==r.tagName,n=r.getBoundingClientRect();null==n.width&&(n=t.extend({},n,{width:n.right-n.left,height:n.bottom-n.top}));var o=a?{top:0,left:0}:e.offset(),i={scroll:a?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},s=a?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},n,i,s,o)},r.prototype.getCalculatedOffset=function(t,e,r,a){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-r/2}:"top"==t?{top:e.top-a,left:e.left+e.width/2-r/2}:"left"==t?{top:e.top+e.height/2-a/2,left:e.left-r}:{top:e.top+e.height/2-a/2,left:e.left+e.width}},r.prototype.getViewportAdjustedDelta=function(t,e,r,a){var n={top:0,left:0};if(!this.$viewport)return n;var o=this.options.viewport&&this.options.viewport.padding||0,i=this.getPosition(this.$viewport);if(/right|left/.test(t)){var s=e.top-o-i.scroll,c=e.top+o-i.scroll+a;s<i.top?n.top=i.top-s:c>i.top+i.height&&(n.top=i.top+i.height-c)}else{var l=e.left-o,u=e.left+o+r;l<i.left?n.left=i.left-l:u>i.right&&(n.left=i.left+i.width-u)}return n},r.prototype.getTitle=function(){var t,e=this.$element,r=this.options;return t=e.attr("data-original-title")||("function"==typeof r.title?r.title.call(e[0]):r.title)},r.prototype.getUID=function(t){do t+=~~(1e6*Math.random());while(document.getElementById(t));return t},r.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},r.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},r.prototype.enable=function(){this.enabled=!0},r.prototype.disable=function(){this.enabled=!1},r.prototype.toggleEnabled=function(){this.enabled=!this.enabled},r.prototype.toggle=function(e){var r=this;e&&(r=t(e.currentTarget).data("bs."+this.type),r||(r=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,r))),e?(r.inState.click=!r.inState.click,r.isInStateTrue()?r.enter(r):r.leave(r)):r.tip().hasClass("in")?r.leave(r):r.enter(r)},r.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null})};var a=t.fn.tooltip;t.fn.tooltip=e,t.fn.tooltip.Constructor=r,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=a,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var a=t(this),n=a.data("bs.popover"),o="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||a.data("bs.popover",n=new r(this,o)),"string"==typeof e&&n[e]())})}var r=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");r.VERSION="3.3.5",r.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),r.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),r.prototype.constructor=r,r.prototype.getDefaults=function(){return r.DEFAULTS},r.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),r=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof r?"html":"append":"text"](r),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},r.prototype.hasContent=function(){return this.getTitle()||this.getContent()},r.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},r.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var a=t.fn.popover;t.fn.popover=e,t.fn.popover.Constructor=r,t.fn.popover.noConflict=function(){return t.fn.popover=a,this}}(jQuery)),MG.chart_title=K,MG.scale_factory=et;var jr={};jr.categorical=function(t,e){e.namespace;bt(t,e),wt(t,e)},jr.numerical=function(t,e){var r=e.namespace,a=r+"_axis",n="mg-"+r+"-axis",o=R(t.target);if(w(o,"."+n),!t[a])return this;var i=k(o,n);return it(t,r),ht(i,t,e),gt(i,t,e),mt(i,t,e),t[r+"_label"]&&e.label(o.select(".mg-"+r+"-axis"),t),t[r+"_rug"]&&yt(t,e),t.show_bar_zero&&Dt(t),this},MG.axis_factory=Mt,MG.y_rug=Gt,MG.y_axis=Tt,MG.y_axis_categorical=Lt,MG.x_rug=St,MG.x_axis=Xt,MG.x_axis_categorical=Ut,MG.init=Ye,MG.markers=Ve;var Xr=new er;e()&&+function(t){"use strict";function e(e){e&&3===e.which||(t(n).remove(),t(o).each(function(){var a=t(this),n=r(a),o={relatedTarget:this};n.hasClass("open")&&(n.trigger(e=t.Event("hide.bs.dropdown",o)),e.isDefaultPrevented()||(a.attr("aria-expanded","false"),n.removeClass("open").trigger("hidden.bs.dropdown",o)))}))}function r(e){var r=e.attr("data-target"); | |
r||(r=e.attr("href"),r=r&&/#[A-Za-z]/.test(r)&&r.replace(/.*(?=#[^\s]*$)/,""));var a=r&&t(r);return a&&a.length?a:e.parent()}function a(e){return this.each(function(){var r=t(this),a=r.data("bs.dropdown");a||r.data("bs.dropdown",a=new i(this)),"string"==typeof e&&a[e].call(r)})}if("function"==typeof t().dropdown)return!0;var n=".dropdown-backdrop",o='[data-toggle="dropdown"]',i=function(e){t(e).on("click.bs.dropdown",this.toggle)};i.VERSION="3.3.1",i.prototype.toggle=function(a){var n=t(this);if(!n.is(".disabled, :disabled")){var o=r(n),i=o.hasClass("open");if(e(),!i){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",e);var s={relatedTarget:this};if(o.trigger(a=t.Event("show.bs.dropdown",s)),a.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),o.toggleClass("open").trigger("shown.bs.dropdown",s)}return!1}},i.prototype.keydown=function(e){if(/(38|40|27|32)/.test(e.which)&&!/input|textarea/i.test(e.target.tagName)){var a=t(this);if(e.preventDefault(),e.stopPropagation(),!a.is(".disabled, :disabled")){var n=r(a),i=n.hasClass("open");if(!i&&27!=e.which||i&&27==e.which)return 27==e.which&&n.find(o).trigger("focus"),a.trigger("click");var s=" li:not(.divider):visible a",c=n.find('[role="menu"]'+s+', [role="listbox"]'+s);if(c.length){var l=c.index(e.target);38==e.which&&l>0&&l--,40==e.which&&l<c.length-1&&l++,~l||(l=0),c.eq(l).trigger("focus")}}}};var s=t.fn.dropdown;t.fn.dropdown=a,t.fn.dropdown.Constructor=i,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=s,this},t(document).on("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",o,i.prototype.toggle).on("keydown.bs.dropdown.data-api",o,i.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',i.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',i.prototype.keydown)}(jQuery),MG.button_layout=function(t){"use strict";return this.target=t,this.feature_set={},this.public_name={},this.sorters={},this.manual=[],this.manual_map={},this.manual_callback={},this._strip_punctuation=function(t){var e=t.replace(/[^a-zA-Z0-9 _]+/g,""),r=e.replace(/ +?/g,"");return r},this.data=function(t){return this._data=t,this},this.manual_button=function(t,e,r){return this.feature_set[t]=e,this.manual_map[this._strip_punctuation(t)]=t,this.manual_callback[t]=r,this},this.button=function(t){return arguments.length>1&&(this.public_name[t]=arguments[1]),arguments.length>2&&(this.sorters[t]=arguments[2]),this.feature_set[t]=[],this},this.callback=function(t){return this._callback=t,this},this.display=function(){var t,e,r,a,n=this._callback,o=this.manual_callback,i=this.manual_map;r=Object.keys(this.feature_set);var s,c=function(e){return t[e]};for(s=0;s<this._data.length;s++){t=this._data[s],e=r.map(c);for(var l=0;l<r.length;l++)a=r[l],this.feature_set[a].indexOf(e[l])===-1&&this.feature_set[a].push(e[l])}for(a in this.feature_set)this.sorters.hasOwnProperty(a)&&this.feature_set[a].sort(this.sorters[a]);$(this.target).empty(),$(this.target).append("<div class='col-lg-12 segments text-center'></div>");var u=function(){var t,e=$(this).data("key"),r=$(this).data("feature");return $("."+r+"-btns button.btn span.title").html(e),i.hasOwnProperty(r)?(t=i[r],o[t](e)):n(r,e),!1};for(var f in this.feature_set){for(r=this.feature_set[f],$(this.target+" div.segments").append('<div class="btn-group '+this._strip_punctuation(f)+'-btns text-left"><button type="button" class="btn btn-default btn-lg dropdown-toggle" data-toggle="dropdown"><span class=\'which-button\'>'+(this.public_name.hasOwnProperty(f)?this.public_name[f]:f)+"</span><span class='title'>"+(this.manual_callback.hasOwnProperty(f)?this.feature_set[f][0]:"all")+'</span><span class="caret"></span></button><ul class="dropdown-menu" role="menu">'+(this.manual_callback.hasOwnProperty(f)?"":'<li><a href="#" data-feature="'+f+'" data-key="all">All</a></li>')+(this.manual_callback.hasOwnProperty(f)?"":'<li class="divider"></li>')+"</ul></div>"),s=0;s<r.length;s++)"all"!==r[s]&&void 0!==r[s]&&$(this.target+" div."+this._strip_punctuation(f)+"-btns ul.dropdown-menu").append('<li><a href="#" data-feature="'+this._strip_punctuation(f)+'" data-key="'+r[s]+'">'+r[s]+"</a></li>");$("."+this._strip_punctuation(f)+"-btns .dropdown-menu li a").on("click",u)}return this},this},function(){"use strict";function e(t,e,r){t.classed("mg-hover-line"+e.line_id+"-color",null===r.colors).attr("fill",null===r.colors?"":r.colors[e.line_id-1])}function i(t,e,r){u(t,e),c(t,e),l(t,e),s(t,e,r)}function s(e,r,a){r.existing_band=a.selectAll(".mg-confidence-band").nodes(),e.show_confidence_band&&(r.confidence_area=t.area().defined(r.line.defined()).x(e.scalefns.xf).y0(function(t){var r=e.show_confidence_band[0];return void 0!=t[r]?e.scales.Y(t[r]):e.scales.Y(t[e.y_accessor])}).y1(function(t){var r=e.show_confidence_band[1];return void 0!=t[r]?e.scales.Y(t[r]):e.scales.Y(t[e.y_accessor])}).curve(e.interpolate))}function c(e,r){r.area=t.area().defined(r.line.defined()).x(e.scalefns.xf).y0(e.scales.Y.range()[0]).y1(e.scalefns.yf).curve(e.interpolate)}function l(e,r){r.flat_line=t.line().defined(function(t){return(void 0===t._missing||t._missing!==!0)&&null!==t[e.y_accessor]}).x(e.scalefns.xf).y(function(){return e.scales.Y(r.data_median)}).curve(e.interpolate)}function u(e,r){r.line=t.line().x(e.scalefns.xf).y(e.scalefns.yf).curve(e.interpolate),e.missing_is_zero||(r.line=r.line.defined(function(t){return(void 0===t._missing||t._missing!==!0)&&null!==t[e.y_accessor]}))}function f(t,e,r,a){if(t.show_confidence_band){var n;r.select(".mg-confidence-band-"+a).empty()&&r.append("path").attr("class","mg-confidence-band mg-confidence-band-"+a),n=r.select(".mg-confidence-band-"+a),n.transition().duration(function(){return t.transition_on_update?1e3:0}).attr("d",e.confidence_area(t.data[a-1])).attr("clip-path","url(#mg-plot-window-"+P(t.target)+")")}}function d(t,e,r,a,n){var o=r.selectAll(".mg-main-area.mg-area"+n);e.display_area?o.empty()?r.append("path").classed("mg-main-area",!0).classed("mg-area"+n,!0).classed("mg-area"+n+"-color",null===t.colors).attr("d",e.area(t.data[a])).attr("fill",null===t.colors?"":t.colors[n-1]).attr("clip-path","url(#mg-plot-window-"+P(t.target)+")"):(r.node().appendChild(o.node()),o.transition().duration(e.update_transition_duration).attr("d",e.area(t.data[a])).attr("clip-path","url(#mg-plot-window-"+P(t.target)+")")):o.empty()||o.remove()}function p(t,e){t.classed("mg-line"+e+"-color",!0)}function _(t,e,r,a){t.colors&&t.colors.constructor===Array?(e.attr("stroke",t.colors[r]),t.colors.length<r+1&&p(e,a)):p(e,a)}function m(e,r,a,n){e.animate_on_load?(r.data_median=t.median(e.data[n],function(t){return t[e.y_accessor]}),a.attr("d",r.flat_line(e.data[n])).transition().duration(1e3).attr("d",r.line(e.data[n])).attr("clip-path","url(#mg-plot-window-"+P(e.target)+")")):a.attr("d",r.line(e.data[n])).attr("clip-path","url(#mg-plot-window-"+P(e.target)+")")}function g(t,e,r,a,n,o){if(a.empty()){var i=r.append("path").attr("class","mg-main-line mg-line"+o);_(t,i,n,o),m(t,e,i,n)}else{r.node().appendChild(a.node());var s=a.transition().duration(e.update_transition_duration);e.display_area||!t.transition_on_update||t.missing_is_hidden?s.attr("d",e.line(t.data[n])):s.attrTween("d",Tr(e.line(t.data[n]),4))}}function h(t,e,r,a){var i;if(t.legend)if(n(t.legend)?i=t.legend[r]:o(t.legend)&&(i=t.legend(t.data[r])),t.legend_target)t.colors&&t.colors.constructor===Array?e.legend_text="<span style='color:"+t.colors[r]+"'>— "+i+" </span>"+e.legend_text:e.legend_text="<span class='mg-line"+a+"-legend-color'>— "+i+" </span>"+e.legend_text;else{var s,c,l;"left"===t.y_axis_position?(s=t.data[r][t.data[r].length-1],c="start",l=t.buffer):(s=t.data[r][0],c="end",l=-t.buffer);var u=e.legend_group.append("svg:text").attr("x",t.scalefns.xf(s)).attr("dx",l).attr("y",t.scalefns.yf(s)).attr("dy",".35em").attr("font-size",10).attr("text-anchor",c).attr("font-weight","300").text(i);t.colors&&t.colors.constructor===Array?t.colors.length<r+1?u.classed("mg-line"+a+"-legend-color",!0):u.attr("fill",t.colors[r]):u.classed("mg-line"+a+"-legend-color",!0),F(e.legend_group.selectAll(".mg-line-legend text").nodes(),t)}}function y(e,r){e&&t.select(e).html(r)}function b(t,e,r){t.legend&&(e.legend_group=k(r,"mg-line-legend"))}function M(t){w(t,".mg-rollover-rect"),w(t,".mg-voronoi"),w(t,".mg-active-datapoint"),w(t,".mg-line-rollover-circle")}function G(t,e){var r=e.selectAll(".mg-line-rollover-circle").data(t.data).enter().append("circle").attr("cx",0).attr("cy",0).attr("r",0);t.colors&&t.colors.constructor===Array?r.attr("class",function(t){return"mg-line"+t.line_id}).attr("fill",function(e,r){return t.colors[r]}).attr("stroke",function(e,r){return t.colors[r]}):r.attr("class",function(t,e){return["mg-line"+t.line_id,"mg-line"+t.line_id+"-color","mg-area"+t.line_id+"-color"].join(" ")}),r.classed("mg-line-rollover-circle",!0)}function A(t){for(var e=1,r=0;r<t.data.length;r++){for(var a=0;a<t.data[r].length;a++)t.data[r][a].index=e,t.custom_line_color_map.length>0?t.data[r][a].line_id=t.custom_line_color_map[r]:t.data[r][a].line_id=e;e++}}function D(e){return t.merge(e.data)}function O(t){return function(e){var r;if(t.linked){var a=e[t.x_accessor],n=MG.time_format(t.utc_time,t.linked_format),o="number"==typeof a?e.line_id-1:n(a);return r="roll_"+o+" mg-line"+e.line_id,null===t.color&&(r+=" mg-line"+e.line_id+"-color"),r}return r="mg-line"+e.line_id,null===t.color&&(r+=" mg-line"+e.line_id+"-color"),r}}function z(e,r,a,n,o){var i=t.voronoi().x(function(t){return e.scales.X(t[e.x_accessor]).toFixed(2)}).y(function(t){return e.scales.Y(t[e.y_accessor]).toFixed(2)}).extent([[e.buffer,e.buffer+e.title_y_position],[e.width-e.buffer,e.height-e.buffer]]),s=k(r,"mg-voronoi");s.selectAll("path").data(i.polygons(D(e))).enter().append("path").filter(function(t){return void 0!==t&&t.length>0}).attr("d",function(t){return null==t?null:"M"+t.join("L")+"Z"}).datum(function(t){return null==t?null:t.data}).attr("class",O(e)).on("mouseover",a).on("mouseout",n).on("mousemove",o),E(e,r)}function C(e){var r=t.nest().key(function(t){return t[e.x_accessor]}).entries(t.merge(e.data));return r.forEach(function(t){var r=t.values[0];t.key=r[e.x_accessor]}),e.x_sort?r.sort(function(t,e){return new Date(t.key)-new Date(e.key)}):r}function T(t,e,r,a,n){var o=C(t),i=o.map(function(e){return t.scales.X(e.key)}),s=e.append("g").attr("class","mg-rollover-rect");s.selectAll(".mg-rollover-rects").data(o).enter().append("rect").attr("x",function(e,r){return 1===i.length?x(t):0===r?i[r].toFixed(2):((i[r-1]+i[r])/2).toFixed(2)}).attr("y",t.top).attr("width",function(e,r){return 1===i.length?v(t):0===r?((i[r+1]-i[r])/2).toFixed(2):r===i.length-1?((i[r]-i[r-1])/2).toFixed(2):((i[r+1]-i[r-1])/2).toFixed(2)}).attr("class",function(e){var r=e.values.map(function(e){var r=$(e.line_id);return null===t.colors&&(r+=" "+L(e.line_id)),r}).join(" ");return t.linked&&e.values.length>0&&(r+=" "+S(j(e.values[0],0,t))),r}).attr("height",t.height-t.bottom-t.top-t.buffer).attr("opacity",0).on("mouseover",r).on("mouseout",a).on("mousemove",n),U(t,e)}function Y(t,e){e.select(".mg-rollover-rect rect").on("mouseover")(t.data[0][0],0)}function E(t,e){for(var r=0;r<t.data.length;r++){var a=r+1;t.custom_line_color_map.length>0&&void 0!==t.custom_line_color_map[r]&&(a=t.custom_line_color_map[r]),1!==t.data[r].length||e.selectAll(".mg-voronoi .mg-line"+a).empty()||(e.selectAll(".mg-voronoi .mg-line"+a).on("mouseover")(t.data[r][0],0),e.selectAll(".mg-voronoi .mg-line"+a).on("mouseout")(t.data[r][0],0))}}function $(t){return"mg-line"+t}function L(t){return"mg-line"+t+"-color"}function S(t){return"roll_"+t}function j(t,e,r){var a=t[r.x_accessor],n=MG.time_format(r.utc_time,r.linked_format),o="number"==typeof a?e:n(a);return o}function X(t,e,r,a,n){var o=1;t.custom_line_color_map.length>0&&(o=t.custom_line_color_map[0]);var i=e.append("g").attr("class","mg-rollover-rect"),s=t.data[0].map(t.scalefns.xf);i.selectAll(".mg-rollover-rects").data(t.data[0]).enter().append("rect").attr("class",function(e,r){var a=L(o)+" "+$(e.line_id);return t.linked&&(a+=a+" "+S(j(e,r,t))),a}).attr("x",function(e,r){return 1===s.length?x(t):0===r?s[r].toFixed(2):((s[r-1]+s[r])/2).toFixed(2)}).attr("y",function(e,r){return t.data.length>1?t.scalefns.yf(e)-6:t.top}).attr("width",function(e,r){return 1===s.length?v(t):0===r?((s[r+1]-s[r])/2).toFixed(2):r===s.length-1?((s[r]-s[r-1])/2).toFixed(2):((s[r+1]-s[r-1])/2).toFixed(2)}).attr("height",function(e,r){return t.data.length>1?12:t.height-t.bottom-t.top-t.buffer}).attr("opacity",0).on("mouseover",r).on("mouseout",a).on("mousemove",n),I(t)&&Y(t,e)}function U(t,e){var r=e.selectAll(".mg-rollover-rect rect"),a=r.nodes()[0][0]||r.nodes()[0];t.data.filter(function(t){return 1===t.length}).length>0&&r.on("mouseover")(a.__data__,0)}function N(t){return t.data.length>1&&!t.aggregate_rollover}function B(t){return t.data.length>1&&t.aggregate_rollover}function I(t){return 1===t.data.length&&1===t.data[0].length}function H(t,e,r){q(e,r);for(var a=t.data.length-1;a>=0;a--){var n=t.data[a];MG.call_hook("line.before_each_series",[n,t]);var o=a+1;if(t.custom_line_color_map.length>0&&(o=t.custom_line_color_map[a]),t.data[a].line_id=o,0!==n.length){var i=r.select("path.mg-main-line.mg-line"+o);f(t,e,r,o),d(t,e,r,a,o),g(t,e,r,i,a,o),h(t,e,a,o),MG.call_hook("line.after_each_series",[n,i,t])}}}function q(t,e){t.existing_band[0]&&t.existing_band[0].length>e.selectAll(".mg-main-line").node().length&&e.selectAll(".mg-confidence-band").remove()}function V(t){var e={},r=R(t.target);w(r,".mg-line-legend"),b(t,e,r),e.data_median=0,e.update_transition_duration=t.transition_on_update?1e3:0,e.display_area=t.area&&!t.use_data_y_min&&t.data.length<=1&&t.aggregate_rollover===!1,e.legend_text="",i(t,e,r),e.existing_band=r.selectAll(".mg-confidence-band").nodes();var a=MG.call_hook("line.before_all_series",[t]);a!==!1&&H(t,e,r),y(t.legend_target,e.legend_text)}function W(t,e){var r=R(t.target);0===r.selectAll(".mg-active-datapoint-container").nodes().length&&k(r,"mg-active-datapoint-container"),M(r),G(t,r),A(t),N(t)?z(t,r,e.rolloverOn(t),e.rolloverOff(t),e.rolloverMove(t)):B(t)?T(t,r,e.rolloverOn(t),e.rolloverOff(t),e.rolloverMove(t)):X(t,r,e.rolloverOn(t),e.rolloverOff(t),e.rolloverMove(t))}function Q(t,e,r){if(t.aggregate_rollover&&t.data.length>1)e.selectAll("circle.mg-line-rollover-circle").style("opacity",0),r.values.forEach(function(r){a(r,t)&&Z(t,e,r)});else{if(t.missing_is_hidden&&r._missing||null===r[t.y_accessor])return;a(r,t)&&K(t,e,r)}}function Z(t,e,r){e.select("circle.mg-line-rollover-circle.mg-line"+r.line_id).attr("cx",t.scales.X(r[t.x_accessor]).toFixed(2)).attr("cy",t.scales.Y(r[t.y_accessor]).toFixed(2)).attr("r",t.point_size).style("opacity",1)}function K(t,e,r){e.selectAll("circle.mg-line-rollover-circle.mg-line"+r.line_id).classed("mg-line-rollover-circle",!0).attr("cx",function(){return t.scales.X(r[t.x_accessor]).toFixed(2)}).attr("cy",function(){return t.scales.Y(r[t.y_accessor]).toFixed(2)}).attr("r",t.point_size).style("opacity",1)}function J(e,r,a){if(e.linked&&!MG.globals.link&&(MG.globals.link=!0,!e.aggregate_rollover||void 0!==r.value||r.values.length>0)){var n=r.values?r.values[0]:r,o=j(n,a,e);t.selectAll("."+$(n.line_id)+"."+S(o)).each(function(e){t.select(this).on("mouseover")(e,a)})}}function tt(e,r,a){if(e.linked&&MG.globals.link){MG.globals.link=!1;var n=MG.time_format(e.utc_time,e.linked_format),o=r.values?r.values:[r];o.forEach(function(r){var o=r[e.x_accessor],i="number"==typeof o?a:n(o);t.selectAll(".roll_"+i).each(function(e){t.select(this).on("mouseout")(e)})})}}function et(t,e){e.selectAll("circle.mg-line-rollover-circle").filter(function(t){return t.length>1}).style("opacity",0)}function rt(t,e,r){e.selectAll("circle.mg-line-rollover-circle.mg-line"+r.line_id).style("opacity",function(){var e=r.line_id-1;return t.custom_line_color_map.length>0&&void 0!==t.custom_line_color_map.indexOf(r.line_id)&&(e=t.custom_line_color_map.indexOf(r.line_id)),1===t.data[e].length?1:0})}function at(t){this.init=function(t){if(this.args=t,!t.data||0===t.data.length)return t.internal_error="No data was supplied",Lr(t),this;t.internal_error=void 0,sr(t),fr(t),MG.call_hook("line.before_destroy",this),Ye(t),new MG.scale_factory(t).namespace("x").numericalDomainFromData().numericalRange("bottom");var e=(t.baselines||[]).map(function(e){return e[t.y_accessor]});new MG.scale_factory(t).namespace("y").zeroBottom(!0).inflateDomain(!0).numericalDomainFromData(e).numericalRange("left");R(t.target);return t.x_axis&&new MG.axis_factory(t).namespace("x").type("numerical").position(t.x_axis_position).rug(St(t)).label(It).draw(),t.y_axis&&new MG.axis_factory(t).namespace("y").type("numerical").position(t.y_axis_position).rug(Gt(t)).label(Ot).draw(),this.markers(),this.mainPlot(),this.rollover(),this.windowListeners(),MG.call_hook("line.after_init",this),this},this.mainPlot=function(){return V(t),this},this.markers=function(){return Ve(t),this},this.rollover=function(){var e=this;return W(t,e),MG.call_hook("line.after_rollover",t),this},this.rolloverOn=function(t){var a=R(t.target);r(t);return function(r,n){if(Q(t,a,r),J(t,r,n),a.selectAll("text").filter(function(t,e){return r===t}).attr("opacity",.3),t.show_rollover_text&&!(t.missing_is_hidden&&r._missing||null===r[t.y_accessor])){var o=tr(t,{svg:a}),i=o.mouseover_row();t.aggregate_rollover&&i.text((t.aggregate_rollover&&t.data.length>1?Cr:Fr)(t,r));var s=t.aggregate_rollover&&t.data.length>1?r.values:[r];s.forEach(function(r){t.aggregate_rollover&&(i=o.mouseover_row()),t.legend&&e(i.text(t.legend[r.index-1]+" ").bold().elem(),r,t),e(i.text("— ").elem(),r,t),t.aggregate_rollover||i.text(Fr(t,r)),i.text(zr(t,r,t.time_series===!1))})}t.mouseover&&t.mouseover(r,n)}},this.rolloverOff=function(t){var e=R(t.target);return function(r,a){tt(t,r,a),t.aggregate_rollover?et(t,e):rt(t,e,r),t.data[0].length>1&&We(e),t.mouseout&&t.mouseout(r,a)}},this.rolloverMove=function(t){return function(e,r){t.mousemove&&t.mousemove(e,r)}},this.windowListeners=function(){return rr(this.args),this},this.init(t)}MG.register("line",at)}.call(this),function(){"use strict";function e(e){this.init=function(t){this.args=t,sr(t),dr(t),Ye(t),new MG.scale_factory(t).namespace("x").numericalDomainFromData().numericalRange("bottom");var e=(t.baselines||[]).map(function(e){return e[t.y_accessor]});return new MG.scale_factory(t).namespace("y").zeroBottom(!0).inflateDomain(!0).numericalDomainFromData(e).numericalRange("left"),Xt(t),Tt(t),this.mainPlot(),this.markers(),this.rollover(),this.windowListeners(),this},this.mainPlot=function(){var t=R(e.target);t.selectAll(".mg-histogram").remove();var r=t.append("g").attr("class","mg-histogram"),a=r.selectAll(".mg-bar").data(e.data[0]).enter().append("g").attr("class","mg-bar").attr("transform",function(t){return"translate("+e.scales.X(t[e.x_accessor]).toFixed(2)+","+e.scales.Y(t[e.y_accessor]).toFixed(2)+")"});return a.append("rect").attr("x",1).attr("width",function(t,r){return 1===e.data[0].length?(e.scalefns.xf(e.data[0][0])-e.bar_margin).toFixed(0):r!==e.data[0].length-1?(e.scalefns.xf(e.data[0][r+1])-e.scalefns.xf(t)).toFixed(0):(e.scalefns.xf(e.data[0][1])-e.scalefns.xf(e.data[0][0])).toFixed(0)}).attr("height",function(t){return 0===t[e.y_accessor]?0:(e.height-e.bottom-e.buffer-e.scales.Y(t[e.y_accessor])).toFixed(2)}),this},this.markers=function(){return Ve(e),this},this.rollover=function(){var t=R(e.target);0===t.selectAll(".mg-active-datapoint-container").nodes().length&&k(t,"mg-active-datapoint-container"),t.selectAll(".mg-rollover-rect").remove(),t.selectAll(".mg-active-datapoint").remove();var r=t.append("g").attr("class","mg-rollover-rect"),a=r.selectAll(".mg-bar").data(e.data[0]).enter().append("g").attr("class",function(t,r){return e.linked?"mg-rollover-rects roll_"+r:"mg-rollover-rects"}).attr("transform",function(t){return"translate("+e.scales.X(t[e.x_accessor])+",0)"});return a.append("rect").attr("x",1).attr("y",e.buffer+e.title_y_position).attr("width",function(t,r){return 1===e.data[0].length?(e.scalefns.xf(e.data[0][0])-e.bar_margin).toFixed(0):r!==e.data[0].length-1?(e.scalefns.xf(e.data[0][r+1])-e.scalefns.xf(t)).toFixed(0):(e.scalefns.xf(e.data[0][1])-e.scalefns.xf(e.data[0][0])).toFixed(0)}).attr("height",function(t){return e.height}).attr("opacity",0).on("mouseover",this.rolloverOn(e)).on("mouseout",this.rolloverOff(e)).on("mousemove",this.rolloverMove(e)),this},this.rolloverOn=function(e){var r=R(e.target);return function(a,n){r.selectAll("text").filter(function(t,e){return a===t}).attr("opacity",.3);e.processed.xax_format||MG.time_format(e.utc_time,"%b %e, %Y"),Dr(e);if(r.selectAll(".mg-bar rect").filter(function(t,e){return e===n}).classed("active",!0),e.linked&&!MG.globals.link&&(MG.globals.link=!0,t.selectAll(".mg-rollover-rects.roll_"+n+" rect").each(function(e){t.select(this).on("mouseover")(e,n)})),e.show_rollover_text){var o=tr(e,{svg:r}),i=o.mouseover_row();i.text("▟ ").elem().classed("hist-symbol",!0),i.text(Fr(e,a)),i.text(zr(e,a,e.time_series===!1))}e.mouseover&&(Qe(r,e),e.mouseover(a,n))}},this.rolloverOff=function(e){var r=R(e.target);return function(a,n){e.linked&&MG.globals.link&&(MG.globals.link=!1,t.selectAll(".mg-rollover-rects.roll_"+n+" rect").each(function(e){t.select(this).on("mouseout")(e,n)})),r.selectAll(".mg-bar rect").classed("active",!1),We(r),e.mouseout&&e.mouseout(a,n)}},this.rolloverMove=function(t){return function(e,r){t.mousemove&&t.mousemove(e,r)}},this.windowListeners=function(){return rr(this.args),this},this.init(e)}var r={binned:!1,bins:null,processed_x_accessor:"x",processed_y_accessor:"y",processed_dx_accessor:"dx",bar_margin:1};MG.register("histogram",e,r)}.call(this),function(){"use strict";function e(t,e){var r=e.x_accessor,a=e.y_accessor,n=t.filter(function(t){return(null===e.min_x||t[r]>=e.min_x)&&(null===e.max_x||t[r]<=e.max_x)&&(null===e.min_y||t[a]>=e.min_y)&&(null===e.max_y||t[a]<=e.max_y)});return n}function r(r){this.init=function(t){this.args=t,t.x_axis_type=T(t,"x"),t.y_axis_type=T(t,"y"),sr(t),_r(t),Ye(t);var e,r;if("categorical"===t.x_axis_type?(e=MG.scale_factory(t).namespace("x").categoricalDomainFromData().categoricalRangeBands([0,t.xgroup_height],null===t.xgroup_accessor),t.xgroup_accessor?new MG.scale_factory(t).namespace("xgroup").categoricalDomainFromData().categoricalRangeBands("bottom"):(t.scales.XGROUP=function(e){return x(t)},t.scalefns.xgroupf=function(e){return x(t)}),t.scalefns.xoutf=function(e){return t.scalefns.xf(e)+t.scalefns.xgroupf(e)}):(e=MG.scale_factory(t).namespace("x").inflateDomain(!0).zeroBottom("categorical"===t.y_axis_type).numericalDomainFromData((t.baselines||[]).map(function(e){return e[t.x_accessor]})).numericalRange("bottom"),t.scalefns.xoutf=t.scalefns.xf),"categorical"===t.y_axis_type)r=MG.scale_factory(t).namespace("y").zeroBottom(!0).categoricalDomainFromData().categoricalRangeBands([0,t.ygroup_height],!0),t.ygroup_accessor?new MG.scale_factory(t).namespace("ygroup").categoricalDomainFromData().categoricalRangeBands("left"):(t.scales.YGROUP=function(){return g(t)},t.scalefns.ygroupf=function(e){return g(t)}),t.scalefns.youtf=function(e){return t.scalefns.yf(e)+t.scalefns.ygroupf(e)};else{var a=(t.baselines||[]).map(function(e){return e[t.y_accessor]});r=MG.scale_factory(t).namespace("y").inflateDomain(!0).zeroBottom("categorical"===t.x_axis_type).numericalDomainFromData(a).numericalRange("left"),t.scalefns.youtf=function(e){return t.scalefns.yf(e)}}if(null!==t.color_accessor){var n=MG.scale_factory(t).namespace("color");"number"===t.color_type?n.numericalDomainFromData(nt(t)).numericalRange(ot(t)).clamp(!0):t.color_domain?n.categoricalDomain(t.color_domain).categoricalRange(t.color_range):n.categoricalDomainFromData().categoricalColorRange()}return t.size_accessor&&new MG.scale_factory(t).namespace("size").numericalDomainFromData().numericalRange(Bt(t)).clamp(!0),new MG.axis_factory(t).namespace("x").type(t.x_axis_type).zeroLine("categorical"===t.y_axis_type).position(t.x_axis_position).rug(St(t)).label(It).draw(),new MG.axis_factory(t).namespace("y").type(t.y_axis_type).zeroLine("categorical"===t.x_axis_type).position(t.y_axis_position).rug(Gt(t)).label(Ot).draw(),this.mainPlot(),this.markers(),this.rollover(),this.windowListeners(),this},this.markers=function(){return Ve(r),r.least_squares&&mr(r),this},this.mainPlot=function(){var t,a=R(r.target),n=e(r.data[0],r);a.selectAll(".mg-points").remove(),t=a.append("g").classed("mg-points",!0);var o=t.selectAll("circle").data(n).enter().append("circle").attr("class",function(t,e){return"path-"+e}).attr("cx",r.scalefns.xoutf).attr("cy",function(t){return r.scalefns.youtf(t)});return null!==r.color_accessor?(o.attr("fill",r.scalefns.colorf),o.attr("stroke",r.scalefns.colorf)):o.classed("mg-points-mono",!0),null!==r.size_accessor?o.attr("r",r.scalefns.sizef):o.attr("r",r.point_size),this},this.rollover=function(){var a=R(r.target);0===a.selectAll(".mg-active-datapoint-container").nodes().length&&k(a,"mg-active-datapoint-container"),a.selectAll(".mg-voronoi").remove();var n=t.voronoi().x(r.scalefns.xoutf).y(r.scalefns.youtf).extent([[r.buffer,r.buffer+r.title_y_position],[r.width-r.buffer,r.height-r.buffer]]),o=a.append("g").attr("class","mg-voronoi");return o.selectAll("path").data(n.polygons(e(r.data[0],r))).enter().append("path").attr("d",function(t){return null==t?null:"M"+t.join(",")+"Z"}).attr("class",function(t,e){return"path-"+e}).style("fill-opacity",0).on("mouseover",this.rolloverOn(r)).on("mouseout",this.rolloverOff(r)).on("mousemove",this.rolloverMove(r)),1===r.data[0].length&&nr(r,a,r.data[0][0]),this},this.rolloverOn=function(e){var r=R(e.target);return function(a,n){r.selectAll(".mg-points circle").classed("selected",!1);var o=r.selectAll(".mg-points circle.path-"+n).classed("selected",!0);e.size_accessor?o.attr("r",function(t){return e.scalefns.sizef(t)+e.active_point_size_increase}):o.attr("r",e.point_size+e.active_point_size_increase),e.linked&&!MG.globals.link&&(MG.globals.link=!0,t.selectAll(".mg-voronoi .path-"+n).each(function(){t.select(this).on("mouseover")(a,n)})),e.show_rollover_text&&nr(e,r,a.data),e.mouseover&&e.mouseover(a,n)}},this.rolloverOff=function(e){var r=R(e.target);return function(a,n){e.linked&&MG.globals.link&&(MG.globals.link=!1,t.selectAll(".mg-voronoi .path-"+n).each(function(){t.select(this).on("mouseout")(a,n)}));var o=r.selectAll(".mg-points circle").classed("unselected",!1).classed("selected",!1);e.size_accessor?o.attr("r",e.scalefns.sizef):o.attr("r",e.point_size),e.data[0].length>1&&We(r),e.mouseout&&e.mouseout(a,n)}},this.rolloverMove=function(t){return function(e,r){t.mousemove&&t.mousemove(e,r)}},this.update=function(t){return this},this.windowListeners=function(){return rr(this.args),this},this.init(r)}var a={y_padding_percentage:.05,y_outer_padding_percentage:.2,ygroup_padding_percentage:0,ygroup_outer_padding_percentage:0,x_padding_percentage:.05,x_outer_padding_percentage:.2,xgroup_padding_percentage:0,xgroup_outer_padding_percentage:0,y_categorical_show_guides:!0,x_categorical_show_guides:!0,buffer:16,ls:!1,lowess:!1,point_size:2.5,label_accessor:null,size_accessor:null,color_accessor:null,size_range:null,color_range:null,size_domain:null,color_domain:null,active_point_size_increase:1,color_type:"number"};MG.register("point",r,a)}.call(this),function(){"use strict";function e(e){var r;if(e.legend_target){var a=t.select(e.legend_target).append("div").classed("mg-bar-target-legend",!0);r="horizontal"==e.orientation?e.scales.Y.domain():e.scales.X.domain(),r.forEach(function(t){var r=a.append("span").classed("mg-bar-target-element",!0);r.append("span").classed("mg-bar-target-legend-shape",!0).style("color",e.scales.COLOR(t)).text("◼ "),r.append("span").classed("mg-bar-target-legend-text",!0).text(t)})}}function r(t,e){var r;r="horizontal"==e.orientation?e.scales.Y.domain():e.scales.X.domain();var a=0,n=1.1,o=t.append("g").classed("mg-bar-legend",!0),i=o.append("text");i.selectAll("*").remove(),i.attr("width",e.right).attr("height",100).attr("text-anchor","start"),r.forEach(function(t){var r=i.append("tspan").attr("x",v(e)).attr("y",e.height/2).attr("dy",a*n+"em");r.append("tspan").text("■ ").attr("fill",e.scales.COLOR(t)).attr("font-size",20),r.append("tspan").text(t).attr("font-weight",300).attr("font-size",10),a++})}function a(a){this.args=a,this.init=function(t){this.args=t,t.x_axis_type=T(t,"x"),t.y_axis_type=T(t,"y"),"categorical"==t.x_axis_type?t.orientation="vertical":"categorical"==t.y_axis_type?t.orientation="horizontal":"categorical"!=t.x_axis_type&&"categorical"!=t.y_axis_type&&(t.orientation="vertical"),sr(t),_r(t),Ye(t);var e,r;if("categorical"===t.x_axis_type?(e=MG.scale_factory(t).namespace("x").categoricalDomainFromData().categoricalRangeBands([0,t.xgroup_height],null===t.xgroup_accessor),t.xgroup_accessor?new MG.scale_factory(t).namespace("xgroup").categoricalDomainFromData().categoricalRangeBands("bottom"):(t.scales.XGROUP=function(e){return x(t)},t.scalefns.xgroupf=function(e){return x(t)}),t.scalefns.xoutf=function(e){return t.scalefns.xf(e)+t.scalefns.xgroupf(e)}):(e=MG.scale_factory(t).namespace("x").inflateDomain(!0).zeroBottom("categorical"===t.y_axis_type).numericalDomainFromData((t.baselines||[]).map(function(e){return e[t.x_accessor]})).numericalRange("bottom"),t.scalefns.xoutf=t.scalefns.xf),"categorical"===t.y_axis_type)r=MG.scale_factory(t).namespace("y").zeroBottom(!0).categoricalDomainFromData().categoricalRangeBands([0,t.ygroup_height],!0),t.ygroup_accessor?new MG.scale_factory(t).namespace("ygroup").categoricalDomainFromData().categoricalRangeBands("left"):(t.scales.YGROUP=function(){return g(t)},t.scalefns.ygroupf=function(e){return g(t)}),t.scalefns.youtf=function(e){return t.scalefns.yf(e)+t.scalefns.ygroupf(e)};else{var a=(t.baselines||[]).map(function(e){return e[t.y_accessor]});r=MG.scale_factory(t).namespace("y").inflateDomain(!0).zeroBottom("categorical"===t.x_axis_type).numericalDomainFromData(a).numericalRange("left"),t.scalefns.youtf=function(e){return t.scalefns.yf(e)}}return null!==t.ygroup_accessor&&(t.ycolor_accessor=t.y_accessor,MG.scale_factory(t).namespace("ycolor").scaleName("color").categoricalDomainFromData().categoricalColorRange()),null!==t.xgroup_accessor&&(t.xcolor_accessor=t.x_accessor,MG.scale_factory(t).namespace("xcolor").scaleName("color").categoricalDomainFromData().categoricalColorRange()),new MG.axis_factory(t).namespace("x").type(t.x_axis_type).zeroLine("categorical"===t.y_axis_type).position(t.x_axis_position).draw(),new MG.axis_factory(t).namespace("y").type(t.y_axis_type).zeroLine("categorical"===t.x_axis_type).position(t.y_axis_position).draw(),this.mainPlot(),this.markers(),this.rollover(),this.windowListeners(),this},this.mainPlot=function(){var t,n=R(a.target),o=a.data[0],i=n.select("g.mg-barplot"),s=i.empty(),c=s&&a.animate_on_load;c||a.transition_on_update,a.transition_duration||1e3;s&&(i=n.append("g").classed("mg-barplot",!0)),t=i.selectAll(".mg-bar").data(o).enter().append("rect").classed("mg-bar",!0).classed("default-bar",!a.scales.hasOwnProperty("COLOR"));var l,u,f,d,p,_,m,g,h,x,y,v,b,w,k,M;if("vertical"==a.orientation&&(l="height",u="width",f=a.y_axis_type,d=a.x_axis_type,p="y",_="x",m="categorical"==f?a.scalefns.youtf:a.scalefns.yf,g="categorical"==d?a.scalefns.xoutf:a.scalefns.xf,h=a.scales.Y,x=a.scales.X,y=a.y_accessor,v=a.x_accessor,b=function(t){var e;return e=m(t),t[y]<0&&(e=h(0)),e},w=function(t){return Math.abs(m(t)-h(0))},k=function(t){return Math.abs(h(t[a.reference_accessor])-h(0))},M=function(t){return h(t[a.reference_accessor])}),"horizontal"==a.orientation&&(l="width",u="height",f=a.x_axis_type,d=a.y_axis_type,p="x",_="y",m="categorical"==f?a.scalefns.xoutf:a.scalefns.xf,g="categorical"==d?a.scalefns.youtf:a.scalefns.yf, | |
h=a.scales.X,x=a.scales.Y,y=a.x_accessor,v=a.y_accessor,b=function(t){var e;return e=h(0)},w=function(t){return Math.abs(m(t)-h(0))},k=function(t){return Math.abs(h(t[a.reference_accessor])-h(0))},M=function(t){return h(0)}),t.attr(p,b),t.attr(_,function(t){var e;return"categorical"==d?e=g(t):(e=x(0),t[v]<0&&(e=g(t))),e-=a.bar_thickness/2}),a.scales.COLOR&&t.attr("fill",a.scalefns.colorf),t.attr(l,w).attr(u,function(t){return a.bar_thickness}),null!==a.reference_accessor){var G=o.filter(function(t){return t.hasOwnProperty(a.reference_accessor)}),A=i.selectAll(".mg-categorical-reference").data(G).enter().append("rect");A.attr(p,M).attr(_,function(t){return g(t)-a.reference_thickness/2}).attr(l,k).attr(u,a.reference_thickness)}if(null!==a.comparison_accessor){var D=null;D=null===a.comparison_thickness?a.bar_thickness/2:a.comparison_thickness;var O=o.filter(function(t){return t.hasOwnProperty(a.comparison_accessor)}),F=i.selectAll(".mg-categorical-comparison").data(O).enter().append("line");F.attr(p+"1",function(t){return h(t[a.comparison_accessor])}).attr(p+"2",function(t){return h(t[a.comparison_accessor])}).attr(_+"1",function(t){return g(t)-D/2}).attr(_+"2",function(t){return g(t)+D/2}).attr("stroke","black").attr("stroke-width",a.comparison_width)}return(a.legend||null!==a.color_accessor&&a.ygroup_accessor!==a.color_accessor)&&(a.legend_target?e(a):r(n,a)),this},this.markers=function(){return Ve(a),this},this.rollover=function(){var t,e=R(a.target);0===e.selectAll(".mg-active-datapoint-container").nodes().length&&k(e,"mg-active-datapoint-container"),e.selectAll(".mg-rollover-rect").remove(),e.selectAll(".mg-active-datapoint").remove();var r,n,o,i,s,c,l,u,f,d,p,_,m,h;"vertical"==a.orientation&&(r="height",n="width",o=a.y_axis_type,i=a.x_axis_type,s="y",c="x",l="categorical"==o?a.scalefns.youtf:a.scalefns.yf,u="categorical"==i?a.scalefns.xoutf:a.scalefns.xf,f=a.scales.Y,d=a.scales.X,p=a.y_accessor,_=a.x_accessor,m=function(t){return g(a)},h=function(t){return a.height-a.top-a.bottom-2*a.buffer}),"horizontal"==a.orientation&&(r="width",n="height",o=a.x_axis_type,i=a.y_axis_type,s="x",c="y",l="categorical"==o?a.scalefns.xoutf:a.scalefns.xf,u="categorical"==i?a.scalefns.youtf:a.scalefns.yf,f=a.scales.X,d=a.scales.Y,p=a.x_accessor,_=a.y_accessor,m=function(t){var e;return e=f(0)},h=function(t){return a.width-a.left-a.right-2*a.buffer});var x,y;"right"===a.rollover_align?(x=a.width-a.right,y="end"):"left"===a.rollover_align?(x=a.left,y="start"):(x=(a.width-a.left-a.right)/2+a.left,y="middle"),e.append("text").attr("class","mg-active-datapoint").attr("xml:space","preserve").attr("x",x).attr("y",.75*a.top).attr("dy",".35em").attr("text-anchor",y),t=e.append("g").attr("class","mg-rollover-rect");var v=t.selectAll(".mg-bar-rollover").data(a.data[0]).enter().append("rect").attr("class","mg-bar-rollover");return v.attr("opacity",0).attr(s,m).attr(c,function(t){var e;return"categorical"==i?e=u(t):(e=d(0),t[_]<0&&(e=u(t))),e-=a.bar_thickness/2}),v.attr(r,h),v.attr(n,function(t){return a.bar_thickness}),v.on("mouseover",this.rolloverOn(a)).on("mouseout",this.rolloverOff(a)).on("mousemove",this.rolloverMove(a)),this},this.rolloverOn=function(e){var r=R(e.target);this.is_vertical?e.x_accessor:e.y_accessor,this.is_vertical?e.y_accessor:e.x_accessor,this.is_vertical?e.yax_units:e.xax_units;return function(a,n){var o=(MG.time_format(e.utc_time,"%b %e, %Y"),Dr(e),r.selectAll("g.mg-barplot .mg-bar").filter(function(t,e){return e===n}).classed("active",!0));if(e.scales.hasOwnProperty("COLOR")?o.attr("fill",t.rgb(e.scalefns.colorf(a)).darker()):o.classed("default-active",!0),e.show_rollover_text){var i=tr(e,{svg:r}),s=i.mouseover_row();e.ygroup_accessor&&s.text(a[e.ygroup_accessor]+" ").bold(),s.text(Fr(e,a)),s.text(e.y_accessor+": "+a[e.y_accessor]),(e.predictor_accessor||e.baseline_accessor)&&(s=i.mouseover_row(),e.predictor_accessor&&s.text(Or(e,a,null,e.predictor_accessor,!1)),e.baseline_accessor&&s.text(Or(e,a,null,e.baseline_accessor,!1)))}e.mouseover&&e.mouseover(a,n)}},this.rolloverOff=function(t){var e=R(t.target);return function(r,a){var n=e.selectAll("g.mg-barplot .mg-bar.active").classed("active",!1);t.scales.hasOwnProperty("COLOR")?n.attr("fill",t.scalefns.colorf(r)):n.classed("default-active",!1),e.select(".mg-active-datapoint").text(""),We(e),t.mouseout&&t.mouseout(r,a)}},this.rolloverMove=function(t){return function(e,r){t.mousemove&&t.mousemove(e,r)}},this.windowListeners=function(){return rr(this.args),this},this.init(a)}var n={y_padding_percentage:.05,y_outer_padding_percentage:.2,ygroup_padding_percentage:0,ygroup_outer_padding_percentage:0,x_padding_percentage:.05,x_outer_padding_percentage:.2,xgroup_padding_percentage:0,xgroup_outer_padding_percentage:0,buffer:16,y_accessor:"factor",x_accessor:"value",reference_accessor:null,comparison_accessor:null,secondary_label_accessor:null,color_accessor:null,color_type:"category",color_domain:null,reference_thickness:1,comparison_width:3,comparison_thickness:null,legend:!1,legend_target:null,mouseover_align:"right",baseline_accessor:null,predictor_accessor:null,predictor_proportion:5,show_bar_zero:!0,binned:!0,truncate_x_labels:!0,truncate_y_labels:!0};MG.register("bar",a,n)}.call(this),MG.data_table=function(r){"use strict";return this.args=r,this.args.standard_col={width:150,font_size:12,font_weight:"normal"},this.args.columns=[],this.formatting_options=[["color","color"],["font-weight","font_weight"],["font-style","font_style"],["font-size","font_size"]],this._strip_punctuation=function(t){var e=t.replace(/[^a-zA-Z0-9 _]+/g,""),r=e.replace(/ +?/g,"");return r},this._format_element=function(t,e,r){this.formatting_options.forEach(function(a){var n=a[0],o=a[1];r[o]&&t.style(n,"string"==typeof r[o]||"number"==typeof r[o]?r[o]:r[o](e))})},this._add_column=function(t,e){var r=this.args.standard_col,a=U(MG.clone(t),MG.clone(r));a.type=e,this.args.columns.push(a)},this.target=function(){var t=arguments[0];return this.args.target=t,this},this.title=function(){return this._add_column(arguments[0],"title"),this},this.text=function(){return this._add_column(arguments[0],"text"),this},this.bullet=function(){return this},this.sparkline=function(){return this},this.number=function(){return this._add_column(arguments[0],"number"),this},this.display=function(){var r=this.args;K(r);var a,n,o,i,s,c,l,u,f,d,p,_,m=r.target,g=t.select(m).append("table").classed("mg-data-table",!0),h=g.append("colgroup"),x=g.append("thead"),y=g.append("tbody");for(o=x.append("tr"),_=0;_<r.columns.length;_++){var v=r.columns[_];c=v.type,u=v.label,u=void 0===u?"":u,i=o.append("th").style("width",v.width).style("text-align","title"===c?"left":"right").text(u),r.show_tooltips&&v.description&&e()&&(i.append("i").classed("fa",!0).classed("fa-question-circle",!0).classed("fa-inverse",!0),$(i.node()).popover({html:!0,animation:!1,content:v.description,trigger:"hover",placement:"top",container:$(i.node())}))}for(_=0;_<r.columns.length;_++)p=h.append("col"),"number"===r.columns[_].type&&p.attr("align","char").attr("char",".");for(var b=0;b<r.data.length;b++){o=y.append("tr");for(var w=0;w<r.columns.length;w++){if(a=r.columns[w],s=a.accessor,l=f=r.data[b][s],c=a.type,"number"===c){if(a.hasOwnProperty("round")&&!a.hasOwnProperty("format")&&(f=t.format("0,."+a.round+"f")(f)),a.hasOwnProperty("value_formatter")&&(f=a.value_formatter(f)),a.hasOwnProperty("format")){a.round&&(f=Math.round(f,a.round));var k,M=a.format;"percentage"===M&&(k=t.format(".0%")),"count"===M&&(k=t.format(",.0f")),"temperature"===M&&(k=function(t){return t+"°"}),f=k(f)}a.hasOwnProperty("currency")&&(f=a.currency+f)}d=o.append("td").classed("table-"+c,!0).classed("table-"+c+"-"+this._strip_punctuation(s),!0).attr("data-value",l).style("width",a.width).style("text-align","title"===c||"text"===c?"left":"right"),this._format_element(d,l,a),"title"===c?(n=d.append("div").text(f),this._format_element(n,f,a),r.columns[w].hasOwnProperty("secondary_accessor")&&d.append("div").text(r.data[b][r.columns[w].secondary_accessor]).classed("secondary-title",!0)):d.text(f)}}return this},this},function(){"use strict";function e(t,e){t.selectAll(".mg-missing-text").data([e.missing_text]).enter().append("text").attr("class","mg-missing-text").attr("x",e.width/2).attr("y",e.height/2).attr("dy",".50em").attr("text-anchor","middle").text(e.missing_text)}function r(e){e.scales.X=t.scaleLinear().domain([0,e.data.length]).range([x(e),v(e)]),e.scalefns.yf=function(t){return e.scales.Y(t.y)}}function a(e){e.scales.Y=t.scaleLinear().domain([-2,2]).range([e.height-e.bottom-2*e.buffer,e.top]),e.scalefns.xf=function(t){return e.scales.X(t.x)}}function n(t){for(var e=[],r=1;r<=50;r++)e.push({x:r,y:Math.random()-.03*r});t.data=e}function o(t,e){t.append("svg:rect").classed("mg-missing-background",!0).attr("x",e.buffer).attr("y",e.buffer+2*e.title_y_position).attr("width",e.width-2*e.buffer).attr("height",e.height-2*e.buffer-2*e.title_y_position).attr("rx",15).attr("ry",15)}function i(e,r){var a=t.line().x(r.scalefns.xf).y(r.scalefns.yf).curve(r.interpolate);e.append("path").attr("class","mg-main-line mg-line1-color").attr("d",a(r.data))}function s(e,r){var a=t.area().x(r.scalefns.xf).y0(r.scales.Y.range()[0]).y1(r.scalefns.yf).curve(r.interpolate);e.append("path").attr("class","mg-main-area mg-area1-color").attr("d",a(r.data))}function c(e){t.select(e.target).selectAll("svg *").remove()}function l(e){e.legend_target&&t.select(e.legend_target).html("")}function u(u){this.init=function(u){this.args=u,xe(u),ye(u);var f=t.select(u.target);De(f,u);var d=f.selectAll("svg");if(ve(d,u),d=be(d,u),ke(d,u),Me(d,u),c(u),d.classed("mg-missing",!0),l(u),K(u),u.show_missing_background){n(u),r(u),a(u);var p=k(d,"mg-missing-pane");o(p,u),i(p,u),s(p,u)}return e(d,u),this.windowListeners(),this},this.windowListeners=function(){return rr(this.args),this},this.init(u)}var f={top:40,bottom:30,right:10,left:0,buffer:8,legend_target:"",width:350,height:220,missing_text:"Data currently missing or unavailable",scalefns:{},scales:{},show_tooltips:!0,show_missing_background:!0};MG.register("missing-data",u,f)}.call(this),MG.raw_data_transformation=sr,MG.process_line=fr,MG.process_histogram=dr,MG.process_categorical_variables=pr,MG.process_point=_r,MG.add_ls=mr,MG.add_lowess=gr,MG.lowess_robust=hr,MG.lowess=xr,MG.least_squares=yr;var Ur=function(t,e,r,a){var n;return n="string"==typeof t?MG.time_format(a,t)(e[r]):"function"==typeof t?t(e):e[r]},Nr=function(e,r,a){var n;return n="string"==typeof e?t.format("s")(r[a]):"function"==typeof e?e(r):r[a]};return MG.format_rollover_number=Dr,MG.path_tween=Tr,MG.render_markup=Er,MG.init_virtual_window=$r,MG.error=Pr,MG}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment