community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1663688 - in /comdev/reporter.apache.org/site: index.html render.js
Date Tue, 03 Mar 2015 12:45:22 GMT
Author: humbedooh
Date: Tue Mar  3 12:45:22 2015
New Revision: 1663688

URL: http://svn.apache.org/r1663688
Log:
Add a preliminary release chart graph thingy

Modified:
    comdev/reporter.apache.org/site/index.html
    comdev/reporter.apache.org/site/render.js

Modified: comdev/reporter.apache.org/site/index.html
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/site/index.html?rev=1663688&r1=1663687&r2=1663688&view=diff
==============================================================================
--- comdev/reporter.apache.org/site/index.html (original)
+++ comdev/reporter.apache.org/site/index.html Tue Mar  3 12:45:22 2015
@@ -28,7 +28,7 @@
    For inquiries, contact <a href="mailto:dev@community.apache.org">dev@community.apache.org</a>.
 </div>
 <script type="text/javascript">
-   google.load("visualization", "1", {packages:["corechart"]});
+   google.load("visualization", "1", {packages:["corechart", "timeline"]});
    google.setOnLoadCallback(function() {
       var project = document.location.search.substr(1);
       GetAsyncJSON("/getjson.py?" + project, project, renderFrontPage)

Modified: comdev/reporter.apache.org/site/render.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/site/render.js?rev=1663688&r1=1663687&r2=1663688&view=diff
==============================================================================
--- comdev/reporter.apache.org/site/render.js (original)
+++ comdev/reporter.apache.org/site/render.js Tue Mar  3 12:45:22 2015
@@ -326,6 +326,13 @@ function renderFrontPage(json) {
 	}
 	releases.innerHTML += "<i>(A total of " + (tr-nr) + " older release(s) were found
for " + pmc + " in our db)</i><br/>"
 	releases.innerHTML += "<br/><a href='addrelease.html?" + pmc + "'>Add a release</a><br/>"
+	
+	if (tr > 0) {
+		var div = renderReleaseChart(json.releases[pmc], pmc, releases);
+		releases.appendChild(div)
+	}
+	
+	
 	addLine(pmc)
 	
 	var mlbox = buildPanel(pmc, "Mailing lists");
@@ -481,3 +488,50 @@ function renderChart(json, name, contain
     return [cu, difference, chartDiv];
 
 }
+
+
+
+function renderReleaseChart(releases, name, container) {
+    
+    var chartDiv = document.createElement('div')
+    chartDiv.setAttribute("id", name + "_releasechart")
+    var narr = []
+    for (version in releases) {
+		if (new Date(releases[version]*1000).getFullYear() >= 1999 ) {
+			var major = parseInt(version) ? parseInt(version) : version
+			var x = version.match(/(\d+\.\d+)\.\d+/)
+			if (x) {
+				major = parseFloat(x[1])
+			}
+			narr.push([new Date(releases[version]*1000), major , String(version)])
+		}
+		
+    }
+    
+    var data = new google.visualization.DataTable();
+	
+	data.addColumn('datetime', 'Date');
+	data.addColumn('number', 'Major Version')
+	data.addColumn('string', 'tooltip');
+	data.setColumnProperty(2, 'role', 'tooltip');
+	
+	data.addRows(narr);
+
+    
+    var options = {
+      title: 'Release timeline for ' + name,
+      height: 240,
+      width: 800,
+      backgroundColor: 'transparent',
+	  series: [
+		{pointSize: 15},
+	],
+	  pointShape: { type: 'star', sides: 5 }
+    };
+
+    var chart = new google.visualization.ScatterChart(chartDiv);
+	chartDiv.style.marginLeft = "50px";
+    
+    chart.draw(data, options);
+    return chartDiv
+}



Mime
View raw message