From e2dfad080a46368950f387c88103561e07c9afa6 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Thu, 10 Apr 2014 12:07:54 -0400
Subject: [PATCH] Remove remaining GoogleCharts code and update documentation

---
 NOTICE                                            |   29 +++++++++-----
 src/site/design.mkd                               |    3 +
 .classpath                                        |    1 
 src/main/java/com/gitblit/wicket/WicketUtils.java |   55 ---------------------------
 build.moxie                                       |    1 
 gitblit.iml                                       |   11 -----
 6 files changed, 21 insertions(+), 79 deletions(-)

diff --git a/.classpath b/.classpath
index 5f3db2b..fd38d56 100644
--- a/.classpath
+++ b/.classpath
@@ -20,7 +20,6 @@
 	<classpathentry kind="lib" path="ext/wicket-1.4.21.jar" sourcepath="ext/src/wicket-1.4.21.jar" />
 	<classpathentry kind="lib" path="ext/wicket-auth-roles-1.4.21.jar" sourcepath="ext/src/wicket-auth-roles-1.4.21.jar" />
 	<classpathentry kind="lib" path="ext/wicket-extensions-1.4.21.jar" sourcepath="ext/src/wicket-extensions-1.4.21.jar" />
-	<classpathentry kind="lib" path="ext/googlecharts-1.4.21.jar" sourcepath="ext/src/googlecharts-1.4.21.jar" />
 	<classpathentry kind="lib" path="ext/lucene-core-4.6.0.jar" sourcepath="ext/src/lucene-core-4.6.0.jar" />
 	<classpathentry kind="lib" path="ext/lucene-analyzers-common-4.6.0.jar" sourcepath="ext/src/lucene-analyzers-common-4.6.0.jar" />
 	<classpathentry kind="lib" path="ext/lucene-highlighter-4.6.0.jar" sourcepath="ext/src/lucene-highlighter-4.6.0.jar" />
diff --git a/NOTICE b/NOTICE
index 359488f..27c01e0 100644
--- a/NOTICE
+++ b/NOTICE
@@ -48,14 +48,6 @@
    http://wicket.apache.org
    
 ---------------------------------------------------------------------------
-WicketStuff GoogleCharts
----------------------------------------------------------------------------
-   WicketStuff GoogleCharts, released under the
-   Apache Software License, Version 2.0.
-
-   https://github.com/wicketstuff/core/wiki/GoogleCharts   
-   
----------------------------------------------------------------------------
 Jetty
 ---------------------------------------------------------------------------
    Jetty, released under the
@@ -203,7 +195,7 @@
 UnboundID
 ---------------------------------------------------------------------------
    UnboundID, released under the
-   GNU LESSER GENERAL PUBLIC LICENSE. (http://www.unboundid.com/products/ldap-sdk/docs/LICENSE-LGPLv2.1.txt)
+   GNU LESSER GENERAL PUBLIC LICENSE.
 
    http://www.unboundid.com
 
@@ -211,7 +203,7 @@
 JCalendar
 ---------------------------------------------------------------------------
    JCalendar, released under the
-   GNU LESSER GENERAL PUBLIC LICENSE. (http://www.unboundid.com/products/ldap-sdk/docs/LICENSE-LGPLv2.1.txt)
+   GNU LESSER GENERAL PUBLIC LICENSE.
 
    http://www.toedter.com/en/jcalendar
    
@@ -334,3 +326,20 @@
    Apache License 2.0
    
    http://args4j.kohsuke.org
+
+---------------------------------------------------------------------------
+jQuery
+---------------------------------------------------------------------------
+   jQuery, release under the
+   MIT License
+   
+   https://jquery.org
+
+---------------------------------------------------------------------------
+flotr2
+---------------------------------------------------------------------------
+   flotr2, release under the
+   BSD License
+   
+   http://humblesoftware.com/flotr2
+   
\ No newline at end of file
diff --git a/build.moxie b/build.moxie
index 0b8d718..19a9027 100644
--- a/build.moxie
+++ b/build.moxie
@@ -138,7 +138,6 @@
 - compile 'org.apache.wicket:wicket:${wicket.version}' :war !org.mockito
 - compile 'org.apache.wicket:wicket-auth-roles:${wicket.version}' :war !org.mockito
 - compile 'org.apache.wicket:wicket-extensions:${wicket.version}' :war !org.mockito
-- compile 'org.wicketstuff:googlecharts:${wicket.version}' :war
 - compile 'org.apache.lucene:lucene-core:${lucene.version}' :war :fedclient
 - compile 'org.apache.lucene:lucene-analyzers-common:${lucene.version}' :war :fedclient
 - compile 'org.apache.lucene:lucene-highlighter:${lucene.version}' :war :fedclient
diff --git a/gitblit.iml b/gitblit.iml
index afbb2a3..8e787cb 100644
--- a/gitblit.iml
+++ b/gitblit.iml
@@ -179,17 +179,6 @@
       </library>
     </orderEntry>
     <orderEntry type="module-library">
-      <library name="googlecharts-1.4.21.jar">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/ext/googlecharts-1.4.21.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES>
-          <root url="jar://$MODULE_DIR$/ext/src/googlecharts-1.4.21.jar!/" />
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
       <library name="lucene-core-4.6.0.jar">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/ext/lucene-core-4.6.0.jar!/" />
diff --git a/src/main/java/com/gitblit/wicket/WicketUtils.java b/src/main/java/com/gitblit/wicket/WicketUtils.java
index bba3f79..8598447 100644
--- a/src/main/java/com/gitblit/wicket/WicketUtils.java
+++ b/src/main/java/com/gitblit/wicket/WicketUtils.java
@@ -38,8 +38,6 @@
 import org.apache.wicket.protocol.http.WebRequest;
 import org.apache.wicket.resource.ContextRelativeResource;
 import org.eclipse.jgit.diff.DiffEntry.ChangeType;
-import org.wicketstuff.googlecharts.AbstractChartData;
-import org.wicketstuff.googlecharts.IChartData;
 
 import com.gitblit.Constants;
 import com.gitblit.Constants.AccessPermission;
@@ -632,32 +630,6 @@
 		return label;
 	}
 
-	public static IChartData getChartData(Collection<Metric> metrics) {
-		final double[] commits = new double[metrics.size()];
-		final double[] tags = new double[metrics.size()];
-		int i = 0;
-		double max = 0;
-		for (Metric m : metrics) {
-			commits[i] = m.count;
-			if (m.tag > 0) {
-				tags[i] = m.count;
-			} else {
-				tags[i] = -1d;
-			}
-			max = Math.max(max, m.count);
-			i++;
-		}
-		IChartData data = new AbstractChartData(max) {
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			public double[][] getData() {
-				return new double[][] { commits, tags };
-			}
-		};
-		return data;
-	}
-
 	public static double maxValue(Collection<Metric> metrics) {
 		double max = Double.MIN_VALUE;
 		for (Metric m : metrics) {
@@ -667,31 +639,4 @@
 		}
 		return max;
 	}
-
-	public static IChartData getScatterData(Collection<Metric> metrics) {
-		final double[] y = new double[metrics.size()];
-		final double[] x = new double[metrics.size()];
-		int i = 0;
-		double max = 0;
-		for (Metric m : metrics) {
-			y[i] = m.count;
-			if (m.duration > 0) {
-				x[i] = m.duration;
-			} else {
-				x[i] = -1d;
-			}
-			max = Math.max(max, m.count);
-			i++;
-		}
-		IChartData data = new AbstractChartData(max) {
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			public double[][] getData() {
-				return new double[][] { x, y };
-			}
-		};
-		return data;
-	}
-
 }
diff --git a/src/site/design.mkd b/src/site/design.mkd
index 8351dd9..6d4b29c 100644
--- a/src/site/design.mkd
+++ b/src/site/design.mkd
@@ -17,6 +17,8 @@
 - [Clippy](https://github.com/mojombo/clippy) (MIT)
 - [google-code-prettify](http://code.google.com/p/google-code-prettify) (Apache 2.0)
 - [Commons Daemon](http://commons.apache.org/daemon) (Apache 2.0)
+- [jQuery](https://jquery.org) (MIT)
+- [flotr2](http://humblesoftware.com/flotr2) (BSD)
 - magnifying glass search icon courtesy of [Gnome](http://gnome.org) (Creative Commons CC-BY)
 - Git logo originally designed by [Jason Long](http://git-scm.com/downloads/logos)
 - modified Git logo originally designed by [Henrik Nyh](http://henrik.nyh.se/2007/06/alternative-git-logo-and-favicon)
@@ -28,7 +30,6 @@
 
 - [JGit][jgit] (EDL 1.0)
 - [Wicket](http://wicket.apache.org) (Apache 2.0)
-- [WicketStuff GoogleCharts](https://github.com/wicketstuff/core/wiki/GoogleCharts) (Apache 2.0)
 - [Jetty](http://eclipse.org/jetty) (Apache 2.0, EPL 1.0)
 - [SLF4J](http://www.slf4j.org) (MIT/X11)
 - [Log4j](http://logging.apache.org/log4j) (Apache 2.0)

--
Gitblit v1.9.1