summaryrefslogtreecommitdiff
path: root/visualize/static
diff options
context:
space:
mode:
Diffstat (limited to 'visualize/static')
-rw-r--r--visualize/static/.gitignore3
-rw-r--r--visualize/static/Makefile41
-rw-r--r--visualize/static/visualize.js20
3 files changed, 64 insertions, 0 deletions
diff --git a/visualize/static/.gitignore b/visualize/static/.gitignore
new file mode 100644
index 00000000..ecb2b9c4
--- /dev/null
+++ b/visualize/static/.gitignore
@@ -0,0 +1,3 @@
+.d3
+d3.v2.js
+d3.v2.min.js
diff --git a/visualize/static/Makefile b/visualize/static/Makefile
new file mode 100644
index 00000000..4fa99a20
--- /dev/null
+++ b/visualize/static/Makefile
@@ -0,0 +1,41 @@
+d3version=2.8.1
+
+targets=d3.v2.js d3.v2.min.js
+gitignore=.d3
+
+# Force creating the d3 directory before we even evaluate how to make d3.js
+all: .d3/d3-$(d3version) .gitignore
+ $(MAKE) $(targets)
+
+distclean-hook: PHONY
+ rm -rf .d3
+
+####
+
+d3.%: .d3/d3-$(d3version)/d3.% .d3/d3-$(d3version)/LICENSE Makefile
+ @echo '[D3-HEADER] > $@'
+ @echo '/* $@ - Data Driven Documents' > $@
+ @echo ' * Version: $(d3version)' >> $@
+ @echo ' * Homepage: http://mbostock.github.com/d3/' >> $@
+ @echo ' * Copyright: 2010, Michael Bostock' >> $@
+ @echo ' * Licence: 3-Clause BSD' >> $@
+ @echo ' *' >> $@
+ @sed 's/.*/ * &/' $(<D)/LICENSE >> $@
+ @echo ' */' >> $@
+ cat $< >> $@
+
+.d3/d3-%.tar.gz: Makefile
+ mkdir -p $(@D)
+ wget https://github.com/mbostock/d3/tarball/v$* -O $@
+.d3/d3-%.tar.gz.d: .d3/d3-%.tar.gz Makefile
+ rm -rf $@
+ mkdir -p $<.d
+ cd $@ && tar xzf ../d3-$*.tar.gz
+.d3/d3-%: .d3/d3-%.tar.gz.d Makefile
+ rm -rf $@
+ cp -r $</*/ $@
+ rm $@/*.min.js
+
+####
+
+include ../../sitestatic/js.mk
diff --git a/visualize/static/visualize.js b/visualize/static/visualize.js
index 5004fe6c..ff39bb96 100644
--- a/visualize/static/visualize.js
+++ b/visualize/static/visualize.js
@@ -1,3 +1,23 @@
+/* archweb.js
+ * Homepage: https://projects.archlinux.org/archweb.git/
+ * Copyright: 2011 Dan McGee
+ * License: GPLv2
+ *
+ * This file is part of Archweb.
+ *
+ * Archweb is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Archweb 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 Archweb. If not, see <http://www.gnu.org/licenses/>.
+ */
+
function packages_treemap(chart_id, orderings, default_order) {
var jq_div = jQuery(chart_id),
color = d3.scale.category20();