diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2016-03-04 19:10:04 +0100 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-03-04 19:10:04 +0100 |
commit | 15dde408db57009e1e4e26d969b9b3e6c1e0c255 (patch) | |
tree | bed87bc591f44dbdc7967c2c9f8b26dd1b040f49 /web/nms.gathering.org/speedometer/d3-master/src/arrays | |
parent | 2e808e318a7b9abd09bf93116dae5368025c3611 (diff) |
nms: Remove redundant files
speedometer probably doesn't work now anyway until it's heavily updated.
Diffstat (limited to 'web/nms.gathering.org/speedometer/d3-master/src/arrays')
26 files changed, 0 insertions, 515 deletions
diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/ascending.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/ascending.js deleted file mode 100644 index 067c17a..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/ascending.js +++ /dev/null @@ -1,5 +0,0 @@ -d3.ascending = d3_ascending; - -function d3_ascending(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; -} diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/bisect.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/bisect.js deleted file mode 100644 index fbe3a73..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/bisect.js +++ /dev/null @@ -1,36 +0,0 @@ -import "ascending"; - -function d3_bisector(compare) { - return { - left: function(a, x, lo, hi) { - if (arguments.length < 3) lo = 0; - if (arguments.length < 4) hi = a.length; - while (lo < hi) { - var mid = lo + hi >>> 1; - if (compare(a[mid], x) < 0) lo = mid + 1; - else hi = mid; - } - return lo; - }, - right: function(a, x, lo, hi) { - if (arguments.length < 3) lo = 0; - if (arguments.length < 4) hi = a.length; - while (lo < hi) { - var mid = lo + hi >>> 1; - if (compare(a[mid], x) > 0) hi = mid; - else lo = mid + 1; - } - return lo; - } - }; -} - -var d3_bisect = d3_bisector(d3_ascending); -d3.bisectLeft = d3_bisect.left; -d3.bisect = d3.bisectRight = d3_bisect.right; - -d3.bisector = function(f) { - return d3_bisector(f.length === 1 - ? function(d, x) { return d3_ascending(f(d), x); } - : f); -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/descending.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/descending.js deleted file mode 100644 index 0503458..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/descending.js +++ /dev/null @@ -1,3 +0,0 @@ -d3.descending = function(a, b) { - return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/deviation.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/deviation.js deleted file mode 100644 index 16663e3..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/deviation.js +++ /dev/null @@ -1,6 +0,0 @@ -import "variance"; - -d3.deviation = function() { - var v = d3.variance.apply(this, arguments); - return v ? Math.sqrt(v) : v; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/entries.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/entries.js deleted file mode 100644 index 4ce014b..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/entries.js +++ /dev/null @@ -1,5 +0,0 @@ -d3.entries = function(map) { - var entries = []; - for (var key in map) entries.push({key: key, value: map[key]}); - return entries; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/extent.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/extent.js deleted file mode 100644 index 7584658..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/extent.js +++ /dev/null @@ -1,21 +0,0 @@ -d3.extent = function(array, f) { - var i = -1, - n = array.length, - a, - b, - c; - if (arguments.length === 1) { - while (++i < n) if ((b = array[i]) != null && b >= b) { a = c = b; break; } - while (++i < n) if ((b = array[i]) != null) { - if (a > b) a = b; - if (c < b) c = b; - } - } else { - while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) { a = c = b; break; } - while (++i < n) if ((b = f.call(array, array[i], i)) != null) { - if (a > b) a = b; - if (c < b) c = b; - } - } - return [a, c]; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/index.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/index.js deleted file mode 100644 index c29fb24..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/index.js +++ /dev/null @@ -1,25 +0,0 @@ -import "ascending"; -import "descending"; -import "min"; -import "max"; -import "extent"; -import "sum"; -import "mean"; -import "median"; -import "quantile"; -import "variance"; -import "deviation"; -import "bisect"; -import "shuffle"; -import "permute"; -import "pairs"; -import "zip"; -import "transpose"; -import "keys"; -import "values"; -import "entries"; -import "merge"; -import "range"; -import "nest"; -import "map"; -import "set"; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/keys.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/keys.js deleted file mode 100644 index c83ec8e..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/keys.js +++ /dev/null @@ -1,5 +0,0 @@ -d3.keys = function(map) { - var keys = []; - for (var key in map) keys.push(key); - return keys; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/map.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/map.js deleted file mode 100644 index 4ba7f3d..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/map.js +++ /dev/null @@ -1,84 +0,0 @@ -import "../core/class"; - -d3.map = function(object, f) { - var map = new d3_Map; - if (object instanceof d3_Map) { - object.forEach(function(key, value) { map.set(key, value); }); - } else if (Array.isArray(object)) { - var i = -1, - n = object.length, - o; - if (arguments.length === 1) while (++i < n) map.set(i, object[i]); - else while (++i < n) map.set(f.call(object, o = object[i], i), o); - } else { - for (var key in object) map.set(key, object[key]); - } - return map; -}; - -function d3_Map() { - this._ = Object.create(null); -} - -var d3_map_proto = "__proto__", - d3_map_zero = "\0"; - -d3_class(d3_Map, { - has: d3_map_has, - get: function(key) { - return this._[d3_map_escape(key)]; - }, - set: function(key, value) { - return this._[d3_map_escape(key)] = value; - }, - remove: d3_map_remove, - keys: d3_map_keys, - values: function() { - var values = []; - for (var key in this._) values.push(this._[key]); - return values; - }, - entries: function() { - var entries = []; - for (var key in this._) entries.push({key: d3_map_unescape(key), value: this._[key]}); - return entries; - }, - size: d3_map_size, - empty: d3_map_empty, - forEach: function(f) { - for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]); - } -}); - -function d3_map_escape(key) { - return (key += "") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key; -} - -function d3_map_unescape(key) { - return (key += "")[0] === d3_map_zero ? key.slice(1) : key; -} - -function d3_map_has(key) { - return d3_map_escape(key) in this._; -} - -function d3_map_remove(key) { - return (key = d3_map_escape(key)) in this._ && delete this._[key]; -} - -function d3_map_keys() { - var keys = []; - for (var key in this._) keys.push(d3_map_unescape(key)); - return keys; -} - -function d3_map_size() { - var size = 0; - for (var key in this._) ++size; - return size; -} - -function d3_map_empty() { - for (var key in this._) return false; - return true; -} diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/max.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/max.js deleted file mode 100644 index 5aec78d..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/max.js +++ /dev/null @@ -1,14 +0,0 @@ -d3.max = function(array, f) { - var i = -1, - n = array.length, - a, - b; - if (arguments.length === 1) { - while (++i < n) if ((b = array[i]) != null && b >= b) { a = b; break; } - while (++i < n) if ((b = array[i]) != null && b > a) a = b; - } else { - while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) { a = b; break; } - while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b; - } - return a; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/mean.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/mean.js deleted file mode 100644 index ab91ae8..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/mean.js +++ /dev/null @@ -1,15 +0,0 @@ -import "../math/number"; - -d3.mean = function(array, f) { - var s = 0, - n = array.length, - a, - i = -1, - j = n; - if (arguments.length === 1) { - while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j; - } else { - while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j; - } - if (j) return s / j; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/median.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/median.js deleted file mode 100644 index 63c2696..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/median.js +++ /dev/null @@ -1,16 +0,0 @@ -import "../math/number"; -import "ascending"; -import "quantile"; - -d3.median = function(array, f) { - var numbers = [], - n = array.length, - a, - i = -1; - if (arguments.length === 1) { - while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a); - } else { - while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a); - } - if (numbers.length) return d3.quantile(numbers.sort(d3_ascending), .5); -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/merge.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/merge.js deleted file mode 100644 index 53c992d..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/merge.js +++ /dev/null @@ -1,21 +0,0 @@ -d3.merge = function(arrays) { - var n = arrays.length, - m, - i = -1, - j = 0, - merged, - array; - - while (++i < n) j += arrays[i].length; - merged = new Array(j); - - while (--n >= 0) { - array = arrays[n]; - m = array.length; - while (--m >= 0) { - merged[--j] = array[m]; - } - } - - return merged; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/min.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/min.js deleted file mode 100644 index c48a49d..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/min.js +++ /dev/null @@ -1,14 +0,0 @@ -d3.min = function(array, f) { - var i = -1, - n = array.length, - a, - b; - if (arguments.length === 1) { - while (++i < n) if ((b = array[i]) != null && b >= b) { a = b; break; } - while (++i < n) if ((b = array[i]) != null && a > b) a = b; - } else { - while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) { a = b; break; } - while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b; - } - return a; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/nest.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/nest.js deleted file mode 100644 index 859add7..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/nest.js +++ /dev/null @@ -1,97 +0,0 @@ -import "map"; - -d3.nest = function() { - var nest = {}, - keys = [], - sortKeys = [], - sortValues, - rollup; - - function map(mapType, array, depth) { - if (depth >= keys.length) return rollup - ? rollup.call(nest, array) : (sortValues - ? array.sort(sortValues) - : array); - - var i = -1, - n = array.length, - key = keys[depth++], - keyValue, - object, - setter, - valuesByKey = new d3_Map, - values; - - while (++i < n) { - if (values = valuesByKey.get(keyValue = key(object = array[i]))) { - values.push(object); - } else { - valuesByKey.set(keyValue, [object]); - } - } - - if (mapType) { - object = mapType(); - setter = function(keyValue, values) { - object.set(keyValue, map(mapType, values, depth)); - }; - } else { - object = {}; - setter = function(keyValue, values) { - object[keyValue] = map(mapType, values, depth); - }; - } - - valuesByKey.forEach(setter); - return object; - } - - function entries(map, depth) { - if (depth >= keys.length) return map; - - var array = [], - sortKey = sortKeys[depth++]; - - map.forEach(function(key, keyMap) { - array.push({key: key, values: entries(keyMap, depth)}); - }); - - return sortKey - ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) - : array; - } - - nest.map = function(array, mapType) { - return map(mapType, array, 0); - }; - - nest.entries = function(array) { - return entries(map(d3.map, array, 0), 0); - }; - - nest.key = function(d) { - keys.push(d); - return nest; - }; - - // Specifies the order for the most-recently specified key. - // Note: only applies to entries. Map keys are unordered! - nest.sortKeys = function(order) { - sortKeys[keys.length - 1] = order; - return nest; - }; - - // Specifies the order for leaf values. - // Applies to both maps and entries array. - nest.sortValues = function(order) { - sortValues = order; - return nest; - }; - - nest.rollup = function(f) { - rollup = f; - return nest; - }; - - return nest; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/pairs.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/pairs.js deleted file mode 100644 index e270f95..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/pairs.js +++ /dev/null @@ -1,5 +0,0 @@ -d3.pairs = function(array) { - var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n); - while (i < n) pairs[i] = [p0 = p1, p1 = array[++i]]; - return pairs; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/permute.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/permute.js deleted file mode 100644 index f27d2c9..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/permute.js +++ /dev/null @@ -1,5 +0,0 @@ -d3.permute = function(array, indexes) { - var i = indexes.length, permutes = new Array(i); - while (i--) permutes[i] = array[indexes[i]]; - return permutes; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/quantile.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/quantile.js deleted file mode 100644 index 67fe9fd..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/quantile.js +++ /dev/null @@ -1,8 +0,0 @@ -// R-7 per <http://en.wikipedia.org/wiki/Quantile> -d3.quantile = function(values, p) { - var H = (values.length - 1) * p + 1, - h = Math.floor(H), - v = +values[h - 1], - e = H - h; - return e ? v + e * (values[h] - v) : v; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/range.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/range.js deleted file mode 100644 index 2fd6a1e..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/range.js +++ /dev/null @@ -1,26 +0,0 @@ -import "../math/abs"; - -d3.range = function(start, stop, step) { - if (arguments.length < 3) { - step = 1; - if (arguments.length < 2) { - stop = start; - start = 0; - } - } - if ((stop - start) / step === Infinity) throw new Error("infinite range"); - var range = [], - k = d3_range_integerScale(abs(step)), - i = -1, - j; - start *= k, stop *= k, step *= k; - if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); - else while ((j = start + step * ++i) < stop) range.push(j / k); - return range; -}; - -function d3_range_integerScale(x) { - var k = 1; - while (x * k % 1) k *= 10; - return k; -} diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/set.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/set.js deleted file mode 100644 index de4dbd4..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/set.js +++ /dev/null @@ -1,27 +0,0 @@ -import "../core/class"; -import "map"; - -d3.set = function(array) { - var set = new d3_Set; - if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]); - return set; -}; - -function d3_Set() { - this._ = Object.create(null); -} - -d3_class(d3_Set, { - has: d3_map_has, - add: function(key) { - this._[d3_map_escape(key += "")] = true; - return key; - }, - remove: d3_map_remove, - values: d3_map_keys, - size: d3_map_size, - empty: d3_map_empty, - forEach: function(f) { - for (var key in this._) f.call(this, d3_map_unescape(key)); - } -}); diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/shuffle.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/shuffle.js deleted file mode 100644 index dbe36bd..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/shuffle.js +++ /dev/null @@ -1,9 +0,0 @@ -d3.shuffle = function(array, i0, i1) { - if ((m = arguments.length) < 3) { i1 = array.length; if (m < 2) i0 = 0; } - var m = i1 - i0, t, i; - while (m) { - i = Math.random() * m-- | 0; - t = array[m + i0], array[m + i0] = array[i + i0], array[i + i0] = t; - } - return array; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/sum.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/sum.js deleted file mode 100644 index 1e179bc..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/sum.js +++ /dev/null @@ -1,14 +0,0 @@ -import "../math/number"; - -d3.sum = function(array, f) { - var s = 0, - n = array.length, - a, - i = -1; - if (arguments.length === 1) { - while (++i < n) if (d3_numeric(a = +array[i])) s += a; // zero and null are equivalent - } else { - while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a; - } - return s; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/transpose.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/transpose.js deleted file mode 100644 index 999c543..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/transpose.js +++ /dev/null @@ -1,5 +0,0 @@ -import "zip"; - -d3.transpose = function(matrix) { - return d3.zip.apply(d3, matrix); -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/values.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/values.js deleted file mode 100644 index 299d304..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/values.js +++ /dev/null @@ -1,5 +0,0 @@ -d3.values = function(map) { - var values = []; - for (var key in map) values.push(map[key]); - return values; -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/variance.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/variance.js deleted file mode 100644 index 70da168..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/variance.js +++ /dev/null @@ -1,29 +0,0 @@ -import "../math/number"; - -d3.variance = function(array, f) { - var n = array.length, - m = 0, - a, - d, - s = 0, - i = -1, - j = 0; - if (arguments.length === 1) { - while (++i < n) { - if (d3_numeric(a = d3_number(array[i]))) { - d = a - m; - m += d / ++j; - s += d * (a - m); - } - } - } else { - while (++i < n) { - if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) { - d = a - m; - m += d / ++j; - s += d * (a - m); - } - } - } - if (j > 1) return s / (j - 1); -}; diff --git a/web/nms.gathering.org/speedometer/d3-master/src/arrays/zip.js b/web/nms.gathering.org/speedometer/d3-master/src/arrays/zip.js deleted file mode 100644 index 302ec4a..0000000 --- a/web/nms.gathering.org/speedometer/d3-master/src/arrays/zip.js +++ /dev/null @@ -1,15 +0,0 @@ -import "min"; - -d3.zip = function() { - if (!(n = arguments.length)) return []; - for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m;) { - for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n;) { - zip[j] = arguments[j][i]; - } - } - return zips; -}; - -function d3_zipLength(d) { - return d.length; -} |