diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2013-07-11 19:44:22 +0200 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2013-07-11 19:44:22 +0200 |
commit | a3a4ce32f0596ff0bf48c7cc04292389e0d9627d (patch) | |
tree | fde894d4ecb2c2fa337efad35a114a5bbd4b1ec8 /hyperkitty/static/js/hyperkitty-overview.js | |
parent | 7660b947f88493bc241f8af3e1e855f75e1d9cd7 (diff) | |
download | hyperkitty-a3a4ce32f0596ff0bf48c7cc04292389e0d9627d.tar.gz hyperkitty-a3a4ce32f0596ff0bf48c7cc04292389e0d9627d.tar.xz hyperkitty-a3a4ce32f0596ff0bf48c7cc04292389e0d9627d.zip |
Move static files into the hyperkitty prefix
Diffstat (limited to 'hyperkitty/static/js/hyperkitty-overview.js')
-rw-r--r-- | hyperkitty/static/js/hyperkitty-overview.js | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/hyperkitty/static/js/hyperkitty-overview.js b/hyperkitty/static/js/hyperkitty-overview.js deleted file mode 100644 index bf88118..0000000 --- a/hyperkitty/static/js/hyperkitty-overview.js +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 1998-2012 by the Free Software Foundation, Inc. - * - * This file is part of HyperKitty. - * - * HyperKitty 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. - * - * HyperKitty 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 - * HyperKitty. If not, see <http://www.gnu.org/licenses/>. - * - * Author: Aurelien Bompard <abompard@fedoraproject.org> - */ - - -/* - * Recent activity graph - */ -function activity_graph(elem_id, dates, counts, baseurl) { - function merge(dates, counts) { - result = [] - for(i = 0; i < dates.length; i++) { - result.push({ - "date": dates[i], - "count": counts[i] - }) - } - return result; - } - var data = merge(dates, counts); - var margin = {top: 20, right: 20, bottom: 100, left: 50}, - width = 540 - margin.left - margin.right, - height = 330 - margin.top - margin.bottom; - - var format_in = d3.time.format("%Y-%m-%d"); - var format_out = d3.time.format("%m-%d"); - - var x = d3.time.scale() - .range([0, width]); - - var y = d3.scale.linear() - .range([height, 0]); - - var xAxis = d3.svg.axis() - .scale(x) - .orient("bottom") - .tickFormat(format_out) - .ticks(d3.time.days, 2); - - var yAxis = d3.svg.axis() - .scale(y) - .orient("left") - .ticks(5) - .tickSubdivide(1); - - var area = d3.svg.area() - .x(function(d) { return x(d.date); }) - .y0(height) - .y1(function(d) { return y(d.count); }); - - var svg = d3.select(elem_id).append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - data.forEach(function(d) { - d.date = format_in.parse(d.date); - d.count = parseInt(d.count); - }); - - x.domain(d3.extent(data, function(d) { return d.date; })); - y.domain([0, d3.max(data, function(d) { return d.count; })]); - - svg.append("path") - .datum(data) - .attr("class", "area") - .attr("d", area); - - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis) - .selectAll("text") - .attr("y", -5) - .attr("x", -30) - .attr("transform", function(d) { - return "rotate(-90)" - }); - - svg.append("g") - .attr("class", "y axis") - .call(yAxis) - .append("text") - .attr("transform", "rotate(-90)") - .attr("y", 6) - .attr("dy", ".71em") - .style("text-anchor", "end") - .text("Messages"); -} |