TagSpaces is an offline, open source, document manager with tagging support
Cleaning up
uggrock831ac05fcc31
diff --git a/data/ext/perspectiveDefault/quantifiedSelfGraph.js b/data/ext/perspectiveDefault/quantifiedSelfGraph.jsdeleted file mode 100644index 4f116f119..000000000--- a/data/ext/perspectiveDefault/quantifiedSelfGraph.js+++ /dev/null@@ -1,177 +0,0 @@-/* Copyright (c) 2012-2013 The TagSpaces Authors. All rights reserved.- * Use of this source code is governed by a AGPL3 license that- * can be found in the LICENSE file. */--define(function(require, exports, module) {-"use strict";-- var extensionTitle = "List"- var extensionID = "perspectiveDefault"; // ID should be equal to the directory name where the ext. is located- var extensionType = "perspective";- var extensionIcon = "icon-list-ul";- var extensionVersion = "1.0";- var extensionManifestVersion = 1;- var extensionLicense = "AGPL";-- console.log("Loading Quantified Self");-- var TSCORE = require("tscore");-- var renderPlace = undefined;- var csvData = undefined;-- var n = 4, // number of layers- m = 58, // number of samples per layer- stack = d3.layout.stack(),- layers = stack(d3.range(n).map(function() { return bumpLayer(m, .1); })),- yGroupMax = d3.max(layers, function(layer) { return d3.max(layer, function(d) { return d.y; }); }),- yStackMax = d3.max(layers, function(layer) { return d3.max(layer, function(d) { return d.y0 + d.y; }); });-- var margin = {top: 20, right: 40, bottom: 30, left: 20},- width = 960 - margin.left - margin.right,- height = 500 - margin.top - margin.bottom,- barWidth = Math.floor(width / 19) - 1;-- var x = d3.scale.linear()- .range([barWidth / 2, width - barWidth / 2]);-- var y = d3.scale.linear()- .range([height, 0]);-- var yAxis = d3.svg.axis()- .scale(y)- .orient("right")- .tickSize(-width)- .tickFormat(function(d) { return Math.round(d / 1e6) + "M"; });-- var svg = undefined;-- // A sliding container to hold the bars by birthyear.- var birthyears = svg.append("g")- .attr("class", "birthyears");-- // A label for the current year.- var title = svg.append("text")- .attr("class", "title")- .attr("dy", ".71em")- .text(2000);-- function update() {- if (!(year in data)) return;- title.text(year);-- birthyears.transition()- .duration(750)- .attr("transform", "translate(" + (x(year1) - x(year)) + ",0)");-- birthyear.selectAll("rect")- .data(function(birthyear) { return data[year][birthyear] || [0, 0]; })- .transition()- .duration(750)- .attr("y", y)- .attr("height", function(value) { return height - y(value); });- }-- function init(renderer, csv) {- console.log("Initializing Quantified Self");- renderPlace = renderer;- csvData = csv;-- svg = d3.select("body").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 = csv;-- // Convert strings to numbers.- data.forEach(function(d) {- d.people = +d.tag3;- d.year = +d.tag0;- d.age = +d.tag1;- });-- // Compute the extent of the data set in age and years.- var age1 = d3.max(data, function(d) { return d.age; }),- year0 = d3.min(data, function(d) { return d.year; }),- year1 = d3.max(data, function(d) { return d.year; }),- year = year1;-- // Update the scale domains.- x.domain([year1 - age1, year1]);- y.domain([0, d3.max(data, function(d) { return d.people; })]);-- // Produce a map from year and birthyear to [male, female].- data = d3.nest()- .key(function(d) { return d.year; })- .key(function(d) { return d.year - d.age; })- .rollup(function(v) { return v.map(function(d) { return d.people; }); })- .map(data);-- // Add an axis to show the population values.- svg.append("g")- .attr("class", "y axis")- .attr("transform", "translate(" + width + ",0)")- .call(yAxis)- .selectAll("g")- .filter(function(value) { return !value; })- .classed("zero", true);-- // Add labeled rects for each birthyear (so that no enter or exit is required).- var birthyear = birthyears.selectAll(".birthyear")- .data(d3.range(year0 - age1, year1 + 1, 5))- .enter().append("g")- .attr("class", "birthyear")- .attr("transform", function(birthyear) { return "translate(" + x(birthyear) + ",0)"; });-- birthyear.selectAll("rect")- .data(function(birthyear) { return data[year][birthyear] || [0, 0]; })- .enter().append("rect")- .attr("x", -barWidth / 2)- .attr("width", barWidth)- .attr("y", y)- .attr("height", function(value) { return height - y(value); });-- // Add labels to show birthyear.- birthyear.append("text")- .attr("y", height - 4)- .text(function(birthyear) { return birthyear; });-- // Add labels to show age (separate; not animated).- svg.selectAll(".age")- .data(d3.range(0, age1 + 1, 5))- .enter().append("text")- .attr("class", "age")- .attr("x", function(age) { return x(year - age); })- .attr("y", height + 4)- .attr("dy", ".71em")- .text(function(age) { return age; });-- // Allow the arrow keys to change the displayed year.- window.focus();- d3.select(window).on("keydown", function() {- switch (d3.event.keyCode) {- case 37: year = Math.max(year0, year - 10); break;- case 39: year = Math.min(year1, year + 10); break;- }- update();- });---- }-- // Vars- exports.Title = extensionTitle;- exports.ID = extensionID;- exports.Type = extensionType;- exports.Icon = extensionIcon;- exports.Version = extensionVersion;- exports.ManifestVersion = extensionManifestVersion;- exports.License = extensionLicense;-- // Methods- exports.init = init;--});\ No newline at end of file