)"
15 | ],
16 | "keywords": [
17 | "underscore",
18 | "string"
19 | ],
20 | "main": "./lib/underscore.string",
21 | "directories": {
22 | "lib": "./lib"
23 | },
24 | "engines": {
25 | "node": "*"
26 | },
27 | "repository": {
28 | "type": "git",
29 | "url": "https://github.com/epeli/underscore.string.git"
30 | },
31 | "bugs": {
32 | "url": "https://github.com/epeli/underscore.string/issues"
33 | },
34 | "licenses" : [
35 | { "type" : "MIT" }
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/component.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "d3",
3 | "version": "3.0.4",
4 | "main": "./d3.js",
5 | "gitHead": "11a19ec03d21a2908ce2d0ceed954e6a41a58cfc",
6 | "readme": "# Data-Driven Documents\n\n**D3.js** is a JavaScript library for manipulating documents based on data. **D3** helps you bring data to life using HTML, SVG and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.\n\nWant to learn more? [See the wiki.](https://github.com/mbostock/d3/wiki)\n\nFor examples, [see the gallery](https://github.com/mbostock/d3/wiki/Gallery) and [mbostock’s bl.ocks](http://bl.ocks.org/mbostock).\n",
7 | "readmeFilename": "README.md",
8 | "_id": "d3@3.0.4",
9 | "description": "**D3.js** is a JavaScript library for manipulating documents based on data. **D3** helps you bring data to life using HTML, SVG and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.",
10 | "repository": {
11 | "type": "git",
12 | "url": "git://github.com/mbostock/d3.git"
13 | }
14 | }
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/src/layout/partition.js:
--------------------------------------------------------------------------------
1 | d3.layout.partition = function() {
2 | var hierarchy = d3.layout.hierarchy(),
3 | size = [1, 1]; // width, height
4 |
5 | function position(node, x, dx, dy) {
6 | var children = node.children;
7 | node.x = x;
8 | node.y = node.depth * dy;
9 | node.dx = dx;
10 | node.dy = dy;
11 | if (children && (n = children.length)) {
12 | var i = -1,
13 | n,
14 | c,
15 | d;
16 | dx = node.value ? dx / node.value : 0;
17 | while (++i < n) {
18 | position(c = children[i], x, d = c.value * dx, dy);
19 | x += d;
20 | }
21 | }
22 | }
23 |
24 | function depth(node) {
25 | var children = node.children,
26 | d = 0;
27 | if (children && (n = children.length)) {
28 | var i = -1,
29 | n;
30 | while (++i < n) d = Math.max(d, depth(children[i]));
31 | }
32 | return 1 + d;
33 | }
34 |
35 | function partition(d, i) {
36 | var nodes = hierarchy.call(this, d, i);
37 | position(nodes[0], 0, size[0], size[1] / depth(nodes[0]));
38 | return nodes;
39 | }
40 |
41 | partition.size = function(x) {
42 | if (!arguments.length) return size;
43 | size = x;
44 | return partition;
45 | };
46 |
47 | return d3_layout_hierarchyRebind(partition, hierarchy);
48 | };
49 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/transition-test-time.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var assert = require("assert");
4 |
5 | module.exports = {
6 | topic: function() {
7 | return d3.select("body").append("div").transition();
8 | },
9 | "is approximately equal to now": function(transition) {
10 | var time = transition[0][0].__transition__[transition.id].time;
11 | assert.inDelta(time, Date.now(), 20);
12 | },
13 | "increases monotonically across transitions": function(transition) {
14 | var now = Date.now, then = Date.now();
15 | try {
16 | Date.now = function() { return ++then; };
17 | var t0 = d3.select("body").append("div").transition(),
18 | t1 = d3.select("body").append("div").transition();
19 | assert.isTrue(t1[0][0].__transition__[t1.id].time > t0[0][0].__transition__[t0.id].time);
20 | } finally {
21 | Date.now = now;
22 | }
23 | },
24 | "is inherited by subtransitions": function(transition) {
25 | var now = Date.now, then = Date.now();
26 | try {
27 | Date.now = function() { return ++then; };
28 | var t0 = d3.select("body").append("div").transition(),
29 | t1 = t0.transition();
30 | assert.equal(t1[0][0].__transition__[t1.id].time, t0[0][0].__transition__[t0.id].time);
31 | } finally {
32 | Date.now = now;
33 | }
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/layout/cluster-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.layout.cluster");
7 |
8 | suite.addBatch({
9 | "cluster": {
10 | topic: d3.layout.cluster,
11 | "can handle an empty children array": function(cluster) {
12 | assert.deepEqual(cluster.nodes({value: 1, children: [{value: 1, children: []}, {value: 1}]}).map(layout), [
13 | {value: 1, depth: 0, x: 0.5, y: 0},
14 | {value: 1, depth: 1, x: 0.25, y: 1},
15 | {value: 1, depth: 1, x: 0.75, y: 1}
16 | ]);
17 | },
18 | "can handle zero-valued nodes": function(cluster) {
19 | assert.deepEqual(cluster.nodes({value: 0, children: [{value: 0}, {value: 1}]}).map(layout), [
20 | {value: 0, depth: 0, x: 0.5, y: 0},
21 | {value: 0, depth: 1, x: 0.25, y: 1},
22 | {value: 1, depth: 1, x: 0.75, y: 1}
23 | ]);
24 | },
25 | "can handle a single node": function(cluster) {
26 | assert.deepEqual(cluster.nodes({value: 0}).map(layout), [
27 | {value: 0, depth: 0, x: 0.5, y: 0}
28 | ]);
29 | }
30 | }
31 | });
32 |
33 | function layout(node) {
34 | return {
35 | value: node.value,
36 | depth: node.depth,
37 | x: node.x,
38 | y: node.y
39 | };
40 | }
41 |
42 | suite.export(module);
43 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/src/geo/path-buffer.js:
--------------------------------------------------------------------------------
1 | function d3_geo_pathBuffer() {
2 | var pointCircle = d3_geo_pathCircle(4.5),
3 | buffer = [];
4 |
5 | var stream = {
6 | point: point,
7 |
8 | // While inside a line, override point to moveTo then lineTo.
9 | lineStart: function() { stream.point = pointLineStart; },
10 | lineEnd: lineEnd,
11 |
12 | // While inside a polygon, override lineEnd to closePath.
13 | polygonStart: function() { stream.lineEnd = lineEndPolygon; },
14 | polygonEnd: function() { stream.lineEnd = lineEnd; stream.point = point; },
15 |
16 | pointRadius: function(_) {
17 | pointCircle = d3_geo_pathCircle(_);
18 | return stream;
19 | },
20 |
21 | result: function() {
22 | if (buffer.length) {
23 | var result = buffer.join("");
24 | buffer = [];
25 | return result;
26 | }
27 | }
28 | };
29 |
30 | function point(x, y) {
31 | buffer.push("M", x, ",", y, pointCircle);
32 | }
33 |
34 | function pointLineStart(x, y) {
35 | buffer.push("M", x, ",", y);
36 | stream.point = pointLine;
37 | }
38 |
39 | function pointLine(x, y) {
40 | buffer.push("L", x, ",", y);
41 | }
42 |
43 | function lineEnd() {
44 | stream.point = point;
45 | }
46 |
47 | function lineEndPolygon() {
48 | buffer.push("Z");
49 | }
50 |
51 | return stream;
52 | }
53 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/select-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.select");
7 |
8 | suite.addBatch({
9 | "select": {
10 | topic: function() {
11 | var body = d3.select("body").html("");
12 | body.append("span").attr("class", "f00").attr("id", "b4r").attr("name", "b4z");
13 | body.append("div").attr("class", "foo").attr("id", "bar").attr("name", "baz");
14 | return body;
15 | },
16 | "selects by element name": function() {
17 | var div = d3.select("div");
18 | assert.equal(div[0][0].tagName, "DIV");
19 | },
20 | "selects by class name": function() {
21 | var div = d3.select(".foo");
22 | assert.equal(div[0][0].className, "foo");
23 | },
24 | "selects by id": function() {
25 | var div = d3.select("div#bar");
26 | assert.equal(div[0][0].id, "bar");
27 | },
28 | "selects by attribute value": function() {
29 | var div = d3.select("[name=baz]");
30 | assert.equal(div[0][0].getAttribute("name"), "baz");
31 | },
32 | "selects by node": function() {
33 | var div = d3.select(document.body.lastChild);
34 | assert.isTrue(div[0][0] === document.body.lastChild);
35 | assert.lengthOf(div, 1);
36 | assert.lengthOf(div[0], 1);
37 | }
38 | }
39 | });
40 |
41 | suite.export(module);
42 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/src/core/map.js:
--------------------------------------------------------------------------------
1 | d3.map = function(object) {
2 | var map = new d3_Map;
3 | for (var key in object) map.set(key, object[key]);
4 | return map;
5 | };
6 |
7 | function d3_Map() {}
8 |
9 | d3_class(d3_Map, {
10 | has: function(key) {
11 | return d3_map_prefix + key in this;
12 | },
13 | get: function(key) {
14 | return this[d3_map_prefix + key];
15 | },
16 | set: function(key, value) {
17 | return this[d3_map_prefix + key] = value;
18 | },
19 | remove: function(key) {
20 | key = d3_map_prefix + key;
21 | return key in this && delete this[key];
22 | },
23 | keys: function() {
24 | var keys = [];
25 | this.forEach(function(key) { keys.push(key); });
26 | return keys;
27 | },
28 | values: function() {
29 | var values = [];
30 | this.forEach(function(key, value) { values.push(value); });
31 | return values;
32 | },
33 | entries: function() {
34 | var entries = [];
35 | this.forEach(function(key, value) { entries.push({key: key, value: value}); });
36 | return entries;
37 | },
38 | forEach: function(f) {
39 | for (var key in this) {
40 | if (key.charCodeAt(0) === d3_map_prefixCode) {
41 | f.call(this, key.substring(1), this[key]);
42 | }
43 | }
44 | }
45 | });
46 |
47 | var d3_map_prefix = "\0", // prevent collision with built-ins
48 | d3_map_prefixCode = d3_map_prefix.charCodeAt(0);
49 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/underscore.string/test/run-qunit.js:
--------------------------------------------------------------------------------
1 | function waitFor(test, complete, timeout) {
2 | var result, start = new Date().getTime()
3 | setInterval(function interval() {
4 | if ((new Date().getTime() - start < timeout) && !result) {
5 | result = test()
6 | } else {
7 | if (!result) {
8 | phantom.exit(1)
9 | } else {
10 | complete()
11 | clearInterval(interval)
12 | }
13 | }
14 | }, 100)
15 | }
16 |
17 |
18 | var fs = require('fs'), page = require('webpage').create();
19 | var url = 'file://localhost' + fs.workingDirectory + '/' + phantom.args[0];
20 |
21 | page.onConsoleMessage = function(msg) {
22 | console.log(msg)
23 | }
24 |
25 | page.open(url, function(status) {
26 | waitFor(function() {
27 | return page.evaluate(function(){
28 | var el = document.getElementById('qunit-testresult')
29 | return el && el.innerText.match('completed')
30 | })
31 | }, function() {
32 | var failures = page.evaluate(function() {
33 | var el = document.getElementById('qunit-testresult'),
34 | fails = document.getElementsByClassName('fail')
35 |
36 | for (var i = 0; i < fails.length; i++)
37 | console.log(fails[i].innerText)
38 |
39 | console.log(el.innerText)
40 |
41 | return parseInt(el.getElementsByClassName('failed')[0].innerHTML)
42 | })
43 | phantom.exit(failures > 0 ? 1 : 0)
44 | }, 10000)
45 | })
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/ascending-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.ascending");
7 |
8 | suite.addBatch({
9 | "numbers": {
10 | "returns a negative number if a < b": function() {
11 | assert.isTrue(d3.ascending(0, 1) < 0);
12 | },
13 | "returns a positive number if a > b": function() {
14 | assert.isTrue(d3.ascending(1, 0) > 0);
15 | },
16 | "returns zero if a == b": function() {
17 | assert.equal(d3.ascending(0, 0), 0);
18 | },
19 | "returns NaN if a or b is undefined": function() {
20 | assert.isNaN(d3.ascending(0, undefined));
21 | assert.isNaN(d3.ascending(undefined, 0));
22 | assert.isNaN(d3.ascending(undefined, undefined));
23 | },
24 | "returns NaN if a or b is NaN": function() {
25 | assert.isNaN(d3.ascending(0, NaN));
26 | assert.isNaN(d3.ascending(NaN, 0));
27 | assert.isNaN(d3.ascending(NaN, NaN));
28 | }
29 | }
30 | });
31 |
32 | suite.addBatch({
33 | "strings": {
34 | "returns a negative number if a < b": function() {
35 | assert.isTrue(d3.ascending("a", "b") < 0);
36 | },
37 | "returns a positive number if a > b": function() {
38 | assert.isTrue(d3.ascending("b", "a") > 0);
39 | },
40 | "returns zero if a == b": function() {
41 | assert.equal(d3.ascending("a", "a"), 0);
42 | }
43 | }
44 | });
45 |
46 | suite.export(module);
47 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/text-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.text");
7 |
8 | suite.addBatch({
9 | "text": {
10 | topic: function() {
11 | var cb = this.callback;
12 | d3.text("test/data/sample.txt", function(error, text) {
13 | cb(null, text);
14 | });
15 | },
16 | "invokes the callback with the loaded text": function(text) {
17 | assert.equal(text, "Hello, world!\n");
18 | },
19 | "does not override the mime type by default": function(text) {
20 | assert.isUndefined(XMLHttpRequest._last._info.mimeType);
21 | },
22 | "": {
23 | topic: function() {
24 | var cb = this.callback;
25 | d3.text("test/data/sample.txt", "text/plain+sample", function(error, text) {
26 | cb(null, text);
27 | });
28 | },
29 | "observes the optional mime type": function(text) {
30 | assert.equal(XMLHttpRequest._last._info.mimeType, "text/plain+sample");
31 | }
32 | },
33 | " ": {
34 | topic: function() {
35 | var cb = this.callback;
36 | d3.text("//does/not/exist.txt", function(error, text) {
37 | cb(null, text);
38 | });
39 | },
40 | "invokes the callback with undefined when an error occurs": function(text) {
41 | assert.isUndefined(text);
42 | }
43 | }
44 | }
45 | });
46 |
47 | suite.export(module);
48 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/descending-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.descending");
7 |
8 | suite.addBatch({
9 | "numbers": {
10 | "returns a negative number if a > b": function() {
11 | assert.isTrue(d3.descending(1, 0) < 0);
12 | },
13 | "returns a positive number if a < b": function() {
14 | assert.isTrue(d3.descending(0, 1) > 0);
15 | },
16 | "returns zero if a == b": function() {
17 | assert.equal(d3.descending(0, 0), 0);
18 | },
19 | "returns NaN if a or b is undefined": function() {
20 | assert.isNaN(d3.descending(0, undefined));
21 | assert.isNaN(d3.descending(undefined, 0));
22 | assert.isNaN(d3.descending(undefined, undefined));
23 | },
24 | "returns NaN if a or b is NaN": function() {
25 | assert.isNaN(d3.descending(0, NaN));
26 | assert.isNaN(d3.descending(NaN, 0));
27 | assert.isNaN(d3.descending(NaN, NaN));
28 | }
29 | }
30 | });
31 |
32 | suite.addBatch({
33 | "strings": {
34 | "returns a negative number if a > b": function() {
35 | assert.isTrue(d3.descending("b", "a") < 0);
36 | },
37 | "returns a positive number if a < b": function() {
38 | assert.isTrue(d3.descending("a", "b") > 0);
39 | },
40 | "returns zero if a == b": function() {
41 | assert.equal(d3.descending("a", "a"), 0);
42 | }
43 | }
44 | });
45 |
46 | suite.export(module);
47 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/touch-test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
22 |
23 |
24 |
62 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/src/scale/pow.js:
--------------------------------------------------------------------------------
1 | d3.scale.pow = function() {
2 | return d3_scale_pow(d3.scale.linear(), 1);
3 | };
4 |
5 | function d3_scale_pow(linear, exponent) {
6 | var powp = d3_scale_powPow(exponent),
7 | powb = d3_scale_powPow(1 / exponent);
8 |
9 | function scale(x) {
10 | return linear(powp(x));
11 | }
12 |
13 | scale.invert = function(x) {
14 | return powb(linear.invert(x));
15 | };
16 |
17 | scale.domain = function(x) {
18 | if (!arguments.length) return linear.domain().map(powb);
19 | linear.domain(x.map(powp));
20 | return scale;
21 | };
22 |
23 | scale.ticks = function(m) {
24 | return d3_scale_linearTicks(scale.domain(), m);
25 | };
26 |
27 | scale.tickFormat = function(m) {
28 | return d3_scale_linearTickFormat(scale.domain(), m);
29 | };
30 |
31 | scale.nice = function() {
32 | return scale.domain(d3_scale_nice(scale.domain(), d3_scale_linearNice));
33 | };
34 |
35 | scale.exponent = function(x) {
36 | if (!arguments.length) return exponent;
37 | var domain = scale.domain();
38 | powp = d3_scale_powPow(exponent = x);
39 | powb = d3_scale_powPow(1 / exponent);
40 | return scale.domain(domain);
41 | };
42 |
43 | scale.copy = function() {
44 | return d3_scale_pow(linear.copy(), exponent);
45 | };
46 |
47 | return d3_scale_linearRebind(scale, linear);
48 | }
49 |
50 | function d3_scale_powPow(e) {
51 | return function(x) {
52 | return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e);
53 | };
54 | }
55 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/underscore.string/test/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Underscore.strings Test Suite
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/selection-node-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("selection.node");
7 |
8 | suite.addBatch({
9 | "select(body)": {
10 | topic: function() {
11 | return d3.select("body").html("");
12 | },
13 | "returns null for empty selections": function(body) {
14 | assert.isNull(body.select("foo").node());
15 | },
16 | "returns the first element for non-empty selections": function(body) {
17 | assert.isTrue(body.node() === document.body);
18 | },
19 | "ignores null nodes": function(body) {
20 | var some = d3.select("body");
21 | some[0][0] = null;
22 | assert.isNull(some.node());
23 | }
24 | }
25 | });
26 |
27 | suite.addBatch({
28 | "selectAll(div)": {
29 | topic: function() {
30 | var body = d3.select("body").html("");
31 | body.append("div").append("span");
32 | body.append("div");
33 | return body.selectAll("div");
34 | },
35 | "returns null for empty selections": function(div) {
36 | assert.isNull(div.select("foo").node());
37 | },
38 | "returns the first element for non-empty selections": function(div) {
39 | assert.isTrue(div.node() === div[0][0]);
40 | },
41 | "ignores null nodes": function(div) {
42 | var some = d3.selectAll("div");
43 | some[0][0] = null;
44 | assert.isTrue(some.node() === div[0][1]);
45 | }
46 | }
47 | });
48 |
49 | suite.export(module);
50 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012, Michael Bostock
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | * The name Michael Bostock may not be used to endorse or promote products
15 | derived from this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
21 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/selection-empty-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("selection.empty");
7 |
8 | suite.addBatch({
9 | "select(body)": {
10 | topic: function() {
11 | return d3.select("body").html("");
12 | },
13 | "returns true for empty selections": function(body) {
14 | assert.isTrue(body.select("foo").empty());
15 | },
16 | "returns false for non-empty selections": function(body) {
17 | assert.isFalse(body.empty());
18 | },
19 | "ignores null nodes": function(body) {
20 | var some = d3.select("body");
21 | some[0][0] = null;
22 | assert.isTrue(some.empty());
23 | }
24 | }
25 | });
26 |
27 | suite.addBatch({
28 | "selectAll(div)": {
29 | topic: function() {
30 | var body = d3.select("body").html("");
31 | body.append("div").append("span");
32 | body.append("div");
33 | return body.selectAll("div");
34 | },
35 | "returns true for empty selections": function(div) {
36 | assert.isTrue(div.select("foo").empty());
37 | },
38 | "returns false for non-empty selections": function(div) {
39 | assert.isFalse(div.empty());
40 | assert.isFalse(div.select("span").empty());
41 | },
42 | "ignores null nodes": function(div) {
43 | var some = d3.selectAll("div");
44 | some[0][0] = null;
45 | assert.isTrue(some.select("span").empty());
46 | }
47 | }
48 | });
49 |
50 | suite.export(module);
51 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/lib/queue/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012, Michael Bostock
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | * The name Michael Bostock may not be used to endorse or promote products
15 | derived from this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
21 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/lib/science/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011, Jason Davies
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | * The name Jason Davies may not be used to endorse or promote products
15 | derived from this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | DISCLAIMED. IN NO EVENT SHALL JASON DAVIES BE LIABLE FOR ANY DIRECT, INDIRECT,
21 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/src/core/selection-property.js:
--------------------------------------------------------------------------------
1 | d3_selectionPrototype.property = function(name, value) {
2 | if (arguments.length < 2) {
3 |
4 | // For property(string), return the property value for the first node.
5 | if (typeof name === "string") return this.node()[name];
6 |
7 | // For property(object), the object specifies the names and values of the
8 | // properties to set or remove. The values may be functions that are
9 | // evaluated for each element.
10 | for (value in name) this.each(d3_selection_property(value, name[value]));
11 | return this;
12 | }
13 |
14 | // Otherwise, both a name and a value are specified, and are handled as below.
15 | return this.each(d3_selection_property(name, value));
16 | };
17 |
18 | function d3_selection_property(name, value) {
19 |
20 | // For property(name, null), remove the property with the specified name.
21 | function propertyNull() {
22 | delete this[name];
23 | }
24 |
25 | // For property(name, string), set the property with the specified name.
26 | function propertyConstant() {
27 | this[name] = value;
28 | }
29 |
30 | // For property(name, function), evaluate the function for each element, and
31 | // set or remove the property as appropriate.
32 | function propertyFunction() {
33 | var x = value.apply(this, arguments);
34 | if (x == null) delete this[name];
35 | else this[name] = x;
36 | }
37 |
38 | return value == null
39 | ? propertyNull : (typeof value === "function"
40 | ? propertyFunction : propertyConstant);
41 | }
42 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/xml-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.xml");
7 |
8 | suite.addBatch({
9 | "xml": {
10 | topic: function() {
11 | var cb = this.callback;
12 | d3.xml("test/data/sample.xml", function(error, xml) {
13 | cb(null, xml);
14 | });
15 | },
16 | "invokes the callback with the loaded xml": function(xml) {
17 | assert.deepEqual(xml, {_xml: "\n\n \n\n"});
18 | },
19 | "does not override the mime type by default": function(xml) {
20 | assert.isUndefined(XMLHttpRequest._last._info.mimeType);
21 | },
22 | "": {
23 | topic: function() {
24 | var cb = this.callback;
25 | d3.xml("test/data/sample.txt", "application/xml+sample", function(error, xml) {
26 | cb(null, xml);
27 | });
28 | },
29 | "observes the optional mime type": function(xml) {
30 | assert.equal(XMLHttpRequest._last._info.mimeType, "application/xml+sample");
31 | }
32 | },
33 | " ": {
34 | topic: function() {
35 | var cb = this.callback;
36 | d3.xml("//does/not/exist.xml", function(error, xml) {
37 | cb(null, xml);
38 | });
39 | },
40 | "invokes the callback with undefined when an error occurs": function(xml) {
41 | assert.isUndefined(xml);
42 | }
43 | }
44 | }
45 | });
46 |
47 | suite.export(module);
48 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/env-xhr.js:
--------------------------------------------------------------------------------
1 | var fs = require("fs");
2 |
3 | XMLHttpRequest = function() {
4 | var self = this,
5 | info = self._info = {},
6 | headers = {},
7 | url;
8 |
9 | // TODO handle file system errors?
10 |
11 | self.open = function(m, u, a) {
12 | info.url = u;
13 | info.async = a;
14 | self.send = a ? read : readSync;
15 | };
16 |
17 | self.setRequestHeader = function(n, v) {
18 | if (/^Accept$/i.test(n)) info.mimeType = v.split(/,/g)[0];
19 | };
20 |
21 | function read() {
22 | fs.readFile(info.url, "binary", function(e, d) {
23 | if (e) {
24 | self.status = 404; // assumed
25 | } else {
26 | self.status = 200;
27 | self.responseText = d;
28 | self.responseXML = {_xml: d};
29 | headers["Content-Length"] = d.length;
30 | }
31 | self.readyState = 4;
32 | XMLHttpRequest._last = self;
33 | if (self.onreadystatechange) self.onreadystatechange();
34 | });
35 | }
36 |
37 | function readSync() {
38 | try {
39 | var d = fs.readFileSync(info.url, "binary");
40 | self.status = 200;
41 | self.responseText = d;
42 | self.responseXML = {_xml: d};
43 | headers["Content-Length"] = d.length;
44 | } catch (e) {
45 | self.status = 404; // assumed
46 | }
47 | self.readyState = 4;
48 | XMLHttpRequest._last = self;
49 | if (self.onreadystatechange) self.onreadystatechange();
50 | }
51 |
52 | self.getResponseHeader = function(n) {
53 | return headers[n];
54 | };
55 | };
56 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/underscore-amd/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Underscore Test Suite
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
28 |
29 |
30 | A representative sample of the functions are benchmarked here, to provide
31 | a sense of how fast they might run in different browsers.
32 | Each iteration runs on an array of 1000 elements.
33 | For example, the 'intersection' test measures the number of times you can
34 | find the intersection of two thousand-element arrays in one second.
35 |
36 |
37 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/lib/sizzle/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009, John Resig
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 | * Redistributions of source code must retain the above copyright
7 | notice, this list of conditions and the following disclaimer.
8 | * Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | * Neither the name of the nor the
12 | names of its contributors may be used to endorse or promote products
13 | derived from this software without specific prior written permission.
14 |
15 | THIS SOFTWARE IS PROVIDED BY John Resig ''AS IS'' AND ANY
16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/lib/jit/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010, Nicolas Garcia Belmonte
2 | All rights reserved
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | * Neither the name of the organization nor the names of its contributors may
15 | be used to endorse or promote products derived from this software without
16 | specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY NICOLAS GARCIA BELMONTE ``AS IS'' AND ANY EXPRESS
19 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
21 | EVENT SHALL NICOLAS GARCIA BELMONTE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/requote-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.requote");
7 |
8 | suite.addBatch({
9 | "requote": {
10 | topic: function() {
11 | return d3.requote;
12 | },
13 | "quotes backslashes": function(quote) {
14 | assert.equal(quote("\\"), "\\\\");
15 | },
16 | "quotes carets": function(quote) {
17 | assert.equal(quote("^"), "\\^");
18 | },
19 | "quotes dollar signs": function(quote) {
20 | assert.equal(quote("$"), "\\$");
21 | },
22 | "quotes stars": function(quote) {
23 | assert.equal(quote("*"), "\\*");
24 | },
25 | "quotes plusses": function(quote) {
26 | assert.equal(quote("+"), "\\+");
27 | },
28 | "quotes question marks": function(quote) {
29 | assert.equal(quote("?"), "\\?");
30 | },
31 | "quotes periods": function(quote) {
32 | assert.equal(quote("."), "\\.");
33 | },
34 | "quotes parentheses": function(quote) {
35 | assert.equal(quote("("), "\\(");
36 | assert.equal(quote(")"), "\\)");
37 | },
38 | "quotes pipes": function(quote) {
39 | assert.equal(quote("|"), "\\|");
40 | },
41 | "quotes curly braces": function(quote) {
42 | assert.equal(quote("{"), "\\{");
43 | assert.equal(quote("}"), "\\}");
44 | },
45 | "quotes square brackets": function(quote) {
46 | assert.equal(quote("["), "\\[");
47 | assert.equal(quote("]"), "\\]");
48 | }
49 | }
50 | });
51 |
52 | suite.export(module);
53 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/src/time/scale-utc.js:
--------------------------------------------------------------------------------
1 | var d3_time_scaleUTCMethods = d3_time_scaleLocalMethods.map(function(m) {
2 | return [m[0].utc, m[1]];
3 | });
4 |
5 | var d3_time_scaleUTCFormats = [
6 | [d3.time.format.utc("%Y"), d3_true],
7 | [d3.time.format.utc("%B"), function(d) { return d.getUTCMonth(); }],
8 | [d3.time.format.utc("%b %d"), function(d) { return d.getUTCDate() != 1; }],
9 | [d3.time.format.utc("%a %d"), function(d) { return d.getUTCDay() && d.getUTCDate() != 1; }],
10 | [d3.time.format.utc("%I %p"), function(d) { return d.getUTCHours(); }],
11 | [d3.time.format.utc("%I:%M"), function(d) { return d.getUTCMinutes(); }],
12 | [d3.time.format.utc(":%S"), function(d) { return d.getUTCSeconds(); }],
13 | [d3.time.format.utc(".%L"), function(d) { return d.getUTCMilliseconds(); }]
14 | ];
15 |
16 | var d3_time_scaleUTCFormat = d3_time_scaleFormat(d3_time_scaleUTCFormats);
17 |
18 | function d3_time_scaleUTCSetYear(y) {
19 | var d = new Date(Date.UTC(y, 0, 1));
20 | d.setUTCFullYear(y); // Y2K fail
21 | return d;
22 | }
23 |
24 | function d3_time_scaleUTCGetYear(d) {
25 | var y = d.getUTCFullYear(),
26 | d0 = d3_time_scaleUTCSetYear(y),
27 | d1 = d3_time_scaleUTCSetYear(y + 1);
28 | return y + (d - d0) / (d1 - d0);
29 | }
30 |
31 | d3_time_scaleUTCMethods.year = function(extent, m) {
32 | return d3_time_scaleLinear.domain(extent.map(d3_time_scaleUTCGetYear)).ticks(m).map(d3_time_scaleUTCSetYear);
33 | };
34 |
35 | d3.time.scale.utc = function() {
36 | return d3_time_scale(d3.scale.linear(), d3_time_scaleUTCMethods, d3_time_scaleUTCFormat);
37 | };
38 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/lib/polymaps/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010, SimpleGeo and Stamen Design
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | * Neither the name of SimpleGeo nor the names of its contributors may be used
15 | to endorse or promote products derived from this software without specific
16 | prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL SIMPLEGEO BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 |
--------------------------------------------------------------------------------
/app/edit/styles/cmx.css:
--------------------------------------------------------------------------------
1 | scene {
2 | display: none;
3 | }
4 |
5 | @font-face {
6 | font-family: 'xkcd';
7 | src: url('/fonts/xkcd.eot');
8 | src: url('/fonts/xkcd.eot?#iefix') format('embedded-opentype'),
9 | url('/fonts/xkcd.woff') format('woff'),
10 | url('/fonts/xkcd.ttf') format('tff');
11 | font-weight: normal;
12 | font-style: normal;
13 | }
14 |
15 | .cmx-scene {
16 | float: left;
17 |
18 | font-family: "xkcd", sans-serif;
19 | font-size: 14px;
20 | background-color: white;
21 | margin: 0px;
22 | position: relative;
23 |
24 | -moz-transition: all 0.6s ease-out;
25 | -o-transition: all 0.6s ease-out;
26 | -webkit-transition: all 0.6s ease-out;
27 | -ms-transition: all 0.6s ease-out;
28 | transition: all 0.6s ease-out;
29 | }
30 |
31 | .cmx-scene svg {
32 | display: block;
33 | }
34 |
35 | .cmx-path {
36 | fill: none;
37 | stroke-width: 2.5px;
38 | stroke-linecap: round;
39 | stroke-linejoin: round;
40 | }
41 |
42 | .cmx-back {
43 | stroke: white;
44 | }
45 |
46 | .cmx-back .cmx-text {
47 | shape-rendering: optimizeSpeed;
48 | text-rendering: optimizeSpeed;
49 | fill: none;
50 | stroke-opacity: 1;
51 | stroke-width: 8px;
52 | stroke-linecap: butt;
53 | stroke-linejoin: miter;
54 | }
55 |
56 | .cmx-back .cmx-path {
57 | stroke-width: 6px;
58 | }
59 |
60 | .cmx-front {
61 | stroke: black;
62 | }
63 |
64 | .cmx-front .cmx-path {
65 | stroke-width: 3px;
66 | }
67 |
68 | .cmx-front .cmx-text {
69 | stroke: none;
70 | }
71 |
72 | .cmx-text-border .cmx-path {
73 | stroke: black;
74 | fill: white;
75 | stroke-width: 2px;
76 | }
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/lib/protovis/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010, Stanford Visualization Group
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | * Neither the name of Stanford University nor the names of its contributors
15 | may be used to endorse or promote products derived from this software
16 | without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/underscore.string/test/test_underscore/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Underscore Test Suite
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
28 |
29 |
30 |
31 | A representative sample of the functions are benchmarked here, to provide
32 | a sense of how fast they might run in different browsers.
33 | Each iteration runs on an array of 1000 elements.
34 | For example, the 'intersection' test measures the number of times you can
35 | find the intersection of two thousand-element arrays in one second.
36 |
37 |
38 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/lib/cmx/gizmos/drawing_gizmo.coffee:
--------------------------------------------------------------------------------
1 | define ['cmx/gizmos/entity_gizmo'], (EntityGizmo) ->
2 |
3 | class DrawingGizmo extends EntityGizmo
4 |
5 | update: ->
6 | super
7 |
8 | @ΔskeletonGizmo?.selectAll(".cmx-control")
9 | .attr("cx", (bone) -> bone.x)
10 | .attr("cy", (bone) -> bone.y)
11 | .style("display", (bone) =>
12 | return
13 | )
14 |
15 | build: ->
16 | base = super
17 |
18 | @ΔskeletonGizmo = base.append("g").attr("class", "cmx-gizmo cmx-drawing")
19 |
20 | resetBone = (bone) =>
21 | @entity.skelet.moveBone(bone.name, 0, 0, yes)
22 | @entity.throttledUpdate()
23 |
24 | doubleClick = (bone) =>
25 | d3.event.preventDefault()
26 | return resetBone(bone) if bone.name is 'HNDL'
27 |
28 | drag = d3.behavior.drag()
29 | .on "dragstart", (bone) =>
30 | @controlUndoOpen "pose"
31 | @controlDragStart(bone)
32 | .on "dragend", (bone) =>
33 | @controlDragEnd(bone)
34 | @controlUndoClose()
35 | .on "drag", (bone) =>
36 | @entity.skelet.moveBone(bone.name, d3.event.dx, d3.event.dy, no)
37 | @entity.throttledUpdate()
38 |
39 | data = @entity.skelet.bonesWithIndices @entity.drawingBones
40 | @ΔskeletonGizmo.selectAll(".cmx-control")
41 | .data(data)
42 | .enter()
43 | .append("circle")
44 | .attr("class", (bone) -> "cmx-control cmx-#{bone.type}")
45 | .attr("r", @CONTROL_POINT_RADIUS)
46 | .on("dblclick", doubleClick)
47 | .call(drag)
48 |
49 | @ΔskeletonGizmo
50 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/geo/circle-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.geo.circle");
7 |
8 | suite.addBatch({
9 | "circle": {
10 | topic: d3.geo.circle,
11 | "generates a Polygon": function(circle) {
12 | var o = circle();
13 | assert.equal(o.type, "Polygon");
14 | assert.inDelta(o.coordinates, [[[-78.690067, -90], [-90, -84], [-90, -78], [-90, -72], [-90, -66], [-90, -60], [-90, -54], [-90, -48], [-90, -42], [-90, -36], [-90, -30], [-90, -24], [-90, -18], [-90, -12], [-90, -6], [-90, 0], [-90, 6], [-90, 12], [-90, 18], [-90, 24], [-90, 30], [-90, 36], [-90, 42], [-90, 48], [-90, 54], [-90, 60], [-90, 66], [-90, 72], [-90, 78], [-90, 84], [-89.596672, 90], [90, 84], [90, 78], [90, 72], [90, 66], [90, 60], [90, 54], [90, 48], [90, 42], [90, 36], [90, 30], [90, 24], [90, 18], [90, 12], [90, 6], [90, 0], [90, -6], [90, -12], [90, -18], [90, -24], [90, -30], [90, -36], [90, -42], [90, -48], [90, -54], [90, -60], [90, -66], [90, -72], [90, -78], [90, -84], [89.569782, -90]]], 1e-6);
15 | },
16 | "origin([0, 90])": function(circle) {
17 | var o = circle.origin([0, 90])();
18 | assert.equal(o.type, "Polygon");
19 | assert.inDelta(o.coordinates, [d3.range(360, -1, -6).map(function(x) { return [x >= 180 ? x - 360 : x, 0]; })], 1e-6);
20 | },
21 | "origin([45, 45])": function(circle) {
22 | var o = circle.origin([45, 45]).angle(0)();
23 | assert.equal(o.type, "Polygon");
24 | assert.inDelta(o.coordinates[0][0], [45, 45], 1e-6);
25 | }
26 | }
27 | });
28 |
29 | suite.export(module);
30 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/layout/partition-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.layout.partition");
7 |
8 | suite.addBatch({
9 | "partition": {
10 | topic: function() {
11 | return d3.layout.partition;
12 | },
13 | "ignores zero values": function(partition) {
14 | var p = partition().size([3, 3]);
15 | assert.deepEqual(p.nodes({children: [{value: 1}, {value: 0}, {value: 2}, {children: [{value: 0}, {value: 0}]}]}).map(metadata), [
16 | {x: 0, y: 0, dx: 3, dy: 1},
17 | {x: 2, y: 1, dx: 1, dy: 1},
18 | {x: 3, y: 1, dx: 0, dy: 1},
19 | {x: 0, y: 1, dx: 2, dy: 1},
20 | {x: 3, y: 1, dx: 0, dy: 1},
21 | {x: 3, y: 2, dx: 0, dy: 1},
22 | {x: 3, y: 2, dx: 0, dy: 1}
23 | ]);
24 | },
25 | "can handle an empty children array": function(partition) {
26 | var p = partition();
27 | assert.deepEqual(p.nodes({children: []}).map(metadata), [
28 | {x: 0, y: 0, dx: 1, dy: 1}
29 | ]);
30 | assert.deepEqual(p.nodes({children: [{children: []}, {value: 1}]}).map(metadata), [
31 | {x: 0, y: 0, dx: 1, dy: 0.5},
32 | {x: 1, y: 0.5, dx: 0, dy: 0.5},
33 | {x: 0, y: 0.5, dx: 1, dy: 0.5}
34 | ]);
35 | }
36 | }
37 | });
38 |
39 | function metadata(node) {
40 | var metadata = {};
41 | if ("x" in node) metadata.x = node.x;
42 | if ("y" in node) metadata.y = node.y;
43 | if ("dx" in node) metadata.dx = node.dx;
44 | if ("dy" in node) metadata.dy = node.dy;
45 | return metadata;
46 | }
47 |
48 | suite.export(module);
49 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/mean-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.mean");
7 |
8 | suite.addBatch({
9 | "mean": {
10 | topic: function() {
11 | return d3.mean;
12 | },
13 | "returns the mean value for numbers": function(mean) {
14 | assert.equal(mean([1]), 1);
15 | assert.equal(mean([5, 1, 2, 3, 4]), 3);
16 | assert.equal(mean([20, 3]), 11.5);
17 | assert.equal(mean([3, 20]), 11.5);
18 | },
19 | "ignores null, undefined and NaN": function(mean) {
20 | assert.equal(mean([NaN, 1, 2, 3, 4, 5]), 3);
21 | assert.equal(mean([1, 2, 3, 4, 5, NaN]), 3);
22 | assert.equal(mean([10, null, 3, undefined, 5, NaN]), 6);
23 | },
24 | "can handle large numbers without overflowing": function(mean) {
25 | assert.equal(mean([Number.MAX_VALUE, Number.MAX_VALUE]), Number.MAX_VALUE);
26 | assert.equal(mean([-Number.MAX_VALUE, -Number.MAX_VALUE]), -Number.MAX_VALUE);
27 | },
28 | "returns undefined for empty array": function(mean) {
29 | assert.isUndefined(mean([]));
30 | assert.isUndefined(mean([null]));
31 | assert.isUndefined(mean([undefined]));
32 | assert.isUndefined(mean([NaN]));
33 | assert.isUndefined(mean([NaN, NaN]));
34 | },
35 | "applies the optional accessor function": function(mean) {
36 | assert.equal(d3.mean([[1, 2, 3, 4, 5], [2, 4, 6, 8, 10]], function(d) { return d3.mean(d); }), 4.5);
37 | assert.equal(d3.mean([1, 2, 3, 4, 5], function(d, i) { return i; }), 2);
38 | }
39 | }
40 | });
41 |
42 | suite.export(module);
43 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/src/geo/rotation.js:
--------------------------------------------------------------------------------
1 | // Note: |δλ| and |δφ| must be < 2π
2 | function d3_geo_rotation(δλ, δφ, δγ) {
3 | return δλ ? (δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ))
4 | : d3_geo_rotationλ(δλ))
5 | : (δφ || δγ ? d3_geo_rotationφγ(δφ, δγ)
6 | : d3_geo_equirectangular);
7 | }
8 |
9 | function d3_geo_forwardRotationλ(δλ) {
10 | return function(λ, φ) {
11 | return λ += δλ, [λ > π ? λ - 2 * π : λ < -π ? λ + 2 * π : λ, φ];
12 | };
13 | }
14 |
15 | function d3_geo_rotationλ(δλ) {
16 | var rotation = d3_geo_forwardRotationλ(δλ);
17 | rotation.invert = d3_geo_forwardRotationλ(-δλ);
18 | return rotation;
19 | }
20 |
21 | function d3_geo_rotationφγ(δφ, δγ) {
22 | var cosδφ = Math.cos(δφ),
23 | sinδφ = Math.sin(δφ),
24 | cosδγ = Math.cos(δγ),
25 | sinδγ = Math.sin(δγ);
26 |
27 | function rotation(λ, φ) {
28 | var cosφ = Math.cos(φ),
29 | x = Math.cos(λ) * cosφ,
30 | y = Math.sin(λ) * cosφ,
31 | z = Math.sin(φ),
32 | k = z * cosδφ + x * sinδφ;
33 | return [
34 | Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ),
35 | Math.asin(Math.max(-1, Math.min(1, k * cosδγ + y * sinδγ)))
36 | ];
37 | }
38 |
39 | rotation.invert = function(λ, φ) {
40 | var cosφ = Math.cos(φ),
41 | x = Math.cos(λ) * cosφ,
42 | y = Math.sin(λ) * cosφ,
43 | z = Math.sin(φ),
44 | k = z * cosδγ - y * sinδγ;
45 | return [
46 | Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ),
47 | Math.asin(Math.max(-1, Math.min(1, k * cosδφ - x * sinδφ)))
48 | ];
49 | };
50 |
51 | return rotation;
52 | }
53 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/selectAll-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.selectAll");
7 |
8 | suite.addBatch({
9 | "selectAll": {
10 | topic: function() {
11 | var body = d3.select("body").html("");
12 | body.append("span").attr("class", "f00").attr("id", "b4r").attr("name", "b4z");
13 | body.append("div").attr("class", "foo").attr("id", "bar").attr("name", "baz");
14 | return body;
15 | },
16 | "selects by element name": function() {
17 | var div = d3.selectAll("div");
18 | assert.equal(div[0][0].tagName, "DIV");
19 | },
20 | "selects by class name": function() {
21 | var div = d3.selectAll(".foo");
22 | assert.equal(div[0][0].className, "foo");
23 | },
24 | "selects by id": function() {
25 | var div = d3.select("div#bar");
26 | assert.equal(div[0][0].id, "bar");
27 | },
28 | "selects by attribute value": function() {
29 | var div = d3.selectAll("[name=baz]");
30 | assert.equal(div[0][0].getAttribute("name"), "baz");
31 | },
32 | "selects by array": function() {
33 | var div = d3.selectAll([document.body.lastChild]);
34 | assert.isTrue(div[0][0] === document.body.lastChild);
35 | assert.lengthOf(div, 1);
36 | assert.lengthOf(div[0], 1);
37 | },
38 | "groups are not instances of NodeList": function() {
39 | var div = d3.select("body").selectAll(function() { return this.getElementsByClassName("div"); });
40 | assert.isFalse(div[0] instanceof window.NodeList);
41 | }
42 | }
43 | });
44 |
45 | suite.export(module);
46 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/geo/equirectangular-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.geo.equirectangular");
7 |
8 | suite.addBatch({
9 | "equirectangular": {
10 | topic: function() {
11 | return d3.geo.equirectangular();
12 | },
13 |
14 | "scale": {
15 | "defaults to 500 / 2π": function(projection) {
16 | assert.equal(projection.scale(), 500 / (2 * Math.PI));
17 | },
18 | "is coerced to a number": function(projection) {
19 | assert.strictEqual(projection.scale("400"), projection);
20 | assert.strictEqual(projection.scale(), 400);
21 | projection.scale(500 / (2 * Math.PI));
22 | }
23 | },
24 |
25 | "translate": {
26 | "defaults to [480, 250]": function(projection) {
27 | assert.deepEqual(projection.translate(), [480, 250]);
28 | },
29 | "is coerced to two numbers": function(projection) {
30 | assert.strictEqual(projection.translate(["23", "141"]), projection);
31 | assert.strictEqual(projection.translate()[0], 23);
32 | assert.strictEqual(projection.translate()[1], 141);
33 | projection.translate([480, 250]);
34 | }
35 | },
36 |
37 | "of San Francisco, CA": {
38 | "is at location [-122.446, 37.767]": function(projection) {
39 | assert.inDelta(projection.invert([310, 198]), [-122.446, 37.767], .5);
40 | },
41 | "is at point [310, 198]": function(projection) {
42 | assert.inDelta(projection([-122.446, 37.767]), [310, 198], .5);
43 | }
44 | }
45 | }
46 | });
47 |
48 | suite.export(module);
49 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/lib/penner/LICENSE:
--------------------------------------------------------------------------------
1 | TERMS OF USE - EASING EQUATIONS
2 |
3 | Open source under the BSD License.
4 |
5 | Copyright 2001 Robert Penner
6 | All rights reserved.
7 |
8 | Redistribution and use in source and binary forms, with or without modification,
9 | are permitted provided that the following conditions are met:
10 |
11 | - Redistributions of source code must retain the above copyright notice, this
12 | list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright notice,
15 | this list of conditions and the following disclaimer in the documentation
16 | and/or other materials provided with the distribution.
17 |
18 | - Neither the name of the author nor the names of contributors may be used to
19 | endorse or promote products derived from this software without specific prior
20 | written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/src/core/hsl.js:
--------------------------------------------------------------------------------
1 | d3.hsl = function(h, s, l) {
2 | return arguments.length === 1
3 | ? (h instanceof d3_Hsl ? d3_hsl(h.h, h.s, h.l)
4 | : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl))
5 | : d3_hsl(+h, +s, +l);
6 | };
7 |
8 | function d3_hsl(h, s, l) {
9 | return new d3_Hsl(h, s, l);
10 | }
11 |
12 | function d3_Hsl(h, s, l) {
13 | this.h = h;
14 | this.s = s;
15 | this.l = l;
16 | }
17 |
18 | var d3_hslPrototype = d3_Hsl.prototype = new d3_Color;
19 |
20 | d3_hslPrototype.brighter = function(k) {
21 | k = Math.pow(0.7, arguments.length ? k : 1);
22 | return d3_hsl(this.h, this.s, this.l / k);
23 | };
24 |
25 | d3_hslPrototype.darker = function(k) {
26 | k = Math.pow(0.7, arguments.length ? k : 1);
27 | return d3_hsl(this.h, this.s, k * this.l);
28 | };
29 |
30 | d3_hslPrototype.rgb = function() {
31 | return d3_hsl_rgb(this.h, this.s, this.l);
32 | };
33 |
34 | function d3_hsl_rgb(h, s, l) {
35 | var m1,
36 | m2;
37 |
38 | /* Some simple corrections for h, s and l. */
39 | h = h % 360; if (h < 0) h += 360;
40 | s = s < 0 ? 0 : s > 1 ? 1 : s;
41 | l = l < 0 ? 0 : l > 1 ? 1 : l;
42 |
43 | /* From FvD 13.37, CSS Color Module Level 3 */
44 | m2 = l <= .5 ? l * (1 + s) : l + s - l * s;
45 | m1 = 2 * l - m2;
46 |
47 | function v(h) {
48 | if (h > 360) h -= 360;
49 | else if (h < 0) h += 360;
50 | if (h < 60) return m1 + (m2 - m1) * h / 60;
51 | if (h < 180) return m2;
52 | if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60;
53 | return m1;
54 | }
55 |
56 | function vv(h) {
57 | return Math.round(v(h) * 255);
58 | }
59 |
60 | return d3_rgb(vv(h + 120), vv(h), vv(h - 120));
61 | }
62 |
--------------------------------------------------------------------------------
/app/lib/cmx/gizmos/label_gizmo.coffee:
--------------------------------------------------------------------------------
1 | define ['cmx/gizmos/entity_gizmo'], (EntityGizmo) ->
2 |
3 | class LabelGizmo extends EntityGizmo
4 |
5 | update: ->
6 | super
7 |
8 | @ΔskeletonGizmo?.selectAll(".cmx-control")
9 | .attr("cx", (bone) -> bone.x)
10 | .attr("cy", (bone) -> bone.y)
11 | .style("display", (bone) =>
12 | return
13 | )
14 |
15 | build: ->
16 | base = super
17 |
18 | @ΔskeletonGizmo = base.append("g").attr("class", "cmx-gizmo cmx-label")
19 |
20 | resetBone = (bone) =>
21 | @entity.skelet.moveBone(bone.name, 0, 0, yes)
22 | @entity.throttledUpdate()
23 |
24 | doubleClick = (bone) =>
25 | d3.event.preventDefault()
26 | return resetBone(bone) if bone.name is 'HNDL'
27 | return resetBone(bone) if bone.name is 'TEXT'
28 |
29 | drag = d3.behavior.drag()
30 | .on "dragstart", (bone) =>
31 | @controlUndoOpen "pose"
32 | @controlDragStart bone
33 | .on "dragend", (bone) =>
34 | @controlDragEnd(bone)
35 | @controlUndoClose()
36 | .on "drag", (bone) =>
37 | @entity.skelet.moveBone(bone.name, d3.event.dx, d3.event.dy, no)
38 | @entity.throttledUpdate()
39 |
40 | data = @entity.skelet.bonesWithIndices @entity.labelBones
41 | @ΔskeletonGizmo.selectAll(".cmx-control")
42 | .data(data)
43 | .enter()
44 | .append("circle")
45 | .attr("class", (bone) -> "cmx-control cmx-#{bone.type}")
46 | .attr("r", @CONTROL_POINT_RADIUS)
47 | .on("dblclick", doubleClick)
48 | .call(drag)
49 |
50 | @ΔskeletonGizmo
51 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/src/scale/category.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This product includes color specifications and designs developed by Cynthia
3 | * Brewer (http://colorbrewer.org/). See lib/colorbrewer for more information.
4 | */
5 |
6 | d3.scale.category10 = function() {
7 | return d3.scale.ordinal().range(d3_category10);
8 | };
9 |
10 | d3.scale.category20 = function() {
11 | return d3.scale.ordinal().range(d3_category20);
12 | };
13 |
14 | d3.scale.category20b = function() {
15 | return d3.scale.ordinal().range(d3_category20b);
16 | };
17 |
18 | d3.scale.category20c = function() {
19 | return d3.scale.ordinal().range(d3_category20c);
20 | };
21 |
22 | var d3_category10 = [
23 | "#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
24 | "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"
25 | ];
26 |
27 | var d3_category20 = [
28 | "#1f77b4", "#aec7e8",
29 | "#ff7f0e", "#ffbb78",
30 | "#2ca02c", "#98df8a",
31 | "#d62728", "#ff9896",
32 | "#9467bd", "#c5b0d5",
33 | "#8c564b", "#c49c94",
34 | "#e377c2", "#f7b6d2",
35 | "#7f7f7f", "#c7c7c7",
36 | "#bcbd22", "#dbdb8d",
37 | "#17becf", "#9edae5"
38 | ];
39 |
40 | var d3_category20b = [
41 | "#393b79", "#5254a3", "#6b6ecf", "#9c9ede",
42 | "#637939", "#8ca252", "#b5cf6b", "#cedb9c",
43 | "#8c6d31", "#bd9e39", "#e7ba52", "#e7cb94",
44 | "#843c39", "#ad494a", "#d6616b", "#e7969c",
45 | "#7b4173", "#a55194", "#ce6dbd", "#de9ed6"
46 | ];
47 |
48 | var d3_category20c = [
49 | "#3182bd", "#6baed6", "#9ecae1", "#c6dbef",
50 | "#e6550d", "#fd8d3c", "#fdae6b", "#fdd0a2",
51 | "#31a354", "#74c476", "#a1d99b", "#c7e9c0",
52 | "#756bb1", "#9e9ac8", "#bcbddc", "#dadaeb",
53 | "#636363", "#969696", "#bdbdbd", "#d9d9d9"
54 | ];
55 |
--------------------------------------------------------------------------------
/app/lib/cmx/gizmos/bubble_gizmo.coffee:
--------------------------------------------------------------------------------
1 | define ['cmx/gizmos/entity_gizmo'], (EntityGizmo) ->
2 |
3 | class BubbleGizmo extends EntityGizmo
4 |
5 | update: ->
6 | super
7 |
8 | @ΔskeletonGizmo?.selectAll(".cmx-control")
9 | .attr("cx", (bone) -> bone.x)
10 | .attr("cy", (bone) -> bone.y)
11 | .style("display", (bone) =>
12 | return
13 | )
14 |
15 | build: ->
16 | base = super
17 |
18 | @ΔskeletonGizmo = base.append("g").attr("class", "cmx-gizmo cmx-bubble")
19 |
20 | resetBone = (bone) =>
21 | @entity.skelet.moveBone(bone.name, 0, 0, yes)
22 | @entity.throttledUpdate()
23 |
24 | doubleClick = (bone) =>
25 | d3.event.preventDefault()
26 | return resetBone(bone) if bone.name is 'HNDL'
27 | return resetBone(bone) if bone.name is 'TEXT'
28 |
29 | drag = d3.behavior.drag()
30 | .on "dragstart", (bone) =>
31 | @controlUndoOpen "pose"
32 | @controlDragStart(bone)
33 | .on "dragend", (bone) =>
34 | @controlDragEnd(bone)
35 | @controlUndoClose()
36 | .on "drag", (bone) =>
37 | @entity.skelet.moveBone(bone.name, d3.event.dx, d3.event.dy, no)
38 | @entity.throttledUpdate()
39 |
40 | data = @entity.skelet.bonesWithIndices @entity.bubbleBones
41 | @ΔskeletonGizmo.selectAll(".cmx-control")
42 | .data(data)
43 | .enter()
44 | .append("circle")
45 | .attr("class", (bone) -> "cmx-control cmx-#{bone.type}")
46 | .attr("r", @CONTROL_POINT_RADIUS)
47 | .on("dblclick", doubleClick)
48 | .call(drag)
49 |
50 |
51 | @ΔskeletonGizmo
52 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/median-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.median");
7 |
8 | suite.addBatch({
9 | "median": {
10 | topic: function() {
11 | return d3.median;
12 | },
13 | "returns the median value for numbers": function(median) {
14 | assert.equal(median([1]), 1);
15 | assert.equal(median([5, 1, 2, 3, 4]), 3);
16 | assert.equal(median([20, 3]), 11.5);
17 | assert.equal(median([3, 20]), 11.5);
18 | },
19 | "ignores null, undefined and NaN": function(median) {
20 | assert.equal(median([NaN, 1, 2, 3, 4, 5]), 3);
21 | assert.equal(median([1, 2, 3, 4, 5, NaN]), 3);
22 | assert.equal(median([10, null, 3, undefined, 5, NaN]), 5);
23 | },
24 | "can handle large numbers without overflowing": function(median) {
25 | assert.equal(median([Number.MAX_VALUE, Number.MAX_VALUE]), Number.MAX_VALUE);
26 | assert.equal(median([-Number.MAX_VALUE, -Number.MAX_VALUE]), -Number.MAX_VALUE);
27 | },
28 | "returns undefined for empty array": function(median) {
29 | assert.isUndefined(median([]));
30 | assert.isUndefined(median([null]));
31 | assert.isUndefined(median([undefined]));
32 | assert.isUndefined(median([NaN]));
33 | assert.isUndefined(median([NaN, NaN]));
34 | },
35 | "applies the optional accessor function": function(median) {
36 | assert.equal(d3.median([[1, 2, 3, 4, 5], [2, 4, 6, 8, 10]], function(d) { return d3.median(d); }), 4.5);
37 | assert.equal(d3.median([1, 2, 3, 4, 5], function(d, i) { return i; }), 2);
38 | }
39 | }
40 | });
41 |
42 | suite.export(module);
43 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/src/core/dispatch.js:
--------------------------------------------------------------------------------
1 | d3.dispatch = function() {
2 | var dispatch = new d3_dispatch,
3 | i = -1,
4 | n = arguments.length;
5 | while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
6 | return dispatch;
7 | };
8 |
9 | function d3_dispatch() {}
10 |
11 | d3_dispatch.prototype.on = function(type, listener) {
12 | var i = type.indexOf("."),
13 | name = "";
14 |
15 | // Extract optional namespace, e.g., "click.foo"
16 | if (i > 0) {
17 | name = type.substring(i + 1);
18 | type = type.substring(0, i);
19 | }
20 |
21 | return arguments.length < 2
22 | ? this[type].on(name)
23 | : this[type].on(name, listener);
24 | };
25 |
26 | function d3_dispatch_event(dispatch) {
27 | var listeners = [],
28 | listenerByName = new d3_Map;
29 |
30 | function event() {
31 | var z = listeners, // defensive reference
32 | i = -1,
33 | n = z.length,
34 | l;
35 | while (++i < n) if (l = z[i].on) l.apply(this, arguments);
36 | return dispatch;
37 | }
38 |
39 | event.on = function(name, listener) {
40 | var l = listenerByName.get(name),
41 | i;
42 |
43 | // return the current listener, if any
44 | if (arguments.length < 2) return l && l.on;
45 |
46 | // remove the old listener, if any (with copy-on-write)
47 | if (l) {
48 | l.on = null;
49 | listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1));
50 | listenerByName.remove(name);
51 | }
52 |
53 | // add the new listener, if any
54 | if (listener) listeners.push(listenerByName.set(name, {on: listener}));
55 |
56 | return dispatch;
57 | };
58 |
59 | return event;
60 | }
61 |
--------------------------------------------------------------------------------
/app/edit/scripts/vendor/d3/test/core/sum-test.js:
--------------------------------------------------------------------------------
1 | require("../env");
2 |
3 | var vows = require("vows"),
4 | assert = require("assert");
5 |
6 | var suite = vows.describe("d3.sum");
7 |
8 | suite.addBatch({
9 | "sum": {
10 | topic: function() {
11 | return d3.sum;
12 | },
13 | "sums numbers": function(sum) {
14 | assert.equal(d3.sum([1]), 1);
15 | assert.equal(d3.sum([5, 1, 2, 3, 4]), 15);
16 | assert.equal(d3.sum([20, 3]), 23);
17 | assert.equal(d3.sum([3, 20]), 23);
18 | },
19 | "sums types that can be coerced to numbers": function(sum) {
20 | assert.equal(d3.sum(["20", "3"]), 23);
21 | assert.equal(d3.sum(["3", "20"]), 23);
22 | assert.equal(d3.sum(["3", 20]), 23);
23 | assert.equal(d3.sum([20, "3"]), 23);
24 | assert.equal(d3.sum([3, "20"]), 23);
25 | assert.equal(d3.sum(["20", 3]), 23);
26 | },
27 | "ignores non-numeric types": function(sum) {
28 | assert.equal(d3.sum(["a", "b", "c"]), 0);
29 | assert.equal(d3.sum(["a", 1, "2"]), 3);
30 | },
31 | "ignores null, undefined and NaN": function(sum) {
32 | assert.equal(d3.sum([NaN, 1, 2, 3, 4, 5]), 15);
33 | assert.equal(d3.sum([1, 2, 3, 4, 5, NaN]), 15);
34 | assert.equal(d3.sum([10, null, 3, undefined, 5, NaN]), 18);
35 | },
36 | "applies the optional acccessor function": function(sum) {
37 | assert.equal(d3.sum([[1, 2, 3, 4, 5], [2, 4, 6, 8, 10]], function(d) { return d3.sum(d); }), 45);
38 | assert.equal(d3.sum([1, 2, 3, 4, 5], function(d, i) { return i; }), 10);
39 | },
40 | "returns zero for the empty array": function(sum) {
41 | assert.equal(d3.sum([]), 0);
42 | }
43 | }
44 | });
45 |
46 | suite.export(module);
47 |
--------------------------------------------------------------------------------