/* * VizGrimoire.js - https://github.com/VizGrimoire/VizGrimoireJS * Copyright (C) 2012 Bitergia * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Authors: * Alvaro del Castillo San Felix * * Underscore.js 1.1.7 (c) 2011 Jeremy Ashkenas, DocumentCloud Inc. MIT license * bean.js - copyright Jacob Thornton 2011, MIT license * Flotr2 (c) 2012 Carl Sutherland, MIT license * Bonzo: DOM Utility (c) Dustin Diaz 2011, MIT license * Envision.js (c) 2012 Carl Sutherland, Humble Software, MIT license * gridster.js Copyright (c) 2012 ducksboard; Licensed MIT * d3.js: Copyright (c) 2012, Michael Bostocks * */function resizedw(){Report.convertGlobal(),Report.convertStudiesGlobal(),Report.convertStudies(),Convert.activateHelp()}function DataSource(e,t){function n(e,t){if(e instanceof Array)return e;var n={};return $.each(e,function(e,r){var i=e,s=e.split("_");isNaN(s[s.length-1])===!1&&(i=s.slice(0,s.length-1).join("_"));var o=t.getName()+"_"+i,u=t.getName()+"_"+e;t.getMetrics()[o]===undefined?n[e]=r:n[u]=r}),n}this.top_data_file=this.data_dir+"/"+this.name+"-top.json",this.getTopDataFile=function(){return this.top_data_file},this.getMetrics=function(){return this.basic_metrics},this.setMetrics=function(e){this.basic_metrics=e},this.setMetricsDefinition=function(e){if(e===undefined)return;this.setMetrics(e)},this.data_file=this.data_dir+"/"+this.name+"-evolutionary.json",this.getDataFile=function(){return this.data_file},this.setDataFile=function(e){this.data_file=e},this.data=null,this.getData=function(){return this.data},this.setData=function(e,t){t===undefined&&(t=this),t.data=n(e,t)},this.demographics_aging_file=this.data_dir+"/"+this.name+"-demographics-aging.json",this.demographics_birth_file=this.data_dir+"/"+this.name+"-demographics-birth.json",this.getDemographicsAgingFile=function(){return this.demographics_aging_file},this.getDemographicsBirthFile=function(){return this.demographics_birth_file},this.demographics_data={},this.getDemographicsData=function(){return this.demographics_data},this.setDemographicsAgingData=function(e,t){t===undefined&&(t=this),t.demographics_data.aging=e},this.setDemographicsBirthData=function(e,t){t===undefined&&(t=this),t.demographics_data.birth=e},this.data_dir="data/json",this.getDataDir=function(){return this.data_dir},this.setDataDir=function(e){this.data_dir=e,this.data_file=e+"/"+this.name+"-evolutionary.json",this.demographics_aging_file=e+"/"+this.name+"-demographics-aging.json",this.demographics_birth_file=e+"/"+this.name+"-demographics-birth.json",this.global_data_file=e+"/"+this.name+"-static.json",this.top_data_file=e+"/"+this.name+"-top.json",this.companies_data_file=e+"/"+this.name+"-companies.json",this.repos_data_file=e+"/"+this.name+"-repos.json",this.countries_data_file=e+"/"+this.name+"-countries.json",this.domains_data_file=e+"/"+this.name+"-domains.json",this.projects_data_file=e+"/"+this.name+"-projects.json",this.time_to_fix_data_file=e+"/"+this.name+"-quantiles-month-time_to_fix_hour.json"},this.global_data_file=this.data_dir+"/"+this.name+"-static.json",this.getGlobalDataFile=function(){return this.global_data_file},this.global_data=null,this.getGlobalData=function(){return this.global_data},this.setGlobalData=function(e,t){t===undefined&&(t=this),t.global_data=n(e,t)},this.global_top_data=null,this.getGlobalTopData=function(){return this.global_top_data},this.setGlobalTopData=function(e,t){t===undefined&&(t=this),t.global_top_data=e},this.name=e,this.getName=function(){return this.name},this.people_data_file=this.data_dir+"/"+this.name+"-people.json",this.getPeopleDataFile=function(){return this.people_data_file},this.people=null,this.getPeopleData=function(){return this.people},this.setPeopleData=function(e,t){t===undefined&&(t=this),t.people=e},this.time_to_fix_data_file=this.data_dir+"/"+this.name+"-quantiles-month-time_to_fix_hour.json",this.getTimeToFixDataFile=function(){return this.time_to_fix_data_file},this.time_to_fix_data=null,this.getTimeToFixData=function(){return this.time_to_fix_data},this.setTimeToFixData=function(e,t){t===undefined&&(t=this),t.time_to_fix_data=e},this.time_to_attention_data_file=this.data_dir+"/"+this.name+"-quantiles-month-time_to_attention_hour.json",this.getTimeToAttentionDataFile=function(){return this.time_to_attention_data_file},this.time_to_attention_data=null,this.getTimeToAttentionData=function(){return this.time_to_attention_data},this.setTimeToAttentionData=function(e,t){t===undefined&&(t=this),t.time_to_attention_data=e},this.project=null,this.getProject=function(){return this.project},this.setProject=function(e){this.project=e},this.markov_table_data_file=this.data_dir+"/"+this.name+"-markov.json",this.getMarkovTableDataFile=function(){return this.markov_table_data_file},this.markov_table_data=null,this.getMarkovTableData=function(){return this.markov_table_data},this.setMarkovTableData=function(e,t){t===undefined&&(t=this),t.markov_table_data=e},this.companies_data_file=this.data_dir+"/"+this.name+"-companies.json",this.getCompaniesDataFile=function(){return this.companies_data_file},this.companies=null,this.getCompaniesDataFull=function(){return this.companies},this.getCompaniesData=function(){var e=this.companies;return e instanceof Array==0&&this.companies!==null&&(e=this.companies.name),e},this.setCompaniesData=function(e,t){e===null&&(e=[]),t===undefined&&(t=this),t.companies=e},this.companies_metrics_data={},this.addCompanyMetricsData=function(e,t,r){r===undefined&&(r=this),r.companies_metrics_data[e]=n(t,r)},this.getCompaniesMetricsData=function(){return this.companies_metrics_data},this.companies_global_data={},this.addCompanyGlobalData=function(e,t,r){r===undefined&&(r=this),r.companies_global_data[e]=n(t,r)},this.getCompaniesGlobalData=function(){return this.companies_global_data},this.companies_top_data={},this.addCompanyTopData=function(e,t,n){n===undefined&&(n=this),n.companies_top_data[e]===undefined&&(n.companies_top_data[e]={}),n.companies_top_data[e]=t},this.getCompaniesTopData=function(){return this.companies_top_data},this.setCompaniesTopData=function(e,t){t===undefined&&(t=this),t.companies_top_data=e},this.repos_data_file=this.data_dir+"/"+this.name+"-repos.json",this.getReposDataFile=function(){return this.repos_data_file},this.repos=null,this.getReposDataFull=function(){return this.repos},this.getReposData=function(){var e=this.repos;return e instanceof Array==0&&this.repos!==null&&(e=this.repos.name),e},this.setReposData=function(e,t){t===undefined&&(t=this),t.repos=e;if(t.getName()!=="its")return;repos_names=[],e instanceof Array==1&&(t.repos={},t.repos.name=e);var n=[];for(var r=0;r=0)if(o.getName()==="mls"){var n=MLS.displayMLSListName(t);i[n]=o.getReposMetricsData()[t]}else i[t]=o.getReposMetricsData()[t]})}else i=this.getData();r&&(i=DataProcess.convert(i,r,e)),Viz.displayMetricsEvol(this,e,i,t,n,s)},this.isPageDisplayed=function(e,t,n,r){var i=Math.floor((r-3)/2),s=e-i,o=e+i;return t===1||t===n||t==e?!0:t>=s&&te?!0:!1},this.displayItemsNav=function(e,t,n,r){var i=parseInt(n,null);isNaN(i)&&(i=1);var s=null,o="",u=0,a=5;if(t==="companies")s=this.getCompaniesData(),o="List of companies";else if(t==="repos")s=this.getReposData(),r&&(s=DataProcess.sortGlobal(this,r,t));else if(t==="countries")s=this.getCountriesData();else if(t==="domains")s=this.getDomainsData();else{if(t!=="projects")return;s=this.getProjectsData()}u=s.length;var f="",l=Report.getPageSize();if(i){f+=""}Report.getPageSize()>10&&$.each(s,function(e,t){var n=Report.cleanLabel(t);f+=""+n+" "}),$("#"+e).append(f)},this.displayCompaniesLinks=function(e,t,n){var r=DataProcess.sortGlobal(this,n,"companies"),i="",s=0;$.each(r,function(e,n){i+='| ";if(s++>=t-1)return!1}),$("#"+e).append(i)},this.displayCompaniesList=function(e,t,n,r,i,s,o,u,a){this.displaySubReportList("companies",e,t,n,r,i,s,o,u,a)},this.displayReposList=function(e,t,n,r,i,s,o,u,a){this.displaySubReportList("repos",e,t,n,r,i,s,o,u,a)},this.displayCountriesList=function(e,t,n,r,i,s,o,u,a){this.displaySubReportList("countries",e,t,n,r,i,s,o,u,a)},this.displayDomainsList=function(e,t,n,r,i,s,o,u,a){this.displaySubReportList("domains",e,t,n,r,i,s,o,u,a)},this.displayProjectsList=function(e,t,n,r,i,s,o,u,a){this.displaySubReportList("projects",e,t,n,r,i,s,o,u,a)},this.displaySubReportList=function(e,t,n,r,i,s,o,u,a,f){var l=parseInt(s,null);isNaN(l)&&(l=1);var c="",h=(l-1)*Report.getPageSize()+1,p=this,d=null,v=null;o===undefined&&(o=!0);if(e==="companies")d=this.getCompaniesMetricsData(),v=DataProcess.sortGlobal(this,i,e);else if(e==="repos")d=this.getReposMetricsData(),v=DataProcess.sortGlobal(this,i,e);else if(e==="countries")d=this.getCountriesMetricsData(),v=DataProcess.sortGlobal(this,i,e);else if(e==="domains")d=this.getDomainsMetricsData(),v=DataProcess.sortGlobal(this,i,e);else{if(e!=="projects")return;d=this.getProjectsMetricsData(),v=DataProcess.sortGlobal(this,i,e)}v=DataProcess.paginate(v,l),c+='',c+="",$.each(t,function(e,t){p.getMetrics()[t]?(title=p.getMetrics()[t].name,c+=""):c+=""}),c+="",$.each(v,function(n,r){c+="",$.each(t,function(t,n){c+="":""),u=!0);var k=n[p],L=s.labelBoxWidth,A=s.labelBoxHeight;d=s.labelFormatter(k.label),v="background-color:"+(k.bars&&k.bars.show&&k.bars.fillColor&&k.bars.fill?k.bars.fillColor:k.color)+";",o.push('",'")}u&&o.push("");if(o.length>0){var O='
"+title+""+t+"
",c+="#"+h+" ",h++;var i=null;Report.addDataDir()&&(i=Report.addDataDir());if(o){var s="";Utils.isReleasePage()&&(s="&release="+$.urlParam("release")),e==="companies"?(c+=""):e==="repos"?(c+=""):e==="countries"?(c+=""):e==="domains"?(c+=""):e==="projects"&&(c+="")}c+="",c+=Report.cleanLabel(r),c+="",o&&(c+=""),c+="",c+="
",r.companies_2006&&(n+="Companies in 2006: "+r.companies_2006+"
"),r.companies_2009&&(n+="Companies in 2009: "+r.companies_2009+"
"),r.companies_2012&&(n+="Companies in 2012: "+r.companies_2012+"
"),$("#"+e).append(n)},this.getSummaryLabels=function(){},this.getLabelForRepository=function(){return"repository"},this.getLabelForRepositories=function(){return"repositories"},this.displaySummary=function(e,t,n,r){n||(n="");var i="
"+r.getTitle()+"
",s=this.getSummaryLabels(),o=null;e==="companies"?o=r.getCompaniesGlobalData()[n]:e==="countries"?o=r.getCountriesGlobalData()[n]:e==="repositories"?o=r.getReposGlobalData()[n]:e==="domains"?o=r.getDomainsGlobalData()[n]:e==="projects"?o=r.getProjectsGlobalData()[n]:o=r.getGlobalData();if(!o)return;i=HTMLComposer.repositorySummaryTable(r,o,s),$("#"+t).append(i)},this.displayReposSummary=function(e,t){var n="",r=t.getGlobalData();n+="Total repositories: "+r[t.getName()+"_repositories"]+"
",$("#"+e).append(n)},this.displayCountriesSummary=function(e,t){var n="",r=t.getGlobalData();n+="Total countries: "+r[t.getName()+"_countries"]+"
",$("#"+e).append(n)},this.displayDomainsSummary=function(e,t){var n="",r=t.getGlobalData();n+="Total domains: "+r.domains+"
",$("#"+e).append(n)},this.displayProjectsSummary=function(e,t){var n="",r=t.getGlobalData();n+="Total projects: "+r.projects+"
",$("#"+e).append(n)},this.displayDemographics=function(e,t){var n=this.getDemographicsData();Viz.displayDemographicsChart(e,this,n,t)},this.displayTimeToAttention=function(e,t,n,r){n=!0,r="Time to Attention "+t;var i=this.getTimeToAttentionData();if(i instanceof Array)return;Viz.displayTimeToAttention(e,i,t,n,r)},this.displayTimeToFix=function(e,t,n,r){n=!0,r="Time to Fix "+t;var i=this.getTimeToFixData();if(i instanceof Array)return;Viz.displayTimeToFix(e,this.getTimeToFixData(),t,n,r)},this.displayMarkovTable=function(e,t){var n=this.getMarkovTableData();if(n===undefined){Report.log("No Markov data available");return}Viz.displayMarkovTable(e,n,t)},this.displayTop=function(e,t,n,r,i,s,o,u,a,f){t===undefined&&(t=!0);var l=null;Viz.displayTop(e,this,t,n,r,i,null,null,o,u,a,f)},this.displayTopCompany=function(e,t,n,r,i){var s=this.getCompaniesTopData()[e];if(s===undefined)return;var o=this.getMetrics()[n];Viz.displayTopCompany(e,s,t,o,r,i)},this.displayTopGlobal=function(e,t,n,r){Viz.displayTopGlobal(e,this,t,n,r)},this.envisionEvo=function(e,t,n,r,i){config=Report.getVizConfig();var s=Viz.getEnvisionOptions(e,t,this.getName(),Report.getVizConfig()[this.getName()+"_hide"],i);s.legend_show=r,n&&DataProcess.addRelativeValues(s.data,this.getMainMetric()),new envision.templates.Envision_Report(s,[this])},this.displayEnvision=function(e,t,n,r){var i=Report.getProjectsDataSources();this.envisionEvo(e,i,t,n,r)}}function IRC(){var e=this;this.basic_metrics={irc_sent:{divid:"irc_sent",column:"sent",name:"Sent",desc:"Messages sent"},irc_senders:{divid:"irc_senders",column:"senders",name:"Senders",desc:"Messages senders",action:"sent"},irc_repositories:{divid:"irc_repositories",column:"repositories",name:"Repositories",desc:"Number of active repositories"}},this.getMainMetric=function(){return"irc_sent"},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End"};return e},this.getLabelForRepository=function(){return"channel"},this.getLabelForRepositories=function(){return"channels"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .irc_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().irc_url,this.global_data.type&&$(t+" #irc_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #irc_url").attr("href",r),$(t+" #irc_name").text("IRC "+this.global_data.type)):($(t+" #irc_url").attr("href",Report.getProjectData().irc_url),$(t+" #irc_name").text(Report.getProjectData().irc_name),$(t+" #irc_type").text(Report.getProjectData().irc_type));var i=this.getGlobalData();$(t+" #ircFirst").text(i.first_date),$(t+" #ircLast").text(i.last_date),$(t+" #ircSent").text(i.irc_sent),$(t+" #ircRepositories").text(i.irc_repositories),i.repositories===1&&$(t+" #ircRepositories").hide()},this.displayBubbles=function(e,t){},this.getTitle=function(){return"IRC Messages"}}function ITS(){this.basic_metrics={its_opened:{divid:"its_opened",column:"opened",name:"Opened",desc:"Number of opened tickets",envision:{y_labels:!0,show_markers:!0}},its_openers:{divid:"its_openers",column:"openers",name:"Openers",desc:"Unique identities opening tickets",action:"opened",envision:{gtype:"whiskers"}},its_closed:{divid:"its_closed",column:"closed",name:"Closed",desc:"Number of closed tickets"},its_closers:{divid:"its_closers",column:"closers",name:"Closers",desc:"Number of identities closing tickets",action:"closed",envision:{gtype:"whiskers"}},its_changed:{divid:"its_changed",column:"changed",name:"Changed",desc:"Number of changes to the state of tickets"},its_changers:{divid:"its_changers",column:"changers",name:"Changers",desc:"Number of identities changing the state of tickets",action:"changed",envision:{gtype:"whiskers"}},its_companies:{divid:"its_companies",column:"companies",name:"Companies",desc:"Number of active companies"},its_countries:{divid:"its_countries",column:"countries",name:"Countries",desc:"Number of active countries"},its_repositories:{divid:"its_repositories",column:"repositories",name:"Respositories",desc:"Number of active respositories"},its_domains:{divid:"its_domains",column:"domains",name:"Domains",desc:"Number of active domains"}},this.getMainMetric=function(){return"its_opened"},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End",tickets:"Tickets",trackers:"Trackers"};return e},this.getLabelForRepository=function(){return"tracker"},this.getLabelForRepositories=function(){return"trackers"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .its-info").hide();return}$(t+" #its_type").text(this.global_data.type);var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().its_url,r===undefined&&(r=""),this.global_data.type==="allura"?r=r.replace("rest/",""):this.global_data.type==="github"&&(r=r.replace("api.",""),r=r.replace("repos/","")),$(t+" #its_url").attr("href",r);var i=this.global_data.type.charAt(0).toUpperCase()+this.global_data.type.slice(1);$(t+" #its_name").text(i+" Tickets");var s=this.getGlobalData();$(t+" #itsFirst").text(s.first_date),$(t+" #itsLast").text(s.last_date),$(t+" #itsTickets").text(s.its_opened),$(t+" #itsOpeners").text(s.its_openers),$(t+" #itsRepositories").text(s.its_repositories),s.repositories===1&&$(t+" #itsRepositories").hide()},this.getTitle=function(){return"Tickets"},this.displayBubbles=function(e,t){Viz.displayBubbles(e,"its_opened","its_openers",t)}}function MediaWiki(){var e=this;this.basic_metrics={mediawiki_reviews:{divid:"mediawiki_reviews",column:"reviews",name:"Editions",desc:"Wiki page editions"},mediawiki_authors:{divid:"mediawiki_authors",column:"authors",name:"Editors",desc:"Editors doing editions",action:"reviews"},mediawiki_pages:{divid:"mediawiki_pages",column:"pages",name:"Pages",desc:"Wiki pages"}},this.getMainMetric=function(){return"mediawiki_reviews"},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End"};return e},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .mediawiki_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().mediawiki_url,this.global_data.type&&$(t+" #mediawiki_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #mediawiki_url").attr("href",r),$(t+" #mediawiki_name").text("MediaWiki "+this.global_data.type)):($(t+" #mediawiki_url").attr("href",Report.getProjectData().mediawiki_url),$(t+" #mediawiki_name").text(Report.getProjectData().mediawiki_name),$(t+" #mediawiki_type").text(Report.getProjectData().mediawiki_type));var i=this.getGlobalData();$(t+" #mediawikiFirst").text(i.first_date),$(t+" #mediawikiLast").text(i.last_date),$(t+" #mediawikiSent").text(i.mediawiki_reviews)},this.displayBubbles=function(e,t){},this.getTitle=function(){return"MediaWiki Reviews"}}function MLS(){function t(){var e=document.getElementById("form_mls_selector"),t=[];for(var n=0;n-1)continue;var a="
";a+="

"+o.name+" "+MLS.displayMLSListName(t)+"

",a+="
",i.show_desc&&(a+="

"+o.desc+"

"),a+="
",$("#"+e).append(a),Viz.displayBasicLinesFile(o.divid+"_"+t,n,o.column,i.show_labels,u)}}function r(){var e=Report.getProjectData();return e.date+"_"+e.project_name}function i(){return r()+"_mls_lists"}function s(){localStorage&&localStorage.length&&localStorage.getItem(i())&&localStorage.removeItem(i())}function o(e){return typeof e.id=="number"&&$.each(e,function(e,t){t=[t]}),e}var e=this;this.basic_metrics={mls_responses:{divid:"mls_responses",column:"responses",name:"Responses",desc:"Number of messages that are responses"},mls_sent:{divid:"mls_sent",column:"sent",name:"Sent",desc:"Number of messages"},mls_senders:{divid:"mls_senders",column:"senders",name:"Senders",desc:"Number of unique message senders",action:"sent"},mls_threads:{divid:"mls_threads",column:"threads",name:"Threads",desc:"Number of messages threads"},mls_companies:{divid:"mls_companies",column:"companies",name:"Companies",desc:"Number of active companies"},mls_countries:{divid:"mls_countries",column:"countries",name:"Countries",desc:"Number of active countries"},mls_repositories:{divid:"mls_repositories",column:"repositories",name:"Respositories",desc:"Number of active respositories"},mls_domains:{divid:"mls_domains",column:"domains",name:"Domains",desc:"Number of active domains"}},this.data_lists_file=this.data_dir+"/mls-lists.json",this.getListsFile=function(){return this.data_lists_file},this.data_lists=null,this.getListsData=function(){return this.data_lists},this.setListsData=function(e,t){t===undefined&&(t=this),t.data_lists=e},this.setDataDir=function(e){this.data_dir=e,this.data_lists_file=this.data_dir+"/mls-lists.json",MLS.prototype.setDataDir.call(this,e)},this.getMainMetric=function(){return"mls_sent"},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End"};return e},this.getLabelForRepository=function(){return"mailing list"},this.getLabelForRepositories=function(){return"mailing lists"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;(!n||n.length===0)&&$(t+" .mls_info").hide();var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().mls_url,this.global_data.type&&$(t+" #mls_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #mls_url").attr("href",r),$(t+" #mls_name").text("MLS "+this.global_data.type)):($(t+" #mls_url").attr("href",Report.getProjectData().mls_url),$(t+" #mls_name").text(Report.getProjectData().mls_name),$(t+" #mls_type").text(Report.getProjectData().mls_type));var i=this.getGlobalData();$(t+" #mlsFirst").text(i.first_date),$(t+" #mlsLast").text(i.last_date),$(t+" #mlsMessages").text(i.mls_sent),$(t+" #mlsSenders").text(i.mls_senders),$(t+" #mlsRepositories").text(i.mls_repositories),i.repositories===1&&$(t+" #mlsRepositories").hide()},this.displayBubbles=function(e,t){Viz.displayBubbles(e,"mls_sent","mls_senders",t)},MLS.displayMLSListName=function(e){var t=e.split("_"),n="";return t.length>1?(n=t[t.length-1],n===""&&(n=t[t.length-2])):(n=e.replace("<",""),n=n.replace(">",""),t=n.split("."),n=t[0]),n},this.displayBasicUserAll=function(e,t){var n=document.getElementById("form_mls_selector");for(var r=0;r-1)continue;file_messages=this.getDataDir()+"/mls-",file_messages+=u,file_messages+="-evolutionary.json" ,n(e,u,file_messages,t)}},this.getTitle=function(){return"Mailing Lists"},this.displayEvoListsMain=function(e){if(localStorage&&localStorage.length&&localStorage.getItem(i()))return lists=JSON.parse(localStorage.getItem(i())),this.displayEvoLists(e,lists);history=this.getListsData(),lists=history.mailing_list;if(lists===undefined)return;var t=Report.getConfig();lists_hide=t.mls_hide_lists,typeof lists=="string"&&(lists=[lists]);var n=[];for(var r=0;r-1?t.elements[n].checked=!0:t.elements[n].checked=!1}},this.displayBasicDefault=function(t){var n=e;this instanceof MLS&&(n=this),s(),n.displaySelectorCheckDefault(),$("#"+t).empty(),n.displayBasic(t)},this.displayEvoDefault=function(t){var n=e;this instanceof MLS&&(n=this),s(),document.getElementById("form_mls_selector")&&n.displaySelectorCheckDefault(),$("#"+t).empty(),n.displayEvoLists(t,n.getDefaultLists())},this.displayEvoUserAll=function(e,t){var n=document.getElementById("form_mls_selector");for(var r=0;r-1&&(u+="checked "),u+=">",u+=MLS.displayMLSListName(f),u+="
"}u+='1&&($("#"+e).append("Not supported in multiproject"),$("#"+e+" :input").attr("disabled",!0))},this.displayEvoLists=function(e,t){for(var n=0;n1?(n=t[t.length-1],n===""&&(n=t[t.length-2])):(n=e.replace("<",""),n=n.replace(">",""),t=n.split("."),n=t[0]),n},this.getTitle=function(){return"Source Code Review"}}function People(){this.basic_metrics={people_members:{column:"members",name:"Members",desc:"Community Members"}},this.getMainMetric=function(){return"people_members"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .mediawiki_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().mediawiki_url,this.global_data.type&&$(t+" #mediawiki_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #mediawiki_url").attr("href",r),$(t+" #mediawiki_name").text("MediaWiki "+this.global_data.type)):($(t+" #mediawiki_url").attr("href",Report.getProjectData().mediawiki_url),$(t+" #mediawiki_name").text(Report.getProjectData().mediawiki_name),$(t+" #mediawiki_type").text(Report.getProjectData().mediawiki_type));var i=this.getGlobalData();$(t+" #mediawikiFirst").text(i.first_date),$(t+" #mediawikiLast").text(i.last_date),$(t+" #mediawikiSent").text(i.mediawiki_reviews)},this.displayBubbles=function(e,t){},this.getTitle=function(){return"Community Members"}}function Downloads(){var e=this;this.basic_metrics={downloads_downloads:{name:"Total downloads",column:"downloads"},downloads_packages:{divid:"",column:"packages",name:"Packages downloaded",desc:"",action:"downloads"},downloads_ips:{divid:"",column:"ips",name:"IP addresses",desc:"",action:"downloads"}},this.getMainMetric=function(){return"downloads_downloads"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .irc_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().irc_url,this.global_data.type&&$(t+" #irc_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #irc_url").attr("href",r),$(t+" #irc_name").text("IRC "+this.global_data.type)):($(t+" #irc_url").attr("href",Report.getProjectData().irc_url),$(t+" #irc_name").text(Report.getProjectData().irc_name),$(t+" #irc_type").text(Report.getProjectData().irc_type));var i=this.getGlobalData();$(t+" #ircFirst").text(i.first_date),$(t+" #ircLast").text(i.last_date),$(t+" #ircSent").text(i.irc_sent),$(t+" #ircRepositories").text(i.irc_repositories),i.repositories===1&&$(t+" #ircRepositories").hide()},this.displayBubbles=function(e,t){},this.getTitle=function(){return"Downloads"}}function QAForums(){var e=this;this.basic_metrics={qaforums_sent:{name:"Messages posted",desc:"Number of messages posted to Q&A forums(s)",column:"sent"},qaforums_qsent:{name:"Questions posted",desc:"Number of questions posted to Q&A forums(s)",column:"qsent"},qaforums_asent:{name:"Answers posted",desc:"Number of answers posted to Q&A forums(s)",column:"asent"},qaforums_senders:{name:"Persons posting messages",desc:"Number of persons posting messages to Q&A forums(s)",column:"senders"},qaforums_asenders:{name:"Persons posting answers",desc:"Number of persons answering in Q&A forums(s)",column:"asenders"},qaforums_qsenders:{divid:"qaforums_qsenders",name:"Persons posting questions",desc:"Number of persons asking questions in Q&A forums(s)",column:"qsenders"},qaforums_participants:{name:"Participants",desc:"Number of persons posting messages",column:"participants"}},this.getMainMetric=function(){return"qaforums_qsent"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .irc_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().irc_url,this.global_data.type&&$(t+" #irc_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #irc_url").attr("href",r),$(t+" #irc_name").text("IRC "+this.global_data.type)):($(t+" #irc_url").attr("href",Report.getProjectData().irc_url),$(t+" #irc_name").text(Report.getProjectData().irc_name),$(t+" #irc_type").text(Report.getProjectData().irc_type));var i=this.getGlobalData();$(t+" #ircFirst").text(i.first_date),$(t+" #ircLast").text(i.last_date),$(t+" #ircSent").text(i.irc_sent),$(t+" #ircRepositories").text(i.irc_repositories),i.repositories===1&&$(t+" #ircRepositories").hide()},this.displayBubbles=function(e,t){},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End",sent:"Messages posted",qsent:"Questions posted",asent:"Answers posted",senders:"Persons posting messages",asenders:"Persons posting answers",qsenders:"Persons posting questions"};return e},this.getTitle=function(){return"QAForums"}}function Releases(){var e=this;this.basic_metrics={releases_modules:{name:"Modules created",desc:"Number of modules created on the forge",column:"modules"}},this.getMainMetric=function(){return"releases_modules"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .irc_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().irc_url,this.global_data.type&&$(t+" #irc_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #irc_url").attr("href",r),$(t+" #irc_name").text("IRC "+this.global_data.type)):($(t+" #irc_url").attr("href",Report.getProjectData().irc_url),$(t+" #irc_name").text(Report.getProjectData().irc_name),$(t+" #irc_type").text(Report.getProjectData().irc_type));var i=this.getGlobalData();$(t+" #ircFirst").text(i.first_date),$(t+" #ircLast").text(i.last_date),$(t+" #ircSent").text(i.irc_sent),$(t+" #ircRepositories").text(i.irc_repositories),i.repositories===1&&$(t+" #ircRepositories").hide()},this.displayBubbles=function(e,t){},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End",modules:"Modules created",releases:"Module releases created",authors:"Persons creating/updating modules"};return e},this.getTitle=function(){return"Releases"}}(function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.slice,u=r.unshift,a=i.toString,f=i.hasOwnProperty,l=r.forEach,c=r.map,h=r.reduce,p=r.reduceRight,d=r.filter,v=r.every,m=r.some,g=r.indexOf,y=r.lastIndexOf,b=Array.isArray,w=Object.keys,E=s.bind,S=function(e){return new k(e)};typeof module!="undefined"&&module.exports?(module.exports=S,S._=S):e._=S,S.VERSION="1.1.7";var x=S.each=S.forEach=function(e,t,r){if(e==null)return;if(l&&e.forEach===l)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i=r.computed&&(r={value:e,computed:o})}),r.value},S.min=function(e,t,n){if(!t&&S.isArray(e))return Math.min.apply(Math,e);var r={computed:Infinity};return x(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;or?1:0}),"value")},S.groupBy=function(e,t){var n={};return x(e,function(e,r){var i=t(e,r);(n[i]||(n[i]=[])).push(e)}),n},S.sortedIndex=function(e,t,n){n||(n=S.identity);var r=0,i=e.length;while(r>1;n(e[s])=0})})},S.difference=function(e,t){return S.filter(e,function(e){return!S.include(t,e)})},S.zip=function(){var e=o.call(arguments),t=S.max(S.pluck(e,"length")),n=new Array(t);for(var r=0;r=0;n--)t=[e[n].apply(this,t)];return t[0]}},S.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},S.keys=w||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)f.call(e,n)&&(t[t.length]=n);return t},S.values=function(e){return S.map(e,S.identity)},S.functions=S.methods=function(e){var t=[];for(var n in e)S.isFunction(e[n])&&t.push(n);return t.sort()},S.extend=function(e){return x(o.call(arguments,1),function(t){for(var n in t)t[n]!==void 0&&(e[n]=t[n])}),e},S.defaults=function(e){return x(o.call(arguments,1),function(t){for(var n in t)e[n]==null&&(e[n]=t[n])}),e},S.clone=function(e){return S.isArray(e)?e.slice():S.extend({},e)},S.tap=function(e,t){return t(e),e},S.isEqual=function(e,t){if(e===t)return!0;var n=typeof e,r=typeof t;if(n!=r)return!1;if(e==t)return!0;if(!e&&t||e&&!t)return!1;e._chain&&(e=e._wrapped),t._chain&&(t=t._wrapped);if(e.isEqual)return e.isEqual(t);if(t.isEqual)return t.isEqual(e);if(S.isDate(e)&&S.isDate(t))return e.getTime()===t.getTime();if(S.isNaN(e)&&S.isNaN(t))return!1;if(S.isRegExp(e)&&S.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline;if(n!=="object")return!1;if(e.length&&e.length!==t.length)return!1;var i=S.keys(e),s=S.keys(t);if(i.length!=s.length)return!1;for(var o in e)if(!(o in t)||!S.isEqual(e[o],t[o]))return!1;return!0},S.isEmpty=function(e){if(S.isArray(e)||S.isString(e))return e.length===0;for(var t in e)if(f.call(e,t))return!1;return!0},S.isElement=function(e){return!!e&&e.nodeType==1},S.isArray=b||function(e){return a.call(e)==="[object Array]"},S.isObject=function(e){return e===Object(e)},S.isArguments=function(e){return!!e&&!!f.call(e,"callee")},S.isFunction=function(e){return!!(e&&e.constructor&&e.call&&e.apply)},S.isString=function(e){return!!(e===""||e&&e.charCodeAt&&e.substr)},S.isNumber=function(e){return!!(e===0||e&&e.toExponential&&e.toFixed)},S.isNaN=function(e){return e!==e},S.isBoolean=function(e){return e===!0||e===!1},S.isDate=function(e){return!!(e&&e.getTimezoneOffset&&e.setUTCFullYear)},S.isRegExp=function(e){return!(!(e&&e.test&&e.exec)||!e.ignoreCase&&e.ignoreCase!==!1)},S.isNull=function(e){return e===null},S.isUndefined=function(e){return e===void 0},S.noConflict=function(){return e._=t,this},S.identity=function(e){return e},S.times=function(e,t,n){for(var r=0;r/g,interpolate:/<%=([\s\S]+?)%>/g},S.template=function(e,t){var n=S.templateSettings,r="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(n.interpolate,function(e,t){return"',"+t.replace(/\\'/g,"'")+",'"}).replace(n.evaluate||null,function(e,t){return"');"+t.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",i=new Function("obj",r);return t?i(t):i};var k=function(e){this._wrapped=e};S.prototype=k.prototype;var L=function(e,t){return t?S(e).chain():e},A=function(e,t){k.prototype[e]=function(){var e=o.call(arguments);return u.call(e,this._wrapped),L(t.apply(S,e),this._chain)}};S.mixin(S),x(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];k.prototype[e]=function(){return t.apply(this._wrapped,arguments),L(this._wrapped,this._chain)}}),x(["concat","join","slice"],function(e){var t=r[e];k.prototype[e]=function(){return L(t.apply(this._wrapped,arguments),this._chain)}}),k.prototype.chain=function(){return this._chain=!0,this},k.prototype.value=function(){return this._wrapped}})(),!function(e,t,n){typeof module!="undefined"?module.exports=n(e,t):typeof define=="function"&&typeof define.amd=="object"?define(n):t[e]=n(e,t)}("bean",this,function(e,t){var n=window,r=t[e],i=/over|out/,s=/[^\.]*(?=\..*)\.|.*/,o=/\..*/,u="addEventListener",a="attachEvent",f="removeEventListener",l="detachEvent",c=document||{},h=c.documentElement||{},p=h[u],d=p?u:a,v=Array.prototype.slice,m=/click|mouse|menu|drag|drop/i,g=/^touch|^gesture/i,y={one:1},b=function(e,t,n){for(n=0;n0){t=t.split(" ");for(f=t.length;f--;)_(e,t[f],n);return e}u=c&&t.replace(o,""),u&&w[u]&&(u=w[u].type);if(!t||c){if(a=c&&t.replace(s,""))a=a.split(".");l(e,u,n,a)}else if(typeof t=="function")l(e,null,t);else for(r in t)t.hasOwnProperty(r)&&_(e,r,t[r]);return e},D=function(e,t,n,r,i){var s,o,u,a,f=n,l=n&&typeof n=="string";if(t&&!n&&typeof t=="object")for(s in t)t.hasOwnProperty(s)&&D.apply(this,[e,s,t[s]]);else{a=arguments.length>3?v.call(arguments,3):[],o=(l?n:t).split(" "),l&&(n=M(t,f=r,i))&&(a=v.call(a,1)),this===y&&(n=L(_,e,t,n,f));for(u=o.length;u--;)O(e,o[u],n,f,a)}return e},P=function(){return D.apply(y,arguments)},H=p?function(e,t,r){var i=c.createEvent(e?"HTMLEvents":"UIEvents");i[e?"initEvent":"initUIEvent"](t,!0,!0,n,1),r.dispatchEvent(i)}:function(e,t,n){n=S(n,e),e?n.fireEvent("on"+t,c.createEventObject()):n["_on"+t]++},B=function(e,t,n){var r,i,u,a,f,l=t.split(" ");for(r=l.length;r--;){t=l[r].replace(o,"");if(a=l[r].replace(s,""))a=a.split(".");if(!a&&!n&&e[d])H(b[t],t,e);else{f=T.get(e,t),n=[!1].concat(n);for(i=0,u=f.length;i1)while(s--&&e>=n)e/=n;else{r=i,s=r.length;while(s--&&e<1)e*=n}return Math.round(e*t)/t+r[s]},getMagnitude:function(e){return Math.pow(10,Math.floor(Math.log(e)/Math.LN10))},toPixel:function(e){return Math.floor(e)+.5},toRad:function(e){return-e*(Math.PI/180)},floorInBase:function(e,t){return t*Math.floor(e/t)},drawText:function(e,t,r,i,s){if(!e.fillText){e.drawText(t,r,i,s);return}s=this._.extend({size:n.defaultOptions.fontSize,color:"#000000",textAlign:"left",textBaseline:"bottom",weight:1,angle:0},s),e.save(),e.translate(r,i),e.rotate(s.angle),e.fillStyle=s.color,e.font=(s.weight>1?"bold ":"")+s.size*1.3+"px sans-serif",e.textAlign=s.textAlign,e.textBaseline=s.textBaseline,e.fillText(t,0,0),e.restore()},getBestTextAlign:function(e,t){return t=t||{textAlign:"center",textBaseline:"middle"},e+=n.getTextAngleFromAlign(t),Math.abs(Math.cos(e))>.01&&(t.textAlign=Math.cos(e)>0?"right":"left"),Math.abs(Math.sin(e))>.01&&(t.textBaseline=Math.sin(e)>0?"top":"bottom"),t},alignTable:{"right middle":0,"right top":Math.PI/4,"center top":Math.PI/2,"left top":3*(Math.PI/4),"left middle":Math.PI,"left bottom":-3*(Math.PI/4),"center bottom":-Math.PI/2,"right bottom":-Math.PI/4,"center middle":0},getTextAngleFromAlign:function(e){return n.alignTable[e.textAlign+" "+e.textBaseline]||0},noConflict:function(){return e.Flotr=t,this}},e.Flotr=n}(),Flotr.defaultOptions={colors:["#00A8F0","#C0D800","#CB4B4B","#4DA74D","#9440ED"],ieBackgroundColor:"#FFFFFF",title:null,subtitle:null,shadowSize:4,defaultType:null,HtmlText:!0,fontColor:"#545454",fontSize:7.5,resolution:1,parseFloat:!0,preventDefault:!0,xaxis:{ticks:null,minorTicks:null,showLabels:!0,showMinorLabels:!1,labelsAngle:0,title:null,titleAngle:0,noTicks:5,minorTickFreq:null,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscale:!1,autoscaleMargin:0,color:null,mode:"normal",timeFormat:null,timeMode:"UTC",timeUnit:"millisecond",scaling:"linear",base:Math.E,titleAlign:"center",margin:!0},x2axis:{},yaxis:{ticks:null,minorTicks:null,showLabels:!0,showMinorLabels:!1,labelsAngle:0,title:null,titleAngle:90,noTicks:5,minorTickFreq:null,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscale:!1,autoscaleMargin:0,color:null,scaling:"linear",base:Math.E,titleAlign:"center",margin:!0},y2axis:{titleAngle:270},grid:{color:"#545454",backgroundColor:null,backgroundImage:null,watermarkAlpha:.4,tickColor:"#DDDDDD",labelMargin:3,verticalLines:!0,minorVerticalLines:null,horizontalLines:!0,minorHorizontalLines:null,outlineWidth:1,outline:"nsew",circular:!1},mouse:{track:!1,trackAll:!1,position:"se",relative:!1,trackFormatter:Flotr.defaultTrackFormatter,margin:5,lineColor:"#FF3F19",trackDecimals:1,sensibility:2,trackY:!0,radius:3,fillColor:null,fillOpacity:.4}},function(){function t(e,t,n,r){this.rgba=["r","g","b","a"];var i=4;while(-1<--i)this[this.rgba[i]]=arguments[i]||(i==3?1:0);this.normalize()}var e=Flotr._,n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};t.prototype={scale:function(t,n,r,i){var s=4;while(-1<--s)e.isUndefined(arguments[s])||(this[this.rgba[s]]*=arguments[s]);return this.normalize()},alpha:function(t){return!e.isUndefined(t)&&!e.isNull(t)&&(this.a=t),this.normalize()},clone:function(){return new t(this.r,this.b,this.g,this.a)},limit:function(e,t,n){return Math.max(Math.min(e,n),t)},normalize:function(){var e=this.limit;return this.r=e(parseInt(this.r,10),0,255),this.g=e(parseInt(this.g,10),0,255),this.b=e(parseInt(this.b,10),0,255),this.a=e(this.a,0,1),this},distance:function(e){if(!e)return;e=new t.parse(e);var n=0,r=3;while(-1<--r)n+=Math.abs(this[this.rgba[r]]-e[this.rgba[r]]);return n},toString:function(){return this.a>=1?"rgb("+[this.r,this.g,this.b].join(",")+")":"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"},contrast:function(){var e=1-(.299*this.r+.587*this.g+.114*this.b)/255;return e<.5?"#000000":"#ffffff"}},e.extend(t,{parse:function(e){if(e instanceof t)return e;var r;if(r=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))return new t(parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16));if(r=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))return new t(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10));if(r=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))return new t(parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16));if(r=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return new t(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4]));if(r=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(e))return new t(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55);if(r=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return new t(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55,parseFloat(r[4]));var i=(e+"").replace(/^\s*([\S\s]*?)\s*$/,"$1").toLowerCase();return i=="transparent"?new t(255,255,255,0):(r=n[i])?new t(r[0],r[1],r[2]):new t(0,0,0,0)},processColor:function(n,r){var i=r.opacity;if(!n)return"rgba(0, 0, 0, 0)";if(n instanceof t)return n.alpha(i).toString();if(e.isString(n))return t.parse(n).alpha(i).toString();var s=n.colors?n:{colors:n};if(!r.ctx)return e.isArray(s.colors)?t.parse(e.isArray(s.colors[0])?s.colors[0][1]:s.colors[0]).alpha(i).toString():"rgba(0, 0, 0, 0)";s=e.extend({start:"top",end:"bottom"},s),/top/i.test(s.start)&&(r.x1=0),/left/i.test(s.start)&&(r.y1=0),/bottom/i.test(s.end)&&(r.x2=0),/right/i.test(s.end)&&(r.y2=0);var o,u,a,f=r.ctx.createLinearGradient(r.x1,r.y1,r.x2,r.y2);for(o=0;o=h)break}h=i[v][0],p=i[v][1],p=="year"&&(h=Flotr.getTickSize(s.noTicks*r.year,a,f,0),h==.5&&(p="month",h=6)),e.tickUnit=p,e.tickSize=h;var g=h*r[p];m=new Date(a);switch(p){case"millisecond":y("Milliseconds");break;case"second":y("Seconds");break;case"minute":y("Minutes");break;case"hour":y("Hours");break;case"month":y("Month");break;case"year":y("FullYear")}g>=r.second&&t(m,"Milliseconds",o,0),g>=r.minute&&t(m,"Seconds",o,0),g>=r.hour&&t(m,"Minutes",o,0),g>=r.day&&t(m,"Hours",o,0),g>=r.day*4&&t(m,"Date",o,1),g>=r.year&&t(m,"Month",o,0);var b=0,w=NaN,E;do{E=w,w=m.getTime(),c.push({v:w/u,label:d(w/u,e)});if(p=="month")if(h<1){t(m,"Date",o,1);var S=m.getTime();t(m,"Month",o,n(m,"Month",o)+1);var x=m.getTime();m.setTime(w+b*r.hour+(x-S)*h),b=n(m,"Hours",o),t(m,"Hours",o,0)}else t(m,"Month",o,n(m,"Month",o)+h);else p=="year"?t(m,"FullYear",o,n(m,"FullYear",o)+h):m.setTime(w+g)}while(w0)return{x:t.touches[0].pageX,y:t.touches[0].pageY};if(!e._.isUndefined(t.changedTouches)&&t.changedTouches.length>0)return{x:t.changedTouches[0].pageX,y:t.changedTouches[0].pageY};if(t.pageX||t.pageY)return{x:t.pageX,y:t.pageY};if(t.clientX||t.clientY){var n=document,r=n.body,i=n.documentElement;return{x:t.clientX+r.scrollLeft+i.scrollLeft,y:t.clientY+r.scrollTop+i.scrollTop}}}}}(),function(){function i(e,n,r){return t.observe.apply(this,arguments),this._handles.push(arguments),this}var e=Flotr.DOM,t=Flotr.EventAdapter,n=Flotr._,r=Flotr;Graph=function(e,i,s){this._setEl(e),this._initMembers(),this._initPlugins(),t.fire(this.el,"flotr:beforeinit",[this]),this.data=i,this.series=r.Series.getSeries(i),this._initOptions(s),this._initGraphTypes(),this._initCanvas(),this._text=new r.Text({element:this.el,ctx:this.ctx,html:this.options.HtmlText,textEnabled:this.textEnabled}),t.fire(this.el,"flotr:afterconstruct",[this]),this._initEvents(),this.findDataRanges(),this.calculateSpacing(),this.draw(n.bind(function(){t.fire(this.el,"flotr:afterinit",[this])},this))},Graph.prototype={destroy:function(){t.fire(this.el,"flotr:destroy"),n.each(this._handles,function(e){t.stopObserving.apply(this,e)}),this._handles=[],this.el.graph=null},observe:i,_observe:i,processColor:function(e,t){var i={x1:0,y1:0,x2:this.plotWidth,y2:this.plotHeight,opacity:1,ctx:this.ctx};return n.extend(i,t),r.Color.processColor(e,i)},findDataRanges:function(){var e=this.axes,t,i,s;n.each(this.series,function(e){s=e.getRange(),s&&(t=e.xaxis,i=e.yaxis,t.datamin=Math.min(s.xmin,t.datamin),t.datamax=Math.max(s.xmax,t.datamax),i.datamin=Math.min(s.ymin,i.datamin),i.datamax=Math.max(s.ymax,i.datamax),t.used=t.used||s.xused,i.used=i.used||s.yused)},this),!e.x.used&&!e.x2.used&&(e.x.used=!0),!e.y.used&&!e.y2.used&&(e.y.used=!0),n.each(e,function(e){e.calculateRange()});var o=n.keys(r.graphTypes),u=!1;n.each(this.series,function(e){if(e.hide)return;n.each(o,function(t){e[t]&&e[t].show&&(this.extendRange(t,e),u=!0)},this),u||this.extendRange(this.options.defaultType,e)},this)},extendRange:function(e,t){this[e].extendRange&&this[e].extendRange(t,t.data,t[e],this[e]),this[e].extendYRange&&this[e].extendYRange(t.yaxis,t.data,t[e],this[e]),this[e].extendXRange&&this[e].extendXRange(t.xaxis,t.data,t[e],this[e])},calculateSpacing:function(){var e=this.axes,t=this.options,r=this.series,i=t.grid.labelMargin,s=this._text,o=e.x,u=e.x2,a=e.y,f=e.y2,l=t.grid.outlineWidth,c,h,p,d;n.each(e,function(e){e.calculateTicks(),e.calculateTextDimensions(s,t)}),d=s.dimensions(t.title,{size:t.fontSize*1.5},"font-size:1em;font-weight:bold;","flotr-title"),this.titleHeight=d.height,d=s.dimensions(t.subtitle,{size:t.fontSize},"font-size:smaller;","flotr-subtitle"),this.subtitleHeight=d.height;for(h=0;h1&&(this.multitouches=n.touches),t.fire(e,"flotr:mousedown",[event,this]),this.observe(document,"touchend",r)},this)),this.observe(this.overlay,"touchmove",n.bind(function(n){var r=this.getEventPosition(n);this.options.preventDefault&&n.preventDefault(),i=!0,this.multitouches||n.touches&&n.touches.length>1?this.multitouches=n.touches:s||t.fire(e,"flotr:mousemove",[event,r,this]),this.lastMousePos=r},this))):this.observe(this.overlay,"mousedown",n.bind(this.mouseDownHandler,this)).observe(e,"mousemove",n.bind(this.mouseMoveHandler,this)).observe(this.overlay,"click",n.bind(this.clickHandler,this)).observe(e,"mouseout",function(n){t.fire(e,"flotr:mouseout",n)})},_initCanvas:function(){function l(i,s){return i||(i=e.create("canvas"),typeof FlashCanvas!="undefined"&&typeof i.getContext=="function"&&(FlashCanvas.initElement(i),this.isFlashCanvas=!0),i.className="flotr-"+s,i.style.cssText="position:absolute;left:0px;top:0px;",e.insert(t,i)),n.each(a,function(t,n){e.show(i);if(s=="canvas"&&i.getAttribute(n)===t)return;i.setAttribute(n,t*r.resolution),i.style[n]=t+"px"}),i.context_=null,i}function c(e){window.G_vmlCanvasManager&&window.G_vmlCanvasManager.initElement(e);var t=e.getContext("2d");return window.G_vmlCanvasManager||t.scale(r.resolution,r.resolution),t}var t=this.el,r=this.options,i=t.children,s=[],o,u,a,f;for(u=i.length;u--;)o=i[u],!this.canvas&&o.className==="flotr-canvas"?this.canvas=o:!this.overlay&&o.className==="flotr-overlay"?this.overlay=o:s.push(o);for(u=s.length;u--;)t.removeChild(s[u]);e.setStyles(t,{position:"relative"}),a={},a.width=t.clientWidth,a.height=t.clientHeight;if(a.width<=0||a.height<=0||r.resolution<=0)throw"Invalid dimensions for plot, width = "+a.width+", height = "+a.height+", resolution = "+r.resolution;this.canvas=l(this.canvas,"canvas"),this.overlay=l(this.overlay,"overlay"),this.ctx=c(this.canvas),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.octx=c(this.overlay),this.octx.clearRect(0,0,this.overlay.width,this.overlay.height),this.canvasHeight=a.height,this.canvasWidth=a.width,this.textEnabled=!!this.ctx.drawText||!!this.ctx.fillText},_initPlugins:function(){n.each(r.plugins,function(e,t){n.each(e.callbacks,function(e,t){this.observe(this.el,t,n.bind(e,this))},this),this[t]=r.clone(e),n.each(this[t],function(e,r){n.isFunction(e)&&(this[t][r]=n.bind(e,this))},this)},this)},_initOptions:function(e){var i=r.clone(r.defaultOptions);i.x2axis=n.extend(n.clone(i.xaxis),i.x2axis),i.y2axis=n.extend(n.clone(i.yaxis),i.y2axis),this.options=r.merge(e||{},i),this.options.grid.minorVerticalLines===null&&this.options.xaxis.scaling==="logarithmic"&&(this.options.grid.minorVerticalLines=!0),this.options.grid.minorHorizontalLines===null&&this.options.yaxis.scaling==="logarithmic"&&(this.options.grid.minorHorizontalLines=!0),t.fire(this.el,"flotr:afterinitoptions",[this]),this.axes=r.Axis.getAxes(this.options);var s=[],o=[],u=this.series.length,a=this.series.length,f=this.options.colors,l=[],c=0,h,p,d,v;for(p=a-1;p>-1;--p)h=this.series[p].color,h&&(--a,n.isNumber(h)?s.push(h):l.push(r.Color.parse(h)));for(p=s.length-1;p>-1;--p)a=Math.max(a,s[p]+1);for(p=0;o.length=f.length&&(p=0,++c)}for(p=0,d=0;p10?t.minorTickFreq=0:o-u>5?t.minorTickFreq=2:t.minorTickFreq=5)}else e.tickSize=Flotr.getTickSize(t.noTicks,n,r,t.tickDecimals);e.min=n,e.max=r,t.min===null&&t.autoscale&&(e.min-=e.tickSize*i,e.min<0&&e.datamin>=0&&(e.min=0),e.min=e.tickSize*Math.floor(e.min/e.tickSize)),t.max===null&&t.autoscale&&(e.max+=e.tickSize*i,e.max>0&&e.datamax<=0&&e.datamax!=e.datamin&&(e.max=0),e.max=e.tickSize*Math.ceil(e.max/e.tickSize)),e.min==e.max&&(e.max=e.min+1)},calculateTextDimensions:function(e,t){var n="",r,i;if(this.options.showLabels)for(i=0;in.length&&(n=this.ticks[i].label);this.maxLabel=e.dimensions(n,{size:t.fontSize,angle:Flotr.toRad(this.options.labelsAngle)},"font-size:smaller;","flotr-grid-label"),this.titleSize=e.dimensions(this.options.title,{size:t.fontSize*1.2,angle:Flotr.toRad(this.options.titleAngle)},"font-weight:bold;","flotr-axis-title")},_cleanUserTicks:function(t,n){var r=this,i=this.options,s,o,u,a;e.isFunction(t)&&(t=t({min:r.min,max:r.max}));for(o=0;o1?a[1]:i.tickFormatter(s,{min:r.min,max:r.max})):(s=a,u=i.tickFormatter(s,{min:this.min,max:this.max})),n[o]={v:s,label:u}},_calculateTimeTicks:function(){this.ticks=Flotr.Date.generator(this)},_calculateLogTicks:function(){var e=this,t=e.options,n,r,s=Math.log(e.max);t.base!=Math.E&&(s/=Math.log(t.base)),s=Math.ceil(s);var o=Math.log(e.min);t.base!=Math.E&&(o/=Math.log(t.base)),o=Math.ceil(o);for(i=o;ii&&(i=a,o=!0)),f!==null&&(fs&&(s=f,u=!0));return{xmin:n,xmax:i,ymin:r,ymax:s,xused:o,yused:u}}},e.extend(t,{getSeries:function(n){return e.map(n,function(n){var r;return n.data?(r=new t,e.extend(r,n)):r=new t({data:n}),r})}}),Flotr.Series=t}(),function(){var e=Flotr,t=e.DOM,n=e._,r=function(e){this.o=e};r.prototype={dimensions:function(e,t,n,r){return e?this.o.html?this.html(e,this.o.element,n,r):this.canvas(e,t):{width:0,height:0}},canvas:function(t,n){if(!this.o.textEnabled)return;n=n||{};var r=this.measureText(t,n),i=r.width,s=n.size||e.defaultOptions.fontSize,o=n.angle||0,u=Math.cos(o),a=Math.sin(o),f=2,l=6,c;return c={width:Math.abs(u*i)+Math.abs(a*s)+f,height:Math.abs(a*i)+Math.abs(u*s)+l},c},html:function(e,n,r,i){var s=t.create("div");return t.setStyles(s,{position:"absolute",top:"-100000px"}),t.insert(s,'
'+e+"
"),t.insert(this.o.element,s),t.size(s)},measureText:function(t,r){var i=this.o.ctx,s;return!i.fillText||e.isIphone&&i.measure?{width:i.measure(t,r)}:(r=n.extend({size:e.defaultOptions.fontSize,weight:1,angle:0},r),i.save(),i.font=(r.weight>1?"bold ":"")+r.size*1.3+"px sans-serif",s=i.measureText(t),i.restore(),s)}},Flotr.Text=r}(), Flotr.addType("lines",{options:{show:!1,lineWidth:2,fill:!1,fillBorder:!1,fillColor:null,fillOpacity:.4,steps:!1,stacked:!1},stack:{values:[]},draw:function(e){var t=e.context,n=e.lineWidth,r=e.shadowSize,i;t.save(),t.lineJoin="round",r&&!1&&(t.lineWidth=r/2,i=n/2+t.lineWidth/2,t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,i+r/2,!1),t.strokeStyle="rgba(0,0,0,0.2)",this.plot(e,i,!1)),t.lineWidth=n,t.strokeStyle=e.color,this.plot(e,0,!0),t.restore()},plot:function(e,t,n){function T(t){var n=null;for(n=l-1;n>=0;--n){if(!e.fill)return;if(!t[n])return;t[n][1]===null&&(t[n][1]=0),x=o(t[n][0]),y=u(t[n][1]),y<0&&(y=0);if(y>s||x>i||y<0||x<0)return;r.lineTo(x,y),r.stroke()}}function N(e){var t=[],n=a[0][0];for(S=0;S0&&a[S][1]&&(r.stroke(),C(),d=null,r.closePath(),r.beginPath());continue}v=o(a[S][0]),m=o(a[S+1][0]),d===null&&(d=a[S]),f?(w=f.values[S]||0,E=f.values[S+1]||0,g=u(a[S][1]+w),b=u(a[S+1][1]+E)):(g=u(a[S][1]),b=u(a[S+1][1]));if(g>s&&b>s||g<0&&b<0||v<0&&m<0||v>i&&m>i)continue;(c!=v||h!=g+t)&&r.moveTo(v,g+t),c=m,h=b+t,e.steps?(r.lineTo(c+t/2,g+t),r.lineTo(c+t/2,h)):r.lineTo(c,h)}(!e.fill||e.fill&&!e.fillBorder)&&r.stroke(),C();if(f)for(S=0;S0?(u[f]=(u[f]||0)+t[l][1],s=Math.max(s,u[f])):(a[f]=(a[f]||0)+t[l][1],o=Math.min(o,a[f]));r.negativeSums=a,r.positiveSums=u,e.max=s,e.min=o}n.steps&&(this.hit=function(e){var t=e.data,n=e.args,r=e.yScale,i=n[0],s=t.length,o=n[1],u=e.xInverse(i.relX),a=i.relY,f;for(f=0;f=t[f][0]&&u<=t[f+1][0]){Math.abs(r(t[f][1])-a)<8&&(o.x=t[f][0],o.y=t[f][1],o.index=f,o.seriesIndex=e.index);break}},this.drawHit=function(e){var t=e.context,n=e.args,r=e.data,i=e.xScale,s=n.index,o=i(n.x),u=e.yScale(n.y),a;r.length-1>s&&(a=e.xScale(r[s+1][0]),t.save(),t.strokeStyle=e.color,t.lineWidth=e.lineWidth,t.beginPath(),t.moveTo(o,u),t.lineTo(a,u),t.stroke(),t.closePath(),t.restore())},this.clearHit=function(e){var t=e.context,n=e.args,r=e.data,i=e.xScale,s=e.lineWidth,o=n.index,u=i(n.x),a=e.yScale(n.y),f;r.length-1>o&&(f=e.xScale(r[o+1][0]),t.clearRect(u-s,a-s,f-u+2*s,2*s))})}}),Flotr.addType("bars",{options:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,fillOpacity:.4,horizontal:!1,stacked:!1,centered:!0,topPadding:.1,grouped:!1},stack:{positive:[],negative:[],_positive:[],_negative:[]},draw:function(e){var t=e.context;this.current+=1,t.save(),t.lineJoin="miter",t.lineWidth=e.lineWidth,t.strokeStyle=e.color,e.fill&&(t.fillStyle=e.fillStyle),this.plot(e),t.restore()},plot:function(e){var t=e.data,n=e.context,r=e.shadowSize,i,s,o,u,a,f;if(t.length<1)return;this.translate(n,e.horizontal);for(i=0;i0?o.positive:o.negative,p=d[c]||p,d[c]=p+h),v=f(c-a),m=f(c+i-a),g=l(h+p),y=l(p),y<0&&(y=0),e===null||t===null?null:{x:c,y:h,xScale:f,yScale:l,top:g,left:Math.min(v,m)-u/2,width:Math.abs(m-v)-u,height:y-g}},hit:function(e){var t=e.data,n=e.args,r=n[0],i=n[1],s=e.xInverse(r.relX),o=e.yInverse(r.relY),u=this.getBarGeometry(s,o,e),a=u.width/2,f=u.left,l=u.y,c,h;for(h=t.length;h--;)c=this.getBarGeometry(t[h][0],t[h][1],e),(l>0&&lc.y)&&Math.abs(f-c.left)0?(f[c]=(f[c]||0)+h,o=Math.max(o,f[c])):(l[c]=(l[c]||0)+h,s=Math.min(s,l[c]));(a==1&&u||a==-1&&!u)&&n.topPadding&&(e.max===e.datamax||n.stacked&&this.stackMax!==o)&&(o+=n.topPadding*(o-s)),this.stackMin=s,this.stackMax=o,this.negativeSums=l,this.positiveSums=f,e.max=o,e.min=s}}),Flotr.addType("bubbles",{options:{show:!1,lineWidth:2,fill:!0,fillOpacity:.4,baseRadius:2},draw:function(e){var t=e.context,n=e.shadowSize;t.save(),t.lineWidth=e.lineWidth,t.fillStyle="rgba(0,0,0,0.05)",t.strokeStyle="rgba(0,0,0,0.05)",this.plot(e,n/2),t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,n/4),t.strokeStyle=e.color,t.fillStyle=e.fillStyle,this.plot(e),t.restore()},plot:function(e,t){var n=e.data,r=e.context,i,s,o,u,a;t=t||0;for(s=0;s0?(r.positive[e]=o+t,o+t):(r.negative[e]=s+t,s+t)}var t=e.data,n=e.context,r=e.stacked?e.stack:!1,i=e.stackingType,s,o,u,a,f,l,c;n.save(),n.lineJoin="round",n.lineWidth=e.lineWidth,n.strokeStyle="rgba(0,0,0,0.5)",n.fillStyle=e.fillStyle;for(a=0;a0?"top":"bottom",k,L,A;n.save(),n.translate(a/2,u/2),n.scale(1,m),L=Math.cos(w)*f,A=Math.sin(w)*f,s>0&&(this.plotSlice(L+s,A+s,p,y,b,n),c&&(n.fillStyle="rgba(0,0,0,0.1)",n.fill())),this.plotSlice(L,A,p,y,b,n),c&&(n.fillStyle=h,n.fill()),n.lineWidth=i,n.strokeStyle=l,n.stroke(),k={size:e.fontSize*1.2,color:e.fontColor,weight:1.5},E&&(e.htmlText||!e.textEnabled?(divStyle="position:absolute;"+C+":"+(u/2+(C==="top"?T:-T))+"px;",divStyle+=N+":"+(a/2+(N==="right"?-x:x))+"px;",v.push('
',E,"
")):(k.textAlign=N,k.textBaseline=C,Flotr.drawText(n,E,x,T,k)));if(e.htmlText||!e.textEnabled){var O=Flotr.DOM.node('
');Flotr.DOM.insert(O,v.join("")),Flotr.DOM.insert(e.element,O)}n.restore(),this.startAngle=b,this.slices=this.slices||[],this.slices.push({radius:Math.min(r.width,r.height)*o/2,x:L,y:A,explode:f,start:y,end:b})},plotSlice:function(e,t,n,r,i,s){s.beginPath(),s.moveTo(e,t),s.arc(e,t,n,r,i,!1),s.lineTo(e,t),s.closePath()},hit:function(e){var t=e.data[0],n=e.args,r=e.index,i=n[0],s=n[1],o=this.slices[r],u=i.relX-e.width/2,a=i.relY-e.height/2,f=Math.sqrt(u*u+a*a),l=Math.atan(a/u),c=Math.PI*2,h=o.explode||e.explode,p=o.start%c,d=o.end%c,v=e.epsilon;u<0?l+=Math.PI:u>0&&a<0&&(l+=c),fh&&(l>p&&ld&&(lp)||p===d&&(o.start===o.end&&Math.abs(l-p)v))&&(s.x=t[0],s.y=t[1],s.sAngle=p,s.eAngle=d,s.index=0,s.seriesIndex=r,s.fraction=t[1]/this.total)},drawHit:function(e){var t=e.context,n=this.slices[e.args.seriesIndex];t.save(),t.translate(e.width/2,e.height/2),this.plotSlice(n.x,n.y,n.radius,n.start,n.end,t),t.stroke(),t.restore()},clearHit:function(e){var t=e.context,n=this.slices[e.args.seriesIndex],r=2*e.lineWidth,i=n.radius+r;t.save(),t.translate(e.width/2,e.height/2),t.clearRect(n.x-i,n.y-i,2*i+r,2*i+r),t.restore()},extendYRange:function(e,t){this.total=(this.total||0)+t[0][1]}})}(),Flotr.addType("points",{options:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#FFFFFF",fillOpacity:1,hitRadius:null},draw:function(e){var t=e.context,n=e.lineWidth,r=e.shadowSize;t.save(),r>0&&(t.lineWidth=r/2,t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,r/2+t.lineWidth/2),t.strokeStyle="rgba(0,0,0,0.2)",this.plot(e,t.lineWidth/2)),t.lineWidth=e.lineWidth,t.strokeStyle=e.color,e.fill&&(t.fillStyle=e.fillStyle),this.plot(e),t.restore()},plot:function(e,t){var n=e.data,r=e.context,i=e.xScale,s=e.yScale,o,u,a;for(o=n.length-1;o>-1;--o){a=n[o][1];if(a===null)continue;u=i(n[o][0]),a=s(a);if(u<0||u>e.width||a<0||a>e.height)continue;r.beginPath(),t?r.arc(u,a+t,e.radius,0,Math.PI,!1):(r.arc(u,a,e.radius,0,2*Math.PI,!0),e.fill&&r.fill()),r.stroke(),r.closePath()}}}),Flotr.addType("radar",{options:{show:!1,lineWidth:2,fill:!0,fillOpacity:.4,radiusRatio:.9,sensibility:2},draw:function(e){var t=e.context,n=e.shadowSize;t.save(),t.translate(e.width/2,e.height/2),t.lineWidth=e.lineWidth,t.fillStyle="rgba(0,0,0,0.05)",t.strokeStyle="rgba(0,0,0,0.05)",this.plot(e,n/2),t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,n/4),t.strokeStyle=e.color,t.fillStyle=e.fillStyle,this.plot(e),t.restore()},plot:function(e,t){var n=e.data,r=e.context,i=Math.min(e.height,e.width)*e.radiusRatio/2,s=2*Math.PI/n.length,o=-Math.PI/2,u,a;t=t||0,r.beginPath();for(u=0;u=5||Math.abs(e.second.y-e.first.y)>=5}})}(),function(){var e=Flotr.DOM,t=Flotr._;Flotr.addPlugin("legend",{options:{show:!0,noColumns:1,labelFormatter:function(e){return e},labelBoxBorderColor:"#CCCCCC",labelBoxWidth:14,labelBoxHeight:10,labelBoxMargin:5,container:null,position:"nw",margin:5,backgroundColor:"#F0F0F0",backgroundOpacity:.85},callbacks:{"flotr:afterinit":function(){this.legend.insertLegend()},"flotr:destroy":function(){var t=this.legend.markup;t&&(this.legend.markup=null,e.remove(t))}},insertLegend:function(){if(!this.options.legend.show)return;var n=this.series,r=this.plotOffset,i=this.options,s=i.legend,o=[],u=!1,a=this.ctx,f=t.filter(n,function(e){return e.label&&!e.hide}).length,l=s.position,c=s.margin,h=s.backgroundOpacity,p,d,v;if(f){var m=s.labelBoxWidth,g=s.labelBoxHeight,y=s.labelBoxMargin,b=r.left+c,w=r.top+c,E=0,S={size:i.fontSize*1.1,color:i.grid.color};for(p=n.length-1;p>-1;--p){if(!n[p].label||n[p].hide)continue;d=s.labelFormatter(n[p].label),E=Math.max(E,this._text.measureText(d,S).width)}var x=Math.round(m+y*3+E),T=Math.round(f*(y+g)+y);!h&&h!==0&&(h=.1);if(!i.HtmlText&&this.textEnabled&&!s.container){l.charAt(0)=="s"&&(w=r.top+this.plotHeight-(c+T)),l.charAt(0)=="c"&&(w=r.top+this.plotHeight/2-(c+T/2)),l.charAt(1)=="e"&&(b=r.left+this.plotWidth-(c+x)),v=this.processColor(s.backgroundColor,{opacity:h}),a.fillStyle=v,a.fillRect(b,w,x,T),a.strokeStyle=s.labelBoxBorderColor,a.strokeRect(Flotr.toPixel(b),Flotr.toPixel(w),x,T);var N=b+y,C=w+y;for(p=0;p
','
','
','
',"
","
","
',d,"
'+o.join("")+"
";if(s.container)O=e.node(O),this.legend.markup=O,e.insert(s.container,O);else{var M={position:"absolute",zIndex:"2",border:"1px solid "+s.labelBoxBorderColor};l.charAt(0)=="n"?(M.top=c+r.top+"px",M.bottom="auto"):l.charAt(0)=="c"?(M.top=c+(this.plotHeight-T)/2+"px",M.bottom="auto"):l.charAt(0)=="s"&&(M.bottom=c+r.bottom+"px",M.top="auto"),l.charAt(1)=="e"?(M.right=c+r.right+"px",M.left="auto"):l.charAt(1)=="w"&&(M.left=c+r.left+"px",M.right="auto");var P=e.create("div"),H;P.className="flotr-legend",e.setStyles(P,M),e.insert(P,O),e.insert(this.el,P);if(!h)return;var B=s.backgroundColor||i.grid.backgroundColor||"#ffffff";t.extend(M,e.size(P),{backgroundColor:B,zIndex:"",border:""}),M.width+="px",M.height+="px",P=e.create("div"),P.className="flotr-legend-bg",e.setStyles(P,M),e.opacity(P,h),e.insert(P," "),e.insert(this.el,P)}}}}}})}(),function(){var e=Flotr.DOM,t=Flotr._,n=Flotr,r="opacity:0.7;background-color:#000;color:#fff;position:absolute;padding:2px 8px;-moz-border-radius:4px;border-radius:4px;white-space:nowrap;";Flotr.addPlugin("hit",{callbacks:{"flotr:mousemove":function(e,t){this.hit.track(t)},"flotr:click":function(e){var n=this.hit.track(e);n&&!t.isUndefined(n.index)&&(e.hit=n)},"flotr:mouseout":function(e){e.relatedTarget!==this.mouseTrack&&this.hit.clearHit()},"flotr:destroy":function(){this.options.mouse.container&&e.remove(this.mouseTrack),this.mouseTrack=null}},track:function(e){if(this.options.mouse.track||t.any(this.series,function(e){return e.mouse&&e.mouse.track}))return this.hit.hit(e)},executeOnType:function(e,r,i){function u(e,u){t.each(t.keys(n.graphTypes),function(t){e[t]&&e[t].show&&this[t][r]&&(o=this.getOptions(e,t),o.fill=!!e.mouse.fillColor,o.fillStyle=this.processColor(e.mouse.fillColor||"#ffffff",{opacity:e.mouse.fillOpacity}),o.color=e.mouse.lineColor,o.context=this.octx,o.index=u,i&&(o.args=i),this[t][r].call(this[t],o),s=!0)},this)}var s=!1,o;return t.isArray(e)||(e=[e]),t.each(e,u,this),s},drawHit:function(e){var t=this.octx,n=e.series;if(n.mouse.lineColor){t.save(),t.lineWidth=n.points?n.points.lineWidth:1,t.strokeStyle=n.mouse.lineColor,t.fillStyle=this.processColor(n.mouse.fillColor||"#ffffff",{opacity:n.mouse.fillOpacity}),t.translate(this.plotOffset.left,this.plotOffset.top);if(!this.hit.executeOnType(n,"drawHit",e)){var r=e.xaxis,i=e.yaxis;t.beginPath(),t.arc(r.d2p(e.x),i.d2p(e.y),n.points.hitRadius||n.points.radius||n.mouse.radius,0,2*Math.PI,!0),t.fill(),t.stroke(),t.closePath()}t.restore(),this.clip(t)}this.prevHit=e},clearHit:function(){var t=this.prevHit,n=this.octx,r=this.plotOffset;n.save(),n.translate(r.left,r.top);if(t){if(!this.hit.executeOnType(t.series,"clearHit",this.prevHit)){var i=t.series,s=i.points?i.points.lineWidth:1;offset=(i.points.hitRadius||i.points.radius||i.mouse.radius)+s,n.clearRect(t.xaxis.d2p(t.x)-offset,t.yaxis.d2p(t.y)-offset,offset*2,offset*2)}e.hide(this.mouseTrack),this.prevHit=null}n.restore()},hit:function(e){var n=this.options,r=this.prevHit,i,s,o,u,a,f,l,c,h;if(this.series.length===0)return;h={relX:e.relX,relY:e.relY,absX:e.absX,absY:e.absY,series:this.series};if(n.mouse.trackY&&!n.mouse.trackAll&&this.hit.executeOnType(this.series,"hit",[e,h])&&!t.isUndefined(h.seriesIndex))a=this.series[h.seriesIndex],h.series=a,h.mouse=a.mouse,h.xaxis=a.xaxis,h.yaxis=a.yaxis;else{i=this.hit.closest(e);if(i){i=n.mouse.trackY?i.point:i.x,u=i.seriesIndex,a=this.series[u],l=a.xaxis,c=a.yaxis,s=2*a.mouse.sensibility;if(n.mouse.trackAll||i.distanceXl.xaxis.max)continue;p=Math.abs(g-v),d=Math.abs(y-m),h=p*p+d*d,h'),this.mouseTrack=c,e.insert(b||this.el,c));if(!g||g<0)g=0;a&&a.toFixed&&(a=a.toFixed(g)),f&&f.toFixed&&(f=f.toFixed(g)),T=n.mouse.trackFormatter({x:a,y:f,series:n.series,index:n.index,nearest:n,fraction:n.fraction});if(t.isNull(T)||t.isUndefined(T)){e.hide(c);return}c.innerHTML=T,e.show(c);if(b)return;x=e.size(c),b&&(S=e.position(this.el),w=S.top,E=S.left);if(!n.mouse.relative)i+="top:",o.charAt(0)=="n"?i+=w+u+m:o.charAt(0)=="s"&&(i+=w-u+m+this.plotHeight-x.height),i+="px;bottom:auto;left:",o.charAt(1)=="e"?i+=E-u+p+this.plotWidth-x.width:o.charAt(1)=="w"&&(i+=E+u+p),i+="px;right:auto;";else if(s.pie&&s.pie.show){var N={x:this.plotWidth/2,y:this.plotHeight/2},C=Math.min(this.canvasWidth,this.canvasHeight)*s.pie.sizeRatio/2,k=n.sAngle(s?e.plotWidth:e.plotHeight))continue;Flotr.drawText(v,n.label,l(e,s,o,a),h(e,s,o,a),u),!s&&!o&&(v.save(),v.strokeStyle=u.color,v.beginPath(),v.moveTo(e.plotOffset.left+e.plotWidth-8,e.plotOffset.top+t.d2p(n.v)),v.lineTo(e.plotOffset.left+e.plotWidth,e.plotOffset.top+t.d2p(n.v)),v.stroke(),v.restore())}}function E(e,t){var r=t.orientation===1,i=t.n===1,o="",u,a,f,l=e.plotOffset;!r&&!i&&(v.save(),v.strokeStyle=t.options.color||d.grid.color,v.beginPath());if(t.options.showLabels&&(i?!0:t.used))for(c=0;c(r?e.canvasWidth:e.canvasHeight))continue;f=l.top+(r?(i?1:-1)*(e.plotHeight+d.grid.labelMargin):t.d2p(n.v)-t.maxLabel.height/2),u=r?l.left+t.d2p(n.v)-s/2:0,o="",c===0?o=" first":c===t.ticks.length-1&&(o=" last"),o+=r?" flotr-grid-label-x":" flotr-grid-label-y",h+=['
'+n.label+"
"].join(" "),!r&&!i&&(v.moveTo(l.left+e.plotWidth-8,l.top+t.d2p(n.v)),v.lineTo(l.left+e.plotWidth,l.top+t.d2p(n.v)))}}var t,n,r,i,s,o,u,a,f,l,c,h="",p=0,d=this.options,v=this.ctx,m=this.axes,g={size:d.fontSize};for(c=0;c-1;--p){if(!n[p].label||n[p].hide)continue;d=s.labelFormatter(n[p].label),E=Math.max(E,this._text.measureText(d,S).width)}var x=Math.round(m+y*3+E),T=Math.round(f*(y+g)+y);!h&&h!==0&&(h=.1);if(!i.HtmlText&&this.textEnabled&&!s.container){l.charAt(0)=="s"&&(w=r.top+this.plotHeight-(c+T)),l.charAt(0)=="c"&&(w=r.top+this.plotHeight/2-(c+T/2)),l.charAt(1)=="e"&&(b=r.left+this.plotWidth-(c+x)),v=this.processColor(s.backgroundColor,{opacity:h}),a.fillStyle=v,a.fillRect(b,w,x,T),a.strokeStyle=s.labelBoxBorderColor,a.strokeRect(Flotr.toPixel(b),Flotr.toPixel(w),x,T);var N=b+y,C=w+y;for(p=0;p":""),u=!0);var k=n[p],L=s.labelBoxWidth,A=s.labelBoxHeight;d=s.labelFormatter(k.label),v="background-color:"+(k.bars&&k.bars.show&&k.bars.fillColor&&k.bars.fill?k.bars.fillColor:k.color)+";",o.push('','
','
','
',"
","
","",'',d,"")}u&&o.push("");if(o.length>0){var O=''+o.join("")+"
";if(s.container)O=e.node(O),this.legend.markup=O,e.insert(s.container,O);else{var M={position:"absolute",zIndex:"2",border:"1px solid "+s.labelBoxBorderColor};l.charAt(0)=="n"?(M.top=c+r.top+"px",M.bottom="auto"):l.charAt(0)=="c"?(M.top=c+(this.plotHeight-T)/2+"px",M.bottom="auto"):l.charAt(0)=="s"&&(M.bottom=c+r.bottom+"px",M.top="auto"),l.charAt(1)=="e"?(M.right=c+r.right+"px",M.left="auto"):l.charAt(1)=="w"&&(M.left=c+r.left+"px",M.right="auto");var P=e.create("div"),H;P.className="flotr-legend",e.setStyles(P,M),e.insert(P,O),e.insert(this.el,P);if(!h)return;var B=s.backgroundColor||i.grid.backgroundColor||"#ffffff";t.extend(M,e.size(P),{backgroundColor:B,zIndex:"",border:""}),M.width+="px",M.height+="px",P=e.create("div"),P.className="flotr-legend-bg",e.setStyles(P,M),e.opacity(P,h),e.insert(P," "),e.insert(this.el,P)}}}}}})}(),function(){var e=Flotr.DOM;Flotr.addPlugin("titles",{callbacks:{"flotr:afterdraw":function(){this.titles.drawTitles()}},drawTitles:function(){var t,n=this.options,r=n.grid.labelMargin,i=this.ctx,s=this.axes;if(!n.HtmlText&&this.textEnabled){var o={size:n.fontSize,color:n.grid.color,textAlign:"center"};n.subtitle&&Flotr.drawText(i,n.subtitle,this.plotOffset.left+this.plotWidth/2,this.titleHeight+this.subtitleHeight-2,o),o.weight=1.5,o.size*=1.5,n.title&&Flotr.drawText(i,n.title,this.plotOffset.left+this.plotWidth/2,this.titleHeight-2,o),o.weight=1.8,o.size*=.8,s.x.options.title&&s.x.used&&(o.textAlign=s.x.options.titleAlign||"center",o.textBaseline="top",o.angle=Flotr.toRad(s.x.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.x.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+s.x.maxLabel.height+this.plotHeight+2*r,o)),s.x2.options.title&&s.x2.used&&(o.textAlign=s.x2.options.titleAlign||"center",o.textBaseline="bottom",o.angle=Flotr.toRad(s.x2.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.x2.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top-s.x2.maxLabel.height-2*r,o)),s.y.options.title&&s.y.used&&(o.textAlign=s.y.options.titleAlign||"right",o.textBaseline="middle",o.angle=Flotr.toRad(s.y.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.y.options.title,this.plotOffset.left-s.y.maxLabel.width-2*r,this.plotOffset.top+this.plotHeight/2,o)),s.y2.options.title&&s.y2.used&&(o.textAlign=s.y2.options.titleAlign||"left",o.textBaseline="middle",o.angle=Flotr.toRad(s.y2.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.y2.options.title,this.plotOffset.left+this.plotWidth+s.y2.maxLabel.width+2*r,this.plotOffset.top+this.plotHeight/2,o))}else{t=[],n.title&&t.push('
',n.title,"
"),n.subtitle&&t.push('
',n.subtitle,"
"),t.push(""),t.push('
'),s.x.options.title&&s.x.used&&t.push('
',s.x.options.title,"
"),s.x2.options.title&&s.x2.used&&t.push('
',s.x2.options.title,"
"),s.y.options.title&&s.y.used&&t.push('
',s.y.options.title,"
"),s.y2.options.title&&s.y2.used&&t.push('
',s.y2.options.title,"
"),t=t.join("");var u=e.create("div");e.setStyles({color:n.grid.color}),u.className="flotr-titles",e.insert(this.el,u),e.insert(u,t)}}})}(),function(){function t(){var t=this.options,n=this.handles,r=this.el,i,s,o,u;if(!t.selection.mode||!t.handles.show||"ontouchstart"in r)return;n.initialized=!0,u=e.node('
'),t=t.handles,t.drag&&(o=e.node('
'),s=e.node('
'),e.insert(u,o),e.insert(u,s),e.hide(s),e.hide(o),n.left=s,n.right=o,this.observe(s,"mousedown",function(){n.moveHandler=a}),this.observe(o,"mousedown",function(){n.moveHandler=f})),t.scroll&&(i=e.node('
'),e.insert(u,i),e.hide(i),n.scroll=i,this.observe(i,"mousedown",function(){n.moveHandler=l})),this.observe(document,"mouseup",function(){n.moveHandler=null}),e.insert(r,u)}function n(e){if(!this.handles.initialized)return;var t=this.handles,n=this.options.handles,s=t.left,o=t.right,u=t.scroll;n&&(n.drag&&(r(this,s,e.x1),r(this,o,e.x2)),n.scroll&&i(this,u,e.x1,e.x2))}function r(t,n,r){e.show(n);var i=e.size(n),s=Math.round(t.axes.x.d2p(r)-i.width/2),o=(t.plotHeight-i.height)/2;e.setStyles(n,{left:s+"px",top:o+"px"})}function i(t,n,r,i){e.show(n);var s=e.size(n),o=Math.round(t.axes.x.d2p(r)),u=t.plotHeight-s.height/2,a=t.axes.x.d2p(i)-t.axes.x.d2p(r);e.setStyles(n,{left:o+"px",top:u+"px",width:a+"px"})}function s(){if(!this.handles.initialized)return;var t=this.handles;t&&(e.hide(t.left),e.hide(t.right),e.hide(t.scroll))}function o(e,t){if(!this.handles.initialized)return;if(!this.handles.moveHandler)return;var n=t.x-this.lastMousePos.x,r=this.selection.selection,i=this.selection.getArea(),s=this.handles;s.moveHandler(i,n),u(i,s),this.selection.setSelection(i)}function u(e,t){var n=t.moveHandler;e.x1>e.x2&&(n==a?n=f:n==f&&(n=a),t.moveHandler=n)}function a(e,t){e.x1+=t}function f(e,t){e.x2+=t}function l(e,t){e.x1+=t,e.x2+=t}var e=Flotr.DOM;Flotr.addPlugin("handles",{options:{show:!1,drag:!0,scroll:!0},callbacks:{"flotr:afterinit":t,"flotr:select":n,"flotr:mousedown":s,"flotr:mousemove":o}})}(),function(){var e=Flotr.EventAdapter,t=Flotr._;Flotr.addPlugin("graphGrid",{callbacks:{"flotr:beforedraw":function(){this.graphGrid.drawGrid()},"flotr:afterdraw":function(){this.graphGrid.drawOutline()}},drawGrid:function(){function v(e){for(p=0;p=c.max||(e==c.min||e==c.max)&&i.outlineWidth)return;r(Math.floor(c.d2p(e))+n.lineWidth/2)})}function g(e){n.moveTo(e,0),n.lineTo(e,f)}function y(e){n.moveTo(0,e),n.lineTo(l,e)}var n=this.ctx,r=this.options,i=r.grid,s=i.verticalLines,o=i.horizontalLines,u=i.minorVerticalLines,a=i.minorHorizontalLines,f=this.plotHeight,l=this.plotWidth,c,h,p,d;(s||u||o||a)&&e.fire(this.el,"flotr:beforegrid",[this.axes.x,this.axes.y,r,this]),n.save(),n.lineWidth=1,n.strokeStyle=i.tickColor;if(i.circular){n.translate(this.plotOffset.left+l/2,this.plotOffset.top+f/2);var b=Math.min(f,l)*r.radar.radiusRatio/2,w=this.axes.x.ticks.length,S=2*(Math.PI/w),x=-Math.PI/2;n.beginPath(),c=this.axes.y,o&&v(c.ticks),a&&v(c.minorTicks),s&&t.times(w,function(e){n.moveTo(0,0),n.lineTo(Math.cos(e*S+x)*b,Math.sin(e*S+x)*b)}),n.stroke()}else n.translate(this.plotOffset.left,this.plotOffset.top),i.backgroundColor&&(n.fillStyle=this.processColor(i.backgroundColor,{x1:0,y1:0,x2:l,y2:f}),n.fillRect(0,0,l,f)),n.beginPath(),c=this.axes.x,s&&m(c.ticks,g),u&&m(c.minorTicks,g),c=this.axes.y,o&&m(c.ticks,y),a&&m(c.minorTicks,y),n.stroke();n.restore(),(s||u||o||a)&&e.fire(this.el,"flotr:aftergrid",[this.axes.x,this.axes.y,r,this])},drawOutline:function(){var e=this,t=e.options,n=t.grid,r=n.outline,s=e.ctx,o=n.backgroundImage,u=e.plotOffset,a=u.left,f=u.top,l=e.plotWidth,c=e.plotHeight,h,p,d,v,m,g;if(!n.outlineWidth)return;s.save();if(n.circular){s.translate(a+l/2,f+c/2);var y=Math.min(c,l)*t.radar.radiusRatio/2,b=this.axes.x.ticks.length,w=2*(Math.PI/b),E=-Math.PI/2;s.beginPath(),s.lineWidth=n.outlineWidth,s.strokeStyle=n.color,s.lineJoin="round";for(i=0;i<=b;++i)s[i===0?"moveTo":"lineTo"](Math.cos(i*w+E)*y,Math.sin(i*w+E)*y);s.stroke()}else{s.translate(a,f);var S=n.outlineWidth,x=.5-S+(S+1)%2/2,T="lineTo",N="moveTo";s.lineWidth=S,s.strokeStyle=n.color,s.lineJoin="miter",s.beginPath(),s.moveTo(x,x),l-=S/2%1,c+=S/2,s[r.indexOf("n")!==-1?T:N](l,x),s[r.indexOf("e")!==-1?T:N](l,c),s[r.indexOf("s")!==-1?T:N](x,c),s[r.indexOf("w")!==-1?T:N](x,x),s.stroke(),s.closePath()}s.restore(),o&&(d=o.src||o,v=(parseInt(o.left,10)||0)+u.left,m=(parseInt(o.top,10)||0)+u.top,p=new Image,p.onload=function(){s.save(),o.alpha&&(s.globalAlpha=o.alpha),s.globalCompositeOperation="destination-over",s.drawImage(p,0,0,p.width,p.height,v,m,l,c),s.restore()},p.src=d)}})}(),!function(e,t){typeof define=="function"?define(t):typeof module!="undefined"?module.exports=t():this[e]=t()}("bonzo",function(){function e(e){return new RegExp("(^|\\s+)"+e+"(\\s+|$)")}function t(e,t,n){for(var r=0,i=e.length;r]+)/.exec(e),n=y.createElement(t&&N[t[1].toLowerCase()]||"div"),r=[];n.innerHTML=e;var i=n.childNodes;n=n.firstChild,r.push(n);while(n=n.nextSibling)n.nodeType==1&&r.push(n);return r}():r(e)?[e.cloneNode(!0)]:[]},v.doc=function(){var e=this.viewport();return{width:Math.max(y.body.scrollWidth,b.scrollWidth,e.width),height:Math.max(y.body.scrollHeight,b.scrollHeight,e.height)}},v.firstChild=function(e){for(var t=e.childNodes,n=0,r=t&&t.length||0,i;n=0&&t
';r.prototype={render:function(e){var t=this.node,n=this.options;e=e||n.element;if(!e)throw"No element to render within.";bonzo(e).addClass(n.name||"").append(this.node),this._setDimension("width"),this._setDimension("height"),this.container=e,this.draw(n.data,n.config)},draw:function(t,n){var r=this.api,i=this.options,s=this.preprocessors,o;o=t=t||i.data,n=n||i.config,!i.skipPreprocess&&t&&(o=[],_.each(r.getDataArray(t),function(u,a){var f=s[a]||new e.Preprocessor,l=_.isArray(u),c=_.isFunction(u),h=l?u:c?u:u.data,p=i.processData,d=r.range(n),v=d.min,m=d.max,g=this.node.clientWidth,y=u,b,w;!c&&!l&&(y=u.data,w=_.extend({},u)),c?b=t(v,m,g):(y!==f.data?f.setData(y):f.reset(),p?(p.apply(this,[{preprocessor:f,min:v,max:m,resolution:g}]),b=f.getData()):b=f.bound(v,m).subsampleMinMax(g).getData()),r.transformData&&(b=r.transformData(b)),w?(w.data=b,o.push(w)):o.push(b)},this)),r&&r.draw(o,n,this.node)},trigger:function(){this.api.trigger.apply(this.api,Array.prototype.concat.apply([this],arguments))},attach:function(){this.api.attach.apply(this.api,Array.prototype.concat.apply([this],arguments))},detach:function(){this.api.detach.apply(this.api,Array.prototype.concat.apply([this],arguments))},destroy:function(){this.api&&this.api.destroy&&this.api.destroy(),bonzo(this.container).empty()},_setDimension:function(e){var t=this.node,n=this.options;n[e]?bonzo(t).css(e,n[e]):n[e]=t.clientWidth,this[e]=n[e]}},e.Component=r}(),function(){function t(e){this.options=e=e||{},this.actions=[],this.actionOptions=[],this.followers=[],this.leaders=[],this.prevent={},e.leader&&this.leader(e.leader)}var e=envision;t.prototype={leader:function(e){return this.leaders.push(e),_.each(this.actions,function(t,n){this._bindLeader(e,t,this.actionOptions[n])},this),this},follower:function(e){return this.followers.push(e),this},group:function(e){return _.isArray(e)||(e=[e]),_.each(e,function(e){this.leader(e),this.follower(e)},this),this},add:function(e,t){return this.actions.push(e),this.actionOptions.push(t),_.each(this.leaders,function(n){this._bindLeader(n,e,t)},this),this},_bindLeader:function(e,t,n){_.each(t.events,function(t){var r=t.handler||t,i=t.consumer||t;e.attach(r,_.bind(function(e,t){if(this.prevent[name])return;n&&n.callback&&n.callback.call(this,t),this.prevent[name]=!0;try{_.each(this.followers,function(n){if(e===n)return;n.trigger(i,t)},this)}catch(r){throw this.prevent[name]=!1,r}this.prevent[name]=!1},this))},this)}},e.Interaction=t}(),function(){function e(e){e=e||{},this.getData=function(){return this.bounded&&r(this),this.processing},this.reset=function(){return this.processing=this.data,this},this.setData=function(e){var t,n;if(!_.isArray(e))throw new Error("Array expected.");if(e.length<2)throw new Error("Data must contain at least two dimensions.");n=e[0].length;for(t=e.length;t--;){if(!_.isArray(e[t]))throw new Error("Data dimensions must be arrays.");if(e[t].length!==n)throw new Error("Data dimensions must contain the same number of points.")}return this.processing=e,this.data=e,this},e.data&&this.setData(e.data)}function t(e,t){var n=_.sortedIndex(e,t);return e[n]>t&&n>0&&n--,n}function n(e,t){return _.sortedIndex(e,t)}function r(e){delete e.bounded;var r=e.processing,i=e.length(),s=r[0],o=r[1],u=e.min||0,a=e.max||i,f=t(s,u),l=n(s,a);e.processing=[s.slice(f,l+1),o.slice(f,l+1)],e.start=f,e.end=l}function i(e,t,n,r,i,s,o,u,a){var f=(e-r)/(s-r),l=1-f,c=(1+2*f)*l*l,h=f*l*l,p=f*f*(3-2*f),d=f*f*(f-1),v=(o-i)/(2*(s-r))+(typeof n=="undefined"?0:(i-n)/(2*(r-t))),m=(typeof a=="undefined"?0:(a-o)/(2*(u-s)))+(o-i)/(2*(s-r)),g=c*i+h*(s-r)*v+p*o+d*(s-r)*m;return g}e.prototype={length:function(){return this.getData()[0].length},bound:function(e,t){return!_.isNumber(e)||!_.isNumber(t)?this:(this.min=e,this.max=t,this.bounded=!0,this)},subsampleMinMax:function(e){var r=this.bounded;delete this.bounded;var i=this.processing,s=this.length(),o=i[0],u=i[1],a=r?t(o,this.min):0,f=r?n(o,this.max):s-1,l=(e-2)/2,c=[],h=[],p=Number.MAX_VALUE,d=-Number.MAX_VALUE,v=1,m=1,g=(f-a)/l,y,b,w,E;if(f-a+1>e){c.push(o[a]),h.push(u[a]),y=a+g;for(w=a;wd&&(d=u[w],m=w),u[w]e){c.push(o[a]),h.push(u[a]);for(p=1;p=f-l)break;d=Math.round(p*l)+a,c.push(o[d]),h.push(u[d])}c.push(o[f]),h.push(u[f]),this.processing=[c,h],this.start=a,this.end=f}else this.bounded=r;return this},interpolate:function(e){var r=this.bounded;delete this.bounded;var s=this.processing,o=this.length(),u=s[0],a=s[1],f=r?t(u,this.min):0,l=r?n(u,this.max):o-1,c=(u[l]-u[f])/e,h=[],p=[],d,v,m;h.push(u[f]),p.push(a[f]);if(l-f+1=s-1?r.lineTo(a,i):(r.quadraticCurveTo(s,o,Math.max(s-o,s-(s-a)/2),o),r.lineTo(Math.min(a+o,s-(s-a)/2),o),r.quadraticCurveTo(a,o,a,i)),r.stroke(),r.closePath(),r.fill(),r.restore()},trigger:function(e,t ,n){t==="zoom"?this.zoom(e,n):t==="reset"&&this.reset(e)},zoom:function(e,t){var n=t.x||{},r=n.min,i=n.max,s=e.api;e.draw(null,{min:r,max:i})},reset:function(e){e.draw(null,{min:e.width/2,max:e.width/2})}},envision.components.QuadraticDrawing=e}(),envision.templates=envision.templates||{},function(){function t(e){var t=e.resolution;e.preprocessor.bound(e.min,e.max).subsampleMinMax(t+Math.round(t/3))}function n(){return{price:{name:"envision-finance-price",config:{"lite-lines":{lineWidth:1,show:!0,fill:!0,fillOpacity:.2},mouse:{track:!0,trackY:!1,trackAll:!0,sensibility:1,trackDecimals:4,position:"ne"},yaxis:{autoscale:!0,autoscaleMargin:.05,noTicks:4,showLabels:!0,min:0}},processData:t},volume:{name:"envision-finance-volume",config:{whiskers:{show:!0,lineWidth:2},mouse:{track:!0,trackY:!1,trackAll:!0},yaxis:{autoscale:!0,autoscaleMargin:.5}},processData:t},summary:{name:"envision-finance-summary",config:{"lite-lines":{show:!0,lineWidth:1,fill:!0,fillOpacity:.2,fillBorder:!0},xaxis:{noTicks:5,showLabels:!0},yaxis:{autoscale:!0,autoscaleMargin:.1},handles:{show:!0},selection:{mode:"x"},grid:{verticalLines:!1}}},connection:{name:"envision-finance-connection",adapterConstructor:e.components.QuadraticDrawing}}}function r(t){var r=t.data,i=n(),s=new e.Visualization({name:"envision-finance"}),o=new e.Interaction,u=new e.Interaction,a,f,l,c;t.defaults&&(i=Flotr.merge(t.defaults,i)),i.price.data=r.price,i.volume.data=r.volume,i.summary.data=r.summary,i.price.config.mouse.trackFormatter=t.trackFormatter||function(e){var t=e.index,n;return a.api.preprocessor&&(t+=a.api.preprocessor.start),n="Price: $"+r.price[1][t]+", Vol: "+r.volume[1][t],n},t.xTickFormatter&&(i.summary.config.xaxis.tickFormatter=t.xTickFormatter),i.price.config.yaxis.tickFormatter=t.yTickFormatter||function(e){return"$"+e},a=new e.Component(i.price),f=new e.Component(i.volume),l=new e.Component(i.connection),c=new e.Component(i.summary),s.add(a).add(f).add(l).add(c).render(t.container),o.follower(a).follower(f).follower(l).leader(c).add(e.actions.selection,t.selectionCallback?{callback:t.selectionCallback}:null),u.group([a,f]).add(e.actions.hit),t.selection&&c.trigger("select",t.selection),this.vis=s,this.selection=o,this.hit=u,this.price=a,this.volume=f,this.summary=c}var e=envision;e.templates.Finance=r}(),function(){function t(){return{detail:{name:"envision-timeseries-detail",config:{"lite-lines":{lineWidth:1,show:!0}}},summary:{name:"envision-timeseries-summary",config:{"lite-lines":{lineWidth:1,show:!0},handles:{show:!0},selection:{mode:"x"},yaxis:{autoscale:!0,autoscaleMargin:.1}}},connection:{name:"envision-timeseries-connection",adapterConstructor:e.components.QuadraticDrawing}}}function n(n){var r=n.data,i=t(),s=new e.Visualization({name:"envision-timeseries"}),o=new e.Interaction,u,a,f;n.defaults&&(i=Flotr.merge(n.defaults,i)),i.detail.data=r.detail,i.summary.data=r.summary,u=new e.Component(i.detail),f=new e.Component(i.connection),a=new e.Component(i.summary),s.add(u).add(f).add(a).render(n.container),o.follower(u).follower(f).leader(a).add(e.actions.selection,n.selectionCallback?{callback:n.selectionCallback}:null),n.selection&&a.trigger("select",n.selection),this.vis=s,this.selection=o,this.detail=u,this.summary=a}var e=envision;e.templates.TimeSeries=n}(),function(){function n(){return{name:"zoom"}}function r(){return{name:"summary",config:{handles:{show:!0},selection:{mode:"x"}}}}function i(e,t){var n=_.defaults(e,t);return n.flotr=_.defaults(n.flotr,t.flotr),n}var e=envision,t;t=function(t){var s=new e.Visualization,o=new e.Component(i(t.zoom||{},n())),u=new e.Component(i(t.summary||{},r())),a=new e.Interaction({leader:u});s.add(o).add(u),a.add(e.actions.selection),a.follower(o),this.vis=s,this.interaction=a,t.container&&this.render(t.container)},t.prototype={render:function(e){this.vis.render(e)}},e.templates.Zoom=t}(),function(){function e(e){return e.target}function t(e){return e.source}function n(e,t){try{for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}catch(r){e.prototype=t}}function r(e){var t=-1,n=e.length,r=[];while(++t8?function(e){return e/n}:function(e){return e*n},symbol:e}}function T(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function N(e){return function(t){return 1-e(1-t)}}function C(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function k(e){return e*e}function L(e){return e*e*e}function A(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function O(e){return function(t){return Math.pow(t,e)}}function M(e){return 1-Math.cos(e*cr/2)}function _(e){return Math.pow(2,10*(e-1))}function D(e){return 1-Math.sqrt(1-e*e)}function P(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/(2*cr)*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*Math.pow(2,10*-r)*Math.sin((r-n)*2*cr/t)}}function H(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}}function B(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function j(){d3.event.stopPropagation(),d3.event.preventDefault()}function F(){var e=d3.event,t;while(t=e.sourceEvent)e=t;return e}function I(e){var t=new b,n=0,r=arguments.length;while(++n360?e-=360:e<0&&(e+=360),e<60?s+(o-s)*e/60:e<180?o:e<240?s+(o-s)*(240-e)/60:s}function i(e){return Math.round(r(e)*255)}var s,o;return e%=360,e<0&&(e+=360),t=t<0?0:t>1?1:t,n=n<0?0:n>1?1:n,o=n<=.5?n*(1+t):n+t-n*t,s=2*n-o,J(i(e+120),i(e),i(e-120))}function st(e,t,n){return new ot(e,t,n)}function ot(e,t,n){this.h=e,this.c=t,this.l=n}function ut(e,t,n){return at(n,Math.cos(e*=pr)*t,Math.sin(e)*t)}function at(e,t,n){return new ft(e,t,n)}function ft(e,t,n){this.l=e,this.a=t,this.b=n}function lt(e,t,n){var r=(e+16)/116,i=r+t/500,s=r-n/200;return i=ht(i)*Fr,r=ht(r)*Ir,s=ht(s)*qr,J(dt(3.2404542*i-1.5371385*r-.4985314*s),dt(-0.969266*i+1.8760108*r+.041556*s),dt(.0556434*i-.2040259*r+1.0572252*s))}function ct(e,t,n){return st(Math.atan2(n,t)/cr*180,Math.sqrt(t*t+n*n),e)}function ht(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function pt(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function dt(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function vt(e){return gr(e,$r),e}function mt(e){return function(){return Ur(e,this)}}function gt(e){return function(){return zr(e,this)}}function yt(e,t){function n(){this.removeAttribute(e)}function r(){this.removeAttributeNS(e.space,e.local)}function i(){this.setAttribute(e,t)}function s(){this.setAttributeNS(e.space,e.local,t)}function o(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}function u(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}return e=d3.ns.qualify(e),t==null?e.local?r:n:typeof t=="function"?e.local?u:o:e.local?s:i}function bt(e){return new RegExp("(?:^|\\s+)"+d3.requote(e)+"(?:\\s+|$)","g")}function wt(e,t){function n(){var n=-1;while(++n0&&(e=e.substring(0,o)),t?i:r}function Lt(e,t){for(var n=0,r=e.length;nn?f():(i.active=n,h.start.call(e,l,t),o.tween.forEach(function(n,r){(r=r.call(e,l,t))&&v.push(r)}),a(r)||d3.timer(a,0,u),1)}function a(r){if(i.active!==n)return f();var s=(r-p)/d,o=c(s),u=v.length;while(u>0)v[--u].call(e,o);if(s>=1)return f(),h.end.call(e,l,t),1}function f(){return--i.count?delete i[n]:delete e.__transition__,1}var l=e.__data__,c=o.ease,h=o.event,p=o.delay,d=o.duration,v=[];return p<=r?s(r):d3.timer(s,p,u),1},0,u),o}}function _t(e){return e==null&&(e=""),function(){this.textContent=e}}function Dt(e,t,n,r){var i=e.id;return Lt(e,typeof n=="function"?function(e,s,o){e.__transition__[i].tween.set(t,r(n.call(e,e.__data__,s,o)))}:(n=r(n),function(e){e.__transition__[i].tween.set(t,n)}))}function Pt(){var e,t=Date.now(),n=ni;while(n)e=t-n.then,e>=n.delay&&(n.flush=n.callback(e)),n=n.next;var r=Ht()-t;r>24?(isFinite(r)&&(clearTimeout(ii),ii=setTimeout(Pt,r)),ri=0):(ri=1,si(Pt))}function Ht(){var e=null,t=ni,n=Infinity;while(t)t.flush?(delete ti[t.callback.id],t=e?e.next=t.next:ni=t.next):(n=Math.min(n,t.then+t.delay),t=(e=t).next);return n}function Bt(e,t){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();if(oi<0&&(window.scrollX||window.scrollY)){n=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var i=n[0][0].getScreenCTM();oi=!i.f&&!i.e,n.remove()}return oi?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}var s=e.getBoundingClientRect();return[t.clientX-s.left-e.clientLeft,t.clientY-s.top-e.clientTop]}function jt(){}function Ft(e){var t=e[0],n=e[e.length-1];return t2?Kt:Jt,a=r?V:X;return o=i(e,t,a,n),u=i(t,e,a,d3.interpolate),s}function s(e){return o(e)}var o,u;return s.invert=function(e){return u(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),i()):e},s.range=function(e){return arguments.length?(t=e,i()):t},s.rangeRound=function(e){return s.range(e).interpolate(d3.interpolateRound)},s.clamp=function(e){return arguments.length?(r=e,i()):r},s.interpolate=function(e){return arguments.length?(n=e,i()):n},s.ticks=function(t){return Vt(e,t)},s.tickFormat=function(t){return $t(e,t)},s.nice=function(){return qt(e,Wt),i()},s.copy=function(){return Ut(e,t,n,r)},i()}function zt(e,t){return d3.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Wt(e){return e=Math.pow(10,Math.round(Math.log(e)/Math.LN10)-1),e&&{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}}function Xt(e,t){var n=Ft(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),s=t/r*i;return s<=.15?i*=10:s<=.35?i*=5:s<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+i*.5,n[2]=i,n}function Vt(e,t){return d3.range.apply(d3,Xt(e,t))}function $t(e,t){return d3.format(",."+Math.max(0,-Math.floor(Math.log(Xt(e,t)[2])/Math.LN10+.01))+"f")}function Jt(e,t,n,r){var i=n(e[0],e[1]),s=r(t[0],t[1]);return function(e){return s(i(e))}}function Kt(e,t,n,r){var i=[],s=[],o=0,u=Math.min(e.length,t.length)-1;e[u]0;f--)i.push(r(s)*f)}else{for(;sa;o--);i=i.slice(s,o)}return i},n.tickFormat=function(e,i){arguments.length<2&&(i=ui);if(!arguments.length)return i;var s=Math.max(.1,e/n.ticks().length),o=t===Yt?(u=-1e-12,Math.floor):(u=1e-12,Math.ceil),u;return function(e){return e/r(o(t(e)+u))<=s?i(e):""}},n.copy=function(){return Qt(e.copy(),t)},zt(n,e)}function Gt(e){return Math.log(e<0?0:e)/Math.LN10}function Yt(e){return-Math.log(e>0?0:-e)/Math.LN10}function Zt(e,t){function n(t){return e(r(t))}var r=en(t),i=en(1/t);return n.invert=function(t){return i(e.invert(t))},n.domain=function(t){return arguments.length?(e.domain(t.map(r)),n):e.domain().map(i)},n.ticks=function(e){return Vt(n.domain(),e)},n.tickFormat=function(e){return $t(n.domain(),e)},n.nice=function(){return n.domain(qt(n.domain(),Wt))},n.exponent=function(e){if(!arguments.length)return t;var s=n.domain();return r=en(t=e),i=en(1/t),n.domain(s)},n.copy=function(){return Zt(e.copy(),t)},zt(n,e)}function en(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function tn(e,t){function n(t){return o[((i.get(t)||i.set(t,e.push(t)))-1)%o.length]}function r(t,n){return d3.range(e.length).map(function(e){return t+n*e})}var i,o,u;return n.domain=function(r){if(!arguments.length)return e;e=[],i=new s;var o=-1,u=r.length,a;while(++or&&(n=t,r=i);return n}function xn(e){return e.reduce(Tn,0)}function Tn(e,t){return e+t[1]}function Nn(e,t){return Cn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Cn(e,t){var n=-1,r=+e[0],i=(e[1]-r)/t,s=[];while(++n<=t)s[n]=i*n+r;return s}function kn(e){return[d3.min(e),d3.max(e)]}function Ln(e,t){return d3.rebind(e,t,"sort","children","value"),e.nodes=e,e.links=_n,e}function An(e){return e.children}function On(e){return e.value}function Mn(e,t){return t.value-e.value}function _n(e){return d3.merge(e.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}function Dn(e,t){return e.value-t.value}function Pn(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function Hn(e,t){e._pack_next=t,t._pack_prev=e}function Bn(e,t){var n=t.x-e.x,r=t.y-e.y,i=e.r+t.r;return i*i-n*n-r*r>.001}function jn(e){function t(e){r=Math.min(e.x-e.r,r),i=Math.max(e.x+e.r,i),s=Math.min(e.y-e.r,s),o=Math.max(e.y+e.r,o)}if(!(n=e.children)||!(p=n.length))return;var n,r=Infinity,i=-Infinity,s=Infinity,o=-Infinity,u,a,f,l,c,h,p;n.forEach(Fn),u=n[0],u.x=-u.r,u.y=0,t(u);if(p>1){a=n[1],a.x=a.r,a.y=0,t(a);if(p>2){f=n[2],Rn(u,a,f),t(f),Pn(u,f),u._pack_prev=f,Pn(f,a),a=u._pack_next;for(l=3;l0&&(e=r)}return e}function Qn(e,t){return e.x-t.x}function Gn(e,t){return t.x-e.x}function Yn(e,t){return e.depth-t.depth}function Zn(e,t){function n(e,r){var i=e.children;if(i&&(a=i.length)){var s,o=null,u=-1,a;while(++u=0)s=r[i]._tree,s.prelim+=t,s.mod+=t,t+=s.shift+(n+=s.change)}function tr(e,t,n){e=e._tree,t=t._tree;var r=n/(t.number-e.number);e.change+=r,t.change-=r,t.shift+=n,t.prelim+=n,t.mod+=n}function nr(e,t,n){return e._tree.ancestor.parent==t.parent?e._tree.ancestor:n}function rr(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function ir(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],s=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),s<0&&(r+=s/2,s=0),{x:n,y:r,dx:i,dy:s}}var sr=".",or=",",ur=[3,3];Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(ar){var fr=CSSStyleDeclaration.prototype,lr=fr.setProperty;fr.setProperty=function(e,t,n){lr.call(this,e,t+"",n)}}d3={version:"3.0.2"};var cr=Math.PI,hr=1e-6,pr=cr/180,dr=180/cr,vr=i;try{vr(document.documentElement.childNodes)[0].nodeType}catch(mr){vr=r}var gr=[].__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]};d3.map=function(e){var t=new s;for(var n in e)t.set(n,e[n]);return t},n(s,{has:function(e){return yr+e in this},get:function(e){return this[yr+e]},set:function(e,t){return this[yr+e]=t},remove:function(e){return e=yr+e,e in this&&delete this[e]},keys:function(){var e=[];return this.forEach(function(t){e.push(t)}),e},values:function(){var e=[];return this.forEach(function(t,n){e.push(n)}),e},entries:function(){var e=[];return this.forEach(function(t,n){e.push({key:t,value:n})}),e},forEach:function(e){for(var t in this)t.charCodeAt(0)===br&&e.call(this,t.substring(1),this[t])}});var yr="\0",br=yr.charCodeAt(0);d3.functor=a,d3.rebind=function(e,t){var n=1,r=arguments.length,i;while(++nt?1:e>=t?0:NaN},d3.descending=function(e,t){return te?1:t>=e?0:NaN},d3.mean=function(e,t){var n=e.length,r,i=0,s=-1,o=0;if(arguments.length===1)while(++s1&&(e=e.map(t)),e=e.filter(l),e.length?d3.quantile(e.sort(d3.ascending),.5):undefined},d3.min=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++ns&&(i=s)}else{while(++ns&&(i=s)}return i},d3.max=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++ni&&(i=s)}else{while(++ni&&(i=s)}return i},d3.extent=function(e,t){var n=-1,r=e.length,i,s,o;if(arguments.length===1){while(++ns&&(i=s),os&&(i=s),o1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(e,t){var n=arguments.length;n<2&&(t=1),n<1&&(e=0);var r=d3.random.normal();return function(){return Math.exp(e+t*r())}},irwinHall:function(e){return function(){for(var t=0,n=0;n>>1;e.call(t,t[s],s)>>1;n=r.length)return u?u.call(n,t):o?t.sort(o):t;var a=-1,f=t.length,l=r[i++],c,h,p=new s,d,v={};while(++a=r.length)return e;var s=[],o=i[n++],u;for(u in e)s.push({key:u,values:t(e[u],n)});return o&&s.sort(function(e,t){return o(e.key,t.key)}),s}var n={},r=[],i=[],o,u;return n.map=function(t){return e(t,0)},n.entries=function(n){return t(e(n,0),0)},n.key=function(e){return r.push(e),n},n.sortKeys=function(e){return i[r.length-1]=e,n},n.sortValues=function(e){return o=e,n},n.rollup=function(e){return u=e,n},n},d3.keys=function(e){var t=[];for(var n in e)t.push(n);return t},d3.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},d3.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},d3.permute=function(e,t){var n=[],r=-1,i=t.length;while(++rt)r.push(o/i);else while((o=e+n*++s)=200&&e<300||e===304?s.load.call(i,a.call(i,f)):s.error.call(i,f)}var i={},s=d3.dispatch("progress","load","error"),u={},a=o,f=new(window.XDomainRequest&&/^(http(s)?:)?\/\//.test(e)?XDomainRequest:XMLHttpRequest);return"onload"in f?f.onload=f.onerror=r:f.onreadystatechange=function(){f.readyState>3&&r()},f.onprogress=function(e){var t=d3.event;d3.event=e;try{s.progress.call(i,f)}finally{d3.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?u[e]:(t==null?delete u[e]:u[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=e==null?null:e+"",i):t},i.response=function(e){return a=e,i},["get","post"].forEach(function(e){i[e]=function(){return i.send.apply(i,[e].concat(vr(arguments)))}}),i.send=function(n,r,s){arguments.length===2&&typeof r=="function"&&(s=r,r=null),f.open(n,e,!0),t!=null&&!("accept"in u)&&(u.accept=t+",*/*");if(f.setRequestHeader)for(var o in u)f.setRequestHeader(o,u[o]);return t!=null&&f.overrideMimeType&&f.overrideMimeType(t),s!=null&&i.on("error",s).on("load",function(e){s(null,e)}),f.send(r==null?null:r),i},i.abort=function(){return f.abort(),i},d3.rebind(i,s,"on"),arguments.length===2&&typeof t=="function"&&(n=t,t=null),n==null?i:i.get(d(n))},d3.text=function(){return d3.xhr.apply(d3,arguments).response(v)},d3.json=function(e,t){return d3.xhr(e,"application/json",t).response(m)},d3.html=function(e,t){return d3.xhr(e,"text/html",t).response(g)},d3.xml=function(){return d3.xhr.apply(d3,arguments).response(y)};var Sr={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:Sr,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&(n=e.substring(0,t),e=e.substring(t+1)),Sr.hasOwnProperty(n)?{space:Sr[n],local:e}:e}},d3.dispatch=function(){var e=new b,t=-1,n=arguments.length;while(++t0&&(r=e.substring(n+1),e=e.substring(0,n)),arguments.length<2?this[e].on(r):this[e].on(r,t)},d3.format=function(e){var t=xr.exec(e),n=t[1]||" ",r=t[2]||">",i=t[3]||"",s=t[4]||"",o=t[5],u=+t[6],a=t[7],f=t[8],l=t[9],c=1,h="",p=!1;f&&(f=+f.substring(1));if(o||n==="0"&&r==="=")o=n="0",r="=",a&&(u-=Math.floor((u-1)/4));switch(l){case"n":a=!0,l="g";break;case"%":c=100,h="%",l="f";break;case"p":c=100,h="%",l="r";break;case"b":case"o":case"x":case"X":s&&(s="0"+l.toLowerCase());case"c":case"d":p=!0,f=0;break;case"s" :c=-1,l="r"}s==="#"&&(s=""),l=="r"&&!f&&(l="g"),l=Tr.get(l)||S;var d=o&&a;return function(e){if(p&&e%1)return"";var t=e<0||e===0&&1/e<0?(e=-e,"-"):i;if(c<0){var v=d3.formatPrefix(e,f);e=v.scale(e),h=v.symbol}else e*=c;e=l(e,f),!o&&a&&(e=Nr(e));var m=s.length+e.length+(d?0:t.length),g=m"?g+t+e:r==="^"?g.substring(0,m>>=1)+t+e+g.substring(m):t+(d?e:g+e))+h}};var xr=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,Tr=d3.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(e,t){return d3.round(e,t=E(e,t)).toFixed(Math.max(0,Math.min(20,t)))}}),Nr=o;if(ur){var Cr=ur.length;Nr=function(e){var t=e.lastIndexOf("."),n=t>=0?"."+e.substring(t+1):(t=e.length,""),r=[],i=0,s=ur[0];while(t>0&&s>0)r.push(e.substring(t-=s,t+s)),s=ur[i=(i+1)%Cr];return r.reverse().join(or||"")+n}}var kr=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(x);d3.formatPrefix=function(e,t){var n=0;return e&&(e<0&&(e*=-1),t&&(e=d3.round(e,E(e,t))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,Math.floor((n<=0?n+1:n-1)/3)*3))),kr[8+n/3]};var Lr=function(){return o},Ar=d3.map({linear:Lr,poly:O,quad:function(){return k},cubic:function(){return L},sin:function(){return M},exp:function(){return _},circle:function(){return D},elastic:P,back:H,bounce:function(){return B}}),Or=d3.map({"in":o,out:N,"in-out":C,"out-in":function(e){return C(N(e))}});d3.ease=function(e){var t=e.indexOf("-"),n=t>=0?e.substring(0,t):e,r=t>=0?e.substring(t+1):"in";return n=Ar.get(n)||Lr,r=Or.get(r)||o,T(r(n.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.transform=function(e){var t=document.createElementNS(d3.ns.prefix.svg,"g");return(d3.transform=function(e){t.setAttribute("transform",e);var n=t.transform.baseVal.consolidate();return new q(n?n.matrix:Mr)})(e)},q.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Mr={a:1,b:0,c:0,d:1,e:0,f:0};d3.interpolate=function(e,t){var n=d3.interpolators.length,r;while(--n>=0&&!(r=d3.interpolators[n](e,t)));return r},d3.interpolateNumber=function(e,t){return t-=e,function(n){return e+t*n}},d3.interpolateRound=function(e,t){return t-=e,function(n){return Math.round(e+t*n)}},d3.interpolateString=function(e,t){var n,r,i,s=0,o=0,u=[],a=[],f,l;_r.lastIndex=0;for(r=0;n=_r.exec(t);++r)n.index&&u.push(t.substring(s,o=n.index)),a.push({i:u.length,x:n[0]}),u.push(null),s=_r.lastIndex;s180?l+=360:l-f>180&&(f+=360),r.push({i:n.push(n.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(f,l)})):l&&n.push(n.pop()+"rotate("+l+")"),c!=h?r.push({i:n.push(n.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(c,h)}):h&&n.push(n.pop()+"skewX("+h+")"),p[0]!=d[0]||p[1]!=d[1]?(i=n.push(n.pop()+"scale(",null,",",null,")"),r.push({i:i-4,x:d3.interpolateNumber(p[0],d[0])},{i:i-2,x:d3.interpolateNumber(p[1],d[1])})):(d[0]!=1||d[1]!=1)&&n.push(n.pop()+"scale("+d+")"),i=r.length,function(e){var t=-1,s;while(++t180?s-=360:s<-180&&(s+=360),function(e){return it(n+s*e,r+o*e,i+u*e)+""}},d3.interpolateLab=function(e,t){e=d3.lab(e),t=d3.lab(t);var n=e.l,r=e.a,i=e.b,s=t.l-n,o=t.a-r,u=t.b-i;return function(e){return lt(n+s*e,r+o*e,i+u*e)+""}},d3.interpolateHcl=function(e,t){e=d3.hcl(e),t=d3.hcl(t);var n=e.h,r=e.c,i=e.l,s=t.h-n,o=t.c-r,u=t.l-i;return s>180?s-=360:s<-180&&(s+=360),function(e){return ut(n+s*e,r+o*e,i+u*e)+""}},d3.interpolateArray=function(e,t){var n=[],r=[],i=e.length,s=t.length,o=Math.min(e.length,t.length),u;for(u=0;u=0;)if(s=n[r])i&&i!==s.nextSibling&&i.parentNode.insertBefore(s,i),i=s;return this},$r.sort=function(e){e=Ct.apply(this,arguments);for(var t=-1,n=this.length;++t0?u=e:u=0:e>0&&(r.start({type:"start",alpha:u=e}),d3.timer(n.tick)),n):u},n.start=function(){function e(e,n){var i=t(r),s=-1,o=i.length,u;while(++si&&(i=u),r.push(u)}for(o=0;o0){s=-1;while(++s=a[0]&&d<=a[1]&&(l=o[d3.bisect(f,d,1,h)-1],l.y+=p,l.push(e[s]))}return o}var t=!0,n=Number,r=kn,i=Nn;return e.value=function(t){return arguments.length?(n=t,e):n},e.range=function(t){return arguments.length?(r=a(t),e):r},e.bins=function(t){return arguments.length?(i=typeof t=="number"?function(e){return Cn(e,t)}:a(t),e):i},e.frequency=function(n){return arguments.length?(t=!!n,e):t},e},d3.layout.hierarchy=function(){function e(t,o,u){var a=i.call(n,t,o);t.depth=o,u.push(t);if(a&&(l=a.length)){var f=-1,l,c=t.children=[],h=0,p=o+1,d;while(++f0){var l=n*f/2;Zn(o,function(e){e.r+=l}),Zn(o,jn),Zn(o,function(e){e.r-=l}),f=Math .max(2*o.r/u,2*o.r/a)}return qn(o,u/2,a/2,1/f),s}var t=d3.layout.hierarchy().sort(Dn),n=0,r=[1,1];return e.size=function(t){return arguments.length?(r=t,e):r},e.padding=function(t){return arguments.length?(n=+t,e):n},Ln(e,t)},d3.layout.cluster=function(){function e(e,i){var s=t.call(this,e,i),o=s[0],u,a=0;Zn(o,function(e){var t=e.children;t&&t.length?(e.x=zn(t),e.y=Un(t)):(e.x=u?a+=n(e,u):0,e.y=0,u=e)});var f=Wn(o),l=Xn(o),c=f.x-n(f,l)/2,h=l.x+n(l,f)/2;return Zn(o,function(e){e.x=(e.x-c)/(h-c)*r[0],e.y=(1-(o.y?e.y/o.y:1))*r[1]}),s}var t=d3.layout.hierarchy().sort(null).value(null),n=Vn,r=[1,1];return e.separation=function(t){return arguments.length?(n=t,e):n},e.size=function(t){return arguments.length?(r=t,e):r},Ln(e,t)},d3.layout.tree=function(){function e(e,i){function s(e,t){var r=e.children,i=e._tree;if(r&&(o=r.length)){var o,a=r[0],f,l=a,c,h=-1;while(++h0&&(tr(nr(o,e,r),e,h),a+=h,f+=h),l+=o._tree.mod,a+=i._tree.mod,c+=u._tree.mod,f+=s._tree.mod;o&&!Jn(s)&&(s._tree.thread=o,s._tree.mod+=l-f),i&&!$n(u)&&(u._tree.thread=i,u._tree.mod+=a-c,r=e)}return r}var a=t.call(this,e,i),f=a[0];Zn(f,function(e,t){e._tree={ancestor:e,prelim:0,mod:0,change:0,shift:0,number:t?t._tree.number+1:0}}),s(f),o(f,-f._tree.prelim);var l=Kn(f,Gn),c=Kn(f,Qn),h=Kn(f,Yn),p=l.x-n(l,c)/2,d=c.x+n(c,l)/2,v=h.depth||1;return Zn(f,function(e){e.x=(e.x-p)/(d-p)*r[0],e.y=e.depth/v*r[1],delete e._tree}),a}var t=d3.layout.hierarchy().sort(null).value(null),n=Vn,r=[1,1];return e.separation=function(t){return arguments.length?(n=t,e):n},e.size=function(t){return arguments.length?(r=t,e):r},Ln(e,t)},d3.layout.treemap=function(){function e(e,t){var n=-1,r=e.length,i,s;while(++n0)u.push(f=a[v-1]),u.area+=f.area,p!=="squarify"||(h=r(u,d))<=c?(a.pop(),c=h):(u.area-=u.pop().area,i(u,d,o,!1),d=Math.min(o.dx,o.dy),u.length=u.area=0,c=Infinity);u.length&&(i(u,d,o,!0),u.length=u.area=0),s.forEach(t)}}function n(t){var r=t.children;if(r&&r.length){var s=l(t),o=r.slice(),u,a=[];e(o,s.dx*s.dy/t.value),a.area=0;while(u=o.pop())a.push(u),a.area+=u.area,u.z!=null&&(i(a,u.z?s.dx:s.dy,s,!o.length),a.length=a.area=0);r.forEach(n)}}function r(e,t){var n=e.area,r,i=0,s=Infinity,o=-1,u=e.length;while(++oi&&(i=r)}return n*=n,t*=t,n?Math.max(t*i*d/n,n/(t*s*d)):Infinity}function i(e,t,n,r){var i=-1,s=e.length,o=n.x,a=n.y,f=t?u(e.area/t):0,l;if(t==n.dx){if(r||f>n.dy)f=n.dy;while(++in.dx)f=n.dx;while(++i=e.x1&&t.x1<=e.x2||t.x2>=e.x1&&t.x2<=e.x2||e.x1>=t.x1&&e.x2<=t.x2)n=!0;if(t.y1>=e.y1&&t.y1<=e.y2||t.y2>=e.y1&&t.y2<=e.y2||e.y1>=t.y1&&e.y2<=t.y2)r=!0;return n&&r},o.detect_overlapping_region=function(e,t){var n="",r="";return e.y1>t.cy&&e.y1t.y1&&e.y2t.cx&&e.x1t.x1&&e.x2this.player_max_left?i=this.player_max_left:i=o&&(t=n+30,t0&&(s.scrollTop(t),this.scrollOffset=this.scrollOffset-30))},f.calculate_positions=function(e){this.window_height=s.height()},f.drag_handler=function(t){var n=t.target.nodeName;if(this.disabled||t.which!==1&&!o)return;if(this.ignore_drag(t))return;var r=this,i=!0;return this.$player=e(t.currentTarget),this.el_init_pos=this.get_actual_pos(this.$player),this.mouse_init_pos=this.get_mouse_pos(t),this.offsetY=this.mouse_init_pos.top-this.el_init_pos.top,this.$body.on(u.move,function(e){var t=r.get_mouse_pos(e),n=Math.abs(t.left-r.mouse_init_pos.left),s=Math.abs(t.top-r.mouse_init_pos.top);return n>r.options.distance||s>r.options.distance?i?(i=!1,r.on_dragstart.call(r,e),!1):(r.is_dragging===!0&&r.on_dragmove.call(r,e),!1):!1}),!1},f.on_dragstart=function(t){t.preventDefault(),this.drag_start=!0,this.is_dragging=!0;var r=this.$container.offset();return this.baseX=Math.round(r.left),this.baseY=Math.round(r.top),this.doc_height=e(n).height(),this.options.helper==="clone"?(this.$helper=this.$player.clone().appendTo(this.$container).addClass("helper"),this.helper=!0):this.helper=!1,this.scrollOffset=0,this.el_init_offset=this.$player.offset(),this.player_width=this.$player.width(),this.player_height=this.$player.height(),this.player_max_left=this.$container.width()-this.player_width+this.options.offset_left,this.options.start&&this.options.start.call(this.$player,t,{helper:this.helper?this.$helper:this.$player}),!1},f.on_dragmove=function(e){var t=this.get_offset(e);this.options.autoscroll&&this.manage_scroll(t),(this.helper?this.$helper:this.$player).css({position:"absolute",left:t.left,top:t.top});var n={position:{left:t.left,top:t.top}};return this.options.drag&&this.options.drag.call(this.$player,e,n),!1},f.on_dragstop=function(e){var t=this.get_offset(e);this.drag_start=!1;var n={position:{left:t.left,top:t.top}};return this.options.stop&&this.options.stop.call(this.$player,e,n),this.helper&&this.$helper.remove(),!1},f.on_select_start=function(e){if(this.disabled)return;if(this.ignore_drag(e))return;return!1},f.enable=function(){this.disabled=!1},f.disable=function(){this.disabled=!0},f.destroy=function(){this.disable(),e.removeData(this.$container,"drag")},f.ignore_drag=function(t){return this.options.handle?!e(t.target).is(this.options.handle):e.inArray(t.target.nodeName,this.options.ignore_dragging)>=0},e.fn.drag=function(t){return this.each(function(){e.data(this,"drag")||e.data(this,"drag",new a(this,t))})}}(jQuery,window,document),function(e,t,n,r){function s(t,n){this.options=e.extend(!0,i,n),this.$el=e(t),this.$wrapper=this.$el.parent(),this.$widgets=this.$el.children(this.options.widget_selector).addClass("gs_w"),this.widgets=[],this.$changed=e([]),this.wrapper_width=this.$wrapper.width(),this.min_widget_width=this.options.widget_margins[0]*2+this.options.widget_base_dimensions[0],this.min_widget_height=this.options.widget_margins[1]*2+this.options.widget_base_dimensions[1],this.init()}var i={namespace:"",widget_selector:"li",widget_margins:[10,10],widget_base_dimensions:[400,225],extra_rows:0,extra_cols:0,min_cols:1,min_rows:15,max_size_x:6,autogenerate_stylesheet:!0,avoid_overlapped_widgets:!0,serialize_params:function(e,t){return{col:t.col,row:t.row,size_x:t.size_x,size_y:t.size_y}},collision:{},draggable:{distance:4}};s.generated_stylesheets=[];var o=s.prototype;o.init=function(){this.generate_grid_and_stylesheet(),this.get_widgets_from_DOM(),this.set_dom_grid_height(),this.$wrapper.addClass("ready"),this.draggable(),e(t).bind("resize",throttle(e.proxy(this.recalculate_faux_grid,this),200))},o.disable=function(){return this.$wrapper.find(".player-revert").removeClass("player-revert"),this.drag_api.disable(),this},o.enable=function(){return this.drag_api.enable(),this},o.add_widget=function(t,n,r,i,s){var o;n||(n=1),r||(r=1),!i&!s?o=this.next_position(n,r):(o={col:i,row:s},this.empty_cells(i,s,n,r));var u=e(t).attr({"data-col":o.col,"data-row":o.row,"data-sizex":n,"data-sizey":r}).addClass("gs_w").appendTo(this.$el).hide();return this.$widgets=this.$widgets.add(u),this.register_widget(u),this.add_faux_rows(o.size_y),this.set_dom_grid_height(),u.fadeIn()},o.resize_widget=function(t,n,r){var i=t.coords().grid;n||(n=i.size_x),r||(r=i.size_y),n>this.cols&&(n=this.cols);var s=this.get_cells_occupied(i),o=i.size_x,u=i.size_y,a=i.col,f=a,l=n>o,c=r>u;if(a+n-1>this.cols){var h=a+(n-1)-this.cols,p=a-h;f=Math.max(1,p)}var d={col:f,row:i.row,size_x:n,size_y:r},v=this.get_cells_occupied(d),m=[];e.each(s.cols,function(t,n){e.inArray(n,v.cols)===-1&&m.push(n)});var g=[];e.each(v.cols,function(t,n){e.inArray(n,s.cols)===-1&&g.push(n)});var y=[];e.each(s.rows,function(t,n){e.inArray(n,v.rows)===-1&&y.push(n)});var b=[];e.each(v.rows,function(t,n){e.inArray(n,s.rows)===-1&&b.push(n)}),this.remove_from_gridmap(i);if(g.length){var w=[f,i.row,n,Math.min(u,r),t];this.empty_cells.apply(this,w)}if(b.length){var E=[f,i.row,n,r,t];this.empty_cells.apply(this,E)}i.col=f,i.size_x=n,i.size_y=r,this.add_to_gridmap(d,t),t.data("coords").update({width:n*this.options.widget_base_dimensions[0]+(n-1)*this.options.widget_margins[0]*2,height:r*this.options.widget_base_dimensions[1]+(r-1)*this.options.widget_margins[1]*2}),r>u&&this.add_faux_rows(r-u),n>o&&this.add_faux_cols(n-o),t.attr({"data-col":f,"data-sizex":n,"data-sizey":r});if(m.length){var S=[m[0],i.row,m.length,Math.min(u,r),t];this.remove_empty_cells.apply(this,S)}if(y.length){var x=[f,i.row,n,r,t];this.remove_empty_cells.apply(this,x)}return t},o.empty_cells=function(t,n,r,i,s){var o=this.widgets_below({col:t,row:n-i,size_x:r,size_y:i});return o.not(s).each(e.proxy(function(t,r){var s=e(r).coords().grid;if(!(s.row<=n+i-1))return;var o=n+i-s.row;this.move_widget_down(e(r),o)},this)),this.set_dom_grid_height(),this},o.remove_empty_cells=function(t,n,r,i,s){var o=this.widgets_below({col:t,row:n,size_x:r,size_y:i});return o.not(s).each(e.proxy(function(t,n){this.move_widget_up(e(n),i)},this)),this.set_dom_grid_height(),this},o.next_position=function(e,t){e||(e=1),t||(t=1);var n=this.gridmap,r=n.length,i=[],s;for(var o=1;o",{"class":"preview-holder","data-row":this.$player.attr("data-row"),"data-col":this.$player.attr("data-col"),css:{width:i.width,height:i.height}}).appendTo(this.$el),this.options.draggable.start&&this.options.draggable.start.call(this,t,n)},o.on_drag=function(e,t){if(this.$player===null)return!1;var n={left:t.position.left+this.baseX,top:t.position.top+this.baseY};this.colliders_data=this.collision_api.get_closest_colliders(n),this.on_overlapped_column_change(this.on_start_overlapping_column,this.on_stop_overlapping_column),this.on_overlapped_row_change(this.on_start_overlapping_row,this.on_stop_overlapping_row),this.helper&&this.$player&&this.$player.css({left:t.position.left,top:t.position.top}),this.options.draggable.drag&&this.options.draggable.drag.call(this,e,t)},o.on_stop_drag=function(e,t){this.$helper.add(this.$player).add(this.$wrapper).removeClass("dragging"),t.position.left=t.position.left+this.baseX,t.position.top=t.position.top+this.baseY,this.colliders_data=this.collision_api.get_closest_colliders(t.position),this.on_overlapped_column_change(this.on_start_overlapping_column,this.on_stop_overlapping_column),this.on_overlapped_row_change(this.on_start_overlapping_row,this.on_stop_overlapping_row),this.$player.addClass("player-revert").removeClass("player").attr({"data-col":this.placeholder_grid_data.col,"data-row":this.placeholder_grid_data.row}).css({left:"",top:""}),this.$changed=this.$changed.add(this.$player),this.cells_occupied_by_player=this.get_cells_occupied(this.placeholder_grid_data),this.set_cells_player_occupies(this.placeholder_grid_data.col,this.placeholder_grid_data.row),this.$player.coords().grid.row=this.placeholder_grid_data.row,this.$player.coords().grid.col=this.placeholder_grid_data.col,this.options.draggable.stop&&this.options.draggable.stop.call(this,e,t),this.$preview_holder.remove(),this.$player=null,this.$helper=null,this.placeholder_grid_data={},this.player_grid_data={},this.cells_occupied_by_placeholder={},this.cells_occupied_by_player={},this.set_dom_grid_height()},o.on_overlapped_column_change=function(t,n){if(!this.colliders_data.length)return;var r=this.get_targeted_columns(this.colliders_data[0].el.data.col),i=this.last_cols.length,s=r.length,o;for(o=0;on.row?1:-1}),t},o.sort_by_row_and_col_asc=function(e){return e=e.sort(function(e,t){return e.row>t.row||e.row===t.row&&e.col>t.col?1:-1}),e},o.sort_by_col_asc=function(e){return e=e.sort(function(e,t){return e.col>t.col?1:-1}),e},o.sort_by_row_desc=function(e){return e=e.sort(function(e,t){return e.row+e.size_y=0&&e.inArray(n,r.rows)>=0},o.is_placeholder_in=function(t,n){var r=this.cells_occupied_by_placeholder||{};return this.is_placeholder_in_col(t)&&e.inArray(n,r.rows)>=0},o.is_placeholder_in_col=function(t){var n=this.cells_occupied_by_placeholder||[];return e.inArray(t,n.cols)>=0},o.is_empty=function(e,t){return typeof this.gridmap[e]!="undefined"&&typeof this.gridmap[e][t]!="undefined"&&this.gridmap[e][t]===!1?!0:!1},o.is_occupied=function(e,t){return this.gridmap[e]?this.gridmap[e][t]?!0:!1:!1},o.is_widget=function(e,t){var n=this.gridmap[e];return n?(n=n[t],n?n:!1):!1},o.is_widget_under_player=function(e,t){return this.is_widget(e,t)?this.is_player_in(e,t):!1},o.get_widgets_under_player=function(t){t||(t=this.cells_occupied_by_player||{cols:[],rows:[]});var n=e([]);return e.each(t.cols,e.proxy(function(r,i){e.each(t.rows,e.proxy(function(e,t){this.is_widget(i,t)&&(n=n.add(this.gridmap[i][t]))},this))},this)),n},o.set_placeholder=function(t,n){var r=e.extend({},this.placeholder_grid_data),i=this.widgets_below({col:r.col,row:r.row,size_y:r.size_y,size_x:r.size_x}),s=t+r.size_x-1;s>this.cols&&(t-=s-t);var o=this.placeholder_grid_data.row0){if(!(this.is_empty(e,u)||this.is_player(e,u)||this.is_widget(e,u)&&o[u].is(s)))break;r[e].push(u),i=u0){if(this.is_widget(s,u)&&!this.is_player_in(s,u)&&!o[u].is(e.el))break;!this.is_player(s,u)&&!this.is_placeholder_in(s,u)&&!this.is_player_in(s,u)&&r[s].push(u),u=t?e[r[0]]:!1},o.get_widgets_overlapped=function(){var t,n=e([]),r=[],i=this.cells_occupied_by_player.rows.slice(0);return i.reverse(),e.each(this.cells_occupied_by_player.cols,e.proxy(function(t,s){e.each(i,e.proxy(function(t,i){if(!this.gridmap[s])return!0;var o=this.gridmap[s][i];this.is_occupied(s,i)&&!this.is_player(o)&&e.inArray(o,r)===-1&&(n=n.add(o),r.push(o))},this))},this)),n},o.on_start_overlapping_column=function(e){this.set_player(e,!1)},o.on_start_overlapping_row=function(e){this.set_player(!1,e)},o.on_stop_overlapping_column=function(e){this.set_player(e,!1);var t=this;this.for_each_widget_below(e,this.cells_occupied_by_player.rows[0],function(e,n){t.move_widget_up(this,t.player_grid_data.size_y)})},o.on_stop_overlapping_row=function(e){this.set_player(!1,e);var t=this,n=this.cells_occupied_by_player.cols;for(var r=0,i=n.length;r0&&this.move_widget_down(r,s)},this)),u.row=a,this.update_widget_position(u,t),t.attr("data-row",u.row),this.$changed=this.$changed.add(t),s.push(t)}},o.can_go_up_to_row=function(t,n,r){var i=this.gridmap,s=!0,o=[],u=t.row,a;this.for_each_column_occupied(t,function(e){var t=i[e];o[e]=[],a=u;while(a--){if(!this.is_empty(e,a)||!!this.is_placeholder_in(e,a))break;o[e].push(a)}if(!o[e].length)return s=!1,!0});if(!s)return!1;a=r;for(a=1;a0?n:0},o.widgets_below=function(t){var n=e.isPlainObject(t)?t:t.coords().grid,r=this,i=this.gridmap,s=n.row+n.size_y-1,o=e([]);return this.for_each_column_occupied(n,function(t){r.for_each_widget_below(t,s,function(t,n){if(!r.is_player(this)&&e.inArray(this,o)===-1)return o=o.add(this),!0})}),this.sort_by_row_asc(o)},o.set_cells_player_occupies=function(e,t){return this.remove_from_gridmap(this.placeholder_grid_data),this.placeholder_grid_data.col=e,this.placeholder_grid_data.row=t,this.add_to_gridmap(this.placeholder_grid_data,this.$player),this},o.empty_cells_player_occupies=function(){return this.remove_from_gridmap(this.placeholder_grid_data),this},o.can_go_up=function(e){var t=e.coords().grid,n=t.row,r=n-1,i=this.gridmap,s=[],o=!0;return n===1?!1:(this.for_each_column_occupied(t,function(e){var t=this.is_widget(e,r);if(this.is_occupied(e,r)||this.is_player(e,r)||this.is_placeholder_in(e,r)||this.is_player_in(e,r))return o=!1,!0}),o)},o.can_move_to=function(e,t,n,r){var i=this.gridmap,s=e.el,o={size_y:e.size_y,size_x:e.size_x,col:t,row:n},u=!0,a=t+e.size_x-1;return a>this.cols?!1:r&&r0&&this.is_widget(r,h)&&e.inArray(o[r][h],c)===-1){u=s.call(o[r][h],r,h),c.push(o[r][h]);if(u)break}},"for_each/below":function(){for(h=i+1,a=o[r].length;h=1;i--)for(e=t[i].length-1;e>=1;e--)if(this.is_widget(i,e)){n.push(e),r[e]=i;break}var s=Math.max.apply(Math,n);return this.highest_occupied_cell={col:r[s],row:s},this.highest_occupied_cell},o.get_widgets_from=function(t,n){var r=this.gridmap,i=e();return t&&(i=i.add(this.$widgets.filter(function(){var n=e(this).attr("data-col");return n===t||n>t}))),n&&(i=i.add(this.$widgets.filter(function(){var t=e(this).attr("data-row");return t===n||t>n}))),i},o.set_dom_grid_height=function(){var e=this.get_highest_occupied_cell().row;return this.$el.css("height",e*this.min_widget_height),this},o.generate_stylesheet=function(t){var n="",r=this.options.max_size_x,i=0,o=0,u,a;t||(t={}),t.cols||(t.cols=this.cols),t.rows||(t.rows=this.rows),t.namespace||(t.namespace=this.options.namespace),t.widget_base_dimensions||(t.widget_base_dimensions=this.options.widget_base_dimensions),t.widget_margins||(t.widget_margins=this.options.widget_margins),t.min_widget_width=t.widget_margins[0]*2+t.widget_base_dimensions[0],t.min_widget_height=t.widget_margins[1]*2+t.widget_base_dimensions[1];var f=e.param(t);if(e.inArray(f,s.generated_stylesheets)>=0)return!1;s.generated_stylesheets.push(f);for(u=t.cols;u>=0;u--)n+=t.namespace+' [data-col="'+(u+1)+'"] { left:'+(u*t.widget_base_dimensions[0]+u*t.widget_margins[0]+(u+1)*t.widget_margins[0])+"px;} ";for(u=t.rows;u>=0;u--)n+=t.namespace+' [data-row="'+(u+1)+'"] { top:'+(u*t.widget_base_dimensions[1]+u*t.widget_margins[1]+(u+1)*t.widget_margins[1])+"px;} ";for(var l=1;l<=t.rows;l++)n+=t.namespace+' [data-sizey="'+l+'"] { height:'+(l*t.widget_base_dimensions[1]+(l-1)*t.widget_margins[1]*2)+"px;}";for(var c=1;c<=r;c++)n+=t.namespace+' [data-sizex="'+c+'"] { width:'+(c*t.widget_base_dimensions[0]+(c-1)*t.widget_margins[0]*2)+"px;}";return this.add_style_tag(n)},o.add_style_tag=function(e){var t=n,r=t.createElement("style");return t.getElementsByTagName("head")[0].appendChild(r),r.setAttribute("type","text/css"),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(n.createTextNode(e)),this},o.generate_faux_grid=function(e,t){this.faux_grid=[],this.gridmap=[];var n,r;for(n=t;n>0;n--){this.gridmap[n]=[];for(r=e;r>0;r--)this.add_faux_cell(r,n)}return this},o.add_faux_cell=function(t,n){var r=e({left:this.baseX+(n-1)*this.min_widget_width,top:this.baseY+(t-1)*this.min_widget_height,width:this.min_widget_width,height:this.min_widget_height,col:n,row:t,original_col:n,original_row:t}).coords();return e.isArray(this.gridmap[n])||(this.gridmap[n]=[]),this.gridmap[n][t]=!1,this.faux_grid.push(r),this},o.add_faux_rows=function(e){var t=this.rows,n=t+(e||1);for(var r=n;r>t;r--)for(var i=this.cols;i>=1;i--)this.add_faux_cell(r,i);return this.rows=n,this.options.autogenerate_stylesheet&&this.generate_stylesheet(),this},o.add_faux_cols=function(e){var t=this.cols,n=t+(e||1);for(var r=t;r=1;i--)this.add_faux_cell(i,r);return this.cols=n,this.options.autogenerate_stylesheet&&this.generate_stylesheet(),this},o.recalculate_faux_grid=function(){var n=this.$wrapper.width();return this.baseX=(e(t).width()-n)/2,this.baseY=this.$wrapper.offset().top,e.each(this.faux_grid,e.proxy(function(e,t){this.faux_grid[e]=t.update({left:this.baseX+(t.data.col-1)*this.min_widget_width,top:this.baseY+(t.data.row-1)*this.min_widget_height})},this)),this},o.get_widgets_from_DOM=function(){return this.$widgets.each(e.proxy(function(t,n){this.register_widget(e(n))},this)),this},o.generate_grid_and_stylesheet=function(){var n=this.$wrapper.width(),r=this.$wrapper.height(),i=Math.floor(n/this.min_widget_width)+this.options.extra_cols,s=this.$widgets.map(function(){return e(this).attr("data-col")});s=Array.prototype.slice.call(s,0),s.length||(s=[0]);var o=Math.max.apply(Math,s),u=this.options.extra_rows;return this.$widgets.each(function(t,n){u+=+e(n).attr("data-sizey")}),this.cols=Math.max(o,i,this.options.min_cols),this.rows=Math.max(u,this.options.min_rows),this.baseX=(e(t).width()-n)/2,this.baseY=this.$wrapper.offset().top,this.options.autogenerate_stylesheet&&this.generate_stylesheet(),this.generate_faux_grid(this.rows,this.cols)},e.fn.gridster=function(t){return this.each(function(){e(this).data("gridster")||e(this).data("gridster",new s(this,t))})},e.Gridster=o}(jQuery,window,document),vizjslib_git_revision="6c6bf1471f91c28dc83253ad74ed2a6848c1c538",vizjslib_git_tag="2.1.5-46-g6c6bf14",function(){function n(e,t,n){var r="";if(!t||t.length===0)return r;for(var i=0;i-1&&(f=t.getMetrics(),i(t,a,f,o))}):$.each(u,function(e,t){f=t.getMetrics(),i(t,a,f,o)}),config=o,a.summary=r("report-summary",config),a.summary.config.xaxis={noTickets:10,showLabels:!0},a.summary.config.handles={show:!0},a.summary.config.selection={mode:"x"},a.summary.config.mouse={},a.connection={name:"report-connection",adapterConstructor:e.components.QuadraticDrawing},a}function o(e,t){var n=[],r=null;return $.each(e,function(e,n){if(n.getMetrics()[t])return r=n,!1}),n.push(r),$.each(e,function(e,t){if(t===r)return;n.push(t)}),n}function u(n,r){var i=n.data.main_metric;t=n.data,r||(r=Report.getDataSources()),r=o(r,i);var u=[];for(var a=0;a-1?n.setCompaniesData([]):f(n.getCompaniesDataFile(),n.setCompaniesData,n)})}function c(){var e=["mediawiki"],t=Report.getDataSources();$.each(t,function(t,n){$.inArray(n.getName(),e)>-1?n.setReposData([]):f(n.getReposDataFile(),n.setReposData,n)}),f(Report.getReposMapFile(),Report.setReposMap)}function h(){var e=["irc","mediawiki"],t=Report.getDataSources();$.each(t,function(t,n){$.inArray(n.getName(),e)>-1?n.setCountriesData([]):f(n.getCountriesDataFile(),n.setCountriesData,n)})}function p(){var e=["irc","mediawiki"],t=Report.getDataSources();$.each(t,function(t,n){$.inArray(n.getName(),e)>-1?n.setDomainsData([]):f(n.getDomainsDataFile(),n.setDomainsData,n)})}function d(){var e=["irc","mediawiki"],t=Report.getDataSources();$.each(t,function(t,n){$.inArray(n.getName(),e)>-1?n.setProjectsData([]):f(n.getProjectsDataFile(),n.setProjectsData,n)})}function v(){var e=Report.getDataSources();$.each(e,function(e,t){t.getName()==="its"&&f(t.getTimeToFixDataFile(),t.setTimeToFixData,t)})}function m(){var e=Report.getDataSources();$.each(e,function(e,t){t.getName()==="its"&&f(t.getMarkovTableDataFile(),t.setMarkovTableData,t)})}function g(){var e=Report.getDataSources();$.each(e,function(e,t){t.getName()==="mls"&&f(t.getTimeToAttentionDataFile(),t.setTimeToAttentionData,t)})}function y(){var e=Report.getDataSources();$.each(e,function(e,t){f(t.getDemographicsAgingFile(),t.setDemographicsAgingData,t),f(t.getDemographicsBirthFile(),t.setDemographicsBirthData,t)})}function b(e){var t=Report.getDataSources();$.each(t,function(e,t){var n=t.getTopDataFile();$.when($.getJSON(n)).done(function(e){t.setGlobalTopData(e),D()}).fail(function(){t.setGlobalTopData([],t),D()})})}function w(e,t){var n=null;return $.each(Report.getDataSources(),function(r,i){if(t=="repos"&&$.inArray(e,i.getReposData())>-1)return n=i,!1;if(t=="companies"&&$.inArray(e,i.getCompaniesData())>-1)return n=i,!1;if(t=="countries"&&$.inArray(e,i.getCountriesData())>-1)return n=i,!1;if(t=="domains"&&$.inArray(e,i.getDomainsData())>-1)return n=i,!1;if(t=="projects"&&$.inArray(e,i.getProjectsData())>-1)return n=i,!1}),n}function E(e){var t="";return e==="repos"?t="rep":e==="companies"?t="com":e==="countries"?t="cou":e==="domains"?t="dom":e==="projects"&&(t="prj"),t}function S(){var e=Report.getDataSources();$.each(e,function(e,t){f(t.getDataFile(),t.setData,t),f(t.getGlobalDataFile(),t.setGlobalData,t),t instanceof MLS&&f(t.getListsFile(),t.setListsData,t)})}function x(){f("VizGrimoireJS/data/metrics.json",Report.setMetricsDefinition)}function T(){var e=Report.getDataSources();$.each(e,function(e,t){f(t.getPeopleDataFile(),t.setPeopleData,t)})}function N(){f(Report.getDataDir()+"/people.json",Report.setPeopleIdentities)}function C(e){return e.getCompaniesData()===null?!1:!0}function k(e){return e.getReposData()===null?!1:!0}function L(e){return e.getCountriesData()===null?!1:!0}function A(e){return e.getDomainsData()===null?!1:!0}function O(e){return e.getProjectsData()===null?!1:!0}function M(){var e=0,t=Report.getProjectsData(),n=Report.getProjectsDirs();for(var r in t)e++;return e-1&&l(),$.inArray("repositories",i)>-1&&c(),$.inArray("countries",i)>-1&&h(),$.inArray("domains",i)>-1&&p(),$.inArray("projects",i)>-1&&d(),$.inArray("people",i)>-1&&(T(),N())}else l(),c(),h(),p(),d(),T(),N()},Loader.get_file_data_div=function(e,t,n){$.when($.getJSON(e)).done(function(r){t(n,e,r)}).fail(function(){t(e,null)})},Loader.check_filters_page=function(e){var t=!0,n=["repos","companies","countries"];return $.each(n,function(n,r){if(!Loader.check_filter_page(e,r))return t=!1,!1}),t},Loader.check_filter_page=function(e,t){var n=!0;e===undefined&&(e=1);var r=Report.getPageSize()*(e-1),i=r+Report.getPageSize();return $.each(Report.getDataSources(),function(e,s){var o=0;t==="repos"&&(o=s.getReposData().length),t==="companies"&&(o=s.getCompaniesData().length),t==="countries"&&(o=s.getCountriesData().length),t==="domains"&&(o=s.getDomainsData().length),t==="projects"&&(o=s.getProjectsData().length),i>o&&(i=o);for(var u=r;u=0&&Loader.data_load_item_top(e,ds,null,Convert.convertFilterTop,t,"top"),!1)):n},Loader.FilterItemCheck=function(e,t){var n=!0,r,i=Report.getReposMap();if(t==="repos"){if(Loader.check_item(e,t)===!1)return r=w(e,t),r===null?(Report.log("Can't find data source for "+e),!0):(Loader.data_load_item(e,r,null,Convert.convertFilterStudyItem,t,null),$.inArray(r.getName(),u)>=0&&Loader.data_load_item_top(e,r,null,Convert.convertFilterStudyItem,t),!1);if(i!==undefined&&i.length!==0){var s=[];$.each(Report.getDataSources(),function(n,r){var i=Convert.getRealItem(r,t,e);i!==undefined&&i!==null&&s.push(i)});if(Loader.check_items(s,t)===!1){for(var a=0;a=0&&$.inArray(e,s.getReposData())>=0&&s.getRepositoriesTopData()[e]!==undefined)return r=!0,!1}else if(s.getReposGlobalData()[e]!==undefined&&s.getReposMetricsData()[e]!==undefined)return r=!0,!1}else if(t==="companies"){var a=s.getCompaniesData();if(a.length===0)r=!0;else if($.inArray(e,a)===-1)r=!0;else{if(s.getCompaniesGlobalData()[e]===undefined||s.getCompaniesMetricsData()[e]===undefined)return r=!1,!1;if($.inArray(s.getName(),o)===-1&&s.getCompaniesTopData()[e]===undefined)return r=!1,!1;r=!0}}else if(t==="countries"){var f=s.getCountriesData();if(f.length===0)r=!0;else if($.inArray(e,f)===-1)r=!0;else{if(s.getCountriesGlobalData()[e]===undefined||s.getCountriesMetricsData()[e]===undefined)return r=!1,!1;r=!0}}else if(t==="domains"){var l=s.getDomainsData();if(l.length===0)r=!0;else if($.inArray(e,l)===-1)r=!0;else{if(s.getDomainsGlobalData()[e]===undefined||s.getDomainsMetricsData()[e]===undefined)return r=!1,!1;r=!0}}else if(t==="projects"){var c=s.getProjectsData();if(c.length===0)r=!0;else if($.inArray(e,c)===-1)r=!0;else{if(s.getProjectsGlobalData()[e]===undefined||s.getProjectsMetricsData()[e]===undefined)return r=!1,!1;r=!0}}}),r},Loader.check_items=function(e,t){var n=!0;return $.each(e,function(e,r){if(Loader.check_item(r,t)===!1)return n=!1,!1}),n},Loader.data_load_items_page=function(e,t,n,r){t===undefined&&(t=1);if(r==="repos"&&e.getReposData()===null)return!1;if(r==="companies"&&e.getCompaniesData()===null)return!1;if(r==="countries"&&e.getCountriesData()===null)return!1;if(r==="domains"&&e.getDomainsData()===null)return!1;if(r==="projects"&&e.getProjectsData()===null)return!1;var i=0;r==="repos"&&(i=e.getReposData().length),r==="companies"&&(i=e.getCompaniesData().length),r==="countries"&&(i=e.getCountriesData().length),r==="domains"&&(i=e.getDomainsData().length),r==="projects"&&(i=e.getProjectsData().length);if(i===0)return!0;var s=Report.getPageSize()*(t-1),o=s+Report.getPageSize();o>i&&(o=i);for(var u=s;u-1){t.addRepoMetricsData(e,[],t),t.addRepoGlobalData(e,[],t);return}}else if(i==="companies"){if($.inArray(t.getName(),u)>-1){t.addCompanyMetricsData(e,[],t),t.addCompanyGlobalData(e,[],t);return}}else if(i==="countries"){if($.inArray(t.getName(),o)>-1){t.addCountryMetricsData(e,[],t),t.addCountryGlobalData(e,[],t);return}}else if(i==="domains"){if($.inArray(t.getName(),a)>-1){t.addDomainMetricsData(e,[],t),t.addDomainGlobalData(e,[],t);return}}else{if(i!=="projects")return;if($.inArray(t.getName(),l)>-1){t.addDomainMetricsData(e,[],t),t.addDomainGlobalData(e,[],t);return}}var c=encodeURIComponent(e),h=t.getDataDir()+"/"+c+"-";h+=t.getName()+"-"+E(i);var p=h+"-evolutionary.json",d=h+"-static.json";$.when($.getJSON(p),$.getJSON(d)).done(function(n,r){i==="repos"?(t.addRepoMetricsData(e,n[0],t),t.addRepoGlobalData(e,r[0],t)):i==="companies"?(t.addCompanyMetricsData(e,n[0],t),t.addCompanyGlobalData(e,r[0],t)):i==="countries"?(t.addCountryMetricsData(e,n[0],t),t.addCountryGlobalData(e,r[0],t)):i==="domains"?(t.addDomainMetricsData(e,n[0],t),t.addDomainGlobalData(e,r[0],t)):i==="projects"&&(t.addProjectMetricsData(e,n[0],t),t.addProjectGlobalData(e,r[0],t))}).always(function(){n!==null?Loader.check_filter_page(n,i)&&(r.called_page===undefined?(r.called_page={},r.called_page[i]=!0,r(i)):r.called_page[i]||(r(i),r.called_page[i]=!0)):s!==null?Loader.check_items(s,i)&&(r.called_map===undefined?(r.called_map={},r.called_map[i]=!0,r(i)):r.called_map[i]||(r(i),r.called_map[i]=!0)):Loader.check_item(e,i)&&(r.called_item===undefined?(r.called_item={},r.called_item[i]=!0,r(i,e)):r.called_item[i]||(r(i,e),r.called_item[i]=!0))})},Loader.check_data_loaded=function(){var e=!0;if(!_())return!1;var t=Report.getDataSources(),n=["companies","repositories","countries","domains","projects"];return Report.getConfig()!==null&&Report.getConfig().reports!==undefined&&(n=Report.getConfig().reports),$.each(t,function(t,r){if(r.getPeopleData()===null)return e=!1,!1;if($.inArray("companies",n)>-1&&!C(r))return e=!1,!1;if($.inArray("repositories",n)>-1&&!k(r))return e=!1,!1;if($.inArray("countries",n)>-1&&!L(r))return e=!1,!1;if($.inArray("domains",n)>-1&&!A(r))return e=!1,!1;if($.inArray("projects",n)>-1&&!O(r))return e=!1,!1;if(r instanceof MLS&&r.getListsData()===null)return e=!1,!1}),e}})();var DataProcess={};(function(){DataProcess.info=function(){},DataProcess.paginate=function(e,t){if(t===undefined||t===0||isNaN(t))return e;var n=[],r=Report.getPageSize(),i=(t-1)*r;for(var s=i;s-1&&(t=e.split("@")[0]),t},DataProcess.selectPersonName=function(e){var t="",n,r;for(var i=0;it.length&&(t=n);return t},DataProcess.selectPersonEmail=function(e){var t="",n,r;for(var i=0;i=0;u--){if(e[n][u]!==0){i===-1&&(i=s),s=o-i)continue;n[a].push(e[a][u])}}return n},DataProcess.filterDates=function(e,t,n){var r={};return $.each(n,function(i,s){r[i]=[],$.each(s,function(s,o){var u=n.unixtime[s];u>e&&(!t||t&&u<=t)&&r[i].push(o)})}),r},DataProcess.filterYear=function(e,t){e=parseInt(e,null);var n=(new Date(e.toString())).getTime(),r=(new Date((e+1).toString())).getTime(),i=filterDates(n,r,t);return i},DataProcess.fillDates=function(e,t){if(e[0].length===0)return t;var n=[[],[]],r=0;if(e[0][0]>t[0][0])for(r=0;r-1){var s=[];s[0]=e[r][0];for(var o=1;o1&&(params=document.URL.split("?")[1]),params}function n(){return aux=document.URL.split("?")[0].split("/"),res=aux[aux.length-1],res}function r(e){return url=e,t().length>0&&(url+="?"+t()),url}function i(t){return url=t,e()&&(url+="?release="+$.urlParam("release")),url}Utils.paramsInURL=t,Utils.isReleasePage=e,Utils.filenameInURL=n,Utils.createLink=r,Utils.createReleaseLink=i,$.urlParam=function(e){var t=(new RegExp("[?&]"+e+"=([^&#]*)")).exec(window.location.href);return t===null?null:t[1]||0}})();var HTMLComposer={};(function(){function e(e,t){var n='
';return n+='
',n+='
',n+='
',n+="

"+u(e)+"

",n+="
",n+='
',n+='
',n+="
",n+='
',n+='
',r+="
",r+='
',r+='
',$.each(n,function(n,i){r+='


',r+='
',r+='
',r+='
',r+="
"}),r+="
",r}function n(e,t,n){var r="";r+='";var i="";return $.each(t,function(t,o){e.getMetrics()[t]?(r+=i+e.getMetrics()[t].name,t==="first_date"||t==="last_date"?r+='

'+u(e.getName())+"

",s="
'+o+s:r+=''+Report.formatValue(o)+s):n[t]&&(r+=i+n[t],t==="first_date"||t==="last_date"?r+=''+o+s:r+=''+Report.formatValue(o)+s)}),r+="
",r}function r(e,t){var n="";return n+="",n+="
",n+="First contribution:
",n+="  "+t.first_date,n+="
",n+="Last contribution:
",n+="  "+t.last_date,n+="
",e=="scm"?n+="Commits:
  "+t.scm_commits:e=="its"?n+="Closed:
  "+t.its_closed:e=="mls"?n+="Sent:
  "+t.mls_sent:e=="irc"?n+="Sent:
  "+t.irc_sent:e=="scr"&&(n+="Closed:
  "+t.scr_closed),n+="
",n}function s(e,t){var n='

  ';return e.length>0?n+=e:t.length>0&&(t.indexOf("@")>0&&(t=t.split("@")[0]),n+=t),n+="

",n}function o(e,t){var n='

';return t==="companies"&&(n+='   '),n+=e,n+="

",n}function u(e){var t="";return e==="scm"?t=' Source Code Management':e==="scr"?t=' Source Code Review':e==="its"?t=' Issue tracking system':e==="mls"?t=' Mailing Lists':e==="irc"?t=' IRC Channels':e==="mediawiki"?t=' Wiki':e==="releases"&&(t=' Releases'),t}function a(){return html="",params="?data_dir="+$.urlParam("data_dir")+"&release="+$.urlParam("release"),html+='
',html+='
  • Source code repositories by companies
  • ',html+='
  • Mailing Lists by companies
  • ',html+='
  • Tickets by companies
  • ',html}function f(e,t){return t.length===0?"":(unsupported=["irc.html","qaforums.html","project.html"],ah_label=" All history ",label=e,label===null?label=ah_label:(label=" Release "+label[0].toUpperCase()+label.substring(1)+" ",t.reverse().push(ah_label),t.reverse()),html='
    ',html+='",html+='",html+="
    ",html)}function l(e,t,n,r){return html="",html+="",html+='
    ',blabels=t.split(","),bmetrics=n.split(","),html+=h(e,blabels,bmetrics),html+='
    ',tsm=r.split(","),html+=p(e,tsm[0]),html+="
    ",html+='
    ',html+=p(e,tsm[1]),html+="
    ",html+="
    ",html+="",html}function c(e,t,n,r){return html="",html+='
    ',html+='
    ',html+='
    '+t+"
    ",html+="
    ",html+='
    ',html+='
    ',target_page=Utils.createLink(n+".html"),html+=' ',html+="",html+="
    ",html+="
    ",html+="
    ",html}function h(e,t,n){return html="",html+="",html+='
    ',html+='
    ',html+='
    ',html+='
    '+t[0]+"
    ",html+="
    ",html+='
    ',html+='
    ',target_page=Utils.createLink(e+".html"),html+=' ',html+="",html+="
    ",html+="
    ",html+='
    ',t.length===2&&n.length===2?html+=c("12",t[1],e,n[1]):t.length===3&&n.length===3?(html+=c("6",t[1],e,n[1]),html+=c("6",t[2],e,n[2])):t.length===4&&n.length===4&&(html+=c("4",t[1],e,n[1]),html+=c("4",t[2],e,n[2]),html+=c("4",t[3],e,n[3])),html+="
    ",html+="
    ",html+="
    ",html+="",html}function p(e,t){return html="",html+='
    ',html+='
    ',html+="",html+="
    ",html}function d(e,t,n,r){text={companies:"Companies","companies-summary":"Companies summary",contributors:"Contributors",countries:"Countries",domains:"Domains",projects:"Projects",repos:"Repositories",tags:"Tags",states:"States"},html="",html+='",html}function v(){return html="",html+="",html+='
    ',html+='
    ',html+='
      ',html+='
    • =0&&(link_exists=!0),Utils.isReleasePage()&&link_exists?(link_to=Utils.createReleaseLink(e),html=''+t+""):link_exists?html=''+t+"":html=t}catch(r){html=t}return html}HTMLComposer.personDSBlock=e,HTMLComposer.filterDSBlock=t,HTMLComposer.DSBlock=l,HTMLComposer.repositorySummaryTable=n,HTMLComposer.personSummaryTable=r,HTMLComposer.personName=s,HTMLComposer.itemName=o,HTMLComposer.sideMenu4Release=a,HTMLComposer.releaseSelector=f,HTMLComposer.sideBarLinks=d,HTMLComposer.overallSummaryBlock=v,HTMLComposer.smartLinks=m})();var Convert={};(function(){function e(e,t){return t.hasOwnProperty(e)&&t[e].title?t[e].title:undefined}function t(e,t){return e.project_idt.project_id?1:0}function n(e,t){var n=[],r=e,i="",s={};while(t[r].hasOwnProperty("parent_project"))i=t[r].parent_project,s=t[i],s.project_id=i,n.push(s),r=i;return n.reverse()}function r(e,n){var r=[],i={};return $.each(n,function(t,s){n[t].parent_project===e&&(i=n[t],i.project_id=t,r.push(i))}),r.sort(t),r}function i(t,n,i){var s="",o=n.length;return o>0?(s+='
    • "):s+="
    • "+e(t,i)+"
    • ",s}function s(e){var t='",t}function o(e){var t="";return t=e.replace(" ","_"),t=t.toLowerCase(),t}function u(t,n,i){var s="",a=n.length,f=o(t);return a>0?(s+="
    • ",s+=''+e(t,i)+"",s+=' '+a+' subprojects
        ',$.each(n,function(e,t){gchildren=r(t.project_id,i),s+=u(t.project_id,gchildren,i)}),s+="
    • "):s+='
    • '+e(t,i)+"
    • ",s}function a(){var e="
        ",t=Report.getProjectsHierarchy();if(t.length===0)return"";project_id="root";var i=r(project_id,t),s=n(project_id,t);return $.each(i,function(n,i){grandchildren=r(i.project_id,t),e+=u(i.project_id,grandchildren,t)}),e+="
      ",e}function f(){var e=[],t={data_sources:"Data sources",project_map:"Project map",people:"Contributor",company:"Company",country:"Country",domain:"Domain","scm-companies":"Activity on code repositories by companies","mls-companies":"Activity on mailing lists by companies","its-companies":"Activity on issue trackers by companies"};url_no_params=document.URL.split("?")[0],url_tokens=url_no_params.split("/");var n=url_tokens[url_tokens.length-1].split(".")[0];return n==="project"||n==="index"||n==="release"||n===""?[]:t.hasOwnProperty(n)?(e.push([n,t[n]]),e):[["#","Unavailable section name"]]}function l(){var e=[],t={mls:"MLS overview",irc:"IRC overview",its:"ITS overview",qaforums:"QA Forums overview",scr:"Code Review overview",scm:"SCM overview",wiki:"Wiki overview",data_sources:"Data sources",project_map:"Project map",people:"Contributor",company:"Company",country:"Country",domain:"Domain",release:"Companies analysis by release"},n={companies:"Activity by companies",contributors:"Activity by contributors",countries:"Activity by companies",domains:"Activity by domains",projects:"Activity by project",repos:"Activity by repositories",states:"Activity by states",tags:"Activity by tags"},r={repository:"Repository"};url_no_params=document.URL.split("?")[0],url_tokens=url_no_params.split("/");var i=url_tokens[url_tokens.length-1].split(".")[0];if(i==="project"||i==="index"||i==="")return[];var s=i.split("-");return s[0]==="repository"&&(ds_name=$.urlParam("ds"),s=[ds_name,"repos","repository"]),t.hasOwnProperty(s[0])?(e.push([s[0],t[s[0]]]),s.length>0&&n.hasOwnProperty(s[1])&&(e.push([s[0]+"-"+s[1],n[s[1]]]),s.length>2&&r.hasOwnProperty(s[2])&&e.push([s[0],r[s[2]]])),e):[["#","Unavailable section name"]]}function c(){return $.urlParam("release")!==null&&$.urlParam("release").length>0?!0:!1}function h(e){e===undefined&&(e="root");var t="",n="";t+='",t}function p(e){var t='",t}function d(e){var t=Report.getParameterByName("repository");if(t&&$.inArray(t,e.getReposData())<0)return"";var n=e.getName(),r="",i=e.getLabelForRepository(),s=e.getLabelForRepositories();return t!==undefined?r=t:r="All "+s,html='
      ',html='
      1. Filtered by '+i+":  
      2. ",html+='
      ",html+="
      ",html}function v(){data=Report.getProjectData(),document.title=data.project_name+" Report by Bitergia",data.title&&(document.title=data.title),$(".report_date").text(data.date),$(".report_name").text(data.project_name),str=data.blog_url,str&&str.length>0?($("#blogEntry").html("
      Blog post with some more details"),$(".blog_url").attr("href",data.blog_url)):$("#more_info").hide(),str=data.producer,str&&str.length>0?$("#producer").html(str):$("#producer").html("Bitergia"),$(".project_name").text(data.project_name),$("#project_url").attr("href",data.project_url)}function m(e,t){t.help=!0;var n=$(e).data("help");n!==undefined&&(t.help=n),t.show_legend=!1,$(e).data("frame-time")&&(t.frame_time=!0),t.graph=$(e).data("graph"),$(e).data("min")&&(t.show_legend=!1,t.show_labels=!0,t.show_grid=!0,t.help=!1),$(e).data("legend")&&(t.show_legend=!0),t.ligth_style=!1,$(e).data("light-style")&&(t.light_style=!0),$(e).data("custom-title")&&(t.custom_title=$(e).data("custom-title")),t.help&&$(e).data("custom-help")?t.custom_help=$(e).data("custom-help"):t.custom_help="",$(e).data("repo-filter")&&(t.repo_filter=$(e).data("repo-filter"));var r=$(e).data("start");r&&(t.start_time=r);var i=$(e).data("end");i&&(t.end_time=i);var s=$(e).data("remove-last-point");return s&&(t.remove_last_point=!0),t}function g(){return Math.floor(Math.random()*1e3+1)}function y(e,t){if(e==="repos"){if(DS.getReposGlobalData()[t]===undefined||DS.getReposGlobalData()[t].length===0)return!1}else if(e==="companies"){if(DS.getCompaniesGlobalData()[t]===undefined||DS.getCompaniesGlobalData()[t].length===0)return!1}else if(e==="countries"){if(DS.getCountriesGlobalData()[t]===undefined||DS.getCountriesGlobalData()[t].length===0)return!1}else if(e==="companies")if(DS.getDomainsGlobalData()[t]===undefined||DS.getDomainsGlobalData()[t].length===0)return!1;return!0}function b(){var e={};return e.show_desc=!1,e.show_title=!1,e.show_labels=!0,e.show_legend=!1,e}Convert.convertMicrodashText=function(){var e=$(".MicrodashText");e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("metric"),r=$(this).data("name"),i=Report.getMetricDS(n)[0];if(i===undefined)return;var s=i.getGlobalData()[n],o='
      ';r&&(o+='
      ',o+=''+i.basic_metrics[n].name+"",o+="
      "),$.each([365,30,7],function(e,t){var s=i.getMetrics()[n].column,u=i.getGlobalData()[n+"_"+t],a=i.getGlobalData()["diff_net"+s+"_"+t],f=i.getGlobalData()["percentage_"+s+"_"+t];f=Math.round(f*10)/10;if(u===undefined)return;var l="";f===0?l=Math.abs(f):a>0?l="+"+f:a<0&&(l="-"+Math.abs(f)),r?o+='
      ':o+='
      ',o+='Last '+t+" days:",o+=" "+Report.formatValue(u)+"
      ",f===0?o+='  '+l+"% ":a>0?o+='  '+l+"% ":a<0&&(o+='  '+l+"% "),o+="
      "}),o+="
      ",$(t).append(o)})},Convert.convertMicrodash=function(){var e=$(".Microdash");e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("metric"),r=$(this).data("text"),i=Report.getMetricDS(n)[0],s=i.getGlobalData()[n],o="
      ";o+='
      ',o+=''+Report.formatValue(s),o+=" "+i.getMetrics()[n].name,o+="
      ",o+='
      ',o+='
      ',$.each([365,30,7],function(e,t){var r=i.getMetrics()[n].column,s=i.getGlobalData()["diff_net"+r+"_"+t],u=i.getGlobalData()["percentage_"+r+"_"+t],a=i.getGlobalData()[n+"_"+t];if(a===undefined)return;o+=""+t+" Days Change:"+Report.formatValue(a)+" ",s===0?o+="":s>0?(o+='',o+="(+"+u+"%) "):s<0&&(o+='',o+="(-"+Math.abs(u)+"%) ")}),o+="
      ",o+="
      ",$(t).append(o)})},Convert.convertSideBar=function(e){var t=$(".SideNavBar");t.length>0&&$.each(t,function(t,n){$(this).empty(),n.id||(n.id="SideNavBar");var r;e&&(r=Report.cleanLabel(e));var i=h(r);$("#"+n.id).append(i),data=Report.getProjectData(),$(".report_name").text(data.project_name)})},Convert.convertProjectNavBar=function(e){var t=$(".ProjectNavBar");t.length>0&&$.each(t,function(t,n){$(this).empty(),n.id||(n.id="ProjectNavBar");var r;e&&(r=Report.cleanLabel(e));var i=s(r);$("#"+n.id).append(i)})},Convert.convertNavbar=function(){$.get(Report.getHtmlDir()+"navbar.html",function(e){$("#Navbar").html(e);var t=Report.getParameterByName("project");Convert.convertProjectNavBar(t),Convert.convertReleaseSelector(),Convert.convertSideBar(t)})},Convert.convertReleaseSelector=function(){var e=Report.getReleaseNames();if(e.length>0){var t=$(".ReleaseSelector");t.length>0&&$.each(t,function(t,n){$(this).empty(),n.id||(n.id="ReleaseSelector"+g());var r=HTMLComposer.releaseSelector($.urlParam("release"),e);$("#"+n.id).append(r)})}},Convert.convertSectionBreadcrumb=function(e){var t=$(".SectionBreadcrumb");t.length>0&&$.each(t,function(t,n){$(this).empty(),n.id||(n.id="SectionBreadcrumb");var r;e&&(r=Report.cleanLabel(e));var i=p(r);$("#"+n.id).append(i)})},Convert.convertProjectMap=function(){var e=$(".ProjectMap");e.length>0&&$.each(e,function(e,t){$(this).empty(),t.id||(t.id="ProjectMap");var n,r=a();$("#"+t.id).append(r)})},Convert.convertFooter=function(){$.get(Report.getHtmlDir()+"footer.html",function(e){$("#Footer").html(e),$("#vizjs-lib-version").append(vizjslib_git_tag)})},Convert.convertSummary=function(){div_param="Summary";var e=$("."+div_param);e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("data-source"),r=Report.getDataSourceByName(n);if(r===null)return;t.id=n+"-Summary",r.displayGlobalSummary(t.id)})},Convert.convertRepositorySelector=function(){var e=$(".repository-selector");e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("data-source"),r=Report.getDataSourceByName(n);if(r===null)return;t.id=n+"-repository-selector";var i=d(r);$("#"+t.id).append(i)})},Convert.convertRefcard=function(){$.when($.get(Report.getHtmlDir()+"refcard.html"),$.get(Report.getHtmlDir()+"project-card.html")).done(function(e,t){refcard=e[0],projcard=t[0],$("#Refcard").html(refcard),v(),$.each(Report.getProjectsData(),function(e,t){var n="card-"+e.replace(".","").replace(" ","");$("#Refcard #projects_info").append(projcard),$("#Refcard #projects_info #new_card").attr("id",n),$.each(Report.getDataSources(),function(t,r){if(r.getProject()!==e){$("#"+n+" ."+r.getName()+"-info").hide();return}r.displayData(n)}),$("#"+n+" #project_name").text(e),Report.getProjectsDirs.length>1&&$("#"+n+" .project_info").append(' Report'),$("#"+n+" #project_url").attr("href",t.url)})})},Convert.convertGlobalData=function(){var e=$(".GlobalData");e.length>0&&$.each(e,function(e,t){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;var n=DS.getGlobalData(),r=$(this).data("field");$(this).text(Report.formatValue(n[r],r))})},Convert.convertProjectData=function(){var e=$(".ProjectData"),t=Report.getParameterByName("project");e.length>0&&$.each(e,function(e,n){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;var r=DS.getProjectsGlobalData()[t],i=$(this).data("field");$(this).text(Report.formatValue(r[i],i))})},Convert.convertRadarActivity=function(){var e="RadarActivity",t=$("#"+e);t.length>0&&($.each(t,function(e,t){$(this).empty()}),Viz.displayRadarActivity(e))},Convert.convertRadarCommunity=function(){var e="RadarCommunity",t=$("#"+e);t.length>0&&($.each(t,function(e,t){$(this).empty()}),Viz.displayRadarCommunity("RadarCommunity"))},Convert.convertTreemap=function(){var e="Treemap",t=$("#"+e);if(t.length>0){$.each(t,function(e,t){$(this).empty()});var n=$("#Treemap").data("file");$("#Treemap").empty(),Viz.displayTreeMap("Treemap",n)}},Convert.convertBubbles=function(){div_param="Bubbles";var e=$("."+div_param);e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("data-source"),r=Report.getDataSourceByName(n);if(r===null)return;if(r.getData().length===0)return;var i=$(this).data("radius");t.id=n+"-Bubbles",r.displayBubbles(t.id,i)})},Convert.convertMetricsEvol=function(){var e={};e.show_desc=!1,e.show_title=!0,e.show_labels=!0;var t=Report.getVizConfig();t&&$.each(t,function(t,n){e[t]=n});var n="MetricsEvol",r=$("."+n);r.length>0&&$.each(r,function(t,n){var r={};$.each(e,function(e,t){r[e]=t}),$(this).empty();var i=$(this).data("metrics"),s=$(this).data("data-source");r.title=$(this).data("title");var o=Report.getDataSourceByName(s);if(o===null)return;r=m(n,r),n.id=i.replace(/,/g,"-")+"-"+s+"-metrics-evol-"+this.id,n.id=n.id.replace(/\n|\s/g,""),o.displayMetricsEvol(i.split(","),n.id,r,$(this).data("convert"))})},Convert.convertMetricsEvolCustomized=function(e){var t={};t.show_desc=!1,t.show_title=!0,t.show_labels=!0;var n=Report.getVizConfig();n&&$.each(n,function(e,n){t[e]=n});var r="MetricsEvolCustomized",i=$("."+r);i.length>0&&$.each(i,function(n,r){if(e!==$(this).data("filter"))return;var i={};$.each(t,function(e,t){i[e]=t}),$(this).empty();var s=$(this).data("metrics"),o=$(this).data("data-source");i.title=$(this).data("title");var u=Report.getDataSourceByName(o);if(u===null)return;i=m(r,i),r.id=s.replace(/,/g,"-")+"-"+o+"-metrics-evol-"+this.id,r.id=r.id.replace(/\n|\s/g,""),u.displayMetricsEvol(s.split(","),r.id,i,$(this).data("convert"))})},Convert.convertMetricsEvolSelector=function(){var e={};e.show_desc=!1,e.show_title=!0,e.show_labels=!0;var t=Report.getVizConfig();t&&$.each(t,function(t,n){e[t]=n});var n="MetricsEvol",r=$("."+n);r.length>0&&$.each(r,function(t,n){var r={};$.each(e,function(e,t){r[e]=t}),$(this).empty();var i=$(this).data("metrics"),s=$(this).data("data-source"),o=Report.getDataSourceByName(s);if(o===null)return;var u=Report.getParameterByName("repository");r=m(n,r),n.id=i.replace(/,/g,"-")+"-"+s+"-metrics-evol-"+this.id,n.id=n.id.replace(/\n|\s/g,""),o.displayMetricsEvol(i.split(","),n.id,r,$(this).data("convert"),u)})},Convert.convertMetricsEvolSet=function(){div_param="MetricsEvolSet";var e=$("."+div_param);e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("all"),r=$(this).data("relative"),i=$(this).data("summary-graph"),s=$(this).data("legend-show");t.id=o+"-MetricsEvolSet-"+this.id;if(n===!0)return t.id=o+"-All",Viz.displayEnvisionAll(t.id,r,s,i),!1;var o=$(this).data("data-source"),u=Report.getDataSourceByName(o);if(u===null)return;u.displayEnvision(t.id,r,s,i)})},Convert.convertTimeTo=function(){var e="TimeTo";divs=$("."+e),divs.length>0&&$.each(divs,function(e,t){$(this).empty();var n=$(this).data("data-source"),r=Report.getDataSourceByName(n);if(r===null)return;var i=$(this).data("quantil"),s=$(this).data("type");t.id=n+"-time-to-"+s+"-"+i,s==="fix"&&r.displayTimeToFix(t.id,i),s==="attention"&&r.displayTimeToAttention(t.id,i)})},Convert.convertMarkovTable=function(){var e="MarkovTable",t=$("."+e),n,r;t.length>0&&$.each(t,function(e,t){$(this).empty(),r=$(this).data("data-source"),n=Report.getDataSourceByName(r);if(n===null)return;if(n.getData().length===0)return;var i=$(this).data("title");t.id=r+"-markov-table",n.displayMarkovTable(t.id,i)})},Convert.convertLastActivity=function(){function t(t,n,r){var i="

      Last "+r+"

      ";$.each(Report.getDataSources(),function(t,s){var o=s.getGlobalData();$.each(o,function(t,s){var u="_"+n;if(t.indexOf(u,t.length-u.length)!==-1){var a=t.substring(0,t.length-u.length);r=a,e[a]&&(r=e[a].name),i+=r+":"+o[t]+"
      "}})}),$(t).append(i)}var e=Report.getAllMetrics(),n=$(".LastActivity"),r=null,i={Week:7,Month:30,Quarter:90,Year:365};n.length>0&&$.each(n,function(e,n){r=$(n).data("period"),t(n,i[r],r)})},Convert.convertTop=function(){var e="Top",t=$("."+e),n,r;if(t.length>0){var i=0;$.each(t,function(t,s){$(this).empty(),r=$(this).data("data-source"),n=Report.getDataSourceByName(r);if(n===null)return;if(n.getData().length===0)return;var o=!1;$(this).data("show_all")&&(o=!0);var u=$(this).data("metric"),a=$(this).data("limit"),f=$(this).data("graph"),l=$(this).data("people_links"),c=$(this).data("threads_links"),h=$(this).data("period"),p=$(this).data("period_all"),d=Report.getParameterByName("repository");s.id=r+"-"+e+i++,f&&(s.id+="-"+f),h===undefined&&p===undefined&&(p=!0),a===undefined&&(a=10),n.displayTop(s.id,o,u,h,p,f,a,l,c,d)})}},Convert.convertPersonMetrics=function(e,t){var n={};n.show_desc=!1,n.show_title=!1,n.show_labels=!0,divs=$(".PersonMetrics"),divs.length&&$.each(divs,function(r,i){$(this).empty(),ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;var s=$(this).data("metrics");n.show_legend=!1,n.help=!1,$(this).data("frame-time")&&(n.frame_time=!0),$(this).data("legend")&&(n.show_legend=!0),$(this).data("person_id")&&(e=$(this).data("person_id")),$(this).data("person_name")&&(t=$(this).data("person_name")),i.id=s.replace(/,/g,"-")+"-people-metrics",DS.displayMetricsPeople(e,t,s.split(","),i.id,n)})},Convert.convertPersonData=function(e,t){var n=$(".PersonData"),r,i;n.length>0&&$.each(n,function(n,s){$(this).empty(),$(this).data("person_id")&&(e=$(this).data("person_id")),s.id||(s.id="PersonData-"+e+"-"+g());var o=Report.getPeopleIdentities()[e];o?(r=DataProcess.selectPersonName(o),i=DataProcess.selectPersonEmail(o),i="("+DataProcess.hideEmail(i)+")"):(t!==undefined?r=t:r=e,i=""),html=HTMLComposer.personName(r,i),$("#"+s.id).append(html)})},Convert.personSummaryBlock=function(e){var t=$(".PersonSummaryBlock");t.length>0&&$.each(t,function(t,n){if(n.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source"),metric_name=$(this).data("metrics"),DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;if(DS.getPeopleMetricsData()[e].length===0)return;var r=HTMLComposer.personDSBlock(ds_name,metric_name);n.id||(n.id="Parsed"+g()),$("#"+n.id).append(r)})},Convert.convertPersonSummary=function(e,t){var n=$(".PersonSummary");n.length>0&&$.each(n,function(n,r){$(this).empty(),ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;$(this).data("person_id")&&(e=$(this).data("person_id")),$(this).data("person_name")&&(t=$(this).data("person_name")),r.id=ds+"-refcard-people",DS.displayPeopleSummary(r.id,e,t,DS)})},Convert.convertPeople=function(e,t){e===undefined&&(e=Report.getParameterByName("id")),t===undefined&&(t=Report.getParameterByName("name"));if(e===undefined)return;if(Loader.check_people_item(e)===!1){$.each(Report.getDataSources(),function(t,n){Loader.data_load_people_item(e,n,Convert.convertPeople)});return}Convert.personSummaryBlock(e),Convert.convertPersonData(e,t),Convert.convertPersonSummary(e,t),Convert.convertPersonMetrics(e,t),Convert.activateHelp()},Convert.repositoryDSBlock=function(e){var t=$(".FilterDSBlock");t.length>0&&$.each(t,function(t,n){if(n.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source"),filter_name=$(this).data("filter"),aux=$(this).data("metrics"),metric_names=aux.split(","),$.each(metric_names,function(e,t){metric_names[e]=metric_names[e].replace(/:/g,",")}),DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;if(y(filter_name,e)){var r=HTMLComposer.filterDSBlock(ds_name,filter_name,metric_names);n.id||(n.id="Parsed"+g()),$("#"+n.id).append(r)}})},Convert.convertDSSummaryBlock=function(e){var t=$(".DSSummaryBlock");t.length>0&&$.each(t,function(e,t){if(t.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source"),box_labels=$(this).data("box-labels"),box_metrics=$(this).data("box-metrics"),ts_metrics=$(this).data("ts-metrics"),DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;var n=HTMLComposer.DSBlock(ds_name,box_labels,box_metrics,ts_metrics);t.id||(t.id="Parsed"+g()),$("#"+t.id).append(n)})},Convert.convertOverallSummaryBlock=function(){var e=$(".OverallSummaryBlock");e.length>0&&$.each(e,function(e,t){if(t.id.indexOf("Parsed")>=0)return;var n=HTMLComposer.overallSummaryBlock();t.id||(t.id="Parsed"+g()),$("#"+t.id).append(n)})},Convert.convertDemographics=function(){var e=$(".Demographics");e.length>0&&$.each(e,function(e,t){$(this).empty(),ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;var n=$(this).data("period");t.id="Demographics-"+ds+"-"+"-"+n,DS.displayDemographics(t.id,n)})},Convert.getRealItem=function(e,t,n){var r=Report.getReposMap();if(r===undefined||r.length===0)return $.inArray(n,e.getReposData())>-1?n:null;var i=null;if(t==="repos"){var s=e.getReposMetricsData()[n];s===undefined?$.each(r,function(t,r){$.each(Report.getDataSources(),function(t,s){if(r[s.getName()]===n)return i=r[e.getName()],!1});if(i!==null)return!1}):i=n}else i=n;return i},Convert.convertFilterItemsSummary=function(e){var t="FilterItemsSummary";divs=$("."+t),divs.length>0&&$.each(divs,function(n,r){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;r.id=ds+"-"+t,$(this).empty(),e==="repos"&&DS.displayReposSummary(r.id,DS),e==="countries"&&DS.displayCountriesSummary(r.id,DS),e==="companies"&&DS.displayCompaniesSummary(r.id,DS),e==="domains"&&DS.displayDomainsSummary(r.id,DS),e==="projects"&&DS.displayProjectsSummary(r.id,DS)})},Convert.convertFilterItemsGlobal=function(e){var t=b(),n="FilterItemsGlobal";divs=$("."+n),divs.length>0&&$.each(divs,function(r,i){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;var s=$(this).data("metric"),o=$(this).data("show-others"),u=$(this).data("order-by");t.show_legend=$(this).data("legend"),$("#"+$(this).data("legend-div")).length>0?t.legend={container:$(this).data("legend-div")}:t.legend={container:null},t.graph=$(this).data("graph"),t.title=$(this).data("title"),t.show_title=1,i.id=s+"-"+n,$(this).empty(),e==="repos"&&DS.displayMetricReposStatic(s,i.id,t,u,o),e==="countries"&&DS.displayMetricCountriesStatic(s,i.id,t,u,o),e==="companies"&&DS.displayMetricCompaniesStatic(s,i.id,t,u,o),e==="domains"&&DS.displayMetricDomainsStatic(s,i.id,t,u,o),e==="projects"&&DS.displayMetricProjectsStatic(s,i.id,t,u,o)})},Convert.convertFilterItemsNav=function(e,t){var n="FilterItemsNav";divs=$("."+n);if(divs.length>0){var r=0;$.each(divs,function(i,s){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;$(this).data("page")&&(t=$(this).data("page")),order_by=$(this).data("order-by"),s.id=ds+"-"+n+"-"+r,r+=1,$(this).empty(),e==="repos"?DS.displayItemsNav(s.id,e,t,order_by):e==="countries"?DS.displayItemsNav(s.id,e,t):e==="companies"? DS.displayItemsNav(s.id,e,t):e==="domains"?DS.displayItemsNav(s.id,e,t):e==="projects"&&DS.displayItemsNav(s.id,e,t)})}},Convert.convertFilterItemsMetricsEvol=function(e){var t=b(),n="FilterItemsMetricsEvol";divs=$("."+n),divs.length>0&&$.each(divs,function(r,i){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;var s=$(this).data("metric"),o=!1;$(this).data("stacked")&&(o=!0),$(this).data("min")&&(config_viz.show_legend=!1,config_viz.show_labels=!0,config_viz.show_grid=!0,config_viz.help=!1);var u=$(this).data("start"),a=$(this).data("end");t.lines={stacked:o},$("#"+$(this).data("legend-div")).length>0?t.legend={container:$(this).data("legend-div")}:t.legend={container:null},t.show_legend=$(this).data("legend"),t.mouse_tracker=$(this).data("mouse_tracker");var f=$(this).data("remove-last-point");f&&(t.remove_last_point=!0),i.id=s+"-"+n,$(this).empty(),e==="companies"?DS.displayMetricCompanies(s,i.id,t,u,a):e==="repos"?DS.displayMetricRepos(s,i.id,t,u,a):e==="domains"?DS.displayMetricDomains(s,i.id,t,u,a):e==="projects"&&DS.displayMetricProjects(s,i.id,t,u,a)})},Convert.convertFilterItemsMiniCharts=function(e,t){var n=b(),r="FilterItemsMiniCharts";divs=$("."+r),divs.length>0&&$.each(divs,function(i,s){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;$(this).data("page")&&(t=$(this).data("page"));var o=$(this).data("metrics"),u=$(this).data("order-by"),a=!0;$(this).data("show_links")!==undefined&&(a=$(this).data("show_links"));var f=$(this).data("start"),l=$(this).data("end"),c=$(this).data("convert");$(this).data("frame-time")&&(n.frame_time=!0);var h=$(this).data("remove-last-point");h&&(n.remove_last_point=!0),s.id=o.replace(/,/g,"-")+"-"+e+"-"+r,$(this).empty(),e==="repos"?DS.displayReposList(o.split(","),s.id,n,u,t,a,f,l,c):e==="countries"?DS.displayCountriesList(o.split(","),s.id,n,u,t,a,f,l,c):e==="companies"?DS.displayCompaniesList(o.split(","),s.id,n,u,t,a,f,l,c):e==="domains"?DS.displayDomainsList(o.split(","),s.id,n,u,t,a,f,l,c):e==="projects"&&DS.displayProjectsList(o.split(","),s.id,n,u,t,a,f,l,c)})},Convert.convertFilterItemData=function(e,t){var n=$(".FilterItemData");n.length>0&&$.each(n,function(n,r){$(this).empty();var i=Report.cleanLabel(t);r.id||(r.id="FilterItemData"+g()),html=HTMLComposer.itemName(i,e),$("#"+r.id).append(html)})},Convert.convertFilterItemSummary=function(e,t){var n="FilterItemSummary";divs=$("."+n),t!==null&&divs.length>0&&$.each(divs,function(r,i){var s=t;ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;$(this).data("item")&&(s=$(this).data("item")),i.id=ds+"-"+e+"-"+n,$(this).empty(),e==="repos"?DS.displayRepoSummary(i.id,s,DS):e==="countries"?DS.displayCountrySummary(i.id,s,DS):e==="companies"?DS.displayCompanySummary(i.id,s,DS):e==="domains"?DS.displayDomainSummary(i.id,s,DS):e==="projects"&&DS.displayProjectSummary(i.id,s,DS)})},Convert.convertFilterItemMicrodashText=function(e,t){var n=$(".FilterItemMicrodashText");n.length>0&&$.each(n,function(n,r){$(this).empty();var i=t,s=$(this).data("metric"),o=$(this).data("name"),u=Report.getMetricDS(s)[0];if(u===undefined)return;if(e!=="projects")return;var a=u.getProjectsGlobalData()[t],f='
      ';o&&(f+='
      ',f+=''+u.basic_metrics[s].name+"",f+="
      "),$.each([365,30,7],function(e,t){var n=u.getMetrics()[s].column,r=a[s+"_"+t],i=a["diff_net"+n+"_"+t],l=a["percentage_"+n+"_"+t];l=Math.round(l*10)/10;if(r===undefined)return;var c="";i>0&&(c="+"+l),i<0&&(c="-"+Math.abs(l)),o?f+='
      ':f+='
      ',f+='Last '+t+" days:",f+=" "+Report.formatValue(r)+"
      ",i===0?f+='  '+c+"% ":i>0?f+='  '+c+"% ":i<0&&(f+='  '+c+"% "),f+="
      "}),f+="
      ",$(r).append(f)})},Convert.convertFilterItemMetricsEvol=function(e,t){var n=b(),r="FilterItemMetricsEvol";divs=$("."+r),t!==null&&divs.length>0&&$.each(divs,function(i,s){var o=t,u=$(this).data("metrics");ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;$(this).data("item")&&(o=$(this).data("item")),n=m(s,n),s.id=Report.cleanLabel(t).replace(/ /g,"_")+"-",s.id+=u.replace(/,/g,"-")+"-"+ds+"-"+e+"-"+r,$(this).empty(),e==="repos"?DS.displayMetricsRepo(o,u.split(","),s.id,n):e==="countries"?DS.displayMetricsCountry(o,u.split(","),s.id,n):e==="companies"?DS.displayMetricsCompany(o,u.split(","),s.id,n):e==="domains"?DS.displayMetricsDomain(o,u.split(","),s.id,n):e==="projects"&&DS.displayMetricsProject(o,u.split(","),s.id,n)})},Convert.convertFilterItemTop=function(e,t){var n="FilterItemTop";divs=$("."+n),divs.length>0&&$.each(divs,function(r,i){var s=t;$(this).empty(),ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;$(this).data("item")&&(s=$(this).data("item"));var o=$(this).data("metric"),u=$(this).data("period"),a=$(this).data("titles");i.id=o+"-"+ds+"-"+e+"-"+n+"-"+g(),$(this).empty(),i.className="",e==="companies"&&DS.displayTopCompany(s,i.id,o,u,a)})},Convert.convertSmartLinks=function(){var e=$(".SmartLinks");e.length>0&&$.each(e,function(e,t){if(t.id.indexOf("Parsed")>=0)return;target_page=$(this).data("target"),label=$(this).data("label");var n=HTMLComposer.smartLinks(target_page,label);t.id||(t.id="Parsed"+g()),$("#"+t.id).append(n)})},Convert.convertFilterStudyItem=function(e,t){var n=Convert.convertFilterStudyItem;if(n.done===undefined)n.done={};else if(n.done[e]===!0)return;e==="repositories"&&(e="repos"),t===undefined&&(e==="repos"&&(t=Report.getParameterByName("repository")),e==="countries"&&(t=Report.getParameterByName("country")),e==="companies"&&(t=Report.getParameterByName("company")),e==="domains"&&(t=Report.getParameterByName("domain")),e==="projects"&&(t=Report.getParameterByName("project")));if(!t)return;if(Loader.FilterItemCheck(t,e)===!1)return;Convert.repositoryDSBlock(t),Convert.convertFilterItemData(e,t),Convert.convertFilterItemSummary(e,t),Convert.convertFilterItemMetricsEvol(e,t),Convert.convertFilterItemTop(e,t),Convert.convertFilterItemMicrodashText(e,t),Convert.convertProjectData(),Convert.activateHelp(),Convert.convertMetricsEvolSelector(),n.done[e]=!0},Convert.activateHelp=function(){$(".help").popover({html:!0,trigger:"manual"}).click(function(e){$(this).popover("toggle"),e.stopPropagation()})},Convert.convertFilterStudy=function(e){var t=Report.getCurrentPage();t===null&&(t=Report.getParameterByName("page"),t!==undefined&&Report.setCurrentPage(t));if(t===undefined){if(!($("[class^='FilterItems']").length>0))return;t=1,Report.setCurrentPage(t)}e==="repositories"&&(e="repos");if(Loader.check_filter_page(t,e)===!1){$.each(Report.getDataSources(),function(n,r){Loader.data_load_items_page(r,t,Convert.convertFilterStudy,e)});return}Convert.convertFilterItemsSummary(e),Convert.convertFilterItemsGlobal(e),Convert.convertFilterItemsNav(e,t),Convert.convertFilterItemsMetricsEvol(e),Convert.convertFilterItemsMiniCharts(e,t)},Convert.convertDSTable=function(){var e="DataSourcesTable",t=$("."+e),n,r;if(t.length>0){var i=0;$.each(t,function(t,n){$(this).empty(),n.id=e+i++,Viz.displayDataSourcesTable(n)})}},Convert.convertBasicDivs=function(){Convert.convertNavbar(),Convert.convertSmartLinks(),Convert.convertSectionBreadcrumb(),Convert.convertProjectMap(),Convert.convertFooter(),Convert.convertOverallSummaryBlock(),Convert.convertDSSummaryBlock(),Convert.convertDSTable(),Convert.convertGlobalData(),Convert.convertSummary()},Convert.convertBasicDivsMisc=function(){Convert.convertRadarActivity(),Convert.convertRadarCommunity(),Convert.convertTreemap(),Convert.convertBubbles()},Convert.convertBasicMetrics=function(e){var t=Report.getParameterByName("repository");t===undefined&&Convert.convertMetricsEvol(),Convert.convertTimeTo(),Convert.convertMarkovTable()},Convert.convertModifiedBasicMetrics=function(e){var t=1;if(Loader.check_filter_page(t,e)===!1){$.each(Report.getDataSources(),function(n,r){if(e!=="repos")return;e==="repos"&&(total=r.getReposData().length);for(var i=0;i0&&(e.push("data/json/"+t),Report.setDataDir("data/json/"+t),e.length>0&&Report.setProjectsDirs(e))}function B(){H();var e=Report.getProjectsDirs(),t,n,r,i,s,o,u,a,f,l;return $.each(e,function(e,c){if(Report.getConfig()===null||Report.getConfig()["data-sources"]===undefined)n=new ITS,Report.registerDataSource(n),r=new MLS,Report.registerDataSource(r),t=new SCM,Report.registerDataSource(t),i=new SCR,Report.registerDataSource(i),s=new IRC,Report.registerDataSource(s),o=new MediaWiki,Report.registerDataSource(o),u=new People,Report.registerDataSource(u),a=new Downloads,Report.registerDataSource(a),f=new QAForums,Report.registerDataSource(f),l=new Releases,Report.registerDataSource(l);else{var h=Report.getConfig()["data-sources"];$.each(h,function(e,c){c==="its"?(n=new ITS,Report.registerDataSource(n)):c==="mls"?(r=new MLS,Report.registerDataSource(r)):c==="scm"?(t=new SCM,Report.registerDataSource(t)):c==="scr"?(i=new SCR,Report.registerDataSource(i)):c==="irc"?(s=new IRC,Report.registerDataSource(s)):c==="mediawiki"?(o=new MediaWiki,Report.registerDataSource(o)):c==="people"?(u=new People,Report.registerDataSource(u)):c==="downloads"?(a=new Downloads,Report.registerDataSource(a)):c==="qaforums"?(f=new QAForums,Report.registerDataSource(f)):c==="releases"?(l=new Releases,Report.registerDataSource(l)):Report.log("Not support data source "+c)})}n&&n.setDataDir(c),r&&r.setDataDir(c),t&&t.setDataDir(c),i&&i.setDataDir(c),s&&s.setDataDir(c),o&&o.setDataDir(c),u&&u.setDataDir(c),a&&a.setDataDir(c),f&&f.setDataDir(c),l&&l.setDataDir(c),t&&n&&t.setITS(n)}),!0}function j(){$.each(Report.getActiveStudies(),function(e,t){var n=t;t==="repositories"&&(n="repos"),DataProcess.orderItems(n),Convert.convertFilterStudy(t),Convert.convertFilterStudyItem(t)})}var e=null,t=null,n=null,r={},i=[],s=null,o="",u="data/json",a="config",f="data/json",l="",c=[f],h={},p={},d,v=a+"/project-info.json",m=u+"/viz_cfg.json",g=u+"/markers.json",y=u+"/repos-map.json",b=u+"/projects_hierarchy.json";menu_elements_file=a+"/menu-elements.json";var w=10,E=null,S={};Report.createDataSources=B,Report.getAllMetrics=P,Report.getMarkers=x,Report.getVizConfig=T,Report.getProjectsHierarchy=N,Report.getMenuElements=C,Report.getReleaseNames=k,Report.getMetricDS=D,Report.getGridster=L,Report.setGridster=A,Report.getCurrentPage=function(){return E},Report.setCurrentPage=function(e){E=e},Report.getPageSize=function(){return w},Report.setPageSize=function(e){w=e},Report.getProjectData=O,Report.getProjectsData=M,Report.convertStudies=j,Report.getDataSources=function(){return i},Report.registerDataSource=function(e){i.push(e)},Report.setHtmlDir=function(e){o=e},Report.getHtmlDir=function(){return o},Report.getDataDir=function(){return u},Report.setDataDir=function(e){u=e,v=e+"/project-info.json",config_file=e+"/viz_cfg.json",g=e+"/markers.json",repos_mapping_file=u+"/repos-mapping.json",b=u+"/projects_hierarchy.json"},Report.setMarkers=function(e){t=e},Report.getMarkersFile=function(){return g},Report.getReposMap=function(){return d},Report.setReposMap=function(e){d=e},Report.getReposMapFile=function(){return y},Report.setVizConfig=function(e){n=e},Report.getVizConfigFile=function(){return m},Report.setProjectsHierarchy=function(e){projects_hierarchy=e},Report.getProjectsHierarchyFile=function(){return b},Report.setMenuElements=function(e){menu_elements=e},Report.getMenuElementsFile=function(){return menu_elements_file},Report.setProjectData=function(t){e=t},Report.getProjectFile=function(){return v},Report.getProjectsDirs=function(){return c},Report.setProjectsDirs=function(e){c=e},Report.getProjectsList=function(){var e=[];return $.each(M(),function(t,n){e.push(t)}),e},Report.getProjectsDataSources=function(){return p},Report.setMetricsDefinition=function(e){$.each(Report.getDataSources(),function(t,n){n.setMetricsDefinition(e[n.getName()])})},Report.getPeopleIdentities=function(){return S},Report.setPeopleIdentities=function(e){S=e},Report.cleanLabel=function(e){var t=e,n=null;return e.split("___").length===2?(n=e.split(" "),t=n[0]):e.lastIndexOf("http")===0||e.split("_").length>3?(n=e.split("_"),t=n.pop(),t===""&&(t=n.pop()),t=t.replace("buglist.cgi?product=",""),t=t.replace("gmane.comp.sysutils.","")):e.lastIndexOf("<")===0&&(t=MLS.displayMLSListName(e)),t},Report.formatValue=function(e,t){if(e===undefined)return"-";var n=["last_date","first_date"],r=e;try{r=parseFloat(e).toFixed(1).toString().replace(/\.0$/,""),r=_(r);if(navigator.language==="es"){var i=r.split(".");i[0]=i[0].replace(/,/g,"."),r=i.join(",")}}catch(s){}return typeof r=="number"&&isNaN(r)&&(r=e.toString()),t!==undefined&&$.inArray(t,n)>-1&&(r=e.toString()),r},Report.escapeHtml=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},Report.getParameterByName=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),n=t.exec(location.search);return n===null?undefined:Report.escapeHtml(decodeURIComponent(n[1].replace(/\+/g," ")))},Report.getDataSourceByName=function(e){var t=null;return $.each(Report.getDataSources(),function(n,r){if(r.getName()===e)return t=r,!1}),t},Report.displayActiveMenu=function(){var e=window.location.href,t=e.substr(e.lastIndexOf("/")+1,e.length);t=t.split(".html")[0];if(t.indexOf("scm")===0)$(".scm-menu")[0].className=$(".scm-menu")[0].className+" active";else if(t.indexOf("its")===0)$(".its-menu")[0].className=$(".its-menu")[0].className+" active";else if(t.indexOf("mls")===0)$(".mls-menu")[0].className=$(".mls-menu")[0].className+" active";else if(t.indexOf("scr")===0)$(".scr-menu")[0].className=$(".scr-menu")[0].className+" active";else if(t.indexOf("irc")===0)$(".irc-menu")[0].className=$(".irc-menu")[0].className+" active";else if(t.indexOf("qaforum")===0)$(".qaforum-menu")[0].className=$(".qaforum-menu")[0].className+" active";else if(t.indexOf("studies")===0)$(".studies-menu")[0].className=$(".studies-menu")[0].className+" active";else if(t.indexOf("wiki")===0)$(".wiki-menu")[0].className=$(".wiki-menu")[0].className+" active";else if(t.indexOf("downloads")===0)$(".downloads-menu")[0].className=$(".downloads-menu")[0].className+" active";else if(t.indexOf("projects")===0)$(".listprojects-menu")[0].className=$(".listprojects-menu")[0].className+" active";else if(t.indexOf("index")===0||t===""){if($(".summary-menu").length===0)return;$(".summary-menu")[0].className=$(".summary-menu")[0].className+" active"}else $(".experimental-menu")[0]&&($(".experimental-menu")[0].className=$(".experimental-menu")[0].className+" active")},Report.addDataDir=function(){var e,t=window.location.search.substr(1);return t&&t.indexOf("data_dir")!==-1&&(e=window.location.search.substr(1)),e},Report.configDataSources=function(){var e=Report.getProjectsDataSources();$.each(Report.getDataSources(),function(t,n){if(n.getData()instanceof Array)return;$.each(h,function(t,r){if(r.dir===n.getDataDir())return e[t]===undefined&&(e[t]=[]),$.each(e[t],function(e,t){if(n.getName()===t.getName())return!1}),n.setProject(t),e[t].push(n),!1})})},Report.getConfig=function(){return s},Report.setConfig=function(e){s=e,e&&(Report.log("Global config file found"),e["global-html-dir"]&&Report.setHtmlDir(e["global-html-dir"]),e["global-data-dir"]&&(Report.setDataDir(e["global-data-dir"]),Report.setProjectsDirs([e["global-data-dir"]])),e["projects-data-dirs"]&&Report.setProjectsDirs(e["projects-data-dirs"]))},Report.convertGlobal=function(){Convert.convertBasicDivs(),Convert.convertBasicDivsMisc(),Convert.convertBasicMetrics(),Convert.convertDemographics(),Convert.convertMetricsEvolSet(),Convert.convertLastActivity(),Convert.convertMicrodash(),Convert.convertMicrodashText()},Report.getActiveStudies=function(){var e=[],t,n=["repositories","countries","companies","domains","projects"];return Report.getConfig()!==null?t=Report.getConfig().reports:t=n,$.each(n,function(n,r){$.inArray(r,t)>-1&&e.push(r)}),e},Report.convertStudiesGlobal=function(){Convert.convertPeople()};var F=!0;Report.getLog=function(){return F},Report.setLog=function(e){F=e},Report.log=function(e){Report.getLog()===!0&&window.console&&console.log(e)}})(),Loader.data_ready_global(function(){Report.configDataSources(),Report.convertGlobal(),Report.convertStudiesGlobal()}),Loader.data_ready(function(){study="repos",Convert.convertFilterTop(study),Convert.convertModifiedBasicMetrics(study)}),Loader.data_ready(function(){Report.convertStudies(),$("body").css("cursor","auto"),$("html").click(function(e){$(".help").popover("hide")}),Convert.activateHelp()}),$(document).ready(function(){var e="./config.json";$.getJSON(e,function(e){Report.setConfig(e)}).fail(function(){window.console&&Report.log("Can't read global config file "+e)}).always(function(e){Report.createDataSources(),Loader.data_load(),$("body").css("cursor","progress")})});var resized;$(window).resize(function(){clearTimeout(resized),resized=setTimeout(resizedw,100)});if(Viz===undefined)var Viz={};(function(){function t(e,t){var n="";return $.each(Report.getAllMetrics(),function(e,r){if(r.action===t)return n=r.column,!1}),n}function n(e,t,n){var r="

      "+n+"

      ",i='';i+="",$.each(t,function(e,n){subdata=t[e],old_value="old_value",new_value="new_value",percent="f",number="issue";for(var r=0;r",i+="",i+=""}}),i+="
      TransitionNumberPercent
      "+e+" -> "+s+""+u+""+o+"
      ",r+=i,div=$("#"+e),div.append(r);return}function r(e,t){return e.hasOwnProperty(t)?e[t]:t}function i(e,t){var n={};return n.id="id",e==="senders"&&(t==="mls"||t==="irc")&&(n.name="senders",n.action="sent"),e==="authors"&&t==="scm"&&(n.name="authors",n.action="commits"),e==="closers"&&t==="its"&&(n.name="closers",n.action="closed"),t==="scr"&&(e==="mergers"&&(n.name="mergers",n.action="merged"),e==="openers"&&(n.name="openers",n.action="opened"),e==="reviewers"&&(n.name="reviewers",n.action="reviews")),t==="downloads"&&(e==="ips"&&(n.name="ips",n.action="downloads"),e==="packages"&&(n.name="packages",n.action="downloads")),t==="mediawiki"&&e==="authors"&&(n.name="authors",n.action="reviews"),t==="qaforums"&&(e==="senders"||e==="asenders"||e==="qsenders")&&(n.name="senders",n.action="sent"),t==="releases"&&e==="authors"&&(n.name="username",n.action="releases"),n}function s(){return["last month","last year",""]}function o(e,t,n){var r="";for(var i=0;i#"+(i+1)+"",r+="",r+=e[n.name][i],r+="",r+=""+s+""}return r}function u(e,t,n){var r="";for(var i=0;i#"+(i+1)+"",r+="";if(n===!0){var s="http://www.google.com/search?output=search&q=X&btnI=1";e.hasOwnProperty("url")&&e.url[i].length>0&&(s="http://www.google.com/search?output=search&q=X%20site%3AY&btnI=1",s=s.replace(/Y/g,e.url[i])),s=s.replace(/X/g,e.subject[i]),r+="",r+='',r+=e.subject[i]+"",r+=' '}else r+=""+e.subject[i]+"";r+=""+e.initiator_name[i]+"",r+=""+e.length[i]+"",r+=""}return r}function a(e,t,n,r){var i="";for(var s=0;s"+(s+1)+"",i+="",n?(i+='"):i+=e[r.name][s],i+="",i+=""+o+""}return i}function f(e,t,n,r){var i="",s=!0;i+='",i}function l(e,t,n,r,i){var s=t+"_"+e,o="",u="";return s in r&&(o=r[s].desc,o=o.toLowerCase()),i===""?data_period_formatted="Complete history":i==="last month"?data_period_formatted="Last 30 days":i==="last year"&&(data_period_formatted="Last 365 days"),Utils.isReleasePage()&&(data_period_formatted="Release history"),n===!0?u+="
      Top "+o+"
      ":u+='
      '+data_period_formatted+"
      ",u}function c(e,t,n,r,c,h,p,d){var v="",m="",g="",y=!0,b=$("#"+e),w=b.attr("data-data-source");periods=s(),d!==undefined&&(y=!1),g+=l(n,w,y,c,d),y===!0&&(v+=f(periods,n,t,w)),m+='
      ';var E=i(n,w);if(y===!0){var S=!0,x="";for(var T=0;T',m+='',n==="threads"?m+=u(t[N],r,p):n==="packages"||n==="ips"?m+=o(t[N],r,E):(unit=c[w+"_"+n].action,m+="",m+=a(t[N],r,h,E),m+=""),m+="
      #"+n.capitalize()+""+unit.capitalize()+"
      ",m+="
      "}}}else m+='',n==="threads"?m+=u(t,r,p):n==="packages"||n==="ips"?m+=o(t,r,E):(unit=c[w+"_"+n].action,m+="",m+=a(t,r,h,E),m+=""),m+="
      #"+n.capitalize()+""+unit.capitalize()+"
      ";m+="
      ",y===!1&&b.append(g),b.append(v),b.append(m),y===!0&&(script="",b.append(script))}function h(e,n,r,i,s,o,u,a){var f=n.name;if(!i||$.isEmptyObject(i))return;var l=n.action;u&&i[l].length
      "),m+=p,d=$("#"+e),d.append(m);if(s){var g=i[c],y=i[l];if(u){g=[],y=[];for(var b=0;b',html+="Data SourceFrom",html+="To (Updated on)",$.each(dsources,function(e,t){if(t.getName()==="people")return;var n=t.getGlobalData(),r=t.getTitle();r===undefined&&(r="-");var i=n.last_date;if(i===undefined)return;var s=n.first_date;s===undefined&&(s="-");var o=n.type;html+=""+r,o!==undefined&&(o=o.toLowerCase(),o=o.charAt(0).toUpperCase()+o.slice(1),html+=" ("+o+")"),html+="",html+=""+s+"",html+=""+i+""}),html+="",$(e).append(html)}function d(e,t,n){var r=Report.getAllMetrics(),i=': "+n.desc+"
      ",!1};for(var u=0;u',i+='
      ';var a=$("#"+e).prev()[0];a&&a.className==="help"&&$("#"+e).prev().empty(),$("#"+e).before(i)}function v(e,t,n,r,i){(!i||i.help!==!1)&&d(e,t,i.custom_help);var s=[];i.remove_last_point&&(n=DataProcess.revomeLastPoint(n)),i.frame_time&&(n=DataProcess.frameTime(n,t)),i.start_time&&(n=DataProcess.filterDates(i.start_time,i.end_time,n)),$.each(t,function(e,t){if(!n[t])return;var r=[[],[]];$.each(n[t],function(e,i){r[e]=[n.id[e],n[t][e]]});var i=t;Report.getAllMetrics()[t]&&(i=Report.getAllMetrics()[t].name),s.push({label:i,data:r})}),N(e,n,s,r,i)}function m(e,t,n,r,i,s){(!i||i.help!==!1)&&d(e,t,i.custom_help);var o=[],u=t[0],a={};$.each(n,function(e,t){if(t===undefined)return!1;if(t[u]===undefined)return!1;i.remove_last_point&&(t=DataProcess.revomeLastPoint(t)),i.frame_time&&(t=DataProcess.frameTime(t,[u])),i.start_time&&(t=DataProcess.filterDates(i.start_time,i.end_time,t));var n=[[],[]];$.each(t[u],function(e,r){n[e]=[t.id[e],t[u][e]]}),o.push({label:e,data:n}),a=t}),N(e,a,o,r,i)}function g(e,t,n,r,i,s,o,u,a){var f=[],l={};$.each(n,function(e,n){if(n===undefined)return!1;if(n[t]===undefined)return!1;u&&(n=DataProcess.convert(n,u,t)),s&&(n=DataProcess.filterDates(s,o,n)),i.frame_time&&(n=DataProcess.frameTime(n,[t]));var r=[[],[]];for(var a=0;a";for(var i=0;i1&&r[i].label!==undefined&&(value_name=r[i].label,t+=value_name+":"),t+=""+Report.formatValue(s)+"
      "}return t}},selection:{mode:"x",fps:10},shadowSize:4};return i&&(Viz._history=n,Viz._lines_data=r,s.mouse.trackFormatter=Viz[i]),s}function b(e,t){if(t.length===0)return t;if(t.length>1)for(var n=0;nt[1]||t[1]===undefined?1:-1}),e}function x(e,t,n){t=Math.round(t),n=Math.round(n);var r=e.length,i=[];for(var s=0;s0;o--){var u=e[s].data[o][0],a=un;a&&e[s].data.splice(o,1)}var f=[];for(s=0;s";for(var i=0;i1&&n[i].label!==undefined&&(r+=n[i].label+":"),r+=Report.formatValue(s)+"
      "}return r}}};i&&(i.show_title||(u.title=""),"show_legend"in i&&(i.show_legend===!0?u.legend.show=!0:u.legend.show=!1),i.lines&&i.lines.stacked&&(u.lines={stacked:!0,fill:!0,fillOpacity:1,fillBorder:!0,lineWidth:.01}),i.show_labels||(u.xaxis.showLabels=!1,u.yaxis.showLabels=!1),i.show_grid===!1&&(u.grid.verticalLines=!1,u.grid.horizontalLines=!1,u.grid.outlineWidth=0),i.show_mouse===!1&&(u.mouse.track=!1),i.graph==="bars"&&(u.bars={show:!0}),i.light_style===!0&&(u.grid.color="#ccc",u.legend.show=!1),i.custom_title&&(u.subtitle=i.custom_title));var a=!1;i.graph!=="bars"&&n.length===1&&n[0].data[0][0]===0&&(a=!0);if(a){n=w(t,n);var f=t.id[t.id.length-1]+1;n[0].data.push([f,undefined]),n[1].data.push([f,undefined]),t.date.push(""),t.id.push(f)}graph=Flotr.draw(s,n,u),a&&(t.date&&t.date.pop(),t.id&&t.id.pop())}function k(e,t){var n,r=e.length;return n=parseInt(t.unixtime[1])-parseInt(t.unixtime[0]),n/(r+1)}function L(e,t,n,r){var i=e.length,s=e[0].data.length;for(var o=0;o1&&(f.legend.show=!0),n=L(n,t,s,o);var l=!1;Utils.isReleasePage()===!1&&(i.graph!=="bars"&&n.length===1&&(l=!0),l?(n=w(t,n),T(n)):!l&&n.length>1&&b(t,n)),console.log(f),graph=c(),Flotr.EventAdapter.observe(u,"flotr:select",function(e){var t={xaxis:{minorTickFreq:4,mode:"time",timeUnit:"second",timeFormat:"%b %y",min:e.x1,max:e.x2},yaxis:{min:e.y1,autoscale:!0},grid:{verticalLines:!0,color:"#000000",outlineWidth:1,outline:"s"}};t.subtitle=E(f.subtitle,e.xfirst,e.xsecond);var r=JSON.parse(JSON.stringify(n)),i=x(r,e.x1,e.x2);t.yaxis.max=i+i*.2,graph=c(t)}),Flotr.EventAdapter.observe(u,"flotr:click",function(){c()})}function O(e,t,n,r,i,s,o,u,a){var f=!1;o&&(f=!0);var l=document.getElementById(e),c=null;s&&s.legend&&s.legend.container&&(c=$("#"+s.legend.container));var h=[],p,d="";if(!f)for(p=0;pf&&(f=n[1].length);var l=!1;s&&(l=!0);var c=document.getElementById(e),h=null;i&&i.legend&&i.legend.container&&(h=$("#"+i.legend.container));var p=[],d,v=[],m=[];for(d=0;dd?g=n[0][d]:g=undefined,n[1].length>d?y=n[1][d]:y=undefined,l?(p.push([g,d-a/2]),v.push([y,d+a/2])):(p.push([d-a/2,g]),v.push([d+a/2,y]))}m=[{data:p,label:t[0]},{data:v,label:t[1]}];var b={title:r,bars:{show:!0,horizontal:l,barWidth:a},grid:{verticalLines:!1,horizontalLines:!1,outlineWidth:0},xaxis:{showLabels:!1,min:0},yaxis:{showLabels:!0,min:0},mouse:{container:h,track:!0,trackFormatter:function(e){var n,r="x";l&&(r="y");var i=parseFloat(e[r],1),s=Math.round((i-.2)*10)/10,o=Math.round((i+.2)*10)/10;s===parseInt(i,10)?n=s:n=o;var a=n;u&&(a=n*u);var f=a+" years: ",c,h;return p[n]===undefined?c=0:c=parseInt(p[n][0],10),isNaN(c)&&(c=0),v[n]===undefined?h=0:h=parseInt(v[n][0],10),isNaN(h)&&(h=0),f+=c+" "+t[0],f+=" , ",f+=h+" "+t[1],f+=" ("+parseInt(c/h*100,10)+"% )",f}},legend:{show:!0,position:"ne",backgroundColor:"#D2E8FF",container:h}};i&&(i.show_title||(b.title=""),i.show_legend&&(b.legend.show=!0)),i&&i.show_legend!==!1&&(b.legend={show:!0,position:"ne",container:h}),b.grid.horizontalLines=!0,b.yaxis={showLabels:!0,min:0},o&&(b.yaxis={showLabels:!0,min:0,tickFormatter:o}),i&&i.xaxis&&(b.xaxis={showLabels:i.xaxis,min:0}),graph=Flotr.draw(c,m,b)}function _(e,t,n,r){var i=document.getElementById(e),s=Report.getMetricDS(t)[0],o=Report.getMetricDS(n)[0],u=[];if(s!=o){Report.log("Metrics for bubbles have different data sources");return}var a=[],f=[];$.each(Report.getDataSources(),function(e,t){t.getName()===s.getName()&&(a.push(t.getData()),f.push(t.getProject()))});var l=[[],[]];l=[a[0].id,a[0].date];for(var c=0;ci&&(i=a,i=parseInt(i*(1+s),10))}(function(){var e=[n,t]})(),graph=Flotr.draw(r,n,{radar:{show:!0},mouse:{track:!0,trackFormatter:function(e){var r="";for(var i=0;i";return r}},grid:{circular:!0,minorHorizontalLines:!0},yaxis:{min:0,max:i,minorTickFreq:1},xaxis:{ticks:t}})}function H(e,t){var n=[],r=[],i=[],s=[],o=0,u=0;for(o=0;o";for(var l in s){if(c.data[l]===undefined)continue;if($.inArray(l,c.data.envision_hide)>-1)continue;for(o=0;o"+a[1][n]+"",u+="",i.length>1&&(u+="");for(l in s){if(c.data[l]===undefined)continue;if($.inArray(l,c.data.envision_hide)>-1)continue;u+=""+s[l].name+""}return u+="",$.each(r,function(e,t){var n="";for(var o in s){if(c.data[o]===undefined)continue;if($.inArray(o,c.data.envision_hide)>-1)continue;mvalue=r[e][o],mvalue===undefined&&(mvalue="n/a"),n+=""+mvalue+""}i.length>1&&(n=""+e+""+n),n+="",u+=n}),u+="",u},c}function V(e){return e===undefined&&(e={}),e.show_desc===undefined&&(e.show_desc=!0),e.show_title===undefined&&(e.show_title=!0),e.show_labels===undefined&&(e.show_labels=!0),e}function J(e,t){var n=e.getMetrics(),r="";for(var i=0;i";for(var n=0;n1&&(lines_data[n].label!==undefined&&(company_name=lines_data[n].label),t+=lines_data[n].label+":"),t+=""+Report.formatValue(r)+"",company_name&&(t+="("+companies[company_name].pending[e.index]+")"),t+="
      "}return t},Viz.getEnvisionOptionsMin=function(e,t,n){var r=t.id[0],i=document.getElementById(e),s,o=Report.getMarkers(),u=Report.getAllMetrics();s={container:i,xTickFormatter:function(e){var n=t.date[e-r];return n==="0"&&(n=""),n},yTickFormatter:function(e){return e+""},selection:{data:{x:{min:t.id[0],max:t.id[t.id.length-1]}}}},s.data={summary:[t.id,t.sent],markers:o,dates:t.date,envision_hide:n,main_metric:"sent"};var a=Report.getAllMetrics(),f=null;for(var l in t)f=l,a[l]&&(f=a[l].name),s.data[l]=[{label:f,data:[t.id,t[l]]}];return s.trackFormatter=function(e){var n=e.series.data,i=n[e.index][0]-r,s=t.date[i]+":
      ";for(var o in u){if(t[o]===undefined)continue;s+=t[o][i]+" "+o+" , "}return s},s}})(),IRC.prototype=new DataSource("irc"),ITS.prototype=new DataSource("its"),MediaWiki.prototype=new DataSource("mediawiki"),MLS.prototype=new DataSource("mls"),SCM.prototype=new DataSource("scm"),SCR.prototype=new DataSource("scr"),People.prototype=new DataSource("people"),Downloads.prototype=new DataSource("downloads"),QAForums.prototype=new DataSource("qaforums"),Releases.prototype=new DataSource("releases");var Identity={};(function(){function t(t,n,r){var i="";t===e?i="":i=e,$("#"+r).sortable({handle:".handle",connectWith:"#"+i,start:function(e,t){t.item.siblings(".ui-selected").appendTo(t.item)},stop:function(t,n){n.item.parent()[0].id===e&&n.item.find(".handle").remove(),n.item.parent().append(n.item.find("li")),n.item.parent().find("li").addClass("mjs-nestedSortable-leaf")}}).selectable().find("li").prepend("
      ")}function n(e,t){$("#"+e.getName()+"filter").autocomplete({source:t,select:function(t,n){return $("#"+e.getName()+"filter").val(""),$("#"+e.getName()+"_people_"+n.item.value).addClass("ui-selected"),!1}})}var e="unique-sortable";Identity.showListNested=function(t,n){list="
        div",maxLevels:2,isTree:!0,expandOnHover:700,startCollapsed:!0}),$(".disclose").on("click",function(){$(this).closest("li").toggleClass("mjs-nestedSortable-collapsed").toggleClass("mjs-nestedSortable-expanded")})},Identity.showList=function(e,r){var i="",s=r.getPeopleData(),o=[];i='
          ';for(var u=0;u"),n(r,o),$("#"+e).append(i),t(e,i,r.getName()+"-sortable")}})();
  • Home