Created
September 23, 2016 11:03
-
-
Save dselivanov/7a0c8a2c68ab4608df0b0313cc2232f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d3 = function() { | |
var d3 = { | |
version: "3.2.7" | |
}; | |
if (!Date.now) Date.now = function() { | |
return +new Date(); | |
}; | |
var d3_document = document, d3_documentElement = d3_document.documentElement, d3_window = window; | |
try { | |
d3_document.createElement("div").style.setProperty("opacity", 0, ""); | |
} catch (error) { | |
var d3_element_prototype = d3_window.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = d3_window.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty; | |
d3_element_prototype.setAttribute = function(name, value) { | |
d3_element_setAttribute.call(this, name, value + ""); | |
}; | |
d3_element_prototype.setAttributeNS = function(space, local, value) { | |
d3_element_setAttributeNS.call(this, space, local, value + ""); | |
}; | |
d3_style_prototype.setProperty = function(name, value, priority) { | |
d3_style_setProperty.call(this, name, value + "", priority); | |
}; | |
} | |
d3.ascending = function(a, b) { | |
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; | |
}; | |
d3.descending = function(a, b) { | |
return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; | |
}; | |
d3.min = function(array, f) { | |
var i = -1, n = array.length, a, b; | |
if (arguments.length === 1) { | |
while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined; | |
while (++i < n) if ((b = array[i]) != null && a > b) a = b; | |
} else { | |
while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined; | |
while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b; | |
} | |
return a; | |
}; | |
d3.max = function(array, f) { | |
var i = -1, n = array.length, a, b; | |
if (arguments.length === 1) { | |
while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined; | |
while (++i < n) if ((b = array[i]) != null && b > a) a = b; | |
} else { | |
while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined; | |
while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b; | |
} | |
return a; | |
}; | |
d3.extent = function(array, f) { | |
var i = -1, n = array.length, a, b, c; | |
if (arguments.length === 1) { | |
while (++i < n && !((a = c = array[i]) != null && a <= a)) a = c = undefined; | |
while (++i < n) if ((b = array[i]) != null) { | |
if (a > b) a = b; | |
if (c < b) c = b; | |
} | |
} else { | |
while (++i < n && !((a = c = f.call(array, array[i], i)) != null && a <= a)) a = undefined; | |
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 ]; | |
}; | |
d3.sum = function(array, f) { | |
var s = 0, n = array.length, a, i = -1; | |
if (arguments.length === 1) { | |
while (++i < n) if (!isNaN(a = +array[i])) s += a; | |
} else { | |
while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a; | |
} | |
return s; | |
}; | |
function d3_number(x) { | |
return x != null && !isNaN(x); | |
} | |
d3.mean = function(array, f) { | |
var n = array.length, a, m = 0, i = -1, j = 0; | |
if (arguments.length === 1) { | |
while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j; | |
} else { | |
while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j; | |
} | |
return j ? m : undefined; | |
}; | |
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; | |
}; | |
d3.median = function(array, f) { | |
if (arguments.length > 1) array = array.map(f); | |
array = array.filter(d3_number); | |
return array.length ? d3.quantile(array.sort(d3.ascending), .5) : undefined; | |
}; | |
d3.bisector = function(f) { | |
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 (f.call(a, a[mid], mid) < x) 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 (x < f.call(a, a[mid], mid)) hi = mid; else lo = mid + 1; | |
} | |
return lo; | |
} | |
}; | |
}; | |
var d3_bisector = d3.bisector(function(d) { | |
return d; | |
}); | |
d3.bisectLeft = d3_bisector.left; | |
d3.bisect = d3.bisectRight = d3_bisector.right; | |
d3.shuffle = function(array) { | |
var m = array.length, t, i; | |
while (m) { | |
i = Math.random() * m-- | 0; | |
t = array[m], array[m] = array[i], array[i] = t; | |
} | |
return array; | |
}; | |
d3.permute = function(array, indexes) { | |
var permutes = [], i = -1, n = indexes.length; | |
while (++i < n) permutes[i] = array[indexes[i]]; | |
return permutes; | |
}; | |
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; | |
} | |
d3.transpose = function(matrix) { | |
return d3.zip.apply(d3, matrix); | |
}; | |
d3.keys = function(map) { | |
var keys = []; | |
for (var key in map) keys.push(key); | |
return keys; | |
}; | |
d3.values = function(map) { | |
var values = []; | |
for (var key in map) values.push(map[key]); | |
return values; | |
}; | |
d3.entries = function(map) { | |
var entries = []; | |
for (var key in map) entries.push({ | |
key: key, | |
value: map[key] | |
}); | |
return entries; | |
}; | |
d3.merge = function(arrays) { | |
return Array.prototype.concat.apply([], arrays); | |
}; | |
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(Math.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; | |
} | |
function d3_class(ctor, properties) { | |
try { | |
for (var key in properties) { | |
Object.defineProperty(ctor.prototype, key, { | |
value: properties[key], | |
enumerable: false | |
}); | |
} | |
} catch (e) { | |
ctor.prototype = properties; | |
} | |
} | |
d3.map = function(object) { | |
var map = new d3_Map(); | |
for (var key in object) map.set(key, object[key]); | |
return map; | |
}; | |
function d3_Map() {} | |
d3_class(d3_Map, { | |
has: function(key) { | |
return d3_map_prefix + key in this; | |
}, | |
get: function(key) { | |
return this[d3_map_prefix + key]; | |
}, | |
set: function(key, value) { | |
return this[d3_map_prefix + key] = value; | |
}, | |
remove: function(key) { | |
key = d3_map_prefix + key; | |
return key in this && delete this[key]; | |
}, | |
keys: function() { | |
var keys = []; | |
this.forEach(function(key) { | |
keys.push(key); | |
}); | |
return keys; | |
}, | |
values: function() { | |
var values = []; | |
this.forEach(function(key, value) { | |
values.push(value); | |
}); | |
return values; | |
}, | |
entries: function() { | |
var entries = []; | |
this.forEach(function(key, value) { | |
entries.push({ | |
key: key, | |
value: value | |
}); | |
}); | |
return entries; | |
}, | |
forEach: function(f) { | |
for (var key in this) { | |
if (key.charCodeAt(0) === d3_map_prefixCode) { | |
f.call(this, key.substring(1), this[key]); | |
} | |
} | |
} | |
}); | |
var d3_map_prefix = "\0", d3_map_prefixCode = d3_map_prefix.charCodeAt(0); | |
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; | |
}; | |
nest.sortKeys = function(order) { | |
sortKeys[keys.length - 1] = order; | |
return nest; | |
}; | |
nest.sortValues = function(order) { | |
sortValues = order; | |
return nest; | |
}; | |
nest.rollup = function(f) { | |
rollup = f; | |
return nest; | |
}; | |
return nest; | |
}; | |
d3.set = function(array) { | |
var set = new d3_Set(); | |
if (array) for (var i = 0; i < array.length; i++) set.add(array[i]); | |
return set; | |
}; | |
function d3_Set() {} | |
d3_class(d3_Set, { | |
has: function(value) { | |
return d3_map_prefix + value in this; | |
}, | |
add: function(value) { | |
this[d3_map_prefix + value] = true; | |
return value; | |
}, | |
remove: function(value) { | |
value = d3_map_prefix + value; | |
return value in this && delete this[value]; | |
}, | |
values: function() { | |
var values = []; | |
this.forEach(function(value) { | |
values.push(value); | |
}); | |
return values; | |
}, | |
forEach: function(f) { | |
for (var value in this) { | |
if (value.charCodeAt(0) === d3_map_prefixCode) { | |
f.call(this, value.substring(1)); | |
} | |
} | |
} | |
}); | |
d3.behavior = {}; | |
d3.rebind = function(target, source) { | |
var i = 1, n = arguments.length, method; | |
while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]); | |
return target; | |
}; | |
function d3_rebind(target, source, method) { | |
return function() { | |
var value = method.apply(source, arguments); | |
return value === source ? target : value; | |
}; | |
} | |
function d3_vendorSymbol(object, name) { | |
if (name in object) return name; | |
name = name.charAt(0).toUpperCase() + name.substring(1); | |
for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) { | |
var prefixName = d3_vendorPrefixes[i] + name; | |
if (prefixName in object) return prefixName; | |
} | |
} | |
var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ]; | |
var d3_array = d3_arraySlice; | |
function d3_arrayCopy(pseudoarray) { | |
var i = -1, n = pseudoarray.length, array = []; | |
while (++i < n) array.push(pseudoarray[i]); | |
return array; | |
} | |
function d3_arraySlice(pseudoarray) { | |
return Array.prototype.slice.call(pseudoarray); | |
} | |
try { | |
d3_array(d3_documentElement.childNodes)[0].nodeType; | |
} catch (e) { | |
d3_array = d3_arrayCopy; | |
} | |
function d3_noop() {} | |
d3.dispatch = function() { | |
var dispatch = new d3_dispatch(), i = -1, n = arguments.length; | |
while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); | |
return dispatch; | |
}; | |
function d3_dispatch() {} | |
d3_dispatch.prototype.on = function(type, listener) { | |
var i = type.indexOf("."), name = ""; | |
if (i >= 0) { | |
name = type.substring(i + 1); | |
type = type.substring(0, i); | |
} | |
if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener); | |
if (arguments.length === 2) { | |
if (listener == null) for (type in this) { | |
if (this.hasOwnProperty(type)) this[type].on(name, null); | |
} | |
return this; | |
} | |
}; | |
function d3_dispatch_event(dispatch) { | |
var listeners = [], listenerByName = new d3_Map(); | |
function event() { | |
var z = listeners, i = -1, n = z.length, l; | |
while (++i < n) if (l = z[i].on) l.apply(this, arguments); | |
return dispatch; | |
} | |
event.on = function(name, listener) { | |
var l = listenerByName.get(name), i; | |
if (arguments.length < 2) return l && l.on; | |
if (l) { | |
l.on = null; | |
listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1)); | |
listenerByName.remove(name); | |
} | |
if (listener) listeners.push(listenerByName.set(name, { | |
on: listener | |
})); | |
return dispatch; | |
}; | |
return event; | |
} | |
d3.event = null; | |
function d3_eventPreventDefault() { | |
d3.event.preventDefault(); | |
} | |
function d3_eventSource() { | |
var e = d3.event, s; | |
while (s = e.sourceEvent) e = s; | |
return e; | |
} | |
function d3_eventDispatch(target) { | |
var dispatch = new d3_dispatch(), i = 0, n = arguments.length; | |
while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); | |
dispatch.of = function(thiz, argumentz) { | |
return function(e1) { | |
try { | |
var e0 = e1.sourceEvent = d3.event; | |
e1.target = target; | |
d3.event = e1; | |
dispatch[e1.type].apply(thiz, argumentz); | |
} finally { | |
d3.event = e0; | |
} | |
}; | |
}; | |
return dispatch; | |
} | |
d3.requote = function(s) { | |
return s.replace(d3_requote_re, "\\$&"); | |
}; | |
var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; | |
var d3_subclass = {}.__proto__ ? function(object, prototype) { | |
object.__proto__ = prototype; | |
} : function(object, prototype) { | |
for (var property in prototype) object[property] = prototype[property]; | |
}; | |
function d3_selection(groups) { | |
d3_subclass(groups, d3_selectionPrototype); | |
return groups; | |
} | |
var d3_select = function(s, n) { | |
return n.querySelector(s); | |
}, d3_selectAll = function(s, n) { | |
return n.querySelectorAll(s); | |
}, d3_selectMatcher = d3_documentElement[d3_vendorSymbol(d3_documentElement, "matchesSelector")], d3_selectMatches = function(n, s) { | |
return d3_selectMatcher.call(n, s); | |
}; | |
if (typeof Sizzle === "function") { | |
d3_select = function(s, n) { | |
return Sizzle(s, n)[0] || null; | |
}; | |
d3_selectAll = function(s, n) { | |
return Sizzle.uniqueSort(Sizzle(s, n)); | |
}; | |
d3_selectMatches = Sizzle.matchesSelector; | |
} | |
d3.selection = function() { | |
return d3_selectionRoot; | |
}; | |
var d3_selectionPrototype = d3.selection.prototype = []; | |
d3_selectionPrototype.select = function(selector) { | |
var subgroups = [], subgroup, subnode, group, node; | |
selector = d3_selection_selector(selector); | |
for (var j = -1, m = this.length; ++j < m; ) { | |
subgroups.push(subgroup = []); | |
subgroup.parentNode = (group = this[j]).parentNode; | |
for (var i = -1, n = group.length; ++i < n; ) { | |
if (node = group[i]) { | |
subgroup.push(subnode = selector.call(node, node.__data__, i, j)); | |
if (subnode && "__data__" in node) subnode.__data__ = node.__data__; | |
} else { | |
subgroup.push(null); | |
} | |
} | |
} | |
return d3_selection(subgroups); | |
}; | |
function d3_selection_selector(selector) { | |
return typeof selector === "function" ? selector : function() { | |
return d3_select(selector, this); | |
}; | |
} | |
d3_selectionPrototype.selectAll = function(selector) { | |
var subgroups = [], subgroup, node; | |
selector = d3_selection_selectorAll(selector); | |
for (var j = -1, m = this.length; ++j < m; ) { | |
for (var group = this[j], i = -1, n = group.length; ++i < n; ) { | |
if (node = group[i]) { | |
subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j))); | |
subgroup.parentNode = node; | |
} | |
} | |
} | |
return d3_selection(subgroups); | |
}; | |
function d3_selection_selectorAll(selector) { | |
return typeof selector === "function" ? selector : function() { | |
return d3_selectAll(selector, this); | |
}; | |
} | |
var d3_nsPrefix = { | |
svg: "http://www.w3.org/2000/svg", | |
xhtml: "http://www.w3.org/1999/xhtml", | |
xlink: "http://www.w3.org/1999/xlink", | |
xml: "http://www.w3.org/XML/1998/namespace", | |
xmlns: "http://www.w3.org/2000/xmlns/" | |
}; | |
d3.ns = { | |
prefix: d3_nsPrefix, | |
qualify: function(name) { | |
var i = name.indexOf(":"), prefix = name; | |
if (i >= 0) { | |
prefix = name.substring(0, i); | |
name = name.substring(i + 1); | |
} | |
return d3_nsPrefix.hasOwnProperty(prefix) ? { | |
space: d3_nsPrefix[prefix], | |
local: name | |
} : name; | |
} | |
}; | |
d3_selectionPrototype.attr = function(name, value) { | |
if (arguments.length < 2) { | |
if (typeof name === "string") { | |
var node = this.node(); | |
name = d3.ns.qualify(name); | |
return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name); | |
} | |
for (value in name) this.each(d3_selection_attr(value, name[value])); | |
return this; | |
} | |
return this.each(d3_selection_attr(name, value)); | |
}; | |
function d3_selection_attr(name, value) { | |
name = d3.ns.qualify(name); | |
function attrNull() { | |
this.removeAttribute(name); | |
} | |
function attrNullNS() { | |
this.removeAttributeNS(name.space, name.local); | |
} | |
function attrConstant() { | |
this.setAttribute(name, value); | |
} | |
function attrConstantNS() { | |
this.setAttributeNS(name.space, name.local, value); | |
} | |
function attrFunction() { | |
var x = value.apply(this, arguments); | |
if (x == null) this.removeAttribute(name); else this.setAttribute(name, x); | |
} | |
function attrFunctionNS() { | |
var x = value.apply(this, arguments); | |
if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x); | |
} | |
return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant; | |
} | |
function d3_collapse(s) { | |
return s.trim().replace(/\s+/g, " "); | |
} | |
d3_selectionPrototype.classed = function(name, value) { | |
if (arguments.length < 2) { | |
if (typeof name === "string") { | |
var node = this.node(), n = (name = name.trim().split(/^|\s+/g)).length, i = -1; | |
if (value = node.classList) { | |
while (++i < n) if (!value.contains(name[i])) return false; | |
} else { | |
value = node.getAttribute("class"); | |
while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false; | |
} | |
return true; | |
} | |
for (value in name) this.each(d3_selection_classed(value, name[value])); | |
return this; | |
} | |
return this.each(d3_selection_classed(name, value)); | |
}; | |
function d3_selection_classedRe(name) { | |
return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g"); | |
} | |
function d3_selection_classed(name, value) { | |
name = name.trim().split(/\s+/).map(d3_selection_classedName); | |
var n = name.length; | |
function classedConstant() { | |
var i = -1; | |
while (++i < n) name[i](this, value); | |
} | |
function classedFunction() { | |
var i = -1, x = value.apply(this, arguments); | |
while (++i < n) name[i](this, x); | |
} | |
return typeof value === "function" ? classedFunction : classedConstant; | |
} | |
function d3_selection_classedName(name) { | |
var re = d3_selection_classedRe(name); | |
return function(node, value) { | |
if (c = node.classList) return value ? c.add(name) : c.remove(name); | |
var c = node.getAttribute("class") || ""; | |
if (value) { | |
re.lastIndex = 0; | |
if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name)); | |
} else { | |
node.setAttribute("class", d3_collapse(c.replace(re, " "))); | |
} | |
}; | |
} | |
d3_selectionPrototype.style = function(name, value, priority) { | |
var n = arguments.length; | |
if (n < 3) { | |
if (typeof name !== "string") { | |
if (n < 2) value = ""; | |
for (priority in name) this.each(d3_selection_style(priority, name[priority], value)); | |
return this; | |
} | |
if (n < 2) return d3_window.getComputedStyle(this.node(), null).getPropertyValue(name); | |
priority = ""; | |
} | |
return this.each(d3_selection_style(name, value, priority)); | |
}; | |
function d3_selection_style(name, value, priority) { | |
function styleNull() { | |
this.style.removeProperty(name); | |
} | |
function styleConstant() { | |
this.style.setProperty(name, value, priority); | |
} | |
function styleFunction() { | |
var x = value.apply(this, arguments); | |
if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority); | |
} | |
return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant; | |
} | |
d3_selectionPrototype.property = function(name, value) { | |
if (arguments.length < 2) { | |
if (typeof name === "string") return this.node()[name]; | |
for (value in name) this.each(d3_selection_property(value, name[value])); | |
return this; | |
} | |
return this.each(d3_selection_property(name, value)); | |
}; | |
function d3_selection_property(name, value) { | |
function propertyNull() { | |
delete this[name]; | |
} | |
function propertyConstant() { | |
this[name] = value; | |
} | |
function propertyFunction() { | |
var x = value.apply(this, arguments); | |
if (x == null) delete this[name]; else this[name] = x; | |
} | |
return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant; | |
} | |
d3_selectionPrototype.text = function(value) { | |
return arguments.length ? this.each(typeof value === "function" ? function() { | |
var v = value.apply(this, arguments); | |
this.textContent = v == null ? "" : v; | |
} : value == null ? function() { | |
this.textContent = ""; | |
} : function() { | |
this.textContent = value; | |
}) : this.node().textContent; | |
}; | |
d3_selectionPrototype.html = function(value) { | |
return arguments.length ? this.each(typeof value === "function" ? function() { | |
var v = value.apply(this, arguments); | |
this.innerHTML = v == null ? "" : v; | |
} : value == null ? function() { | |
this.innerHTML = ""; | |
} : function() { | |
this.innerHTML = value; | |
}) : this.node().innerHTML; | |
}; | |
d3_selectionPrototype.append = function(name) { | |
name = d3_selection_creator(name); | |
return this.select(function() { | |
return this.appendChild(name.apply(this, arguments)); | |
}); | |
}; | |
function d3_selection_creator(name) { | |
return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? function() { | |
return d3_document.createElementNS(name.space, name.local); | |
} : function() { | |
return d3_document.createElementNS(this.namespaceURI, name); | |
}; | |
} | |
d3_selectionPrototype.insert = function(name, before) { | |
name = d3_selection_creator(name); | |
before = d3_selection_selector(before); | |
return this.select(function() { | |
return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments)); | |
}); | |
}; | |
d3_selectionPrototype.remove = function() { | |
return this.each(function() { | |
var parent = this.parentNode; | |
if (parent) parent.removeChild(this); | |
}); | |
}; | |
d3_selectionPrototype.data = function(value, key) { | |
var i = -1, n = this.length, group, node; | |
if (!arguments.length) { | |
value = new Array(n = (group = this[0]).length); | |
while (++i < n) { | |
if (node = group[i]) { | |
value[i] = node.__data__; | |
} | |
} | |
return value; | |
} | |
function bind(group, groupData) { | |
var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData; | |
if (key) { | |
var nodeByKeyValue = new d3_Map(), dataByKeyValue = new d3_Map(), keyValues = [], keyValue; | |
for (i = -1; ++i < n; ) { | |
keyValue = key.call(node = group[i], node.__data__, i); | |
if (nodeByKeyValue.has(keyValue)) { | |
exitNodes[i] = node; | |
} else { | |
nodeByKeyValue.set(keyValue, node); | |
} | |
keyValues.push(keyValue); | |
} | |
for (i = -1; ++i < m; ) { | |
keyValue = key.call(groupData, nodeData = groupData[i], i); | |
if (node = nodeByKeyValue.get(keyValue)) { | |
updateNodes[i] = node; | |
node.__data__ = nodeData; | |
} else if (!dataByKeyValue.has(keyValue)) { | |
enterNodes[i] = d3_selection_dataNode(nodeData); | |
} | |
dataByKeyValue.set(keyValue, nodeData); | |
nodeByKeyValue.remove(keyValue); | |
} | |
for (i = -1; ++i < n; ) { | |
if (nodeByKeyValue.has(keyValues[i])) { | |
exitNodes[i] = group[i]; | |
} | |
} | |
} else { | |
for (i = -1; ++i < n0; ) { | |
node = group[i]; | |
nodeData = groupData[i]; | |
if (node) { | |
node.__data__ = nodeData; | |
updateNodes[i] = node; | |
} else { | |
enterNodes[i] = d3_selection_dataNode(nodeData); | |
} | |
} | |
for (;i < m; ++i) { | |
enterNodes[i] = d3_selection_dataNode(groupData[i]); | |
} | |
for (;i < n; ++i) { | |
exitNodes[i] = group[i]; | |
} | |
} | |
enterNodes.update = updateNodes; | |
enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode; | |
enter.push(enterNodes); | |
update.push(updateNodes); | |
exit.push(exitNodes); | |
} | |
var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]); | |
if (typeof value === "function") { | |
while (++i < n) { | |
bind(group = this[i], value.call(group, group.parentNode.__data__, i)); | |
} | |
} else { | |
while (++i < n) { | |
bind(group = this[i], value); | |
} | |
} | |
update.enter = function() { | |
return enter; | |
}; | |
update.exit = function() { | |
return exit; | |
}; | |
return update; | |
}; | |
function d3_selection_dataNode(data) { | |
return { | |
__data__: data | |
}; | |
} | |
d3_selectionPrototype.datum = function(value) { | |
return arguments.length ? this.property("__data__", value) : this.property("__data__"); | |
}; | |
d3_selectionPrototype.filter = function(filter) { | |
var subgroups = [], subgroup, group, node; | |
if (typeof filter !== "function") filter = d3_selection_filter(filter); | |
for (var j = 0, m = this.length; j < m; j++) { | |
subgroups.push(subgroup = []); | |
subgroup.parentNode = (group = this[j]).parentNode; | |
for (var i = 0, n = group.length; i < n; i++) { | |
if ((node = group[i]) && filter.call(node, node.__data__, i)) { | |
subgroup.push(node); | |
} | |
} | |
} | |
return d3_selection(subgroups); | |
}; | |
function d3_selection_filter(selector) { | |
return function() { | |
return d3_selectMatches(this, selector); | |
}; | |
} | |
d3_selectionPrototype.order = function() { | |
for (var j = -1, m = this.length; ++j < m; ) { | |
for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) { | |
if (node = group[i]) { | |
if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next); | |
next = node; | |
} | |
} | |
} | |
return this; | |
}; | |
d3_selectionPrototype.sort = function(comparator) { | |
comparator = d3_selection_sortComparator.apply(this, arguments); | |
for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator); | |
return this.order(); | |
}; | |
function d3_selection_sortComparator(comparator) { | |
if (!arguments.length) comparator = d3.ascending; | |
return function(a, b) { | |
return !a - !b || comparator(a.__data__, b.__data__); | |
}; | |
} | |
d3_selectionPrototype.each = function(callback) { | |
return d3_selection_each(this, function(node, i, j) { | |
callback.call(node, node.__data__, i, j); | |
}); | |
}; | |
function d3_selection_each(groups, callback) { | |
for (var j = 0, m = groups.length; j < m; j++) { | |
for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) { | |
if (node = group[i]) callback(node, i, j); | |
} | |
} | |
return groups; | |
} | |
d3_selectionPrototype.call = function(callback) { | |
var args = d3_array(arguments); | |
callback.apply(args[0] = this, args); | |
return this; | |
}; | |
d3_selectionPrototype.empty = function() { | |
return !this.node(); | |
}; | |
d3_selectionPrototype.node = function() { | |
for (var j = 0, m = this.length; j < m; j++) { | |
for (var group = this[j], i = 0, n = group.length; i < n; i++) { | |
var node = group[i]; | |
if (node) return node; | |
} | |
} | |
return null; | |
}; | |
d3_selectionPrototype.size = function() { | |
var n = 0; | |
this.each(function() { | |
++n; | |
}); | |
return n; | |
}; | |
function d3_selection_enter(selection) { | |
d3_subclass(selection, d3_selection_enterPrototype); | |
return selection; | |
} | |
var d3_selection_enterPrototype = []; | |
d3.selection.enter = d3_selection_enter; | |
d3.selection.enter.prototype = d3_selection_enterPrototype; | |
d3_selection_enterPrototype.append = d3_selectionPrototype.append; | |
d3_selection_enterPrototype.empty = d3_selectionPrototype.empty; | |
d3_selection_enterPrototype.node = d3_selectionPrototype.node; | |
d3_selection_enterPrototype.call = d3_selectionPrototype.call; | |
d3_selection_enterPrototype.size = d3_selectionPrototype.size; | |
d3_selection_enterPrototype.select = function(selector) { | |
var subgroups = [], subgroup, subnode, upgroup, group, node; | |
for (var j = -1, m = this.length; ++j < m; ) { | |
upgroup = (group = this[j]).update; | |
subgroups.push(subgroup = []); | |
subgroup.parentNode = group.parentNode; | |
for (var i = -1, n = group.length; ++i < n; ) { | |
if (node = group[i]) { | |
subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j)); | |
subnode.__data__ = node.__data__; | |
} else { | |
subgroup.push(null); | |
} | |
} | |
} | |
return d3_selection(subgroups); | |
}; | |
d3_selection_enterPrototype.insert = function(name, before) { | |
if (arguments.length < 2) before = d3_selection_enterInsertBefore(this); | |
return d3_selectionPrototype.insert.call(this, name, before); | |
}; | |
function d3_selection_enterInsertBefore(enter) { | |
var i0, j0; | |
return function(d, i, j) { | |
var group = enter[j].update, n = group.length, node; | |
if (j != j0) j0 = j, i0 = 0; | |
if (i >= i0) i0 = i + 1; | |
while (!(node = group[i0]) && ++i0 < n) ; | |
return node; | |
}; | |
} | |
d3_selectionPrototype.transition = function() { | |
var id = d3_transitionInheritId || ++d3_transitionId, subgroups = [], subgroup, node, transition = d3_transitionInherit || { | |
time: Date.now(), | |
ease: d3_ease_cubicInOut, | |
delay: 0, | |
duration: 250 | |
}; | |
for (var j = -1, m = this.length; ++j < m; ) { | |
subgroups.push(subgroup = []); | |
for (var group = this[j], i = -1, n = group.length; ++i < n; ) { | |
if (node = group[i]) d3_transitionNode(node, i, id, transition); | |
subgroup.push(node); | |
} | |
} | |
return d3_transition(subgroups, id); | |
}; | |
d3.select = function(node) { | |
var group = [ typeof node === "string" ? d3_select(node, d3_document) : node ]; | |
group.parentNode = d3_documentElement; | |
return d3_selection([ group ]); | |
}; | |
d3.selectAll = function(nodes) { | |
var group = d3_array(typeof nodes === "string" ? d3_selectAll(nodes, d3_document) : nodes); | |
group.parentNode = d3_documentElement; | |
return d3_selection([ group ]); | |
}; | |
var d3_selectionRoot = d3.select(d3_documentElement); | |
d3_selectionPrototype.on = function(type, listener, capture) { | |
var n = arguments.length; | |
if (n < 3) { | |
if (typeof type !== "string") { | |
if (n < 2) listener = false; | |
for (capture in type) this.each(d3_selection_on(capture, type[capture], listener)); | |
return this; | |
} | |
if (n < 2) return (n = this.node()["__on" + type]) && n._; | |
capture = false; | |
} | |
return this.each(d3_selection_on(type, listener, capture)); | |
}; | |
function d3_selection_on(type, listener, capture) { | |
var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener; | |
if (i > 0) type = type.substring(0, i); | |
var filter = d3_selection_onFilters.get(type); | |
if (filter) type = filter, wrap = d3_selection_onFilter; | |
function onRemove() { | |
var l = this[name]; | |
if (l) { | |
this.removeEventListener(type, l, l.$); | |
delete this[name]; | |
} | |
} | |
function onAdd() { | |
var l = wrap(listener, d3_array(arguments)); | |
onRemove.call(this); | |
this.addEventListener(type, this[name] = l, l.$ = capture); | |
l._ = listener; | |
} | |
function removeAll() { | |
var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match; | |
for (var name in this) { | |
if (match = name.match(re)) { | |
var l = this[name]; | |
this.removeEventListener(match[1], l, l.$); | |
delete this[name]; | |
} | |
} | |
} | |
return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll; | |
} | |
var d3_selection_onFilters = d3.map({ | |
mouseenter: "mouseover", | |
mouseleave: "mouseout" | |
}); | |
d3_selection_onFilters.forEach(function(k) { | |
if ("on" + k in d3_document) d3_selection_onFilters.remove(k); | |
}); | |
function d3_selection_onListener(listener, argumentz) { | |
return function(e) { | |
var o = d3.event; | |
d3.event = e; | |
argumentz[0] = this.__data__; | |
try { | |
listener.apply(this, argumentz); | |
} finally { | |
d3.event = o; | |
} | |
}; | |
} | |
function d3_selection_onFilter(listener, argumentz) { | |
var l = d3_selection_onListener(listener, argumentz); | |
return function(e) { | |
var target = this, related = e.relatedTarget; | |
if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) { | |
l.call(target, e); | |
} | |
}; | |
} | |
var d3_event_dragSelect = d3_vendorSymbol(d3_documentElement.style, "userSelect"), d3_event_dragId = 0; | |
function d3_event_dragSuppress() { | |
var name = ".dragsuppress-" + ++d3_event_dragId, touchmove = "touchmove" + name, selectstart = "selectstart" + name, dragstart = "dragstart" + name, click = "click" + name, w = d3.select(d3_window).on(touchmove, d3_eventPreventDefault).on(selectstart, d3_eventPreventDefault).on(dragstart, d3_eventPreventDefault), style = d3_documentElement.style, select = style[d3_event_dragSelect]; | |
style[d3_event_dragSelect] = "none"; | |
return function(suppressClick) { | |
w.on(name, null); | |
style[d3_event_dragSelect] = select; | |
if (suppressClick) { | |
function off() { | |
w.on(click, null); | |
} | |
w.on(click, function() { | |
d3_eventPreventDefault(); | |
off(); | |
}, true); | |
setTimeout(off, 0); | |
} | |
}; | |
} | |
d3.mouse = function(container) { | |
return d3_mousePoint(container, d3_eventSource()); | |
}; | |
var d3_mouse_bug44083 = /WebKit/.test(d3_window.navigator.userAgent) ? -1 : 0; | |
function d3_mousePoint(container, e) { | |
var svg = container.ownerSVGElement || container; | |
if (svg.createSVGPoint) { | |
var point = svg.createSVGPoint(); | |
if (d3_mouse_bug44083 < 0 && (d3_window.scrollX || d3_window.scrollY)) { | |
svg = d3.select("body").append("svg").style({ | |
position: "absolute", | |
top: 0, | |
left: 0, | |
margin: 0, | |
padding: 0, | |
border: "none" | |
}, "important"); | |
var ctm = svg[0][0].getScreenCTM(); | |
d3_mouse_bug44083 = !(ctm.f || ctm.e); | |
svg.remove(); | |
} | |
if (d3_mouse_bug44083) { | |
point.x = e.pageX; | |
point.y = e.pageY; | |
} else { | |
point.x = e.clientX; | |
point.y = e.clientY; | |
} | |
point = point.matrixTransform(container.getScreenCTM().inverse()); | |
return [ point.x, point.y ]; | |
} | |
var rect = container.getBoundingClientRect(); | |
return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ]; | |
} | |
d3.touches = function(container, touches) { | |
if (arguments.length < 2) touches = d3_eventSource().touches; | |
return touches ? d3_array(touches).map(function(touch) { | |
var point = d3_mousePoint(container, touch); | |
point.identifier = touch.identifier; | |
return point; | |
}) : []; | |
}; | |
d3.behavior.drag = function() { | |
var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, "mousemove", "mouseup"), touchstart = dragstart(touchid, touchposition, "touchmove", "touchend"); | |
function drag() { | |
this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart); | |
} | |
function touchid() { | |
return d3.event.changedTouches[0].identifier; | |
} | |
function touchposition(parent, id) { | |
return d3.touches(parent).filter(function(p) { | |
return p.identifier === id; | |
})[0]; | |
} | |
function dragstart(id, position, move, end) { | |
return function() { | |
var target = this, parent = target.parentNode, event_ = event.of(target, arguments), eventTarget = d3.event.target, eventId = id(), drag = eventId == null ? "drag" : "drag-" + eventId, origin_ = position(parent, eventId), dragged = 0, offset, w = d3.select(d3_window).on(move + "." + drag, moved).on(end + "." + drag, ended), dragRestore = d3_event_dragSuppress(); | |
if (origin) { | |
offset = origin.apply(target, arguments); | |
offset = [ offset.x - origin_[0], offset.y - origin_[1] ]; | |
} else { | |
offset = [ 0, 0 ]; | |
} | |
event_({ | |
type: "dragstart" | |
}); | |
function moved() { | |
if (!parent) return ended(); | |
var p = position(parent, eventId), dx = p[0] - origin_[0], dy = p[1] - origin_[1]; | |
dragged |= dx | dy; | |
origin_ = p; | |
event_({ | |
type: "drag", | |
x: p[0] + offset[0], | |
y: p[1] + offset[1], | |
dx: dx, | |
dy: dy | |
}); | |
} | |
function ended() { | |
w.on(move + "." + drag, null).on(end + "." + drag, null); | |
dragRestore(dragged && d3.event.target === eventTarget); | |
event_({ | |
type: "dragend" | |
}); | |
} | |
}; | |
} | |
drag.origin = function(x) { | |
if (!arguments.length) return origin; | |
origin = x; | |
return drag; | |
}; | |
return d3.rebind(drag, event, "on"); | |
}; | |
d3.behavior.zoom = function() { | |
var translate = [ 0, 0 ], translate0, scale = 1, scaleExtent = d3_behavior_zoomInfinity, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", event = d3_eventDispatch(zoom, "zoom"), x0, x1, y0, y1, touchtime; | |
function zoom() { | |
this.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on(mousemove, mousewheelreset).on("dblclick.zoom", dblclicked).on("touchstart.zoom", touchstarted); | |
} | |
zoom.translate = function(x) { | |
if (!arguments.length) return translate; | |
translate = x.map(Number); | |
rescale(); | |
return zoom; | |
}; | |
zoom.scale = function(x) { | |
if (!arguments.length) return scale; | |
scale = +x; | |
rescale(); | |
return zoom; | |
}; | |
zoom.scaleExtent = function(x) { | |
if (!arguments.length) return scaleExtent; | |
scaleExtent = x == null ? d3_behavior_zoomInfinity : x.map(Number); | |
return zoom; | |
}; | |
zoom.x = function(z) { | |
if (!arguments.length) return x1; | |
x1 = z; | |
x0 = z.copy(); | |
translate = [ 0, 0 ]; | |
scale = 1; | |
return zoom; | |
}; | |
zoom.y = function(z) { | |
if (!arguments.length) return y1; | |
y1 = z; | |
y0 = z.copy(); | |
translate = [ 0, 0 ]; | |
scale = 1; | |
return zoom; | |
}; | |
function location(p) { | |
return [ (p[0] - translate[0]) / scale, (p[1] - translate[1]) / scale ]; | |
} | |
function point(l) { | |
return [ l[0] * scale + translate[0], l[1] * scale + translate[1] ]; | |
} | |
function scaleTo(s) { | |
scale = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s)); | |
} | |
function translateTo(p, l) { | |
l = point(l); | |
translate[0] += p[0] - l[0]; | |
translate[1] += p[1] - l[1]; | |
} | |
function rescale() { | |
if (x1) x1.domain(x0.range().map(function(x) { | |
return (x - translate[0]) / scale; | |
}).map(x0.invert)); | |
if (y1) y1.domain(y0.range().map(function(y) { | |
return (y - translate[1]) / scale; | |
}).map(y0.invert)); | |
} | |
function dispatch(event) { | |
rescale(); | |
event({ | |
type: "zoom", | |
scale: scale, | |
translate: translate | |
}); | |
} | |
function mousedowned() { | |
var target = this, event_ = event.of(target, arguments), eventTarget = d3.event.target, dragged = 0, w = d3.select(d3_window).on(mousemove, moved).on(mouseup, ended), l = location(d3.mouse(target)), dragRestore = d3_event_dragSuppress(); | |
function moved() { | |
dragged = 1; | |
translateTo(d3.mouse(target), l); | |
dispatch(event_); | |
} | |
function ended() { | |
w.on(mousemove, d3_window === target ? mousewheelreset : null).on(mouseup, null); | |
dragRestore(dragged && d3.event.target === eventTarget); | |
} | |
} | |
function touchstarted() { | |
var target = this, event_ = event.of(target, arguments), touches = d3.touches(target), locations = {}, distance0 = 0, scale0 = scale, now = Date.now(), name = "zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove." + name, touchend = "touchend." + name, w = d3.select(d3_window).on(touchmove, moved).on(touchend, ended), t = d3.select(target).on(mousedown, null), dragRestore = d3_event_dragSuppress(); | |
touches.forEach(function(t) { | |
locations[t.identifier] = location(t); | |
}); | |
if (touches.length === 1) { | |
if (now - touchtime < 500) { | |
var p = touches[0], l = location(touches[0]); | |
scaleTo(scale * 2); | |
translateTo(p, l); | |
d3_eventPreventDefault(); | |
dispatch(event_); | |
} | |
touchtime = now; | |
} else if (touches.length > 1) { | |
var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1]; | |
distance0 = dx * dx + dy * dy; | |
} | |
function moved() { | |
var touches = d3.touches(target), p0 = touches[0], l0 = locations[p0.identifier]; | |
if (p1 = touches[1]) { | |
var p1, l1 = locations[p1.identifier], scale1 = d3.event.scale; | |
if (scale1 == null) { | |
var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1; | |
scale1 = distance0 && Math.sqrt(distance1 / distance0); | |
} | |
p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ]; | |
l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ]; | |
scaleTo(scale1 * scale0); | |
} | |
touchtime = null; | |
translateTo(p0, l0); | |
dispatch(event_); | |
} | |
function ended() { | |
w.on(touchmove, null).on(touchend, null); | |
t.on(mousedown, mousedowned); | |
dragRestore(); | |
} | |
} | |
function mousewheeled() { | |
d3_eventPreventDefault(); | |
if (!translate0) translate0 = location(d3.mouse(this)); | |
scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * scale); | |
translateTo(d3.mouse(this), translate0); | |
dispatch(event.of(this, arguments)); | |
} | |
function mousewheelreset() { | |
translate0 = null; | |
} | |
function dblclicked() { | |
var p = d3.mouse(this), l = location(p), k = Math.log(scale) / Math.LN2; | |
scaleTo(Math.pow(2, d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1)); | |
translateTo(p, l); | |
dispatch(event.of(this, arguments)); | |
} | |
return d3.rebind(zoom, event, "on"); | |
}; | |
var d3_behavior_zoomInfinity = [ 0, Infinity ]; | |
var d3_behavior_zoomDelta, d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() { | |
return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1); | |
}, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() { | |
return d3.event.wheelDelta; | |
}, "mousewheel") : (d3_behavior_zoomDelta = function() { | |
return -d3.event.detail; | |
}, "MozMousePixelScroll"); | |
function d3_Color() {} | |
d3_Color.prototype.toString = function() { | |
return this.rgb() + ""; | |
}; | |
d3.hsl = function(h, s, l) { | |
return arguments.length === 1 ? h instanceof d3_Hsl ? d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : d3_hsl(+h, +s, +l); | |
}; | |
function d3_hsl(h, s, l) { | |
return new d3_Hsl(h, s, l); | |
} | |
function d3_Hsl(h, s, l) { | |
this.h = h; | |
this.s = s; | |
this.l = l; | |
} | |
var d3_hslPrototype = d3_Hsl.prototype = new d3_Color(); | |
d3_hslPrototype.brighter = function(k) { | |
k = Math.pow(.7, arguments.length ? k : 1); | |
return d3_hsl(this.h, this.s, this.l / k); | |
}; | |
d3_hslPrototype.darker = function(k) { | |
k = Math.pow(.7, arguments.length ? k : 1); | |
return d3_hsl(this.h, this.s, k * this.l); | |
}; | |
d3_hslPrototype.rgb = function() { | |
return d3_hsl_rgb(this.h, this.s, this.l); | |
}; | |
function d3_hsl_rgb(h, s, l) { | |
var m1, m2; | |
h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h; | |
s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s; | |
l = l < 0 ? 0 : l > 1 ? 1 : l; | |
m2 = l <= .5 ? l * (1 + s) : l + s - l * s; | |
m1 = 2 * l - m2; | |
function v(h) { | |
if (h > 360) h -= 360; else if (h < 0) h += 360; | |
if (h < 60) return m1 + (m2 - m1) * h / 60; | |
if (h < 180) return m2; | |
if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60; | |
return m1; | |
} | |
function vv(h) { | |
return Math.round(v(h) * 255); | |
} | |
return d3_rgb(vv(h + 120), vv(h), vv(h - 120)); | |
} | |
var π = Math.PI, ε = 1e-6, ε2 = ε * ε, d3_radians = π / 180, d3_degrees = 180 / π; | |
function d3_sgn(x) { | |
return x > 0 ? 1 : x < 0 ? -1 : 0; | |
} | |
function d3_acos(x) { | |
return x > 1 ? 0 : x < -1 ? π : Math.acos(x); | |
} | |
function d3_asin(x) { | |
return x > 1 ? π / 2 : x < -1 ? -π / 2 : Math.asin(x); | |
} | |
function d3_sinh(x) { | |
return (Math.exp(x) - Math.exp(-x)) / 2; | |
} | |
function d3_cosh(x) { | |
return (Math.exp(x) + Math.exp(-x)) / 2; | |
} | |
function d3_haversin(x) { | |
return (x = Math.sin(x / 2)) * x; | |
} | |
d3.hcl = function(h, c, l) { | |
return arguments.length === 1 ? h instanceof d3_Hcl ? d3_hcl(h.h, h.c, h.l) : h instanceof d3_Lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : d3_hcl(+h, +c, +l); | |
}; | |
function d3_hcl(h, c, l) { | |
return new d3_Hcl(h, c, l); | |
} | |
function d3_Hcl(h, c, l) { | |
this.h = h; | |
this.c = c; | |
this.l = l; | |
} | |
var d3_hclPrototype = d3_Hcl.prototype = new d3_Color(); | |
d3_hclPrototype.brighter = function(k) { | |
return d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1))); | |
}; | |
d3_hclPrototype.darker = function(k) { | |
return d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1))); | |
}; | |
d3_hclPrototype.rgb = function() { | |
return d3_hcl_lab(this.h, this.c, this.l).rgb(); | |
}; | |
function d3_hcl_lab(h, c, l) { | |
if (isNaN(h)) h = 0; | |
if (isNaN(c)) c = 0; | |
return d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c); | |
} | |
d3.lab = function(l, a, b) { | |
return arguments.length === 1 ? l instanceof d3_Lab ? d3_lab(l.l, l.a, l.b) : l instanceof d3_Hcl ? d3_hcl_lab(l.l, l.c, l.h) : d3_rgb_lab((l = d3.rgb(l)).r, l.g, l.b) : d3_lab(+l, +a, +b); | |
}; | |
function d3_lab(l, a, b) { | |
return new d3_Lab(l, a, b); | |
} | |
function d3_Lab(l, a, b) { | |
this.l = l; | |
this.a = a; | |
this.b = b; | |
} | |
var d3_lab_K = 18; | |
var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883; | |
var d3_labPrototype = d3_Lab.prototype = new d3_Color(); | |
d3_labPrototype.brighter = function(k) { | |
return d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); | |
}; | |
d3_labPrototype.darker = function(k) { | |
return d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); | |
}; | |
d3_labPrototype.rgb = function() { | |
return d3_lab_rgb(this.l, this.a, this.b); | |
}; | |
function d3_lab_rgb(l, a, b) { | |
var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200; | |
x = d3_lab_xyz(x) * d3_lab_X; | |
y = d3_lab_xyz(y) * d3_lab_Y; | |
z = d3_lab_xyz(z) * d3_lab_Z; | |
return d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z)); | |
} | |
function d3_lab_hcl(l, a, b) { | |
return l > 0 ? d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : d3_hcl(NaN, NaN, l); | |
} | |
function d3_lab_xyz(x) { | |
return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037; | |
} | |
function d3_xyz_lab(x) { | |
return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29; | |
} | |
function d3_xyz_rgb(r) { | |
return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055)); | |
} | |
d3.rgb = function(r, g, b) { | |
return arguments.length === 1 ? r instanceof d3_Rgb ? d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : d3_rgb(~~r, ~~g, ~~b); | |
}; | |
function d3_rgbNumber(value) { | |
return d3_rgb(value >> 16, value >> 8 & 255, value & 255); | |
} | |
function d3_rgbString(value) { | |
return d3_rgbNumber(value) + ""; | |
} | |
function d3_rgb(r, g, b) { | |
return new d3_Rgb(r, g, b); | |
} | |
function d3_Rgb(r, g, b) { | |
this.r = r; | |
this.g = g; | |
this.b = b; | |
} | |
var d3_rgbPrototype = d3_Rgb.prototype = new d3_Color(); | |
d3_rgbPrototype.brighter = function(k) { | |
k = Math.pow(.7, arguments.length ? k : 1); | |
var r = this.r, g = this.g, b = this.b, i = 30; | |
if (!r && !g && !b) return d3_rgb(i, i, i); | |
if (r && r < i) r = i; | |
if (g && g < i) g = i; | |
if (b && b < i) b = i; | |
return d3_rgb(Math.min(255, ~~(r / k)), Math.min(255, ~~(g / k)), Math.min(255, ~~(b / k))); | |
}; | |
d3_rgbPrototype.darker = function(k) { | |
k = Math.pow(.7, arguments.length ? k : 1); | |
return d3_rgb(~~(k * this.r), ~~(k * this.g), ~~(k * this.b)); | |
}; | |
d3_rgbPrototype.hsl = function() { | |
return d3_rgb_hsl(this.r, this.g, this.b); | |
}; | |
d3_rgbPrototype.toString = function() { | |
return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b); | |
}; | |
function d3_rgb_hex(v) { | |
return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16); | |
} | |
function d3_rgb_parse(format, rgb, hsl) { | |
var r = 0, g = 0, b = 0, m1, m2, name; | |
m1 = /([a-z]+)\((.*)\)/i.exec(format); | |
if (m1) { | |
m2 = m1[2].split(","); | |
switch (m1[1]) { | |
case "hsl": | |
{ | |
return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100); | |
} | |
case "rgb": | |
{ | |
return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2])); | |
} | |
} | |
} | |
if (name = d3_rgb_names.get(format)) return rgb(name.r, name.g, name.b); | |
if (format != null && format.charAt(0) === "#") { | |
if (format.length === 4) { | |
r = format.charAt(1); | |
r += r; | |
g = format.charAt(2); | |
g += g; | |
b = format.charAt(3); | |
b += b; | |
} else if (format.length === 7) { | |
r = format.substring(1, 3); | |
g = format.substring(3, 5); | |
b = format.substring(5, 7); | |
} | |
r = parseInt(r, 16); | |
g = parseInt(g, 16); | |
b = parseInt(b, 16); | |
} | |
return rgb(r, g, b); | |
} | |
function d3_rgb_hsl(r, g, b) { | |
var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2; | |
if (d) { | |
s = l < .5 ? d / (max + min) : d / (2 - max - min); | |
if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4; | |
h *= 60; | |
} else { | |
h = NaN; | |
s = l > 0 && l < 1 ? 0 : h; | |
} | |
return d3_hsl(h, s, l); | |
} | |
function d3_rgb_lab(r, g, b) { | |
r = d3_rgb_xyz(r); | |
g = d3_rgb_xyz(g); | |
b = d3_rgb_xyz(b); | |
var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z); | |
return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z)); | |
} | |
function d3_rgb_xyz(r) { | |
return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4); | |
} | |
function d3_rgb_parseNumber(c) { | |
var f = parseFloat(c); | |
return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f; | |
} | |
var d3_rgb_names = d3.map({ | |
aliceblue: 15792383, | |
antiquewhite: 16444375, | |
aqua: 65535, | |
aquamarine: 8388564, | |
azure: 15794175, | |
beige: 16119260, | |
bisque: 16770244, | |
black: 0, | |
blanchedalmond: 16772045, | |
blue: 255, | |
blueviolet: 9055202, | |
brown: 10824234, | |
burlywood: 14596231, | |
cadetblue: 6266528, | |
chartreuse: 8388352, | |
chocolate: 13789470, | |
coral: 16744272, | |
cornflowerblue: 6591981, | |
cornsilk: 16775388, | |
crimson: 14423100, | |
cyan: 65535, | |
darkblue: 139, | |
darkcyan: 35723, | |
darkgoldenrod: 12092939, | |
darkgray: 11119017, | |
darkgreen: 25600, | |
darkgrey: 11119017, | |
darkkhaki: 12433259, | |
darkmagenta: 9109643, | |
darkolivegreen: 5597999, | |
darkorange: 16747520, | |
darkorchid: 10040012, | |
darkred: 9109504, | |
darksalmon: 15308410, | |
darkseagreen: 9419919, | |
darkslateblue: 4734347, | |
darkslategray: 3100495, | |
darkslategrey: 3100495, | |
darkturquoise: 52945, | |
darkviolet: 9699539, | |
deeppink: 16716947, | |
deepskyblue: 49151, | |
dimgray: 6908265, | |
dimgrey: 6908265, | |
dodgerblue: 2003199, | |
firebrick: 11674146, | |
floralwhite: 16775920, | |
forestgreen: 2263842, | |
fuchsia: 16711935, | |
gainsboro: 14474460, | |
ghostwhite: 16316671, | |
gold: 16766720, | |
goldenrod: 14329120, | |
gray: 8421504, | |
green: 32768, | |
greenyellow: 11403055, | |
grey: 8421504, | |
honeydew: 15794160, | |
hotpink: 16738740, | |
indianred: 13458524, | |
indigo: 4915330, | |
ivory: 16777200, | |
khaki: 15787660, | |
lavender: 15132410, | |
lavenderblush: 16773365, | |
lawngreen: 8190976, | |
lemonchiffon: 16775885, | |
lightblue: 11393254, | |
lightcoral: 15761536, | |
lightcyan: 14745599, | |
lightgoldenrodyellow: 16448210, | |
lightgray: 13882323, | |
lightgreen: 9498256, | |
lightgrey: 13882323, | |
lightpink: 16758465, | |
lightsalmon: 16752762, | |
lightseagreen: 2142890, | |
lightskyblue: 8900346, | |
lightslategray: 7833753, | |
lightslategrey: 7833753, | |
lightsteelblue: 11584734, | |
lightyellow: 16777184, | |
lime: 65280, | |
limegreen: 3329330, | |
linen: 16445670, | |
magenta: 16711935, | |
maroon: 8388608, | |
mediumaquamarine: 6737322, | |
mediumblue: 205, | |
mediumorchid: 12211667, | |
mediumpurple: 9662683, | |
mediumseagreen: 3978097, | |
mediumslateblue: 8087790, | |
mediumspringgreen: 64154, | |
mediumturquoise: 4772300, | |
mediumvioletred: 13047173, | |
midnightblue: 1644912, | |
mintcream: 16121850, | |
mistyrose: 16770273, | |
moccasin: 16770229, | |
navajowhite: 16768685, | |
navy: 128, | |
oldlace: 16643558, | |
olive: 8421376, | |
olivedrab: 7048739, | |
orange: 16753920, | |
orangered: 16729344, | |
orchid: 14315734, | |
palegoldenrod: 15657130, | |
palegreen: 10025880, | |
paleturquoise: 11529966, | |
palevioletred: 14381203, | |
papayawhip: 16773077, | |
peachpuff: 16767673, | |
peru: 13468991, | |
pink: 16761035, | |
plum: 14524637, | |
powderblue: 11591910, | |
purple: 8388736, | |
red: 16711680, | |
rosybrown: 12357519, | |
royalblue: 4286945, | |
saddlebrown: 9127187, | |
salmon: 16416882, | |
sandybrown: 16032864, | |
seagreen: 3050327, | |
seashell: 16774638, | |
sienna: 10506797, | |
silver: 12632256, | |
skyblue: 8900331, | |
slateblue: 6970061, | |
slategray: 7372944, | |
slategrey: 7372944, | |
snow: 16775930, | |
springgreen: 65407, | |
steelblue: 4620980, | |
tan: 13808780, | |
teal: 32896, | |
thistle: 14204888, | |
tomato: 16737095, | |
turquoise: 4251856, | |
violet: 15631086, | |
wheat: 16113331, | |
white: 16777215, | |
whitesmoke: 16119285, | |
yellow: 16776960, | |
yellowgreen: 10145074 | |
}); | |
d3_rgb_names.forEach(function(key, value) { | |
d3_rgb_names.set(key, d3_rgbNumber(value)); | |
}); | |
function d3_functor(v) { | |
return typeof v === "function" ? v : function() { | |
return v; | |
}; | |
} | |
d3.functor = d3_functor; | |
function d3_identity(d) { | |
return d; | |
} | |
d3.xhr = d3_xhrType(d3_identity); | |
function d3_xhrType(response) { | |
return function(url, mimeType, callback) { | |
if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType, | |
mimeType = null; | |
return d3_xhr(url, mimeType, response, callback); | |
}; | |
} | |
function d3_xhr(url, mimeType, response, callback) { | |
var xhr = {}, dispatch = d3.dispatch("progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null; | |
if (d3_window.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest(); | |
"onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() { | |
request.readyState > 3 && respond(); | |
}; | |
function respond() { | |
var status = request.status, result; | |
if (!status && request.responseText || status >= 200 && status < 300 || status === 304) { | |
try { | |
result = response.call(xhr, request); | |
} catch (e) { | |
dispatch.error.call(xhr, e); | |
return; | |
} | |
dispatch.load.call(xhr, result); | |
} else { | |
dispatch.error.call(xhr, request); | |
} | |
} | |
request.onprogress = function(event) { | |
var o = d3.event; | |
d3.event = event; | |
try { | |
dispatch.progress.call(xhr, request); | |
} finally { | |
d3.event = o; | |
} | |
}; | |
xhr.header = function(name, value) { | |
name = (name + "").toLowerCase(); | |
if (arguments.length < 2) return headers[name]; | |
if (value == null) delete headers[name]; else headers[name] = value + ""; | |
return xhr; | |
}; | |
xhr.mimeType = function(value) { | |
if (!arguments.length) return mimeType; | |
mimeType = value == null ? null : value + ""; | |
return xhr; | |
}; | |
xhr.responseType = function(value) { | |
if (!arguments.length) return responseType; | |
responseType = value; | |
return xhr; | |
}; | |
xhr.response = function(value) { | |
response = value; | |
return xhr; | |
}; | |
[ "get", "post" ].forEach(function(method) { | |
xhr[method] = function() { | |
return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments))); | |
}; | |
}); | |
xhr.send = function(method, data, callback) { | |
if (arguments.length === 2 && typeof data === "function") callback = data, data = null; | |
request.open(method, url, true); | |
if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*"; | |
if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]); | |
if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType); | |
if (responseType != null) request.responseType = responseType; | |
if (callback != null) xhr.on("error", callback).on("load", function(request) { | |
callback(null, request); | |
}); | |
request.send(data == null ? null : data); | |
return xhr; | |
}; | |
xhr.abort = function() { | |
request.abort(); | |
return xhr; | |
}; | |
d3.rebind(xhr, dispatch, "on"); | |
return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback)); | |
} | |
function d3_xhr_fixCallback(callback) { | |
return callback.length === 1 ? function(error, request) { | |
callback(error == null ? request : null); | |
} : callback; | |
} | |
d3.dsv = function(delimiter, mimeType) { | |
var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0); | |
function dsv(url, row, callback) { | |
if (arguments.length < 3) callback = row, row = null; | |
var xhr = d3.xhr(url, mimeType, callback); | |
xhr.row = function(_) { | |
return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row; | |
}; | |
return xhr.row(row); | |
} | |
function response(request) { | |
return dsv.parse(request.responseText); | |
} | |
function typedResponse(f) { | |
return function(request) { | |
return dsv.parse(request.responseText, f); | |
}; | |
} | |
dsv.parse = function(text, f) { | |
var o; | |
return dsv.parseRows(text, function(row, i) { | |
if (o) return o(row, i - 1); | |
var a = new Function("d", "return {" + row.map(function(name, i) { | |
return JSON.stringify(name) + ": d[" + i + "]"; | |
}).join(",") + "}"); | |
o = f ? function(row, i) { | |
return f(a(row), i); | |
} : a; | |
}); | |
}; | |
dsv.parseRows = function(text, f) { | |
var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol; | |
function token() { | |
if (I >= N) return EOF; | |
if (eol) return eol = false, EOL; | |
var j = I; | |
if (text.charCodeAt(j) === 34) { | |
var i = j; | |
while (i++ < N) { | |
if (text.charCodeAt(i) === 34) { | |
if (text.charCodeAt(i + 1) !== 34) break; | |
++i; | |
} | |
} | |
I = i + 2; | |
var c = text.charCodeAt(i + 1); | |
if (c === 13) { | |
eol = true; | |
if (text.charCodeAt(i + 2) === 10) ++I; | |
} else if (c === 10) { | |
eol = true; | |
} | |
return text.substring(j + 1, i).replace(/""/g, '"'); | |
} | |
while (I < N) { | |
var c = text.charCodeAt(I++), k = 1; | |
if (c === 10) eol = true; else if (c === 13) { | |
eol = true; | |
if (text.charCodeAt(I) === 10) ++I, ++k; | |
} else if (c !== delimiterCode) continue; | |
return text.substring(j, I - k); | |
} | |
return text.substring(j); | |
} | |
while ((t = token()) !== EOF) { | |
var a = []; | |
while (t !== EOL && t !== EOF) { | |
a.push(t); | |
t = token(); | |
} | |
if (f && !(a = f(a, n++))) continue; | |
rows.push(a); | |
} | |
return rows; | |
}; | |
dsv.format = function(rows) { | |
if (Array.isArray(rows[0])) return dsv.formatRows(rows); | |
var fieldSet = new d3_Set(), fields = []; | |
rows.forEach(function(row) { | |
for (var field in row) { | |
if (!fieldSet.has(field)) { | |
fields.push(fieldSet.add(field)); | |
} | |
} | |
}); | |
return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) { | |
return fields.map(function(field) { | |
return formatValue(row[field]); | |
}).join(delimiter); | |
})).join("\n"); | |
}; | |
dsv.formatRows = function(rows) { | |
return rows.map(formatRow).join("\n"); | |
}; | |
function formatRow(row) { | |
return row.map(formatValue).join(delimiter); | |
} | |
function formatValue(text) { | |
return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text; | |
} | |
return dsv; | |
}; | |
d3.csv = d3.dsv(",", "text/csv"); | |
d3.tsv = d3.dsv(" ", "text/tab-separated-values"); | |
var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = d3_window[d3_vendorSymbol(d3_window, "requestAnimationFrame")] || function(callback) { | |
setTimeout(callback, 17); | |
}; | |
d3.timer = function(callback, delay, then) { | |
var n = arguments.length; | |
if (n < 2) delay = 0; | |
if (n < 3) then = Date.now(); | |
var time = then + delay, timer = { | |
callback: callback, | |
time: time, | |
next: null | |
}; | |
if (d3_timer_queueTail) d3_timer_queueTail.next = timer; else d3_timer_queueHead = timer; | |
d3_timer_queueTail = timer; | |
if (!d3_timer_interval) { | |
d3_timer_timeout = clearTimeout(d3_timer_timeout); | |
d3_timer_interval = 1; | |
d3_timer_frame(d3_timer_step); | |
} | |
}; | |
function d3_timer_step() { | |
var now = d3_timer_mark(), delay = d3_timer_sweep() - now; | |
if (delay > 24) { | |
if (isFinite(delay)) { | |
clearTimeout(d3_timer_timeout); | |
d3_timer_timeout = setTimeout(d3_timer_step, delay); | |
} | |
d3_timer_interval = 0; | |
} else { | |
d3_timer_interval = 1; | |
d3_timer_frame(d3_timer_step); | |
} | |
} | |
d3.timer.flush = function() { | |
d3_timer_mark(); | |
d3_timer_sweep(); | |
}; | |
function d3_timer_replace(callback, delay, then) { | |
var n = arguments.length; | |
if (n < 2) delay = 0; | |
if (n < 3) then = Date.now(); | |
d3_timer_active.callback = callback; | |
d3_timer_active.time = then + delay; | |
} | |
function d3_timer_mark() { | |
var now = Date.now(); | |
d3_timer_active = d3_timer_queueHead; | |
while (d3_timer_active) { | |
if (now >= d3_timer_active.time) d3_timer_active.flush = d3_timer_active.callback(now - d3_timer_active.time); | |
d3_timer_active = d3_timer_active.next; | |
} | |
return now; | |
} | |
function d3_timer_sweep() { | |
var t0, t1 = d3_timer_queueHead, time = Infinity; | |
while (t1) { | |
if (t1.flush) { | |
t1 = t0 ? t0.next = t1.next : d3_timer_queueHead = t1.next; | |
} else { | |
if (t1.time < time) time = t1.time; | |
t1 = (t0 = t1).next; | |
} | |
} | |
d3_timer_queueTail = t0; | |
return time; | |
} | |
var d3_format_decimalPoint = ".", d3_format_thousandsSeparator = ",", d3_format_grouping = [ 3, 3 ], d3_format_currencySymbol = "$"; | |
var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix); | |
d3.formatPrefix = function(value, precision) { | |
var i = 0; | |
if (value) { | |
if (value < 0) value *= -1; | |
if (precision) value = d3.round(value, d3_format_precision(value, precision)); | |
i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10); | |
i = Math.max(-24, Math.min(24, Math.floor((i <= 0 ? i + 1 : i - 1) / 3) * 3)); | |
} | |
return d3_formatPrefixes[8 + i / 3]; | |
}; | |
function d3_formatPrefix(d, i) { | |
var k = Math.pow(10, Math.abs(8 - i) * 3); | |
return { | |
scale: i > 8 ? function(d) { | |
return d / k; | |
} : function(d) { | |
return d * k; | |
}, | |
symbol: d | |
}; | |
} | |
d3.round = function(x, n) { | |
return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x); | |
}; | |
d3.format = function(specifier) { | |
var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, suffix = "", integer = false; | |
if (precision) precision = +precision.substring(1); | |
if (zfill || fill === "0" && align === "=") { | |
zfill = fill = "0"; | |
align = "="; | |
if (comma) width -= Math.floor((width - 1) / 4); | |
} | |
switch (type) { | |
case "n": | |
comma = true; | |
type = "g"; | |
break; | |
case "%": | |
scale = 100; | |
suffix = "%"; | |
type = "f"; | |
break; | |
case "p": | |
scale = 100; | |
suffix = "%"; | |
type = "r"; | |
break; | |
case "b": | |
case "o": | |
case "x": | |
case "X": | |
if (symbol === "#") symbol = "0" + type.toLowerCase(); | |
case "c": | |
case "d": | |
integer = true; | |
precision = 0; | |
break; | |
case "s": | |
scale = -1; | |
type = "r"; | |
break; | |
} | |
if (symbol === "#") symbol = ""; else if (symbol === "$") symbol = d3_format_currencySymbol; | |
if (type == "r" && !precision) type = "g"; | |
if (precision != null) { | |
if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision)); | |
} | |
type = d3_format_types.get(type) || d3_format_typeDefault; | |
var zcomma = zfill && comma; | |
return function(value) { | |
if (integer && value % 1) return ""; | |
var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign; | |
if (scale < 0) { | |
var prefix = d3.formatPrefix(value, precision); | |
value = prefix.scale(value); | |
suffix = prefix.symbol; | |
} else { | |
value *= scale; | |
} | |
value = type(value, precision); | |
var i = value.lastIndexOf("."), before = i < 0 ? value : value.substring(0, i), after = i < 0 ? "" : d3_format_decimalPoint + value.substring(i + 1); | |
if (!zfill && comma) before = d3_format_group(before); | |
var length = symbol.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : ""; | |
if (zcomma) before = d3_format_group(padding + before); | |
negative += symbol; | |
value = before + after; | |
return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + suffix; | |
}; | |
}; | |
var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i; | |
var d3_format_types = d3.map({ | |
b: function(x) { | |
return x.toString(2); | |
}, | |
c: function(x) { | |
return String.fromCharCode(x); | |
}, | |
o: function(x) { | |
return x.toString(8); | |
}, | |
x: function(x) { | |
return x.toString(16); | |
}, | |
X: function(x) { | |
return x.toString(16).toUpperCase(); | |
}, | |
g: function(x, p) { | |
return x.toPrecision(p); | |
}, | |
e: function(x, p) { | |
return x.toExponential(p); | |
}, | |
f: function(x, p) { | |
return x.toFixed(p); | |
}, | |
r: function(x, p) { | |
return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p)))); | |
} | |
}); | |
function d3_format_precision(x, p) { | |
return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1); | |
} | |
function d3_format_typeDefault(x) { | |
return x + ""; | |
} | |
var d3_format_group = d3_identity; | |
if (d3_format_grouping) { | |
var d3_format_groupingLength = d3_format_grouping.length; | |
d3_format_group = function(value) { | |
var i = value.length, t = [], j = 0, g = d3_format_grouping[0]; | |
while (i > 0 && g > 0) { | |
t.push(value.substring(i -= g, i + g)); | |
g = d3_format_grouping[j = (j + 1) % d3_format_groupingLength]; | |
} | |
return t.reverse().join(d3_format_thousandsSeparator); | |
}; | |
} | |
d3.geo = {}; | |
function d3_adder() {} | |
d3_adder.prototype = { | |
s: 0, | |
t: 0, | |
add: function(y) { | |
d3_adderSum(y, this.t, d3_adderTemp); | |
d3_adderSum(d3_adderTemp.s, this.s, this); | |
if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t; | |
}, | |
reset: function() { | |
this.s = this.t = 0; | |
}, | |
valueOf: function() { | |
return this.s; | |
} | |
}; | |
var d3_adderTemp = new d3_adder(); | |
function d3_adderSum(a, b, o) { | |
var x = o.s = a + b, bv = x - a, av = x - bv; | |
o.t = a - av + (b - bv); | |
} | |
d3.geo.stream = function(object, listener) { | |
if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) { | |
d3_geo_streamObjectType[object.type](object, listener); | |
} else { | |
d3_geo_streamGeometry(object, listener); | |
} | |
}; | |
function d3_geo_streamGeometry(geometry, listener) { | |
if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) { | |
d3_geo_streamGeometryType[geometry.type](geometry, listener); | |
} | |
} | |
var d3_geo_streamObjectType = { | |
Feature: function(feature, listener) { | |
d3_geo_streamGeometry(feature.geometry, listener); | |
}, | |
FeatureCollection: function(object, listener) { | |
var features = object.features, i = -1, n = features.length; | |
while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener); | |
} | |
}; | |
var d3_geo_streamGeometryType = { | |
Sphere: function(object, listener) { | |
listener.sphere(); | |
}, | |
Point: function(object, listener) { | |
var coordinate = object.coordinates; | |
listener.point(coordinate[0], coordinate[1]); | |
}, | |
MultiPoint: function(object, listener) { | |
var coordinates = object.coordinates, i = -1, n = coordinates.length, coordinate; | |
while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1]); | |
}, | |
LineString: function(object, listener) { | |
d3_geo_streamLine(object.coordinates, listener, 0); | |
}, | |
MultiLineString: function(object, listener) { | |
var coordinates = object.coordinates, i = -1, n = coordinates.length; | |
while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0); | |
}, | |
Polygon: function(object, listener) { | |
d3_geo_streamPolygon(object.coordinates, listener); | |
}, | |
MultiPolygon: function(object, listener) { | |
var coordinates = object.coordinates, i = -1, n = coordinates.length; | |
while (++i < n) d3_geo_streamPolygon(coordinates[i], listener); | |
}, | |
GeometryCollection: function(object, listener) { | |
var geometries = object.geometries, i = -1, n = geometries.length; | |
while (++i < n) d3_geo_streamGeometry(geometries[i], listener); | |
} | |
}; | |
function d3_geo_streamLine(coordinates, listener, closed) { | |
var i = -1, n = coordinates.length - closed, coordinate; | |
listener.lineStart(); | |
while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1]); | |
listener.lineEnd(); | |
} | |
function d3_geo_streamPolygon(coordinates, listener) { | |
var i = -1, n = coordinates.length; | |
listener.polygonStart(); | |
while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1); | |
listener.polygonEnd(); | |
} | |
d3.geo.area = function(object) { | |
d3_geo_areaSum = 0; | |
d3.geo.stream(object, d3_geo_area); | |
return d3_geo_areaSum; | |
}; | |
var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder(); | |
var d3_geo_area = { | |
sphere: function() { | |
d3_geo_areaSum += 4 * π; | |
}, | |
point: d3_noop, | |
lineStart: d3_noop, | |
lineEnd: d3_noop, | |
polygonStart: function() { | |
d3_geo_areaRingSum.reset(); | |
d3_geo_area.lineStart = d3_geo_areaRingStart; | |
}, | |
polygonEnd: function() { | |
var area = 2 * d3_geo_areaRingSum; | |
d3_geo_areaSum += area < 0 ? 4 * π + area : area; | |
d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop; | |
} | |
}; | |
function d3_geo_areaRingStart() { | |
var λ00, φ00, λ0, cosφ0, sinφ0; | |
d3_geo_area.point = function(λ, φ) { | |
d3_geo_area.point = nextPoint; | |
λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4), | |
sinφ0 = Math.sin(φ); | |
}; | |
function nextPoint(λ, φ) { | |
λ *= d3_radians; | |
φ = φ * d3_radians / 2 + π / 4; | |
var dλ = λ - λ0, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(dλ), v = k * Math.sin(dλ); | |
d3_geo_areaRingSum.add(Math.atan2(v, u)); | |
λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ; | |
} | |
d3_geo_area.lineEnd = function() { | |
nextPoint(λ00, φ00); | |
}; | |
} | |
function d3_geo_cartesian(spherical) { | |
var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ); | |
return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ]; | |
} | |
function d3_geo_cartesianDot(a, b) { | |
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; | |
} | |
function d3_geo_cartesianCross(a, b) { | |
return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ]; | |
} | |
function d3_geo_cartesianAdd(a, b) { | |
a[0] += b[0]; | |
a[1] += b[1]; | |
a[2] += b[2]; | |
} | |
function d3_geo_cartesianScale(vector, k) { | |
return [ vector[0] * k, vector[1] * k, vector[2] * k ]; | |
} | |
function d3_geo_cartesianNormalize(d) { | |
var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); | |
d[0] /= l; | |
d[1] /= l; | |
d[2] /= l; | |
} | |
function d3_geo_spherical(cartesian) { | |
return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ]; | |
} | |
function d3_geo_sphericalEqual(a, b) { | |
return Math.abs(a[0] - b[0]) < ε && Math.abs(a[1] - b[1]) < ε; | |
} | |
d3.geo.bounds = function() { | |
var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range; | |
var bound = { | |
point: point, | |
lineStart: lineStart, | |
lineEnd: lineEnd, | |
polygonStart: function() { | |
bound.point = ringPoint; | |
bound.lineStart = ringStart; | |
bound.lineEnd = ringEnd; | |
dλSum = 0; | |
d3_geo_area.polygonStart(); | |
}, | |
polygonEnd: function() { | |
d3_geo_area.polygonEnd(); | |
bound.point = point; | |
bound.lineStart = lineStart; | |
bound.lineEnd = lineEnd; | |
if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90; | |
range[0] = λ0, range[1] = λ1; | |
} | |
}; | |
function point(λ, φ) { | |
ranges.push(range = [ λ0 = λ, λ1 = λ ]); | |
if (φ < φ0) φ0 = φ; | |
if (φ > φ1) φ1 = φ; | |
} | |
function linePoint(λ, φ) { | |
var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]); | |
if (p0) { | |
var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal); | |
d3_geo_cartesianNormalize(inflection); | |
inflection = d3_geo_spherical(inflection); | |
var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = Math.abs(dλ) > 180; | |
if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) { | |
var φi = inflection[1] * d3_degrees; | |
if (φi > φ1) φ1 = φi; | |
} else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) { | |
var φi = -inflection[1] * d3_degrees; | |
if (φi < φ0) φ0 = φi; | |
} else { | |
if (φ < φ0) φ0 = φ; | |
if (φ > φ1) φ1 = φ; | |
} | |
if (antimeridian) { | |
if (λ < λ_) { | |
if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; | |
} else { | |
if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; | |
} | |
} else { | |
if (λ1 >= λ0) { | |
if (λ < λ0) λ0 = λ; | |
if (λ > λ1) λ1 = λ; | |
} else { | |
if (λ > λ_) { | |
if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; | |
} else { | |
if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; | |
} | |
} | |
} | |
} else { | |
point(λ, φ); | |
} | |
p0 = p, λ_ = λ; | |
} | |
function lineStart() { | |
bound.point = linePoint; | |
} | |
function lineEnd() { | |
range[0] = λ0, range[1] = λ1; | |
bound.point = point; | |
p0 = null; | |
} | |
function ringPoint(λ, φ) { | |
if (p0) { | |
var dλ = λ - λ_; | |
dλSum += Math.abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ; | |
} else λ__ = λ, φ__ = φ; | |
d3_geo_area.point(λ, φ); | |
linePoint(λ, φ); | |
} | |
function ringStart() { | |
d3_geo_area.lineStart(); | |
} | |
function ringEnd() { | |
ringPoint(λ__, φ__); | |
d3_geo_area.lineEnd(); | |
if (Math.abs(dλSum) > ε) λ0 = -(λ1 = 180); | |
range[0] = λ0, range[1] = λ1; | |
p0 = null; | |
} | |
function angle(λ0, λ1) { | |
return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1; | |
} | |
function compareRanges(a, b) { | |
return a[0] - b[0]; | |
} | |
function withinRange(x, range) { | |
return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x; | |
} | |
return function(feature) { | |
φ1 = λ1 = -(λ0 = φ0 = Infinity); | |
ranges = []; | |
d3.geo.stream(feature, bound); | |
var n = ranges.length; | |
if (n) { | |
ranges.sort(compareRanges); | |
for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) { | |
b = ranges[i]; | |
if (withinRange(b[0], a) || withinRange(b[1], a)) { | |
if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1]; | |
if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0]; | |
} else { | |
merged.push(a = b); | |
} | |
} | |
var best = -Infinity, dλ; | |
for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) { | |
b = merged[i]; | |
if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1]; | |
} | |
} | |
ranges = range = null; | |
return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ]; | |
}; | |
}(); | |
d3.geo.centroid = function(object) { | |
d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; | |
d3.geo.stream(object, d3_geo_centroid); | |
var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z; | |
if (m < ε2) { | |
x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1; | |
if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0; | |
m = x * x + y * y + z * z; | |
if (m < ε2) return [ NaN, NaN ]; | |
} | |
return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ]; | |
}; | |
var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2; | |
var d3_geo_centroid = { | |
sphere: d3_noop, | |
point: d3_geo_centroidPoint, | |
lineStart: d3_geo_centroidLineStart, | |
lineEnd: d3_geo_centroidLineEnd, | |
polygonStart: function() { | |
d3_geo_centroid.lineStart = d3_geo_centroidRingStart; | |
}, | |
polygonEnd: function() { | |
d3_geo_centroid.lineStart = d3_geo_centroidLineStart; | |
} | |
}; | |
function d3_geo_centroidPoint(λ, φ) { | |
λ *= d3_radians; | |
var cosφ = Math.cos(φ *= d3_radians); | |
d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ)); | |
} | |
function d3_geo_centroidPointXYZ(x, y, z) { | |
++d3_geo_centroidW0; | |
d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0; | |
d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0; | |
d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0; | |
} | |
function d3_geo_centroidLineStart() { | |
var x0, y0, z0; | |
d3_geo_centroid.point = function(λ, φ) { | |
λ *= d3_radians; | |
var cosφ = Math.cos(φ *= d3_radians); | |
x0 = cosφ * Math.cos(λ); | |
y0 = cosφ * Math.sin(λ); | |
z0 = Math.sin(φ); | |
d3_geo_centroid.point = nextPoint; | |
d3_geo_centroidPointXYZ(x0, y0, z0); | |
}; | |
function nextPoint(λ, φ) { | |
λ *= d3_radians; | |
var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z); | |
d3_geo_centroidW1 += w; | |
d3_geo_centroidX1 += w * (x0 + (x0 = x)); | |
d3_geo_centroidY1 += w * (y0 + (y0 = y)); | |
d3_geo_centroidZ1 += w * (z0 + (z0 = z)); | |
d3_geo_centroidPointXYZ(x0, y0, z0); | |
} | |
} | |
function d3_geo_centroidLineEnd() { | |
d3_geo_centroid.point = d3_geo_centroidPoint; | |
} | |
function d3_geo_centroidRingStart() { | |
var λ00, φ00, x0, y0, z0; | |
d3_geo_centroid.point = function(λ, φ) { | |
λ00 = λ, φ00 = φ; | |
d3_geo_centroid.point = nextPoint; | |
λ *= d3_radians; | |
var cosφ = Math.cos(φ *= d3_radians); | |
x0 = cosφ * Math.cos(λ); | |
y0 = cosφ * Math.sin(λ); | |
z0 = Math.sin(φ); | |
d3_geo_centroidPointXYZ(x0, y0, z0); | |
}; | |
d3_geo_centroid.lineEnd = function() { | |
nextPoint(λ00, φ00); | |
d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd; | |
d3_geo_centroid.point = d3_geo_centroidPoint; | |
}; | |
function nextPoint(λ, φ) { | |
λ *= d3_radians; | |
var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u); | |
d3_geo_centroidX2 += v * cx; | |
d3_geo_centroidY2 += v * cy; | |
d3_geo_centroidZ2 += v * cz; | |
d3_geo_centroidW1 += w; | |
d3_geo_centroidX1 += w * (x0 + (x0 = x)); | |
d3_geo_centroidY1 += w * (y0 + (y0 = y)); | |
d3_geo_centroidZ1 += w * (z0 + (z0 = z)); | |
d3_geo_centroidPointXYZ(x0, y0, z0); | |
} | |
} | |
function d3_true() { | |
return true; | |
} | |
function d3_geo_clipPolygon(segments, compare, inside, interpolate, listener) { | |
var subject = [], clip = []; | |
segments.forEach(function(segment) { | |
if ((n = segment.length - 1) <= 0) return; | |
var n, p0 = segment[0], p1 = segment[n]; | |
if (d3_geo_sphericalEqual(p0, p1)) { | |
listener.lineStart(); | |
for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]); | |
listener.lineEnd(); | |
return; | |
} | |
var a = { | |
point: p0, | |
points: segment, | |
other: null, | |
visited: false, | |
entry: true, | |
subject: true | |
}, b = { | |
point: p0, | |
points: [ p0 ], | |
other: a, | |
visited: false, | |
entry: false, | |
subject: false | |
}; | |
a.other = b; | |
subject.push(a); | |
clip.push(b); | |
a = { | |
point: p1, | |
points: [ p1 ], | |
other: null, | |
visited: false, | |
entry: false, | |
subject: true | |
}; | |
b = { | |
point: p1, | |
points: [ p1 ], | |
other: a, | |
visited: false, | |
entry: true, | |
subject: false | |
}; | |
a.other = b; | |
subject.push(a); | |
clip.push(b); | |
}); | |
clip.sort(compare); | |
d3_geo_clipPolygonLinkCircular(subject); | |
d3_geo_clipPolygonLinkCircular(clip); | |
if (!subject.length) return; | |
if (inside) for (var i = 1, e = !inside(clip[0].point), n = clip.length; i < n; ++i) { | |
clip[i].entry = e = !e; | |
} | |
var start = subject[0], current, points, point; | |
while (1) { | |
current = start; | |
while (current.visited) if ((current = current.next) === start) return; | |
points = current.points; | |
listener.lineStart(); | |
do { | |
current.visited = current.other.visited = true; | |
if (current.entry) { | |
if (current.subject) { | |
for (var i = 0; i < points.length; i++) listener.point((point = points[i])[0], point[1]); | |
} else { | |
interpolate(current.point, current.next.point, 1, listener); | |
} | |
current = current.next; | |
} else { | |
if (current.subject) { | |
points = current.prev.points; | |
for (var i = points.length; --i >= 0; ) listener.point((point = points[i])[0], point[1]); | |
} else { | |
interpolate(current.point, current.prev.point, -1, listener); | |
} | |
current = current.prev; | |
} | |
current = current.other; | |
points = current.points; | |
} while (!current.visited); | |
listener.lineEnd(); | |
} | |
} | |
function d3_geo_clipPolygonLinkCircular(array) { | |
if (!(n = array.length)) return; | |
var n, i = 0, a = array[0], b; | |
while (++i < n) { | |
a.next = b = array[i]; | |
b.prev = a; | |
a = b; | |
} | |
a.next = b = array[0]; | |
b.prev = a; | |
} | |
function d3_geo_clip(pointVisible, clipLine, interpolate, polygonContains) { | |
return function(listener) { | |
var line = clipLine(listener); | |
var clip = { | |
point: point, | |
lineStart: lineStart, | |
lineEnd: lineEnd, | |
polygonStart: function() { | |
clip.point = pointRing; | |
clip.lineStart = ringStart; | |
clip.lineEnd = ringEnd; | |
segments = []; | |
polygon = []; | |
listener.polygonStart(); | |
}, | |
polygonEnd: function() { | |
clip.point = point; | |
clip.lineStart = lineStart; | |
clip.lineEnd = lineEnd; | |
segments = d3.merge(segments); | |
if (segments.length) { | |
d3_geo_clipPolygon(segments, d3_geo_clipSort, null, interpolate, listener); | |
} else if (polygonContains(polygon)) { | |
listener.lineStart(); | |
interpolate(null, null, 1, listener); | |
listener.lineEnd(); | |
} | |
listener.polygonEnd(); | |
segments = polygon = null; | |
}, | |
sphere: function() { | |
listener.polygonStart(); | |
listener.lineStart(); | |
interpolate(null, null, 1, listener); | |
listener.lineEnd(); | |
listener.polygonEnd(); | |
} | |
}; | |
function point(λ, φ) { | |
if (pointVisible(λ, φ)) listener.point(λ, φ); | |
} | |
function pointLine(λ, φ) { | |
line.point(λ, φ); | |
} | |
function lineStart() { | |
clip.point = pointLine; | |
line.lineStart(); | |
} | |
function lineEnd() { | |
clip.point = point; | |
line.lineEnd(); | |
} | |
var segments; | |
var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygon, ring; | |
function pointRing(λ, φ) { | |
ringListener.point(λ, φ); | |
ring.push([ λ, φ ]); | |
} | |
function ringStart() { | |
ringListener.lineStart(); | |
ring = []; | |
} | |
function ringEnd() { | |
pointRing(ring[0][0], ring[0][1]); | |
ringListener.lineEnd(); | |
var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length; | |
ring.pop(); | |
polygon.push(ring); | |
ring = null; | |
if (!n) return; | |
if (clean & 1) { | |
segment = ringSegments[0]; | |
var n = segment.length - 1, i = -1, point; | |
listener.lineStart(); | |
while (++i < n) listener.point((point = segment[i])[0], point[1]); | |
listener.lineEnd(); | |
return; | |
} | |
if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift())); | |
segments.push(ringSegments.filter(d3_geo_clipSegmentLength1)); | |
} | |
return clip; | |
}; | |
} | |
function d3_geo_clipSegmentLength1(segment) { | |
return segment.length > 1; | |
} | |
function d3_geo_clipBufferListener() { | |
var lines = [], line; | |
return { | |
lineStart: function() { | |
lines.push(line = []); | |
}, | |
point: function(λ, φ) { | |
line.push([ λ, φ ]); | |
}, | |
lineEnd: d3_noop, | |
buffer: function() { | |
var buffer = lines; | |
lines = []; | |
line = null; | |
return buffer; | |
}, | |
rejoin: function() { | |
if (lines.length > 1) lines.push(lines.pop().concat(lines.shift())); | |
} | |
}; | |
} | |
function d3_geo_clipSort(a, b) { | |
return ((a = a.point)[0] < 0 ? a[1] - π / 2 - ε : π / 2 - a[1]) - ((b = b.point)[0] < 0 ? b[1] - π / 2 - ε : π / 2 - b[1]); | |
} | |
function d3_geo_pointInPolygon(point, polygon) { | |
var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, polar = false, southPole = false, winding = 0; | |
d3_geo_areaRingSum.reset(); | |
for (var i = 0, n = polygon.length; i < n; ++i) { | |
var ring = polygon[i], m = ring.length; | |
if (!m) continue; | |
var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1; | |
while (true) { | |
if (j === m) j = 0; | |
point = ring[j]; | |
var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, antimeridian = Math.abs(dλ) > π, k = sinφ0 * sinφ; | |
d3_geo_areaRingSum.add(Math.atan2(k * Math.sin(dλ), cosφ0 * cosφ + k * Math.cos(dλ))); | |
if (Math.abs(φ) < ε) southPole = true; | |
polarAngle += antimeridian ? dλ + (dλ >= 0 ? 2 : -2) * π : dλ; | |
if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) { | |
var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point)); | |
d3_geo_cartesianNormalize(arc); | |
var intersection = d3_geo_cartesianCross(meridianNormal, arc); | |
d3_geo_cartesianNormalize(intersection); | |
var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]); | |
if (parallel > φarc) { | |
winding += antimeridian ^ dλ >= 0 ? 1 : -1; | |
} | |
} | |
if (!j++) break; | |
λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point; | |
} | |
if (Math.abs(polarAngle) > ε) polar = true; | |
} | |
return (!southPole && !polar && d3_geo_areaRingSum < 0 || polarAngle < -ε) ^ winding & 1; | |
} | |
var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, d3_geo_clipAntimeridianPolygonContains); | |
function d3_geo_clipAntimeridianLine(listener) { | |
var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean; | |
return { | |
lineStart: function() { | |
listener.lineStart(); | |
clean = 1; | |
}, | |
point: function(λ1, φ1) { | |
var sλ1 = λ1 > 0 ? π : -π, dλ = Math.abs(λ1 - λ0); | |
if (Math.abs(dλ - π) < ε) { | |
listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? π / 2 : -π / 2); | |
listener.point(sλ0, φ0); | |
listener.lineEnd(); | |
listener.lineStart(); | |
listener.point(sλ1, φ0); | |
listener.point(λ1, φ0); | |
clean = 0; | |
} else if (sλ0 !== sλ1 && dλ >= π) { | |
if (Math.abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε; | |
if (Math.abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε; | |
φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1); | |
listener.point(sλ0, φ0); | |
listener.lineEnd(); | |
listener.lineStart(); | |
listener.point(sλ1, φ0); | |
clean = 0; | |
} | |
listener.point(λ0 = λ1, φ0 = φ1); | |
sλ0 = sλ1; | |
}, | |
lineEnd: function() { | |
listener.lineEnd(); | |
λ0 = φ0 = NaN; | |
}, | |
clean: function() { | |
return 2 - clean; | |
} | |
}; | |
} | |
function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) { | |
var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1); | |
return Math.abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2; | |
} | |
function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) { | |
var φ; | |
if (from == null) { | |
φ = direction * π / 2; | |
listener.point(-π, φ); | |
listener.point(0, φ); | |
listener.point(π, φ); | |
listener.point(π, 0); | |
listener.point(π, -φ); | |
listener.point(0, -φ); | |
listener.point(-π, -φ); | |
listener.point(-π, 0); | |
listener.point(-π, φ); | |
} else if (Math.abs(from[0] - to[0]) > ε) { | |
var s = (from[0] < to[0] ? 1 : -1) * π; | |
φ = direction * s / 2; | |
listener.point(-s, φ); | |
listener.point(0, φ); | |
listener.point(s, φ); | |
} else { | |
listener.point(to[0], to[1]); | |
} | |
} | |
var d3_geo_clipAntimeridianPoint = [ -π, 0 ]; | |
function d3_geo_clipAntimeridianPolygonContains(polygon) { | |
return d3_geo_pointInPolygon(d3_geo_clipAntimeridianPoint, polygon); | |
} | |
function d3_geo_clipCircle(radius) { | |
var cr = Math.cos(radius), smallRadius = cr > 0, point = [ radius, 0 ], notHemisphere = Math.abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians); | |
return d3_geo_clip(visible, clipLine, interpolate, polygonContains); | |
function visible(λ, φ) { | |
return Math.cos(λ) * Math.cos(φ) > cr; | |
} | |
function clipLine(listener) { | |
var point0, c0, v0, v00, clean; | |
return { | |
lineStart: function() { | |
v00 = v0 = false; | |
clean = 1; | |
}, | |
point: function(λ, φ) { | |
var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0; | |
if (!point0 && (v00 = v0 = v)) listener.lineStart(); | |
if (v !== v0) { | |
point2 = intersect(point0, point1); | |
if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) { | |
point1[0] += ε; | |
point1[1] += ε; | |
v = visible(point1[0], point1[1]); | |
} | |
} | |
if (v !== v0) { | |
clean = 0; | |
if (v) { | |
listener.lineStart(); | |
point2 = intersect(point1, point0); | |
listener.point(point2[0], point2[1]); | |
} else { | |
point2 = intersect(point0, point1); | |
listener.point(point2[0], point2[1]); | |
listener.lineEnd(); | |
} | |
point0 = point2; | |
} else if (notHemisphere && point0 && smallRadius ^ v) { | |
var t; | |
if (!(c & c0) && (t = intersect(point1, point0, true))) { | |
clean = 0; | |
if (smallRadius) { | |
listener.lineStart(); | |
listener.point(t[0][0], t[0][1]); | |
listener.point(t[1][0], t[1][1]); | |
listener.lineEnd(); | |
} else { | |
listener.point(t[1][0], t[1][1]); | |
listener.lineEnd(); | |
listener.lineStart(); | |
listener.point(t[0][0], t[0][1]); | |
} | |
} | |
} | |
if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) { | |
listener.point(point1[0], point1[1]); | |
} | |
point0 = point1, v0 = v, c0 = c; | |
}, | |
lineEnd: function() { | |
if (v0) listener.lineEnd(); | |
point0 = null; | |
}, | |
clean: function() { | |
return clean | (v00 && v0) << 1; | |
} | |
}; | |
} | |
function intersect(a, b, two) { | |
var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b); | |
var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2; | |
if (!determinant) return !two && a; | |
var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2); | |
d3_geo_cartesianAdd(A, B); | |
var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1); | |
if (t2 < 0) return; | |
var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu); | |
d3_geo_cartesianAdd(q, A); | |
q = d3_geo_spherical(q); | |
if (!two) return q; | |
var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z; | |
if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z; | |
var δλ = λ1 - λ0, polar = Math.abs(δλ - π) < ε, meridian = polar || δλ < ε; | |
if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z; | |
if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (Math.abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) { | |
var q1 = d3_geo_cartesianScale(u, (-w + t) / uu); | |
d3_geo_cartesianAdd(q1, A); | |
return [ q, d3_geo_spherical(q1) ]; | |
} | |
} | |
function code(λ, φ) { | |
var r = smallRadius ? radius : π - radius, code = 0; | |
if (λ < -r) code |= 1; else if (λ > r) code |= 2; | |
if (φ < -r) code |= 4; else if (φ > r) code |= 8; | |
return code; | |
} | |
function polygonContains(polygon) { | |
return d3_geo_pointInPolygon(point, polygon); | |
} | |
} | |
var d3_geo_clipViewMAX = 1e9; | |
function d3_geo_clipView(x0, y0, x1, y1) { | |
return function(listener) { | |
var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), segments, polygon, ring; | |
var clip = { | |
point: point, | |
lineStart: lineStart, | |
lineEnd: lineEnd, | |
polygonStart: function() { | |
listener = bufferListener; | |
segments = []; | |
polygon = []; | |
}, | |
polygonEnd: function() { | |
listener = listener_; | |
if ((segments = d3.merge(segments)).length) { | |
listener.polygonStart(); | |
d3_geo_clipPolygon(segments, compare, inside, interpolate, listener); | |
listener.polygonEnd(); | |
} else if (insidePolygon([ x0, y0 ])) { | |
listener.polygonStart(), listener.lineStart(); | |
interpolate(null, null, 1, listener); | |
listener.lineEnd(), listener.polygonEnd(); | |
} | |
segments = polygon = ring = null; | |
} | |
}; | |
function inside(point) { | |
var a = corner(point, -1), i = insidePolygon([ a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0 ]); | |
return i; | |
} | |
function insidePolygon(p) { | |
var wn = 0, n = polygon.length, y = p[1]; | |
for (var i = 0; i < n; ++i) { | |
for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) { | |
b = v[j]; | |
if (a[1] <= y) { | |
if (b[1] > y && isLeft(a, b, p) > 0) ++wn; | |
} else { | |
if (b[1] <= y && isLeft(a, b, p) < 0) --wn; | |
} | |
a = b; | |
} | |
} | |
return wn !== 0; | |
} | |
function isLeft(a, b, c) { | |
return (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]); | |
} | |
function interpolate(from, to, direction, listener) { | |
var a = 0, a1 = 0; | |
if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) { | |
do { | |
listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0); | |
} while ((a = (a + direction + 4) % 4) !== a1); | |
} else { | |
listener.point(to[0], to[1]); | |
} | |
} | |
function visible(x, y) { | |
return x0 <= x && x <= x1 && y0 <= y && y <= y1; | |
} | |
function point(x, y) { | |
if (visible(x, y)) listener.point(x, y); | |
} | |
var x__, y__, v__, x_, y_, v_, first; | |
function lineStart() { | |
clip.point = linePoint; | |
if (polygon) polygon.push(ring = []); | |
first = true; | |
v_ = false; | |
x_ = y_ = NaN; | |
} | |
function lineEnd() { | |
if (segments) { | |
linePoint(x__, y__); | |
if (v__ && v_) bufferListener.rejoin(); | |
segments.push(bufferListener.buffer()); | |
} | |
clip.point = point; | |
if (v_) listener.lineEnd(); | |
} | |
function linePoint(x, y) { | |
x = Math.max(-d3_geo_clipViewMAX, Math.min(d3_geo_clipViewMAX, x)); | |
y = Math.max(-d3_geo_clipViewMAX, Math.min(d3_geo_clipViewMAX, y)); | |
var v = visible(x, y); | |
if (polygon) ring.push([ x, y ]); | |
if (first) { | |
x__ = x, y__ = y, v__ = v; | |
first = false; | |
if (v) { | |
listener.lineStart(); | |
listener.point(x, y); | |
} | |
} else { | |
if (v && v_) listener.point(x, y); else { | |
var a = [ x_, y_ ], b = [ x, y ]; | |
if (clipLine(a, b)) { | |
if (!v_) { | |
listener.lineStart(); | |
listener.point(a[0], a[1]); | |
} | |
listener.point(b[0], b[1]); | |
if (!v) listener.lineEnd(); | |
} else if (v) { | |
listener.lineStart(); | |
listener.point(x, y); | |
} | |
} | |
} | |
x_ = x, y_ = y, v_ = v; | |
} | |
return clip; | |
}; | |
function corner(p, direction) { | |
return Math.abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : Math.abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : Math.abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2; | |
} | |
function compare(a, b) { | |
return comparePoints(a.point, b.point); | |
} | |
function comparePoints(a, b) { | |
var ca = corner(a, 1), cb = corner(b, 1); | |
return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0]; | |
} | |
function clipLine(a, b) { | |
var dx = b[0] - a[0], dy = b[1] - a[1], t = [ 0, 1 ]; | |
if (Math.abs(dx) < ε && Math.abs(dy) < ε) return x0 <= a[0] && a[0] <= x1 && y0 <= a[1] && a[1] <= y1; | |
if (d3_geo_clipViewT(x0 - a[0], dx, t) && d3_geo_clipViewT(a[0] - x1, -dx, t) && d3_geo_clipViewT(y0 - a[1], dy, t) && d3_geo_clipViewT(a[1] - y1, -dy, t)) { | |
if (t[1] < 1) { | |
b[0] = a[0] + t[1] * dx; | |
b[1] = a[1] + t[1] * dy; | |
} | |
if (t[0] > 0) { | |
a[0] += t[0] * dx; | |
a[1] += t[0] * dy; | |
} | |
return true; | |
} | |
return false; | |
} | |
} | |
function d3_geo_clipViewT(num, denominator, t) { | |
if (Math.abs(denominator) < ε) return num <= 0; | |
var u = num / denominator; | |
if (denominator > 0) { | |
if (u > t[1]) return false; | |
if (u > t[0]) t[0] = u; | |
} else { | |
if (u < t[0]) return false; | |
if (u < t[1]) t[1] = u; | |
} | |
return true; | |
} | |
function d3_geo_compose(a, b) { | |
function compose(x, y) { | |
return x = a(x, y), b(x[0], x[1]); | |
} | |
if (a.invert && b.invert) compose.invert = function(x, y) { | |
return x = b.invert(x, y), x && a.invert(x[0], x[1]); | |
}; | |
return compose; | |
} | |
function d3_geo_conic(projectAt) { | |
var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1); | |
p.parallels = function(_) { | |
if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ]; | |
return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180); | |
}; | |
return p; | |
} | |
function d3_geo_conicEqualArea(φ0, φ1) { | |
var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n; | |
function forward(λ, φ) { | |
var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n; | |
return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ]; | |
} | |
forward.invert = function(x, y) { | |
var ρ0_y = ρ0 - y; | |
return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ]; | |
}; | |
return forward; | |
} | |
(d3.geo.conicEqualArea = function() { | |
return d3_geo_conic(d3_geo_conicEqualArea); | |
}).raw = d3_geo_conicEqualArea; | |
d3.geo.albers = function() { | |
return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070); | |
}; | |
d3.geo.albersUsa = function() { | |
var lower48 = d3.geo.albers(); | |
var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]); | |
var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]); | |
var point, pointStream = { | |
point: function(x, y) { | |
point = [ x, y ]; | |
} | |
}, lower48Point, alaskaPoint, hawaiiPoint; | |
function albersUsa(coordinates) { | |
var x = coordinates[0], y = coordinates[1]; | |
point = null; | |
(lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y); | |
return point; | |
} | |
albersUsa.invert = function(coordinates) { | |
var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k; | |
return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates); | |
}; | |
albersUsa.stream = function(stream) { | |
var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream); | |
return { | |
point: function(x, y) { | |
lower48Stream.point(x, y); | |
alaskaStream.point(x, y); | |
hawaiiStream.point(x, y); | |
}, | |
sphere: function() { | |
lower48Stream.sphere(); | |
alaskaStream.sphere(); | |
hawaiiStream.sphere(); | |
}, | |
lineStart: function() { | |
lower48Stream.lineStart(); | |
alaskaStream.lineStart(); | |
hawaiiStream.lineStart(); | |
}, | |
lineEnd: function() { | |
lower48Stream.lineEnd(); | |
alaskaStream.lineEnd(); | |
hawaiiStream.lineEnd(); | |
}, | |
polygonStart: function() { | |
lower48Stream.polygonStart(); | |
alaskaStream.polygonStart(); | |
hawaiiStream.polygonStart(); | |
}, | |
polygonEnd: function() { | |
lower48Stream.polygonEnd(); | |
alaskaStream.polygonEnd(); | |
hawaiiStream.polygonEnd(); | |
} | |
}; | |
}; | |
albersUsa.precision = function(_) { | |
if (!arguments.length) return lower48.precision(); | |
lower48.precision(_); | |
alaska.precision(_); | |
hawaii.precision(_); | |
return albersUsa; | |
}; | |
albersUsa.scale = function(_) { | |
if (!arguments.length) return lower48.scale(); | |
lower48.scale(_); | |
alaska.scale(_ * .35); | |
hawaii.scale(_); | |
return albersUsa.translate(lower48.translate()); | |
}; | |
albersUsa.translate = function(_) { | |
if (!arguments.length) return lower48.translate(); | |
var k = lower48.scale(), x = +_[0], y = +_[1]; | |
lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point; | |
alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; | |
hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; | |
return albersUsa; | |
}; | |
return albersUsa.scale(1070); | |
}; | |
var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = { | |
point: d3_noop, | |
lineStart: d3_noop, | |
lineEnd: d3_noop, | |
polygonStart: function() { | |
d3_geo_pathAreaPolygon = 0; | |
d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart; | |
}, | |
polygonEnd: function() { | |
d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop; | |
d3_geo_pathAreaSum += Math.abs(d3_geo_pathAreaPolygon / 2); | |
} | |
}; | |
function d3_geo_pathAreaRingStart() { | |
var x00, y00, x0, y0; | |
d3_geo_pathArea.point = function(x, y) { | |
d3_geo_pathArea.point = nextPoint; | |
x00 = x0 = x, y00 = y0 = y; | |
}; | |
function nextPoint(x, y) { | |
d3_geo_pathAreaPolygon += y0 * x - x0 * y; | |
x0 = x, y0 = y; | |
} | |
d3_geo_pathArea.lineEnd = function() { | |
nextPoint(x00, y00); | |
}; | |
} | |
var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1; | |
var d3_geo_pathBounds = { | |
point: d3_geo_pathBoundsPoint, | |
lineStart: d3_noop, | |
lineEnd: d3_noop, | |
polygonStart: d3_noop, | |
polygonEnd: d3_noop | |
}; | |
function d3_geo_pathBoundsPoint(x, y) { | |
if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x; | |
if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x; | |
if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y; | |
if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y; | |
} | |
function d3_geo_pathBuffer() { | |
var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = []; | |
var stream = { | |
point: point, | |
lineStart: function() { | |
stream.point = pointLineStart; | |
}, | |
lineEnd: lineEnd, | |
polygonStart: function() { | |
stream.lineEnd = lineEndPolygon; | |
}, | |
polygonEnd: function() { | |
stream.lineEnd = lineEnd; | |
stream.point = point; | |
}, | |
pointRadius: function(_) { | |
pointCircle = d3_geo_pathBufferCircle(_); | |
return stream; | |
}, | |
result: function() { | |
if (buffer.length) { | |
var result = buffer.join(""); | |
buffer = []; | |
return result; | |
} | |
} | |
}; | |
function point(x, y) { | |
buffer.push("M", x, ",", y, pointCircle); | |
} | |
function pointLineStart(x, y) { | |
buffer.push("M", x, ",", y); | |
stream.point = pointLine; | |
} | |
function pointLine(x, y) { | |
buffer.push("L", x, ",", y); | |
} | |
function lineEnd() { | |
stream.point = point; | |
} | |
function lineEndPolygon() { | |
buffer.push("Z"); | |
} | |
return stream; | |
} | |
function d3_geo_pathBufferCircle(radius) { | |
return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z"; | |
} | |
var d3_geo_pathCentroid = { | |
point: d3_geo_pathCentroidPoint, | |
lineStart: d3_geo_pathCentroidLineStart, | |
lineEnd: d3_geo_pathCentroidLineEnd, | |
polygonStart: function() { | |
d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart; | |
}, | |
polygonEnd: function() { | |
d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; | |
d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart; | |
d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd; | |
} | |
}; | |
function d3_geo_pathCentroidPoint(x, y) { | |
d3_geo_centroidX0 += x; | |
d3_geo_centroidY0 += y; | |
++d3_geo_centroidZ0; | |
} | |
function d3_geo_pathCentroidLineStart() { | |
var x0, y0; | |
d3_geo_pathCentroid.point = function(x, y) { | |
d3_geo_pathCentroid.point = nextPoint; | |
d3_geo_pathCentroidPoint(x0 = x, y0 = y); | |
}; | |
function nextPoint(x, y) { | |
var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); | |
d3_geo_centroidX1 += z * (x0 + x) / 2; | |
d3_geo_centroidY1 += z * (y0 + y) / 2; | |
d3_geo_centroidZ1 += z; | |
d3_geo_pathCentroidPoint(x0 = x, y0 = y); | |
} | |
} | |
function d3_geo_pathCentroidLineEnd() { | |
d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; | |
} | |
function d3_geo_pathCentroidRingStart() { | |
var x00, y00, x0, y0; | |
d3_geo_pathCentroid.point = function(x, y) { | |
d3_geo_pathCentroid.point = nextPoint; | |
d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y); | |
}; | |
function nextPoint(x, y) { | |
var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); | |
d3_geo_centroidX1 += z * (x0 + x) / 2; | |
d3_geo_centroidY1 += z * (y0 + y) / 2; | |
d3_geo_centroidZ1 += z; | |
z = y0 * x - x0 * y; | |
d3_geo_centroidX2 += z * (x0 + x); | |
d3_geo_centroidY2 += z * (y0 + y); | |
d3_geo_centroidZ2 += z * 3; | |
d3_geo_pathCentroidPoint(x0 = x, y0 = y); | |
} | |
d3_geo_pathCentroid.lineEnd = function() { | |
nextPoint(x00, y00); | |
}; | |
} | |
function d3_geo_pathContext(context) { | |
var pointRadius = 4.5; | |
var stream = { | |
point: point, | |
lineStart: function() { | |
stream.point = pointLineStart; | |
}, | |
lineEnd: lineEnd, | |
polygonStart: function() { | |
stream.lineEnd = lineEndPolygon; | |
}, | |
polygonEnd: function() { | |
stream.lineEnd = lineEnd; | |
stream.point = point; | |
}, | |
pointRadius: function(_) { | |
pointRadius = _; | |
return stream; | |
}, | |
result: d3_noop | |
}; | |
function point(x, y) { | |
context.moveTo(x, y); | |
context.arc(x, y, pointRadius, 0, 2 * π); | |
} | |
function pointLineStart(x, y) { | |
context.moveTo(x, y); | |
stream.point = pointLine; | |
} | |
function pointLine(x, y) { | |
context.lineTo(x, y); | |
} | |
function lineEnd() { | |
stream.point = point; | |
} | |
function lineEndPolygon() { | |
context.closePath(); | |
} | |
return stream; | |
} | |
function d3_geo_resample(project) { | |
var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16; | |
function resample(stream) { | |
var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0; | |
var resample = { | |
point: point, | |
lineStart: lineStart, | |
lineEnd: lineEnd, | |
polygonStart: function() { | |
stream.polygonStart(); | |
resample.lineStart = ringStart; | |
}, | |
polygonEnd: function() { | |
stream.polygonEnd(); | |
resample.lineStart = lineStart; | |
} | |
}; | |
function point(x, y) { | |
x = project(x, y); | |
stream.point(x[0], x[1]); | |
} | |
function lineStart() { | |
x0 = NaN; | |
resample.point = linePoint; | |
stream.lineStart(); | |
} | |
function linePoint(λ, φ) { | |
var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ); | |
resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream); | |
stream.point(x0, y0); | |
} | |
function lineEnd() { | |
resample.point = point; | |
stream.lineEnd(); | |
} | |
function ringStart() { | |
lineStart(); | |
resample.point = ringPoint; | |
resample.lineEnd = ringEnd; | |
} | |
function ringPoint(λ, φ) { | |
linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0; | |
resample.point = linePoint; | |
} | |
function ringEnd() { | |
resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream); | |
resample.lineEnd = lineEnd; | |
lineEnd(); | |
} | |
return resample; | |
} | |
function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) { | |
var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy; | |
if (d2 > 4 * δ2 && depth--) { | |
var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = Math.abs(Math.abs(c) - 1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2; | |
if (dz * dz / d2 > δ2 || Math.abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { | |
resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream); | |
stream.point(x2, y2); | |
resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream); | |
} | |
} | |
} | |
resample.precision = function(_) { | |
if (!arguments.length) return Math.sqrt(δ2); | |
maxDepth = (δ2 = _ * _) > 0 && 16; | |
return resample; | |
}; | |
return resample; | |
} | |
d3.geo.path = function() { | |
var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream; | |
function path(object) { | |
if (object) { | |
if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments)); | |
if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream); | |
d3.geo.stream(object, cacheStream); | |
} | |
return contextStream.result(); | |
} | |
path.area = function(object) { | |
d3_geo_pathAreaSum = 0; | |
d3.geo.stream(object, projectStream(d3_geo_pathArea)); | |
return d3_geo_pathAreaSum; | |
}; | |
path.centroid = function(object) { | |
d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; | |
d3.geo.stream(object, projectStream(d3_geo_pathCentroid)); | |
return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ]; | |
}; | |
path.bounds = function(object) { | |
d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity); | |
d3.geo.stream(object, projectStream(d3_geo_pathBounds)); | |
return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ]; | |
}; | |
path.projection = function(_) { | |
if (!arguments.length) return projection; | |
projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity; | |
return reset(); | |
}; | |
path.context = function(_) { | |
if (!arguments.length) return context; | |
contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_); | |
if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius); | |
return reset(); | |
}; | |
path.pointRadius = function(_) { | |
if (!arguments.length) return pointRadius; | |
pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_); | |
return path; | |
}; | |
function reset() { | |
cacheStream = null; | |
return path; | |
} | |
return path.projection(d3.geo.albersUsa()).context(null); | |
}; | |
function d3_geo_pathProjectStream(project) { | |
var resample = d3_geo_resample(function(λ, φ) { | |
return project([ λ * d3_degrees, φ * d3_degrees ]); | |
}); | |
return function(stream) { | |
stream = resample(stream); | |
return { | |
point: function(λ, φ) { | |
stream.point(λ * d3_radians, φ * d3_radians); | |
}, | |
sphere: function() { | |
stream.sphere(); | |
}, | |
lineStart: function() { | |
stream.lineStart(); | |
}, | |
lineEnd: function() { | |
stream.lineEnd(); | |
}, | |
polygonStart: function() { | |
stream.polygonStart(); | |
}, | |
polygonEnd: function() { | |
stream.polygonEnd(); | |
} | |
}; | |
}; | |
} | |
d3.geo.projection = d3_geo_projection; | |
d3.geo.projectionMutator = d3_geo_projectionMutator; | |
function d3_geo_projection(project) { | |
return d3_geo_projectionMutator(function() { | |
return project; | |
})(); | |
} | |
function d3_geo_projectionMutator(projectAt) { | |
var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) { | |
x = project(x, y); | |
return [ x[0] * k + δx, δy - x[1] * k ]; | |
}), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream; | |
function projection(point) { | |
point = projectRotate(point[0] * d3_radians, point[1] * d3_radians); | |
return [ point[0] * k + δx, δy - point[1] * k ]; | |
} | |
function invert(point) { | |
point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k); | |
return point && [ point[0] * d3_degrees, point[1] * d3_degrees ]; | |
} | |
projection.stream = function(output) { | |
if (stream) stream.valid = false; | |
stream = d3_geo_projectionRadiansRotate(rotate, preclip(projectResample(postclip(output)))); | |
stream.valid = true; | |
return stream; | |
}; | |
projection.clipAngle = function(_) { | |
if (!arguments.length) return clipAngle; | |
preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians); | |
return invalidate(); | |
}; | |
projection.clipExtent = function(_) { | |
if (!arguments.length) return clipExtent; | |
clipExtent = _; | |
postclip = _ == null ? d3_identity : d3_geo_clipView(_[0][0], _[0][1], _[1][0], _[1][1]); | |
return invalidate(); | |
}; | |
projection.scale = function(_) { | |
if (!arguments.length) return k; | |
k = +_; | |
return reset(); | |
}; | |
projection.translate = function(_) { | |
if (!arguments.length) return [ x, y ]; | |
x = +_[0]; | |
y = +_[1]; | |
return reset(); | |
}; | |
projection.center = function(_) { | |
if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ]; | |
λ = _[0] % 360 * d3_radians; | |
φ = _[1] % 360 * d3_radians; | |
return reset(); | |
}; | |
projection.rotate = function(_) { | |
if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ]; | |
δλ = _[0] % 360 * d3_radians; | |
δφ = _[1] % 360 * d3_radians; | |
δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0; | |
return reset(); | |
}; | |
d3.rebind(projection, projectResample, "precision"); | |
function reset() { | |
projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project); | |
var center = project(λ, φ); | |
δx = x - center[0] * k; | |
δy = y + center[1] * k; | |
return invalidate(); | |
} | |
function invalidate() { | |
if (stream) { | |
stream.valid = false; | |
stream = null; | |
} | |
return projection; | |
} | |
return function() { | |
project = projectAt.apply(this, arguments); | |
projection.invert = project.invert && invert; | |
return reset(); | |
}; | |
} | |
function d3_geo_projectionRadiansRotate(rotate, stream) { | |
return { | |
point: function(x, y) { | |
y = rotate(x * d3_radians, y * d3_radians), x = y[0]; | |
stream.point(x > π ? x - 2 * π : x < -π ? x + 2 * π : x, y[1]); | |
}, | |
sphere: function() { | |
stream.sphere(); | |
}, | |
lineStart: function() { | |
stream.lineStart(); | |
}, | |
lineEnd: function() { | |
stream.lineEnd(); | |
}, | |
polygonStart: function() { | |
stream.polygonStart(); | |
}, | |
polygonEnd: function() { | |
stream.polygonEnd(); | |
} | |
}; | |
} | |
function d3_geo_equirectangular(λ, φ) { | |
return [ λ, φ ]; | |
} | |
(d3.geo.equirectangular = function() { | |
return d3_geo_projection(d3_geo_equirectangular); | |
}).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular; | |
d3.geo.rotation = function(rotate) { | |
rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0); | |
function forward(coordinates) { | |
coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians); | |
return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; | |
} | |
forward.invert = function(coordinates) { | |
coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians); | |
return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; | |
}; | |
return forward; | |
}; | |
function d3_geo_rotation(δλ, δφ, δγ) { | |
return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_equirectangular; | |
} | |
function d3_geo_forwardRotationλ(δλ) { | |
return function(λ, φ) { | |
return λ += δλ, [ λ > π ? λ - 2 * π : λ < -π ? λ + 2 * π : λ, φ ]; | |
}; | |
} | |
function d3_geo_rotationλ(δλ) { | |
var rotation = d3_geo_forwardRotationλ(δλ); | |
rotation.invert = d3_geo_forwardRotationλ(-δλ); | |
return rotation; | |
} | |
function d3_geo_rotationφγ(δφ, δγ) { | |
var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ); | |
function rotation(λ, φ) { | |
var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ; | |
return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ]; | |
} | |
rotation.invert = function(λ, φ) { | |
var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ; | |
return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ]; | |
}; | |
return rotation; | |
} | |
d3.geo.circle = function() { | |
var origin = [ 0, 0 ], angle, precision = 6, interpolate; | |
function circle() { | |
var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = []; | |
interpolate(null, null, 1, { | |
point: function(x, y) { | |
ring.push(x = rotate(x, y)); | |
x[0] *= d3_degrees, x[1] *= d3_degrees; | |
} | |
}); | |
return { | |
type: "Polygon", | |
coordinates: [ ring ] | |
}; | |
} | |
circle.origin = function(x) { | |
if (!arguments.length) return origin; | |
origin = x; | |
return circle; | |
}; | |
circle.angle = function(x) { | |
if (!arguments.length) return angle; | |
interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians); | |
return circle; | |
}; | |
circle.precision = function(_) { | |
if (!arguments.length) return precision; | |
interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians); | |
return circle; | |
}; | |
return circle.angle(90); | |
}; | |
function d3_geo_circleInterpolate(radius, precision) { | |
var cr = Math.cos(radius), sr = Math.sin(radius); | |
return function(from, to, direction, listener) { | |
if (from != null) { | |
from = d3_geo_circleAngle(cr, from); | |
to = d3_geo_circleAngle(cr, to); | |
if (direction > 0 ? from < to : from > to) from += direction * 2 * π; | |
} else { | |
from = radius + direction * 2 * π; | |
to = radius; | |
} | |
var point; | |
for (var step = direction * precision, t = from; direction > 0 ? t > to : t < to; t -= step) { | |
listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]); | |
} | |
}; | |
} | |
function d3_geo_circleAngle(cr, point) { | |
var a = d3_geo_cartesian(point); | |
a[0] -= cr; | |
d3_geo_cartesianNormalize(a); | |
var angle = d3_acos(-a[1]); | |
return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI); | |
} | |
d3.geo.distance = function(a, b) { | |
var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t; | |
return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ); | |
}; | |
d3.geo.graticule = function() { | |
var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5; | |
function graticule() { | |
return { | |
type: "MultiLineString", | |
coordinates: lines() | |
}; | |
} | |
function lines() { | |
return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) { | |
return Math.abs(x % DX) > ε; | |
}).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) { | |
return Math.abs(y % DY) > ε; | |
}).map(y)); | |
} | |
graticule.lines = function() { | |
return lines().map(function(coordinates) { | |
return { | |
type: "LineString", | |
coordinates: coordinates | |
}; | |
}); | |
}; | |
graticule.outline = function() { | |
return { | |
type: "Polygon", | |
coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ] | |
}; | |
}; | |
graticule.extent = function(_) { | |
if (!arguments.length) return graticule.minorExtent(); | |
return graticule.majorExtent(_).minorExtent(_); | |
}; | |
graticule.majorExtent = function(_) { | |
if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ]; | |
X0 = +_[0][0], X1 = +_[1][0]; | |
Y0 = +_[0][1], Y1 = +_[1][1]; | |
if (X0 > X1) _ = X0, X0 = X1, X1 = _; | |
if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _; | |
return graticule.precision(precision); | |
}; | |
graticule.minorExtent = function(_) { | |
if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ]; | |
x0 = +_[0][0], x1 = +_[1][0]; | |
y0 = +_[0][1], y1 = +_[1][1]; | |
if (x0 > x1) _ = x0, x0 = x1, x1 = _; | |
if (y0 > y1) _ = y0, y0 = y1, y1 = _; | |
return graticule.precision(precision); | |
}; | |
graticule.step = function(_) { | |
if (!arguments.length) return graticule.minorStep(); | |
return graticule.majorStep(_).minorStep(_); | |
}; | |
graticule.majorStep = function(_) { | |
if (!arguments.length) return [ DX, DY ]; | |
DX = +_[0], DY = +_[1]; | |
return graticule; | |
}; | |
graticule.minorStep = function(_) { | |
if (!arguments.length) return [ dx, dy ]; | |
dx = +_[0], dy = +_[1]; | |
return graticule; | |
}; | |
graticule.precision = function(_) { | |
if (!arguments.length) return precision; | |
precision = +_; | |
x = d3_geo_graticuleX(y0, y1, 90); | |
y = d3_geo_graticuleY(x0, x1, precision); | |
X = d3_geo_graticuleX(Y0, Y1, 90); | |
Y = d3_geo_graticuleY(X0, X1, precision); | |
return graticule; | |
}; | |
return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]); | |
}; | |
function d3_geo_graticuleX(y0, y1, dy) { | |
var y = d3.range(y0, y1 - ε, dy).concat(y1); | |
return function(x) { | |
return y.map(function(y) { | |
return [ x, y ]; | |
}); | |
}; | |
} | |
function d3_geo_graticuleY(x0, x1, dx) { | |
var x = d3.range(x0, x1 - ε, dx).concat(x1); | |
return function(y) { | |
return x.map(function(x) { | |
return [ x, y ]; | |
}); | |
}; | |
} | |
function d3_source(d) { | |
return d.source; | |
} | |
function d3_target(d) { | |
return d.target; | |
} | |
d3.geo.greatArc = function() { | |
var source = d3_source, source_, target = d3_target, target_; | |
function greatArc() { | |
return { | |
type: "LineString", | |
coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ] | |
}; | |
} | |
greatArc.distance = function() { | |
return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments)); | |
}; | |
greatArc.source = function(_) { | |
if (!arguments.length) return source; | |
source = _, source_ = typeof _ === "function" ? null : _; | |
return greatArc; | |
}; | |
greatArc.target = function(_) { | |
if (!arguments.length) return target; | |
target = _, target_ = typeof _ === "function" ? null : _; | |
return greatArc; | |
}; | |
greatArc.precision = function() { | |
return arguments.length ? greatArc : 0; | |
}; | |
return greatArc; | |
}; | |
d3.geo.interpolate = function(source, target) { | |
return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians); | |
}; | |
function d3_geo_interpolate(x0, y0, x1, y1) { | |
var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d); | |
var interpolate = d ? function(t) { | |
var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1; | |
return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ]; | |
} : function() { | |
return [ x0 * d3_degrees, y0 * d3_degrees ]; | |
}; | |
interpolate.distance = d; | |
return interpolate; | |
} | |
d3.geo.length = function(object) { | |
d3_geo_lengthSum = 0; | |
d3.geo.stream(object, d3_geo_length); | |
return d3_geo_lengthSum; | |
}; | |
var d3_geo_lengthSum; | |
var d3_geo_length = { | |
sphere: d3_noop, | |
point: d3_noop, | |
lineStart: d3_geo_lengthLineStart, | |
lineEnd: d3_noop, | |
polygonStart: d3_noop, | |
polygonEnd: d3_noop | |
}; | |
function d3_geo_lengthLineStart() { | |
var λ0, sinφ0, cosφ0; | |
d3_geo_length.point = function(λ, φ) { | |
λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ); | |
d3_geo_length.point = nextPoint; | |
}; | |
d3_geo_length.lineEnd = function() { | |
d3_geo_length.point = d3_geo_length.lineEnd = d3_noop; | |
}; | |
function nextPoint(λ, φ) { | |
var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = Math.abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t); | |
d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ); | |
λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ; | |
} | |
} | |
function d3_geo_azimuthal(scale, angle) { | |
function azimuthal(λ, φ) { | |
var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ); | |
return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ]; | |
} | |
azimuthal.invert = function(x, y) { | |
var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c); | |
return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ]; | |
}; | |
return azimuthal; | |
} | |
var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) { | |
return Math.sqrt(2 / (1 + cosλcosφ)); | |
}, function(ρ) { | |
return 2 * Math.asin(ρ / 2); | |
}); | |
(d3.geo.azimuthalEqualArea = function() { | |
return d3_geo_projection(d3_geo_azimuthalEqualArea); | |
}).raw = d3_geo_azimuthalEqualArea; | |
var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) { | |
var c = Math.acos(cosλcosφ); | |
return c && c / Math.sin(c); | |
}, d3_identity); | |
(d3.geo.azimuthalEquidistant = function() { | |
return d3_geo_projection(d3_geo_azimuthalEquidistant); | |
}).raw = d3_geo_azimuthalEquidistant; | |
function d3_geo_conicConformal(φ0, φ1) { | |
var cosφ0 = Math.cos(φ0), t = function(φ) { | |
return Math.tan(π / 4 + φ / 2); | |
}, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n; | |
if (!n) return d3_geo_mercator; | |
function forward(λ, φ) { | |
var ρ = Math.abs(Math.abs(φ) - π / 2) < ε ? 0 : F / Math.pow(t(φ), n); | |
return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ]; | |
} | |
forward.invert = function(x, y) { | |
var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y); | |
return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - π / 2 ]; | |
}; | |
return forward; | |
} | |
(d3.geo.conicConformal = function() { | |
return d3_geo_conic(d3_geo_conicConformal); | |
}).raw = d3_geo_conicConformal; | |
function d3_geo_conicEquidistant(φ0, φ1) { | |
var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0; | |
if (Math.abs(n) < ε) return d3_geo_equirectangular; | |
function forward(λ, φ) { | |
var ρ = G - φ; | |
return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ]; | |
} | |
forward.invert = function(x, y) { | |
var ρ0_y = G - y; | |
return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ]; | |
}; | |
return forward; | |
} | |
(d3.geo.conicEquidistant = function() { | |
return d3_geo_conic(d3_geo_conicEquidistant); | |
}).raw = d3_geo_conicEquidistant; | |
var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) { | |
return 1 / cosλcosφ; | |
}, Math.atan); | |
(d3.geo.gnomonic = function() { | |
return d3_geo_projection(d3_geo_gnomonic); | |
}).raw = d3_geo_gnomonic; | |
function d3_geo_mercator(λ, φ) { | |
return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ]; | |
} | |
d3_geo_mercator.invert = function(x, y) { | |
return [ x, 2 * Math.atan(Math.exp(y)) - π / 2 ]; | |
}; | |
function d3_geo_mercatorProjection(project) { | |
var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto; | |
m.scale = function() { | |
var v = scale.apply(m, arguments); | |
return v === m ? clipAuto ? m.clipExtent(null) : m : v; | |
}; | |
m.translate = function() { | |
var v = translate.apply(m, arguments); | |
return v === m ? clipAuto ? m.clipExtent(null) : m : v; | |
}; | |
m.clipExtent = function(_) { | |
var v = clipExtent.apply(m, arguments); | |
if (v === m) { | |
if (clipAuto = _ == null) { | |
var k = π * scale(), t = translate(); | |
clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]); | |
} | |
} else if (clipAuto) { | |
v = null; | |
} | |
return v; | |
}; | |
return m.clipExtent(null); | |
} | |
(d3.geo.mercator = function() { | |
return d3_geo_mercatorProjection(d3_geo_mercator); | |
}).raw = d3_geo_mercator; | |
var d3_geo_orthographic = d3_geo_azimuthal(function() { | |
return 1; | |
}, Math.asin); | |
(d3.geo.orthographic = function() { | |
return d3_geo_projection(d3_geo_orthographic); | |
}).raw = d3_geo_orthographic; | |
var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) { | |
return 1 / (1 + cosλcosφ); | |
}, function(ρ) { | |
return 2 * Math.atan(ρ); | |
}); | |
(d3.geo.stereographic = function() { | |
return d3_geo_projection(d3_geo_stereographic); | |
}).raw = d3_geo_stereographic; | |
function d3_geo_transverseMercator(λ, φ) { | |
var B = Math.cos(φ) * Math.sin(λ); | |
return [ Math.log((1 + B) / (1 - B)) / 2, Math.atan2(Math.tan(φ), Math.cos(λ)) ]; | |
} | |
d3_geo_transverseMercator.invert = function(x, y) { | |
return [ Math.atan2(d3_sinh(x), Math.cos(y)), d3_asin(Math.sin(y) / d3_cosh(x)) ]; | |
}; | |
(d3.geo.transverseMercator = function() { | |
return d3_geo_mercatorProjection(d3_geo_transverseMercator); | |
}).raw = d3_geo_transverseMercator; | |
d3.geom = {}; | |
d3.svg = {}; | |
function d3_svg_line(projection) { | |
var x = d3_svg_lineX, y = d3_svg_lineY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7; | |
function line(data) { | |
var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y); | |
function segment() { | |
segments.push("M", interpolate(projection(points), tension)); | |
} | |
while (++i < n) { | |
if (defined.call(this, d = data[i], i)) { | |
points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]); | |
} else if (points.length) { | |
segment(); | |
points = []; | |
} | |
} | |
if (points.length) segment(); | |
return segments.length ? segments.join("") : null; | |
} | |
line.x = function(_) { | |
if (!arguments.length) return x; | |
x = _; | |
return line; | |
}; | |
line.y = function(_) { | |
if (!arguments.length) return y; | |
y = _; | |
return line; | |
}; | |
line.defined = function(_) { | |
if (!arguments.length) return defined; | |
defined = _; | |
return line; | |
}; | |
line.interpolate = function(_) { | |
if (!arguments.length) return interpolateKey; | |
if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; | |
return line; | |
}; | |
line.tension = function(_) { | |
if (!arguments.length) return tension; | |
tension = _; | |
return line; | |
}; | |
return line; | |
} | |
d3.svg.line = function() { | |
return d3_svg_line(d3_identity); | |
}; | |
function d3_svg_lineX(d) { | |
return d[0]; | |
} | |
function d3_svg_lineY(d) { | |
return d[1]; | |
} | |
var d3_svg_lineInterpolators = d3.map({ | |
linear: d3_svg_lineLinear, | |
"linear-closed": d3_svg_lineLinearClosed, | |
step: d3_svg_lineStep, | |
"step-before": d3_svg_lineStepBefore, | |
"step-after": d3_svg_lineStepAfter, | |
basis: d3_svg_lineBasis, | |
"basis-open": d3_svg_lineBasisOpen, | |
"basis-closed": d3_svg_lineBasisClosed, | |
bundle: d3_svg_lineBundle, | |
cardinal: d3_svg_lineCardinal, | |
"cardinal-open": d3_svg_lineCardinalOpen, | |
"cardinal-closed": d3_svg_lineCardinalClosed, | |
monotone: d3_svg_lineMonotone | |
}); | |
d3_svg_lineInterpolators.forEach(function(key, value) { | |
value.key = key; | |
value.closed = /-closed$/.test(key); | |
}); | |
function d3_svg_lineLinear(points) { | |
return points.join("L"); | |
} | |
function d3_svg_lineLinearClosed(points) { | |
return d3_svg_lineLinear(points) + "Z"; | |
} | |
function d3_svg_lineStep(points) { | |
var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; | |
while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]); | |
if (n > 1) path.push("H", p[0]); | |
return path.join(""); | |
} | |
function d3_svg_lineStepBefore(points) { | |
var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; | |
while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]); | |
return path.join(""); | |
} | |
function d3_svg_lineStepAfter(points) { | |
var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; | |
while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]); | |
return path.join(""); | |
} | |
function d3_svg_lineCardinalOpen(points, tension) { | |
return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, points.length - 1), d3_svg_lineCardinalTangents(points, tension)); | |
} | |
function d3_svg_lineCardinalClosed(points, tension) { | |
return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]), | |
points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension)); | |
} | |
function d3_svg_lineCardinal(points, tension) { | |
return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension)); | |
} | |
function d3_svg_lineHermite(points, tangents) { | |
if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) { | |
return d3_svg_lineLinear(points); | |
} | |
var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1; | |
if (quad) { | |
path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1]; | |
p0 = points[1]; | |
pi = 2; | |
} | |
if (tangents.length > 1) { | |
t = tangents[1]; | |
p = points[pi]; | |
pi++; | |
path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; | |
for (var i = 2; i < tangents.length; i++, pi++) { | |
p = points[pi]; | |
t = tangents[i]; | |
path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; | |
} | |
} | |
if (quad) { | |
var lp = points[pi]; | |
path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1]; | |
} | |
return path; | |
} | |
function d3_svg_lineCardinalTangents(points, tension) { | |
var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length; | |
while (++i < n) { | |
p0 = p1; | |
p1 = p2; | |
p2 = points[i]; | |
tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]); | |
} | |
return tangents; | |
} | |
function d3_svg_lineBasis(points) { | |
if (points.length < 3) return d3_svg_lineLinear(points); | |
var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; | |
points.push(points[n - 1]); | |
while (++i <= n) { | |
pi = points[i]; | |
px.shift(); | |
px.push(pi[0]); | |
py.shift(); | |
py.push(pi[1]); | |
d3_svg_lineBasisBezier(path, px, py); | |
} | |
points.pop(); | |
path.push("L", pi); | |
return path.join(""); | |
} | |
function d3_svg_lineBasisOpen(points) { | |
if (points.length < 4) return d3_svg_lineLinear(points); | |
var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ]; | |
while (++i < 3) { | |
pi = points[i]; | |
px.push(pi[0]); | |
py.push(pi[1]); | |
} | |
path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py)); | |
--i; | |
while (++i < n) { | |
pi = points[i]; | |
px.shift(); | |
px.push(pi[0]); | |
py.shift(); | |
py.push(pi[1]); | |
d3_svg_lineBasisBezier(path, px, py); | |
} | |
return path.join(""); | |
} | |
function d3_svg_lineBasisClosed(points) { | |
var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = []; | |
while (++i < 4) { | |
pi = points[i % n]; | |
px.push(pi[0]); | |
py.push(pi[1]); | |
} | |
path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; | |
--i; | |
while (++i < m) { | |
pi = points[i % n]; | |
px.shift(); | |
px.push(pi[0]); | |
py.shift(); | |
py.push(pi[1]); | |
d3_svg_lineBasisBezier(path, px, py); | |
} | |
return path.join(""); | |
} | |
function d3_svg_lineBundle(points, tension) { | |
var n = points.length - 1; | |
if (n) { | |
var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t; | |
while (++i <= n) { | |
p = points[i]; | |
t = i / n; | |
p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx); | |
p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy); | |
} | |
} | |
return d3_svg_lineBasis(points); | |
} | |
function d3_svg_lineDot4(a, b) { | |
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; | |
} | |
var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ]; | |
function d3_svg_lineBasisBezier(path, x, y) { | |
path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y)); | |
} | |
function d3_svg_lineSlope(p0, p1) { | |
return (p1[1] - p0[1]) / (p1[0] - p0[0]); | |
} | |
function d3_svg_lineFiniteDifferences(points) { | |
var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1); | |
while (++i < j) { | |
m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2; | |
} | |
m[i] = d; | |
return m; | |
} | |
function d3_svg_lineMonotoneTangents(points) { | |
var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1; | |
while (++i < j) { | |
d = d3_svg_lineSlope(points[i], points[i + 1]); | |
if (Math.abs(d) < 1e-6) { | |
m[i] = m[i + 1] = 0; | |
} else { | |
a = m[i] / d; | |
b = m[i + 1] / d; | |
s = a * a + b * b; | |
if (s > 9) { | |
s = d * 3 / Math.sqrt(s); | |
m[i] = s * a; | |
m[i + 1] = s * b; | |
} | |
} | |
} | |
i = -1; | |
while (++i <= j) { | |
s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i])); | |
tangents.push([ s || 0, m[i] * s || 0 ]); | |
} | |
return tangents; | |
} | |
function d3_svg_lineMonotone(points) { | |
return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points)); | |
} | |
d3.geom.hull = function(vertices) { | |
var x = d3_svg_lineX, y = d3_svg_lineY; | |
if (arguments.length) return hull(vertices); | |
function hull(data) { | |
if (data.length < 3) return []; | |
var fx = d3_functor(x), fy = d3_functor(y), n = data.length, vertices, plen = n - 1, points = [], stack = [], d, i, j, h = 0, x1, y1, x2, y2, u, v, a, sp; | |
if (fx === d3_svg_lineX && y === d3_svg_lineY) vertices = data; else for (i = 0, | |
vertices = []; i < n; ++i) { | |
vertices.push([ +fx.call(this, d = data[i], i), +fy.call(this, d, i) ]); | |
} | |
for (i = 1; i < n; ++i) { | |
if (vertices[i][1] < vertices[h][1] || vertices[i][1] == vertices[h][1] && vertices[i][0] < vertices[h][0]) h = i; | |
} | |
for (i = 0; i < n; ++i) { | |
if (i === h) continue; | |
y1 = vertices[i][1] - vertices[h][1]; | |
x1 = vertices[i][0] - vertices[h][0]; | |
points.push({ | |
angle: Math.atan2(y1, x1), | |
index: i | |
}); | |
} | |
points.sort(function(a, b) { | |
return a.angle - b.angle; | |
}); | |
a = points[0].angle; | |
v = points[0].index; | |
u = 0; | |
for (i = 1; i < plen; ++i) { | |
j = points[i].index; | |
if (a == points[i].angle) { | |
x1 = vertices[v][0] - vertices[h][0]; | |
y1 = vertices[v][1] - vertices[h][1]; | |
x2 = vertices[j][0] - vertices[h][0]; | |
y2 = vertices[j][1] - vertices[h][1]; | |
if (x1 * x1 + y1 * y1 >= x2 * x2 + y2 * y2) { | |
points[i].index = -1; | |
continue; | |
} else { | |
points[u].index = -1; | |
} | |
} | |
a = points[i].angle; | |
u = i; | |
v = j; | |
} | |
stack.push(h); | |
for (i = 0, j = 0; i < 2; ++j) { | |
if (points[j].index > -1) { | |
stack.push(points[j].index); | |
i++; | |
} | |
} | |
sp = stack.length; | |
for (;j < plen; ++j) { | |
if (points[j].index < 0) continue; | |
while (!d3_geom_hullCCW(stack[sp - 2], stack[sp - 1], points[j].index, vertices)) { | |
--sp; | |
} | |
stack[sp++] = points[j].index; | |
} | |
var poly = []; | |
for (i = sp - 1; i >= 0; --i) poly.push(data[stack[i]]); | |
return poly; | |
} | |
hull.x = function(_) { | |
return arguments.length ? (x = _, hull) : x; | |
}; | |
hull.y = function(_) { | |
return arguments.length ? (y = _, hull) : y; | |
}; | |
return hull; | |
}; | |
function d3_geom_hullCCW(i1, i2, i3, v) { | |
var t, a, b, c, d, e, f; | |
t = v[i1]; | |
a = t[0]; | |
b = t[1]; | |
t = v[i2]; | |
c = t[0]; | |
d = t[1]; | |
t = v[i3]; | |
e = t[0]; | |
f = t[1]; | |
return (f - b) * (c - a) - (d - b) * (e - a) > 0; | |
} | |
d3.geom.polygon = function(coordinates) { | |
d3_subclass(coordinates, d3_geom_polygonPrototype); | |
return coordinates; | |
}; | |
var d3_geom_polygonPrototype = d3.geom.polygon.prototype = []; | |
d3_geom_polygonPrototype.area = function() { | |
var i = -1, n = this.length, a, b = this[n - 1], area = 0; | |
while (++i < n) { | |
a = b; | |
b = this[i]; | |
area += a[1] * b[0] - a[0] * b[1]; | |
} | |
return area * .5; | |
}; | |
d3_geom_polygonPrototype.centroid = function(k) { | |
var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c; | |
if (!arguments.length) k = -1 / (6 * this.area()); | |
while (++i < n) { | |
a = b; | |
b = this[i]; | |
c = a[0] * b[1] - b[0] * a[1]; | |
x += (a[0] + b[0]) * c; | |
y += (a[1] + b[1]) * c; | |
} | |
return [ x * k, y * k ]; | |
}; | |
d3_geom_polygonPrototype.clip = function(subject) { | |
var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d; | |
while (++i < n) { | |
input = subject.slice(); | |
subject.length = 0; | |
b = this[i]; | |
c = input[(m = input.length - closed) - 1]; | |
j = -1; | |
while (++j < m) { | |
d = input[j]; | |
if (d3_geom_polygonInside(d, a, b)) { | |
if (!d3_geom_polygonInside(c, a, b)) { | |
subject.push(d3_geom_polygonIntersect(c, d, a, b)); | |
} | |
subject.push(d); | |
} else if (d3_geom_polygonInside(c, a, b)) { | |
subject.push(d3_geom_polygonIntersect(c, d, a, b)); | |
} | |
c = d; | |
} | |
if (closed) subject.push(subject[0]); | |
a = b; | |
} | |
return subject; | |
}; | |
function d3_geom_polygonInside(p, a, b) { | |
return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]); | |
} | |
function d3_geom_polygonIntersect(c, d, a, b) { | |
var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21); | |
return [ x1 + ua * x21, y1 + ua * y21 ]; | |
} | |
function d3_geom_polygonClosed(coordinates) { | |
var a = coordinates[0], b = coordinates[coordinates.length - 1]; | |
return !(a[0] - b[0] || a[1] - b[1]); | |
} | |
d3.geom.delaunay = function(vertices) { | |
var edges = vertices.map(function() { | |
return []; | |
}), triangles = []; | |
d3_geom_voronoiTessellate(vertices, function(e) { | |
edges[e.region.l.index].push(vertices[e.region.r.index]); | |
}); | |
edges.forEach(function(edge, i) { | |
var v = vertices[i], cx = v[0], cy = v[1]; | |
edge.forEach(function(v) { | |
v.angle = Math.atan2(v[0] - cx, v[1] - cy); | |
}); | |
edge.sort(function(a, b) { | |
return a.angle - b.angle; | |
}); | |
for (var j = 0, m = edge.length - 1; j < m; j++) { | |
triangles.push([ v, edge[j], edge[j + 1] ]); | |
} | |
}); | |
return triangles; | |
}; | |
d3.geom.voronoi = function(points) { | |
var x = d3_svg_lineX, y = d3_svg_lineY, clipPolygon = null; | |
if (arguments.length) return voronoi(points); | |
function voronoi(data) { | |
var points, polygons = data.map(function() { | |
return []; | |
}), fx = d3_functor(x), fy = d3_functor(y), d, i, n = data.length, Z = 1e6; | |
if (fx === d3_svg_lineX && fy === d3_svg_lineY) points = data; else for (points = new Array(n), | |
i = 0; i < n; ++i) { | |
points[i] = [ +fx.call(this, d = data[i], i), +fy.call(this, d, i) ]; | |
} | |
d3_geom_voronoiTessellate(points, function(e) { | |
var s1, s2, x1, x2, y1, y2; | |
if (e.a === 1 && e.b >= 0) { | |
s1 = e.ep.r; | |
s2 = e.ep.l; | |
} else { | |
s1 = e.ep.l; | |
s2 = e.ep.r; | |
} | |
if (e.a === 1) { | |
y1 = s1 ? s1.y : -Z; | |
x1 = e.c - e.b * y1; | |
y2 = s2 ? s2.y : Z; | |
x2 = e.c - e.b * y2; | |
} else { | |
x1 = s1 ? s1.x : -Z; | |
y1 = e.c - e.a * x1; | |
x2 = s2 ? s2.x : Z; | |
y2 = e.c - e.a * x2; | |
} | |
var v1 = [ x1, y1 ], v2 = [ x2, y2 ]; | |
polygons[e.region.l.index].push(v1, v2); | |
polygons[e.region.r.index].push(v1, v2); | |
}); | |
polygons = polygons.map(function(polygon, i) { | |
var cx = points[i][0], cy = points[i][1], angle = polygon.map(function(v) { | |
return Math.atan2(v[0] - cx, v[1] - cy); | |
}), order = d3.range(polygon.length).sort(function(a, b) { | |
return angle[a] - angle[b]; | |
}); | |
return order.filter(function(d, i) { | |
return !i || angle[d] - angle[order[i - 1]] > ε; | |
}).map(function(d) { | |
return polygon[d]; | |
}); | |
}); | |
polygons.forEach(function(polygon, i) { | |
var n = polygon.length; | |
if (!n) return polygon.push([ -Z, -Z ], [ -Z, Z ], [ Z, Z ], [ Z, -Z ]); | |
if (n > 2) return; | |
var p0 = points[i], p1 = polygon[0], p2 = polygon[1], x0 = p0[0], y0 = p0[1], x1 = p1[0], y1 = p1[1], x2 = p2[0], y2 = p2[1], dx = Math.abs(x2 - x1), dy = y2 - y1; | |
if (Math.abs(dy) < ε) { | |
var y = y0 < y1 ? -Z : Z; | |
polygon.push([ -Z, y ], [ Z, y ]); | |
} else if (dx < ε) { | |
var x = x0 < x1 ? -Z : Z; | |
polygon.push([ x, -Z ], [ x, Z ]); | |
} else { | |
var y = (x2 - x1) * (y1 - y0) < (x1 - x0) * (y2 - y1) ? Z : -Z, z = Math.abs(dy) - dx; | |
if (Math.abs(z) < ε) { | |
polygon.push([ dy < 0 ? y : -y, y ]); | |
} else { | |
if (z > 0) y *= -1; | |
polygon.push([ -Z, y ], [ Z, y ]); | |
} | |
} | |
}); | |
if (clipPolygon) for (i = 0; i < n; ++i) clipPolygon.clip(polygons[i]); | |
for (i = 0; i < n; ++i) polygons[i].point = data[i]; | |
return polygons; | |
} | |
voronoi.x = function(_) { | |
return arguments.length ? (x = _, voronoi) : x; | |
}; | |
voronoi.y = function(_) { | |
return arguments.length ? (y = _, voronoi) : y; | |
}; | |
voronoi.clipExtent = function(_) { | |
if (!arguments.length) return clipPolygon && [ clipPolygon[0], clipPolygon[2] ]; | |
if (_ == null) clipPolygon = null; else { | |
var x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], y2 = +_[1][1]; | |
clipPolygon = d3.geom.polygon([ [ x1, y1 ], [ x1, y2 ], [ x2, y2 ], [ x2, y1 ] ]); | |
} | |
return voronoi; | |
}; | |
voronoi.size = function(_) { | |
if (!arguments.length) return clipPolygon && clipPolygon[2]; | |
return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]); | |
}; | |
voronoi.links = function(data) { | |
var points, graph = data.map(function() { | |
return []; | |
}), links = [], fx = d3_functor(x), fy = d3_functor(y), d, i, n = data.length; | |
if (fx === d3_svg_lineX && fy === d3_svg_lineY) points = data; else for (points = new Array(n), | |
i = 0; i < n; ++i) { | |
points[i] = [ +fx.call(this, d = data[i], i), +fy.call(this, d, i) ]; | |
} | |
d3_geom_voronoiTessellate(points, function(e) { | |
var l = e.region.l.index, r = e.region.r.index; | |
if (graph[l][r]) return; | |
graph[l][r] = graph[r][l] = true; | |
links.push({ | |
source: data[l], | |
target: data[r] | |
}); | |
}); | |
return links; | |
}; | |
voronoi.triangles = function(data) { | |
if (x === d3_svg_lineX && y === d3_svg_lineY) return d3.geom.delaunay(data); | |
var points = new Array(n), fx = d3_functor(x), fy = d3_functor(y), d, i = -1, n = data.length; | |
while (++i < n) { | |
(points[i] = [ +fx.call(this, d = data[i], i), +fy.call(this, d, i) ]).data = d; | |
} | |
return d3.geom.delaunay(points).map(function(triangle) { | |
return triangle.map(function(point) { | |
return point.data; | |
}); | |
}); | |
}; | |
return voronoi; | |
}; | |
var d3_geom_voronoiOpposite = { | |
l: "r", | |
r: "l" | |
}; | |
function d3_geom_voronoiTessellate(points, callback) { | |
var Sites = { | |
list: points.map(function(v, i) { | |
return { | |
index: i, | |
x: v[0], | |
y: v[1] | |
}; | |
}).sort(function(a, b) { | |
return a.y < b.y ? -1 : a.y > b.y ? 1 : a.x < b.x ? -1 : a.x > b.x ? 1 : 0; | |
}), | |
bottomSite: null | |
}; | |
var EdgeList = { | |
list: [], | |
leftEnd: null, | |
rightEnd: null, | |
init: function() { | |
EdgeList.leftEnd = EdgeList.createHalfEdge(null, "l"); | |
EdgeList.rightEnd = EdgeList.createHalfEdge(null, "l"); | |
EdgeList.leftEnd.r = EdgeList.rightEnd; | |
EdgeList.rightEnd.l = EdgeList.leftEnd; | |
EdgeList.list.unshift(EdgeList.leftEnd, EdgeList.rightEnd); | |
}, | |
createHalfEdge: function(edge, side) { | |
return { | |
edge: edge, | |
side: side, | |
vertex: null, | |
l: null, | |
r: null | |
}; | |
}, | |
insert: function(lb, he) { | |
he.l = lb; | |
he.r = lb.r; | |
lb.r.l = he; | |
lb.r = he; | |
}, | |
leftBound: function(p) { | |
var he = EdgeList.leftEnd; | |
do { | |
he = he.r; | |
} while (he != EdgeList.rightEnd && Geom.rightOf(he, p)); | |
he = he.l; | |
return he; | |
}, | |
del: function(he) { | |
he.l.r = he.r; | |
he.r.l = he.l; | |
he.edge = null; | |
}, | |
right: function(he) { | |
return he.r; | |
}, | |
left: function(he) { | |
return he.l; | |
}, | |
leftRegion: function(he) { | |
return he.edge == null ? Sites.bottomSite : he.edge.region[he.side]; | |
}, | |
rightRegion: function(he) { | |
return he.edge == null ? Sites.bottomSite : he.edge.region[d3_geom_voronoiOpposite[he.side]]; | |
} | |
}; | |
var Geom = { | |
bisect: function(s1, s2) { | |
var newEdge = { | |
region: { | |
l: s1, | |
r: s2 | |
}, | |
ep: { | |
l: null, | |
r: null | |
} | |
}; | |
var dx = s2.x - s1.x, dy = s2.y - s1.y, adx = dx > 0 ? dx : -dx, ady = dy > 0 ? dy : -dy; | |
newEdge.c = s1.x * dx + s1.y * dy + (dx * dx + dy * dy) * .5; | |
if (adx > ady) { | |
newEdge.a = 1; | |
newEdge.b = dy / dx; | |
newEdge.c /= dx; | |
} else { | |
newEdge.b = 1; | |
newEdge.a = dx / dy; | |
newEdge.c /= dy; | |
} | |
return newEdge; | |
}, | |
intersect: function(el1, el2) { | |
var e1 = el1.edge, e2 = el2.edge; | |
if (!e1 || !e2 || e1.region.r == e2.region.r) { | |
return null; | |
} | |
var d = e1.a * e2.b - e1.b * e2.a; | |
if (Math.abs(d) < 1e-10) { | |
return null; | |
} | |
var xint = (e1.c * e2.b - e2.c * e1.b) / d, yint = (e2.c * e1.a - e1.c * e2.a) / d, e1r = e1.region.r, e2r = e2.region.r, el, e; | |
if (e1r.y < e2r.y || e1r.y == e2r.y && e1r.x < e2r.x) { | |
el = el1; | |
e = e1; | |
} else { | |
el = el2; | |
e = e2; | |
} | |
var rightOfSite = xint >= e.region.r.x; | |
if (rightOfSite && el.side === "l" || !rightOfSite && el.side === "r") { | |
return null; | |
} | |
return { | |
x: xint, | |
y: yint | |
}; | |
}, | |
rightOf: function(he, p) { | |
var e = he.edge, topsite = e.region.r, rightOfSite = p.x > topsite.x; | |
if (rightOfSite && he.side === "l") { | |
return 1; | |
} | |
if (!rightOfSite && he.side === "r") { | |
return 0; | |
} | |
if (e.a === 1) { | |
var dyp = p.y - topsite.y, dxp = p.x - topsite.x, fast = 0, above = 0; | |
if (!rightOfSite && e.b < 0 || rightOfSite && e.b >= 0) { | |
above = fast = dyp >= e.b * dxp; | |
} else { | |
above = p.x + p.y * e.b > e.c; | |
if (e.b < 0) { | |
above = !above; | |
} | |
if (!above) { | |
fast = 1; | |
} | |
} | |
if (!fast) { | |
var dxs = topsite.x - e.region.l.x; | |
above = e.b * (dxp * dxp - dyp * dyp) < dxs * dyp * (1 + 2 * dxp / dxs + e.b * e.b); | |
if (e.b < 0) { | |
above = !above; | |
} | |
} | |
} else { | |
var yl = e.c - e.a * p.x, t1 = p.y - yl, t2 = p.x - topsite.x, t3 = yl - topsite.y; | |
above = t1 * t1 > t2 * t2 + t3 * t3; | |
} | |
return he.side === "l" ? above : !above; | |
}, | |
endPoint: function(edge, side, site) { | |
edge.ep[side] = site; | |
if (!edge.ep[d3_geom_voronoiOpposite[side]]) return; | |
callback(edge); | |
}, | |
distance: function(s, t) { | |
var dx = s.x - t.x, dy = s.y - t.y; | |
return Math.sqrt(dx * dx + dy * dy); | |
} | |
}; | |
var EventQueue = { | |
list: [], | |
insert: function(he, site, offset) { | |
he.vertex = site; | |
he.ystar = site.y + offset; | |
for (var i = 0, list = EventQueue.list, l = list.length; i < l; i++) { | |
var next = list[i]; | |
if (he.ystar > next.ystar || he.ystar == next.ystar && site.x > next.vertex.x) { | |
continue; | |
} else { | |
break; | |
} | |
} | |
list.splice(i, 0, he); | |
}, | |
del: function(he) { | |
for (var i = 0, ls = EventQueue.list, l = ls.length; i < l && ls[i] != he; ++i) {} | |
ls.splice(i, 1); | |
}, | |
empty: function() { | |
return EventQueue.list.length === 0; | |
}, | |
nextEvent: function(he) { | |
for (var i = 0, ls = EventQueue.list, l = ls.length; i < l; ++i) { | |
if (ls[i] == he) return ls[i + 1]; | |
} | |
return null; | |
}, | |
min: function() { | |
var elem = EventQueue.list[0]; | |
return { | |
x: elem.vertex.x, | |
y: elem.ystar | |
}; | |
}, | |
extractMin: function() { | |
return EventQueue.list.shift(); | |
} | |
}; | |
EdgeList.init(); | |
Sites.bottomSite = Sites.list.shift(); | |
var newSite = Sites.list.shift(), newIntStar; | |
var lbnd, rbnd, llbnd, rrbnd, bisector; | |
var bot, top, temp, p, v; | |
var e, pm; | |
while (true) { | |
if (!EventQueue.empty()) { | |
newIntStar = EventQueue.min(); | |
} | |
if (newSite && (EventQueue.empty() || newSite.y < newIntStar.y || newSite.y == newIntStar.y && newSite.x < newIntStar.x)) { | |
lbnd = EdgeList.leftBound(newSite); | |
rbnd = EdgeList.right(lbnd); | |
bot = EdgeList.rightRegion(lbnd); | |
e = Geom.bisect(bot, newSite); | |
bisector = EdgeList.createHalfEdge(e, "l"); | |
EdgeList.insert(lbnd, bisector); | |
p = Geom.intersect(lbnd, bisector); | |
if (p) { | |
EventQueue.del(lbnd); | |
EventQueue.insert(lbnd, p, Geom.distance(p, newSite)); | |
} | |
lbnd = bisector; | |
bisector = EdgeList.createHalfEdge(e, "r"); | |
EdgeList.insert(lbnd, bisector); | |
p = Geom.intersect(bisector, rbnd); | |
if (p) { | |
EventQueue.insert(bisector, p, Geom.distance(p, newSite)); | |
} | |
newSite = Sites.list.shift(); | |
} else if (!EventQueue.empty()) { | |
lbnd = EventQueue.extractMin(); | |
llbnd = EdgeList.left(lbnd); | |
rbnd = EdgeList.right(lbnd); | |
rrbnd = EdgeList.right(rbnd); | |
bot = EdgeList.leftRegion(lbnd); | |
top = EdgeList.rightRegion(rbnd); | |
v = lbnd.vertex; | |
Geom.endPoint(lbnd.edge, lbnd.side, v); | |
Geom.endPoint(rbnd.edge, rbnd.side, v); | |
EdgeList.del(lbnd); | |
EventQueue.del(rbnd); | |
EdgeList.del(rbnd); | |
pm = "l"; | |
if (bot.y > top.y) { | |
temp = bot; | |
bot = top; | |
top = temp; | |
pm = "r"; | |
} | |
e = Geom.bisect(bot, top); | |
bisector = EdgeList.createHalfEdge(e, pm); | |
EdgeList.insert(llbnd, bisector); | |
Geom.endPoint(e, d3_geom_voronoiOpposite[pm], v); | |
p = Geom.intersect(llbnd, bisector); | |
if (p) { | |
EventQueue.del(llbnd); | |
EventQueue.insert(llbnd, p, Geom.distance(p, bot)); | |
} | |
p = Geom.intersect(bisector, rrbnd); | |
if (p) { | |
EventQueue.insert(bisector, p, Geom.distance(p, bot)); | |
} | |
} else { | |
break; | |
} | |
} | |
for (lbnd = EdgeList.right(EdgeList.leftEnd); lbnd != EdgeList.rightEnd; lbnd = EdgeList.right(lbnd)) { | |
callback(lbnd.edge); | |
} | |
} | |
d3.geom.quadtree = function(points, x1, y1, x2, y2) { | |
var x = d3_svg_lineX, y = d3_svg_lineY, compat; | |
if (compat = arguments.length) { | |
x = d3_geom_quadtreeCompatX; | |
y = d3_geom_quadtreeCompatY; | |
if (compat === 3) { | |
y2 = y1; | |
x2 = x1; | |
y1 = x1 = 0; | |
} | |
return quadtree(points); | |
} | |
function quadtree(data) { | |
var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_; | |
if (x1 != null) { | |
x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2; | |
} else { | |
x2_ = y2_ = -(x1_ = y1_ = Infinity); | |
xs = [], ys = []; | |
n = data.length; | |
if (compat) for (i = 0; i < n; ++i) { | |
d = data[i]; | |
if (d.x < x1_) x1_ = d.x; | |
if (d.y < y1_) y1_ = d.y; | |
if (d.x > x2_) x2_ = d.x; | |
if (d.y > y2_) y2_ = d.y; | |
xs.push(d.x); | |
ys.push(d.y); | |
} else for (i = 0; i < n; ++i) { | |
var x_ = +fx(d = data[i], i), y_ = +fy(d, i); | |
if (x_ < x1_) x1_ = x_; | |
if (y_ < y1_) y1_ = y_; | |
if (x_ > x2_) x2_ = x_; | |
if (y_ > y2_) y2_ = y_; | |
xs.push(x_); | |
ys.push(y_); | |
} | |
} | |
var dx = x2_ - x1_, dy = y2_ - y1_; | |
if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy; | |
function insert(n, d, x, y, x1, y1, x2, y2) { | |
if (isNaN(x) || isNaN(y)) return; | |
if (n.leaf) { | |
var nx = n.x, ny = n.y; | |
if (nx != null) { | |
if (Math.abs(nx - x) + Math.abs(ny - y) < .01) { | |
insertChild(n, d, x, y, x1, y1, x2, y2); | |
} else { | |
var nPoint = n.point; | |
n.x = n.y = n.point = null; | |
insertChild(n, nPoint, nx, ny, x1, y1, x2, y2); | |
insertChild(n, d, x, y, x1, y1, x2, y2); | |
} | |
} else { | |
n.x = x, n.y = y, n.point = d; | |
} | |
} else { | |
insertChild(n, d, x, y, x1, y1, x2, y2); | |
} | |
} | |
function insertChild(n, d, x, y, x1, y1, x2, y2) { | |
var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, right = x >= sx, bottom = y >= sy, i = (bottom << 1) + right; | |
n.leaf = false; | |
n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode()); | |
if (right) x1 = sx; else x2 = sx; | |
if (bottom) y1 = sy; else y2 = sy; | |
insert(n, d, x, y, x1, y1, x2, y2); | |
} | |
var root = d3_geom_quadtreeNode(); | |
root.add = function(d) { | |
insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_); | |
}; | |
root.visit = function(f) { | |
d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_); | |
}; | |
i = -1; | |
if (x1 == null) { | |
while (++i < n) { | |
insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_); | |
} | |
--i; | |
} else data.forEach(root.add); | |
xs = ys = data = d = null; | |
return root; | |
} | |
quadtree.x = function(_) { | |
return arguments.length ? (x = _, quadtree) : x; | |
}; | |
quadtree.y = function(_) { | |
return arguments.length ? (y = _, quadtree) : y; | |
}; | |
quadtree.extent = function(_) { | |
if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ]; | |
if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], | |
y2 = +_[1][1]; | |
return quadtree; | |
}; | |
quadtree.size = function(_) { | |
if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ]; | |
if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1]; | |
return quadtree; | |
}; | |
return quadtree; | |
}; | |
function d3_geom_quadtreeCompatX(d) { | |
return d.x; | |
} | |
function d3_geom_quadtreeCompatY(d) { | |
return d.y; | |
} | |
function d3_geom_quadtreeNode() { | |
return { | |
leaf: true, | |
nodes: [], | |
point: null, | |
x: null, | |
y: null | |
}; | |
} | |
function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) { | |
if (!f(node, x1, y1, x2, y2)) { | |
var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes; | |
if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy); | |
if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy); | |
if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2); | |
if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2); | |
} | |
} | |
d3.interpolateRgb = d3_interpolateRgb; | |
function d3_interpolateRgb(a, b) { | |
a = d3.rgb(a); | |
b = d3.rgb(b); | |
var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab; | |
return function(t) { | |
return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t)); | |
}; | |
} | |
d3.interpolateObject = d3_interpolateObject; | |
function d3_interpolateObject(a, b) { | |
var i = {}, c = {}, k; | |
for (k in a) { | |
if (k in b) { | |
i[k] = d3_interpolate(a[k], b[k]); | |
} else { | |
c[k] = a[k]; | |
} | |
} | |
for (k in b) { | |
if (!(k in a)) { | |
c[k] = b[k]; | |
} | |
} | |
return function(t) { | |
for (k in i) c[k] = i[k](t); | |
return c; | |
}; | |
} | |
d3.interpolateNumber = d3_interpolateNumber; | |
function d3_interpolateNumber(a, b) { | |
b -= a = +a; | |
return function(t) { | |
return a + b * t; | |
}; | |
} | |
d3.interpolateString = d3_interpolateString; | |
function d3_interpolateString(a, b) { | |
var m, i, j, s0 = 0, s1 = 0, s = [], q = [], n, o; | |
a = a + "", b = b + ""; | |
d3_interpolate_number.lastIndex = 0; | |
for (i = 0; m = d3_interpolate_number.exec(b); ++i) { | |
if (m.index) s.push(b.substring(s0, s1 = m.index)); | |
q.push({ | |
i: s.length, | |
x: m[0] | |
}); | |
s.push(null); | |
s0 = d3_interpolate_number.lastIndex; | |
} | |
if (s0 < b.length) s.push(b.substring(s0)); | |
for (i = 0, n = q.length; (m = d3_interpolate_number.exec(a)) && i < n; ++i) { | |
o = q[i]; | |
if (o.x == m[0]) { | |
if (o.i) { | |
if (s[o.i + 1] == null) { | |
s[o.i - 1] += o.x; | |
s.splice(o.i, 1); | |
for (j = i + 1; j < n; ++j) q[j].i--; | |
} else { | |
s[o.i - 1] += o.x + s[o.i + 1]; | |
s.splice(o.i, 2); | |
for (j = i + 1; j < n; ++j) q[j].i -= 2; | |
} | |
} else { | |
if (s[o.i + 1] == null) { | |
s[o.i] = o.x; | |
} else { | |
s[o.i] = o.x + s[o.i + 1]; | |
s.splice(o.i + 1, 1); | |
for (j = i + 1; j < n; ++j) q[j].i--; | |
} | |
} | |
q.splice(i, 1); | |
n--; | |
i--; | |
} else { | |
o.x = d3_interpolateNumber(parseFloat(m[0]), parseFloat(o.x)); | |
} | |
} | |
while (i < n) { | |
o = q.pop(); | |
if (s[o.i + 1] == null) { | |
s[o.i] = o.x; | |
} else { | |
s[o.i] = o.x + s[o.i + 1]; | |
s.splice(o.i + 1, 1); | |
} | |
n--; | |
} | |
if (s.length === 1) { | |
return s[0] == null ? (o = q[0].x, function(t) { | |
return o(t) + ""; | |
}) : function() { | |
return b; | |
}; | |
} | |
return function(t) { | |
for (i = 0; i < n; ++i) s[(o = q[i]).i] = o.x(t); | |
return s.join(""); | |
}; | |
} | |
var d3_interpolate_number = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g; | |
d3.interpolate = d3_interpolate; | |
function d3_interpolate(a, b) { | |
var i = d3.interpolators.length, f; | |
while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ; | |
return f; | |
} | |
d3.interpolators = [ function(a, b) { | |
var t = typeof b; | |
return (t === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_Color ? d3_interpolateRgb : t === "object" ? Array.isArray(b) ? d3_interpolateArray : d3_interpolateObject : d3_interpolateNumber)(a, b); | |
} ]; | |
d3.interpolateArray = d3_interpolateArray; | |
function d3_interpolateArray(a, b) { | |
var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i; | |
for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i])); | |
for (;i < na; ++i) c[i] = a[i]; | |
for (;i < nb; ++i) c[i] = b[i]; | |
return function(t) { | |
for (i = 0; i < n0; ++i) c[i] = x[i](t); | |
return c; | |
}; | |
} | |
var d3_ease_default = function() { | |
return d3_identity; | |
}; | |
var d3_ease = d3.map({ | |
linear: d3_ease_default, | |
poly: d3_ease_poly, | |
quad: function() { | |
return d3_ease_quad; | |
}, | |
cubic: function() { | |
return d3_ease_cubic; | |
}, | |
sin: function() { | |
return d3_ease_sin; | |
}, | |
exp: function() { | |
return d3_ease_exp; | |
}, | |
circle: function() { | |
return d3_ease_circle; | |
}, | |
elastic: d3_ease_elastic, | |
back: d3_ease_back, | |
bounce: function() { | |
return d3_ease_bounce; | |
} | |
}); | |
var d3_ease_mode = d3.map({ | |
"in": d3_identity, | |
out: d3_ease_reverse, | |
"in-out": d3_ease_reflect, | |
"out-in": function(f) { | |
return d3_ease_reflect(d3_ease_reverse(f)); | |
} | |
}); | |
d3.ease = function(name) { | |
var i = name.indexOf("-"), t = i >= 0 ? name.substring(0, i) : name, m = i >= 0 ? name.substring(i + 1) : "in"; | |
t = d3_ease.get(t) || d3_ease_default; | |
m = d3_ease_mode.get(m) || d3_identity; | |
return d3_ease_clamp(m(t.apply(null, Array.prototype.slice.call(arguments, 1)))); | |
}; | |
function d3_ease_clamp(f) { | |
return function(t) { | |
return t <= 0 ? 0 : t >= 1 ? 1 : f(t); | |
}; | |
} | |
function d3_ease_reverse(f) { | |
return function(t) { | |
return 1 - f(1 - t); | |
}; | |
} | |
function d3_ease_reflect(f) { | |
return function(t) { | |
return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t)); | |
}; | |
} | |
function d3_ease_quad(t) { | |
return t * t; | |
} | |
function d3_ease_cubic(t) { | |
return t * t * t; | |
} | |
function d3_ease_cubicInOut(t) { | |
if (t <= 0) return 0; | |
if (t >= 1) return 1; | |
var t2 = t * t, t3 = t2 * t; | |
return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75); | |
} | |
function d3_ease_poly(e) { | |
return function(t) { | |
return Math.pow(t, e); | |
}; | |
} | |
function d3_ease_sin(t) { | |
return 1 - Math.cos(t * π / 2); | |
} | |
function d3_ease_exp(t) { | |
return Math.pow(2, 10 * (t - 1)); | |
} | |
function d3_ease_circle(t) { | |
return 1 - Math.sqrt(1 - t * t); | |
} | |
function d3_ease_elastic(a, p) { | |
var s; | |
if (arguments.length < 2) p = .45; | |
if (arguments.length) s = p / (2 * π) * Math.asin(1 / a); else a = 1, s = p / 4; | |
return function(t) { | |
return 1 + a * Math.pow(2, 10 * -t) * Math.sin((t - s) * 2 * π / p); | |
}; | |
} | |
function d3_ease_back(s) { | |
if (!s) s = 1.70158; | |
return function(t) { | |
return t * t * ((s + 1) * t - s); | |
}; | |
} | |
function d3_ease_bounce(t) { | |
return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375; | |
} | |
d3.interpolateHcl = d3_interpolateHcl; | |
function d3_interpolateHcl(a, b) { | |
a = d3.hcl(a); | |
b = d3.hcl(b); | |
var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al; | |
if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac; | |
if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; | |
return function(t) { | |
return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + ""; | |
}; | |
} | |
d3.interpolateHsl = d3_interpolateHsl; | |
function d3_interpolateHsl(a, b) { | |
a = d3.hsl(a); | |
b = d3.hsl(b); | |
var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al; | |
if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as; | |
if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; | |
return function(t) { | |
return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + ""; | |
}; | |
} | |
d3.interpolateLab = d3_interpolateLab; | |
function d3_interpolateLab(a, b) { | |
a = d3.lab(a); | |
b = d3.lab(b); | |
var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab; | |
return function(t) { | |
return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + ""; | |
}; | |
} | |
d3.interpolateRound = d3_interpolateRound; | |
function d3_interpolateRound(a, b) { | |
b -= a; | |
return function(t) { | |
return Math.round(a + b * t); | |
}; | |
} | |
d3.transform = function(string) { | |
var g = d3_document.createElementNS(d3.ns.prefix.svg, "g"); | |
return (d3.transform = function(string) { | |
if (string != null) { | |
g.setAttribute("transform", string); | |
var t = g.transform.baseVal.consolidate(); | |
} | |
return new d3_transform(t ? t.matrix : d3_transformIdentity); | |
})(string); | |
}; | |
function d3_transform(m) { | |
var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0; | |
if (r0[0] * r1[1] < r1[0] * r0[1]) { | |
r0[0] *= -1; | |
r0[1] *= -1; | |
kx *= -1; | |
kz *= -1; | |
} | |
this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees; | |
this.translate = [ m.e, m.f ]; | |
this.scale = [ kx, ky ]; | |
this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0; | |
} | |
d3_transform.prototype.toString = function() { | |
return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")"; | |
}; | |
function d3_transformDot(a, b) { | |
return a[0] * b[0] + a[1] * b[1]; | |
} | |
function d3_transformNormalize(a) { | |
var k = Math.sqrt(d3_transformDot(a, a)); | |
if (k) { | |
a[0] /= k; | |
a[1] /= k; | |
} | |
return k; | |
} | |
function d3_transformCombine(a, b, k) { | |
a[0] += k * b[0]; | |
a[1] += k * b[1]; | |
return a; | |
} | |
var d3_transformIdentity = { | |
a: 1, | |
b: 0, | |
c: 0, | |
d: 1, | |
e: 0, | |
f: 0 | |
}; | |
d3.interpolateTransform = d3_interpolateTransform; | |
function d3_interpolateTransform(a, b) { | |
var s = [], q = [], n, A = d3.transform(a), B = d3.transform(b), ta = A.translate, tb = B.translate, ra = A.rotate, rb = B.rotate, wa = A.skew, wb = B.skew, ka = A.scale, kb = B.scale; | |
if (ta[0] != tb[0] || ta[1] != tb[1]) { | |
s.push("translate(", null, ",", null, ")"); | |
q.push({ | |
i: 1, | |
x: d3_interpolateNumber(ta[0], tb[0]) | |
}, { | |
i: 3, | |
x: d3_interpolateNumber(ta[1], tb[1]) | |
}); | |
} else if (tb[0] || tb[1]) { | |
s.push("translate(" + tb + ")"); | |
} else { | |
s.push(""); | |
} | |
if (ra != rb) { | |
if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360; | |
q.push({ | |
i: s.push(s.pop() + "rotate(", null, ")") - 2, | |
x: d3_interpolateNumber(ra, rb) | |
}); | |
} else if (rb) { | |
s.push(s.pop() + "rotate(" + rb + ")"); | |
} | |
if (wa != wb) { | |
q.push({ | |
i: s.push(s.pop() + "skewX(", null, ")") - 2, | |
x: d3_interpolateNumber(wa, wb) | |
}); | |
} else if (wb) { | |
s.push(s.pop() + "skewX(" + wb + ")"); | |
} | |
if (ka[0] != kb[0] || ka[1] != kb[1]) { | |
n = s.push(s.pop() + "scale(", null, ",", null, ")"); | |
q.push({ | |
i: n - 4, | |
x: d3_interpolateNumber(ka[0], kb[0]) | |
}, { | |
i: n - 2, | |
x: d3_interpolateNumber(ka[1], kb[1]) | |
}); | |
} else if (kb[0] != 1 || kb[1] != 1) { | |
s.push(s.pop() + "scale(" + kb + ")"); | |
} | |
n = q.length; | |
return function(t) { | |
var i = -1, o; | |
while (++i < n) s[(o = q[i]).i] = o.x(t); | |
return s.join(""); | |
}; | |
} | |
function d3_uninterpolateNumber(a, b) { | |
b = b - (a = +a) ? 1 / (b - a) : 0; | |
return function(x) { | |
return (x - a) * b; | |
}; | |
} | |
function d3_uninterpolateClamp(a, b) { | |
b = b - (a = +a) ? 1 / (b - a) : 0; | |
return function(x) { | |
return Math.max(0, Math.min(1, (x - a) * b)); | |
}; | |
} | |
d3.layout = {}; | |
d3.layout.bundle = function() { | |
return function(links) { | |
var paths = [], i = -1, n = links.length; | |
while (++i < n) paths.push(d3_layout_bundlePath(links[i])); | |
return paths; | |
}; | |
}; | |
function d3_layout_bundlePath(link) { | |
var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ]; | |
while (start !== lca) { | |
start = start.parent; | |
points.push(start); | |
} | |
var k = points.length; | |
while (end !== lca) { | |
points.splice(k, 0, end); | |
end = end.parent; | |
} | |
return points; | |
} | |
function d3_layout_bundleAncestors(node) { | |
var ancestors = [], parent = node.parent; | |
while (parent != null) { | |
ancestors.push(node); | |
node = parent; | |
parent = parent.parent; | |
} | |
ancestors.push(node); | |
return ancestors; | |
} | |
function d3_layout_bundleLeastCommonAncestor(a, b) { | |
if (a === b) return a; | |
var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null; | |
while (aNode === bNode) { | |
sharedNode = aNode; | |
aNode = aNodes.pop(); | |
bNode = bNodes.pop(); | |
} | |
return sharedNode; | |
} | |
d3.layout.chord = function() { | |
var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords; | |
function relayout() { | |
var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j; | |
chords = []; | |
groups = []; | |
k = 0, i = -1; | |
while (++i < n) { | |
x = 0, j = -1; | |
while (++j < n) { | |
x += matrix[i][j]; | |
} | |
groupSums.push(x); | |
subgroupIndex.push(d3.range(n)); | |
k += x; | |
} | |
if (sortGroups) { | |
groupIndex.sort(function(a, b) { | |
return sortGroups(groupSums[a], groupSums[b]); | |
}); | |
} | |
if (sortSubgroups) { | |
subgroupIndex.forEach(function(d, i) { | |
d.sort(function(a, b) { | |
return sortSubgroups(matrix[i][a], matrix[i][b]); | |
}); | |
}); | |
} | |
k = (2 * π - padding * n) / k; | |
x = 0, i = -1; | |
while (++i < n) { | |
x0 = x, j = -1; | |
while (++j < n) { | |
var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k; | |
subgroups[di + "-" + dj] = { | |
index: di, | |
subindex: dj, | |
startAngle: a0, | |
endAngle: a1, | |
value: v | |
}; | |
} | |
groups[di] = { | |
index: di, | |
startAngle: x0, | |
endAngle: x, | |
value: (x - x0) / k | |
}; | |
x += padding; | |
} | |
i = -1; | |
while (++i < n) { | |
j = i - 1; | |
while (++j < n) { | |
var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i]; | |
if (source.value || target.value) { | |
chords.push(source.value < target.value ? { | |
source: target, | |
target: source | |
} : { | |
source: source, | |
target: target | |
}); | |
} | |
} | |
} | |
if (sortChords) resort(); | |
} | |
function resort() { | |
chords.sort(function(a, b) { | |
return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2); | |
}); | |
} | |
chord.matrix = function(x) { | |
if (!arguments.length) return matrix; | |
n = (matrix = x) && matrix.length; | |
chords = groups = null; | |
return chord; | |
}; | |
chord.padding = function(x) { | |
if (!arguments.length) return padding; | |
padding = x; | |
chords = groups = null; | |
return chord; | |
}; | |
chord.sortGroups = function(x) { | |
if (!arguments.length) return sortGroups; | |
sortGroups = x; | |
chords = groups = null; | |
return chord; | |
}; | |
chord.sortSubgroups = function(x) { | |
if (!arguments.length) return sortSubgroups; | |
sortSubgroups = x; | |
chords = null; | |
return chord; | |
}; | |
chord.sortChords = function(x) { | |
if (!arguments.length) return sortChords; | |
sortChords = x; | |
if (chords) resort(); | |
return chord; | |
}; | |
chord.chords = function() { | |
if (!chords) relayout(); | |
return chords; | |
}; | |
chord.groups = function() { | |
if (!groups) relayout(); | |
return groups; | |
}; | |
return chord; | |
}; | |
d3.layout.force = function() { | |
var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, gravity = .1, theta = .8, nodes = [], links = [], distances, strengths, charges; | |
function repulse(node) { | |
return function(quad, x1, _, x2) { | |
if (quad.point !== node) { | |
var dx = quad.cx - node.x, dy = quad.cy - node.y, dn = 1 / Math.sqrt(dx * dx + dy * dy); | |
if ((x2 - x1) * dn < theta) { | |
var k = quad.charge * dn * dn; | |
node.px -= dx * k; | |
node.py -= dy * k; | |
return true; | |
} | |
if (quad.point && isFinite(dn)) { | |
var k = quad.pointCharge * dn * dn; | |
node.px -= dx * k; | |
node.py -= dy * k; | |
} | |
} | |
return !quad.charge; | |
}; | |
} | |
force.tick = function() { | |
if ((alpha *= .99) < .005) { | |
event.end({ | |
type: "end", | |
alpha: alpha = 0 | |
}); | |
return true; | |
} | |
var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y; | |
for (i = 0; i < m; ++i) { | |
o = links[i]; | |
s = o.source; | |
t = o.target; | |
x = t.x - s.x; | |
y = t.y - s.y; | |
if (l = x * x + y * y) { | |
l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l; | |
x *= l; | |
y *= l; | |
t.x -= x * (k = s.weight / (t.weight + s.weight)); | |
t.y -= y * k; | |
s.x += x * (k = 1 - k); | |
s.y += y * k; | |
} | |
} | |
if (k = alpha * gravity) { | |
x = size[0] / 2; | |
y = size[1] / 2; | |
i = -1; | |
if (k) while (++i < n) { | |
o = nodes[i]; | |
o.x += (x - o.x) * k; | |
o.y += (y - o.y) * k; | |
} | |
} | |
if (charge) { | |
d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges); | |
i = -1; | |
while (++i < n) { | |
if (!(o = nodes[i]).fixed) { | |
q.visit(repulse(o)); | |
} | |
} | |
} | |
i = -1; | |
while (++i < n) { | |
o = nodes[i]; | |
if (o.fixed) { | |
o.x = o.px; | |
o.y = o.py; | |
} else { | |
o.x -= (o.px - (o.px = o.x)) * friction; | |
o.y -= (o.py - (o.py = o.y)) * friction; | |
} | |
} | |
event.tick({ | |
type: "tick", | |
alpha: alpha | |
}); | |
}; | |
force.nodes = function(x) { | |
if (!arguments.length) return nodes; | |
nodes = x; | |
return force; | |
}; | |
force.links = function(x) { | |
if (!arguments.length) return links; | |
links = x; | |
return force; | |
}; | |
force.size = function(x) { | |
if (!arguments.length) return size; | |
size = x; | |
return force; | |
}; | |
force.linkDistance = function(x) { | |
if (!arguments.length) return linkDistance; | |
linkDistance = typeof x === "function" ? x : +x; | |
return force; | |
}; | |
force.distance = force.linkDistance; | |
force.linkStrength = function(x) { | |
if (!arguments.length) return linkStrength; | |
linkStrength = typeof x === "function" ? x : +x; | |
return force; | |
}; | |
force.friction = function(x) { | |
if (!arguments.length) return friction; | |
friction = +x; | |
return force; | |
}; | |
force.charge = function(x) { | |
if (!arguments.length) return charge; | |
charge = typeof x === "function" ? x : +x; | |
return force; | |
}; | |
force.gravity = function(x) { | |
if (!arguments.length) return gravity; | |
gravity = +x; | |
return force; | |
}; | |
force.theta = function(x) { | |
if (!arguments.length) return theta; | |
theta = +x; | |
return force; | |
}; | |
force.alpha = function(x) { | |
if (!arguments.length) return alpha; | |
x = +x; | |
if (alpha) { | |
if (x > 0) alpha = x; else alpha = 0; | |
} else if (x > 0) { | |
event.start({ | |
type: "start", | |
alpha: alpha = x | |
}); | |
d3.timer(force.tick); | |
} | |
return force; | |
}; | |
force.start = function() { | |
var i, j, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o; | |
for (i = 0; i < n; ++i) { | |
(o = nodes[i]).index = i; | |
o.weight = 0; | |
} | |
for (i = 0; i < m; ++i) { | |
o = links[i]; | |
if (typeof o.source == "number") o.source = nodes[o.source]; | |
if (typeof o.target == "number") o.target = nodes[o.target]; | |
++o.source.weight; | |
++o.target.weight; | |
} | |
for (i = 0; i < n; ++i) { | |
o = nodes[i]; | |
if (isNaN(o.x)) o.x = position("x", w); | |
if (isNaN(o.y)) o.y = position("y", h); | |
if (isNaN(o.px)) o.px = o.x; | |
if (isNaN(o.py)) o.py = o.y; | |
} | |
distances = []; | |
if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance; | |
strengths = []; | |
if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength; | |
charges = []; | |
if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge; | |
function position(dimension, size) { | |
var neighbors = neighbor(i), j = -1, m = neighbors.length, x; | |
while (++j < m) if (!isNaN(x = neighbors[j][dimension])) return x; | |
return Math.random() * size; | |
} | |
function neighbor() { | |
if (!neighbors) { | |
neighbors = []; | |
for (j = 0; j < n; ++j) { | |
neighbors[j] = []; | |
} | |
for (j = 0; j < m; ++j) { | |
var o = links[j]; | |
neighbors[o.source.index].push(o.target); | |
neighbors[o.target.index].push(o.source); | |
} | |
} | |
return neighbors[i]; | |
} | |
return force.resume(); | |
}; | |
force.resume = function() { | |
return force.alpha(.1); | |
}; | |
force.stop = function() { | |
return force.alpha(0); | |
}; | |
force.drag = function() { | |
if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend); | |
if (!arguments.length) return drag; | |
this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag); | |
}; | |
function dragmove(d) { | |
d.px = d3.event.x, d.py = d3.event.y; | |
force.resume(); | |
} | |
return d3.rebind(force, event, "on"); | |
}; | |
function d3_layout_forceDragstart(d) { | |
d.fixed |= 2; | |
} | |
function d3_layout_forceDragend(d) { | |
d.fixed &= ~6; | |
} | |
function d3_layout_forceMouseover(d) { | |
d.fixed |= 4; | |
d.px = d.x, d.py = d.y; | |
} | |
function d3_layout_forceMouseout(d) { | |
d.fixed &= ~4; | |
} | |
function d3_layout_forceAccumulate(quad, alpha, charges) { | |
var cx = 0, cy = 0; | |
quad.charge = 0; | |
if (!quad.leaf) { | |
var nodes = quad.nodes, n = nodes.length, i = -1, c; | |
while (++i < n) { | |
c = nodes[i]; | |
if (c == null) continue; | |
d3_layout_forceAccumulate(c, alpha, charges); | |
quad.charge += c.charge; | |
cx += c.charge * c.cx; | |
cy += c.charge * c.cy; | |
} | |
} | |
if (quad.point) { | |
if (!quad.leaf) { | |
quad.point.x += Math.random() - .5; | |
quad.point.y += Math.random() - .5; | |
} | |
var k = alpha * charges[quad.point.index]; | |
quad.charge += quad.pointCharge = k; | |
cx += k * quad.point.x; | |
cy += k * quad.point.y; | |
} | |
quad.cx = cx / quad.charge; | |
quad.cy = cy / quad.charge; | |
} | |
var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1; | |
d3.layout.hierarchy = function() { | |
var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue; | |
function recurse(node, depth, nodes) { | |
var childs = children.call(hierarchy, node, depth); | |
node.depth = depth; | |
nodes.push(node); | |
if (childs && (n = childs.length)) { | |
var i = -1, n, c = node.children = [], v = 0, j = depth + 1, d; | |
while (++i < n) { | |
d = recurse(childs[i], j, nodes); | |
d.parent = node; | |
c.push(d); | |
v += d.value; | |
} | |
if (sort) c.sort(sort); | |
if (value) node.value = v; | |
} else if (value) { | |
node.value = +value.call(hierarchy, node, depth) || 0; | |
} | |
return node; | |
} | |
function revalue(node, depth) { | |
var children = node.children, v = 0; | |
if (children && (n = children.length)) { | |
var i = -1, n, j = depth + 1; | |
while (++i < n) v += revalue(children[i], j); | |
} else if (value) { | |
v = +value.call(hierarchy, node, depth) || 0; | |
} | |
if (value) node.value = v; | |
return v; | |
} | |
function hierarchy(d) { | |
var nodes = []; | |
recurse(d, 0, nodes); | |
return nodes; | |
} | |
hierarchy.sort = function(x) { | |
if (!arguments.length) return sort; | |
sort = x; | |
return hierarchy; | |
}; | |
hierarchy.children = function(x) { | |
if (!arguments.length) return children; | |
children = x; | |
return hierarchy; | |
}; | |
hierarchy.value = function(x) { | |
if (!arguments.length) return value; | |
value = x; | |
return hierarchy; | |
}; | |
hierarchy.revalue = function(root) { | |
revalue(root, 0); | |
return root; | |
}; | |
return hierarchy; | |
}; | |
function d3_layout_hierarchyRebind(object, hierarchy) { | |
d3.rebind(object, hierarchy, "sort", "children", "value"); | |
object.nodes = object; | |
object.links = d3_layout_hierarchyLinks; | |
return object; | |
} | |
function d3_layout_hierarchyChildren(d) { | |
return d.children; | |
} | |
function d3_layout_hierarchyValue(d) { | |
return d.value; | |
} | |
function d3_layout_hierarchySort(a, b) { | |
return b.value - a.value; | |
} | |
function d3_layout_hierarchyLinks(nodes) { | |
return d3.merge(nodes.map(function(parent) { | |
return (parent.children || []).map(function(child) { | |
return { | |
source: parent, | |
target: child | |
}; | |
}); | |
})); | |
} | |
d3.layout.partition = function() { | |
var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ]; | |
function position(node, x, dx, dy) { | |
var children = node.children; | |
node.x = x; | |
node.y = node.depth * dy; | |
node.dx = dx; | |
node.dy = dy; | |
if (children && (n = children.length)) { | |
var i = -1, n, c, d; | |
dx = node.value ? dx / node.value : 0; | |
while (++i < n) { | |
position(c = children[i], x, d = c.value * dx, dy); | |
x += d; | |
} | |
} | |
} | |
function depth(node) { | |
var children = node.children, d = 0; | |
if (children && (n = children.length)) { | |
var i = -1, n; | |
while (++i < n) d = Math.max(d, depth(children[i])); | |
} | |
return 1 + d; | |
} | |
function partition(d, i) { | |
var nodes = hierarchy.call(this, d, i); | |
position(nodes[0], 0, size[0], size[1] / depth(nodes[0])); | |
return nodes; | |
} | |
partition.size = function(x) { | |
if (!arguments.length) return size; | |
size = x; | |
return partition; | |
}; | |
return d3_layout_hierarchyRebind(partition, hierarchy); | |
}; | |
d3.layout.pie = function() { | |
var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = 2 * π; | |
function pie(data) { | |
var values = data.map(function(d, i) { | |
return +value.call(pie, d, i); | |
}); | |
var a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle); | |
var k = ((typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a) / d3.sum(values); | |
var index = d3.range(data.length); | |
if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) { | |
return values[j] - values[i]; | |
} : function(i, j) { | |
return sort(data[i], data[j]); | |
}); | |
var arcs = []; | |
index.forEach(function(i) { | |
var d; | |
arcs[i] = { | |
data: data[i], | |
value: d = values[i], | |
startAngle: a, | |
endAngle: a += d * k | |
}; | |
}); | |
return arcs; | |
} | |
pie.value = function(x) { | |
if (!arguments.length) return value; | |
value = x; | |
return pie; | |
}; | |
pie.sort = function(x) { | |
if (!arguments.length) return sort; | |
sort = x; | |
return pie; | |
}; | |
pie.startAngle = function(x) { | |
if (!arguments.length) return startAngle; | |
startAngle = x; | |
return pie; | |
}; | |
pie.endAngle = function(x) { | |
if (!arguments.length) return endAngle; | |
endAngle = x; | |
return pie; | |
}; | |
return pie; | |
}; | |
var d3_layout_pieSortByValue = {}; | |
d3.layout.stack = function() { | |
var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY; | |
function stack(data, index) { | |
var series = data.map(function(d, i) { | |
return values.call(stack, d, i); | |
}); | |
var points = series.map(function(d) { | |
return d.map(function(v, i) { | |
return [ x.call(stack, v, i), y.call(stack, v, i) ]; | |
}); | |
}); | |
var orders = order.call(stack, points, index); | |
series = d3.permute(series, orders); | |
points = d3.permute(points, orders); | |
var offsets = offset.call(stack, points, index); | |
var n = series.length, m = series[0].length, i, j, o; | |
for (j = 0; j < m; ++j) { | |
out.call(stack, series[0][j], o = offsets[j], points[0][j][1]); | |
for (i = 1; i < n; ++i) { | |
out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]); | |
} | |
} | |
return data; | |
} | |
stack.values = function(x) { | |
if (!arguments.length) return values; | |
values = x; | |
return stack; | |
}; | |
stack.order = function(x) { | |
if (!arguments.length) return order; | |
order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault; | |
return stack; | |
}; | |
stack.offset = function(x) { | |
if (!arguments.length) return offset; | |
offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero; | |
return stack; | |
}; | |
stack.x = function(z) { | |
if (!arguments.length) return x; | |
x = z; | |
return stack; | |
}; | |
stack.y = function(z) { | |
if (!arguments.length) return y; | |
y = z; | |
return stack; | |
}; | |
stack.out = function(z) { | |
if (!arguments.length) return out; | |
out = z; | |
return stack; | |
}; | |
return stack; | |
}; | |
function d3_layout_stackX(d) { | |
return d.x; | |
} | |
function d3_layout_stackY(d) { | |
return d.y; | |
} | |
function d3_layout_stackOut(d, y0, y) { | |
d.y0 = y0; | |
d.y = y; | |
} | |
var d3_layout_stackOrders = d3.map({ | |
"inside-out": function(data) { | |
var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) { | |
return max[a] - max[b]; | |
}), top = 0, bottom = 0, tops = [], bottoms = []; | |
for (i = 0; i < n; ++i) { | |
j = index[i]; | |
if (top < bottom) { | |
top += sums[j]; | |
tops.push(j); | |
} else { | |
bottom += sums[j]; | |
bottoms.push(j); | |
} | |
} | |
return bottoms.reverse().concat(tops); | |
}, | |
reverse: function(data) { | |
return d3.range(data.length).reverse(); | |
}, | |
"default": d3_layout_stackOrderDefault | |
}); | |
var d3_layout_stackOffsets = d3.map({ | |
silhouette: function(data) { | |
var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = []; | |
for (j = 0; j < m; ++j) { | |
for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; | |
if (o > max) max = o; | |
sums.push(o); | |
} | |
for (j = 0; j < m; ++j) { | |
y0[j] = (max - sums[j]) / 2; | |
} | |
return y0; | |
}, | |
wiggle: function(data) { | |
var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = []; | |
y0[0] = o = o0 = 0; | |
for (j = 1; j < m; ++j) { | |
for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1]; | |
for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) { | |
for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) { | |
s3 += (data[k][j][1] - data[k][j - 1][1]) / dx; | |
} | |
s2 += s3 * data[i][j][1]; | |
} | |
y0[j] = o -= s1 ? s2 / s1 * dx : 0; | |
if (o < o0) o0 = o; | |
} | |
for (j = 0; j < m; ++j) y0[j] -= o0; | |
return y0; | |
}, | |
expand: function(data) { | |
var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = []; | |
for (j = 0; j < m; ++j) { | |
for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; | |
if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k; | |
} | |
for (j = 0; j < m; ++j) y0[j] = 0; | |
return y0; | |
}, | |
zero: d3_layout_stackOffsetZero | |
}); | |
function d3_layout_stackOrderDefault(data) { | |
return d3.range(data.length); | |
} | |
function d3_layout_stackOffsetZero(data) { | |
var j = -1, m = data[0].length, y0 = []; | |
while (++j < m) y0[j] = 0; | |
return y0; | |
} | |
function d3_layout_stackMaxIndex(array) { | |
var i = 1, j = 0, v = array[0][1], k, n = array.length; | |
for (;i < n; ++i) { | |
if ((k = array[i][1]) > v) { | |
j = i; | |
v = k; | |
} | |
} | |
return j; | |
} | |
function d3_layout_stackReduceSum(d) { | |
return d.reduce(d3_layout_stackSum, 0); | |
} | |
function d3_layout_stackSum(p, d) { | |
return p + d[1]; | |
} | |
d3.layout.histogram = function() { | |
var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges; | |
function histogram(data, i) { | |
var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x; | |
while (++i < m) { | |
bin = bins[i] = []; | |
bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]); | |
bin.y = 0; | |
} | |
if (m > 0) { | |
i = -1; | |
while (++i < n) { | |
x = values[i]; | |
if (x >= range[0] && x <= range[1]) { | |
bin = bins[d3.bisect(thresholds, x, 1, m) - 1]; | |
bin.y += k; | |
bin.push(data[i]); | |
} | |
} | |
} | |
return bins; | |
} | |
histogram.value = function(x) { | |
if (!arguments.length) return valuer; | |
valuer = x; | |
return histogram; | |
}; | |
histogram.range = function(x) { | |
if (!arguments.length) return ranger; | |
ranger = d3_functor(x); | |
return histogram; | |
}; | |
histogram.bins = function(x) { | |
if (!arguments.length) return binner; | |
binner = typeof x === "number" ? function(range) { | |
return d3_layout_histogramBinFixed(range, x); | |
} : d3_functor(x); | |
return histogram; | |
}; | |
histogram.frequency = function(x) { | |
if (!arguments.length) return frequency; | |
frequency = !!x; | |
return histogram; | |
}; | |
return histogram; | |
}; | |
function d3_layout_histogramBinSturges(range, values) { | |
return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1)); | |
} | |
function d3_layout_histogramBinFixed(range, n) { | |
var x = -1, b = +range[0], m = (range[1] - b) / n, f = []; | |
while (++x <= n) f[x] = m * x + b; | |
return f; | |
} | |
function d3_layout_histogramRange(values) { | |
return [ d3.min(values), d3.max(values) ]; | |
} | |
d3.layout.tree = function() { | |
var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false; | |
function tree(d, i) { | |
var nodes = hierarchy.call(this, d, i), root = nodes[0]; | |
function firstWalk(node, previousSibling) { | |
var children = node.children, layout = node._tree; | |
if (children && (n = children.length)) { | |
var n, firstChild = children[0], previousChild, ancestor = firstChild, child, i = -1; | |
while (++i < n) { | |
child = children[i]; | |
firstWalk(child, previousChild); | |
ancestor = apportion(child, previousChild, ancestor); | |
previousChild = child; | |
} | |
d3_layout_treeShift(node); | |
var midpoint = .5 * (firstChild._tree.prelim + child._tree.prelim); | |
if (previousSibling) { | |
layout.prelim = previousSibling._tree.prelim + separation(node, previousSibling); | |
layout.mod = layout.prelim - midpoint; | |
} else { | |
layout.prelim = midpoint; | |
} | |
} else { | |
if (previousSibling) { | |
layout.prelim = previousSibling._tree.prelim + separation(node, previousSibling); | |
} | |
} | |
} | |
function secondWalk(node, x) { | |
node.x = node._tree.prelim + x; | |
var children = node.children; | |
if (children && (n = children.length)) { | |
var i = -1, n; | |
x += node._tree.mod; | |
while (++i < n) { | |
secondWalk(children[i], x); | |
} | |
} | |
} | |
function apportion(node, previousSibling, ancestor) { | |
if (previousSibling) { | |
var vip = node, vop = node, vim = previousSibling, vom = node.parent.children[0], sip = vip._tree.mod, sop = vop._tree.mod, sim = vim._tree.mod, som = vom._tree.mod, shift; | |
while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) { | |
vom = d3_layout_treeLeft(vom); | |
vop = d3_layout_treeRight(vop); | |
vop._tree.ancestor = node; | |
shift = vim._tree.prelim + sim - vip._tree.prelim - sip + separation(vim, vip); | |
if (shift > 0) { | |
d3_layout_treeMove(d3_layout_treeAncestor(vim, node, ancestor), node, shift); | |
sip += shift; | |
sop += shift; | |
} | |
sim += vim._tree.mod; | |
sip += vip._tree.mod; | |
som += vom._tree.mod; | |
sop += vop._tree.mod; | |
} | |
if (vim && !d3_layout_treeRight(vop)) { | |
vop._tree.thread = vim; | |
vop._tree.mod += sim - sop; | |
} | |
if (vip && !d3_layout_treeLeft(vom)) { | |
vom._tree.thread = vip; | |
vom._tree.mod += sip - som; | |
ancestor = node; | |
} | |
} | |
return ancestor; | |
} | |
d3_layout_treeVisitAfter(root, function(node, previousSibling) { | |
node._tree = { | |
ancestor: node, | |
prelim: 0, | |
mod: 0, | |
change: 0, | |
shift: 0, | |
number: previousSibling ? previousSibling._tree.number + 1 : 0 | |
}; | |
}); | |
firstWalk(root); | |
secondWalk(root, -root._tree.prelim); | |
var left = d3_layout_treeSearch(root, d3_layout_treeLeftmost), right = d3_layout_treeSearch(root, d3_layout_treeRightmost), deep = d3_layout_treeSearch(root, d3_layout_treeDeepest), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2, y1 = deep.depth || 1; | |
d3_layout_treeVisitAfter(root, nodeSize ? function(node) { | |
node.x *= size[0]; | |
node.y = node.depth * size[1]; | |
delete node._tree; | |
} : function(node) { | |
node.x = (node.x - x0) / (x1 - x0) * size[0]; | |
node.y = node.depth / y1 * size[1]; | |
delete node._tree; | |
}); | |
return nodes; | |
} | |
tree.separation = function(x) { | |
if (!arguments.length) return separation; | |
separation = x; | |
return tree; | |
}; | |
tree.size = function(x) { | |
if (!arguments.length) return nodeSize ? null : size; | |
nodeSize = (size = x) == null; | |
return tree; | |
}; | |
tree.nodeSize = function(x) { | |
if (!arguments.length) return nodeSize ? size : null; | |
nodeSize = (size = x) != null; | |
return tree; | |
}; | |
return d3_layout_hierarchyRebind(tree, hierarchy); | |
}; | |
function d3_layout_treeSeparation(a, b) { | |
return a.parent == b.parent ? 1 : 2; | |
} | |
function d3_layout_treeLeft(node) { | |
var children = node.children; | |
return children && children.length ? children[0] : node._tree.thread; | |
} | |
function d3_layout_treeRight(node) { | |
var children = node.children, n; | |
return children && (n = children.length) ? children[n - 1] : node._tree.thread; | |
} | |
function d3_layout_treeSearch(node, compare) { | |
var children = node.children; | |
if (children && (n = children.length)) { | |
var child, n, i = -1; | |
while (++i < n) { | |
if (compare(child = d3_layout_treeSearch(children[i], compare), node) > 0) { | |
node = child; | |
} | |
} | |
} | |
return node; | |
} | |
function d3_layout_treeRightmost(a, b) { | |
return a.x - b.x; | |
} | |
function d3_layout_treeLeftmost(a, b) { | |
return b.x - a.x; | |
} | |
function d3_layout_treeDeepest(a, b) { | |
return a.depth - b.depth; | |
} | |
function d3_layout_treeVisitAfter(node, callback) { | |
function visit(node, previousSibling) { | |
var children = node.children; | |
if (children && (n = children.length)) { | |
var child, previousChild = null, i = -1, n; | |
while (++i < n) { | |
child = children[i]; | |
visit(child, previousChild); | |
previousChild = child; | |
} | |
} | |
callback(node, previousSibling); | |
} | |
visit(node, null); | |
} | |
function d3_layout_treeShift(node) { | |
var shift = 0, change = 0, children = node.children, i = children.length, child; | |
while (--i >= 0) { | |
child = children[i]._tree; | |
child.prelim += shift; | |
child.mod += shift; | |
shift += child.shift + (change += child.change); | |
} | |
} | |
function d3_layout_treeMove(ancestor, node, shift) { | |
ancestor = ancestor._tree; | |
node = node._tree; | |
var change = shift / (node.number - ancestor.number); | |
ancestor.change += change; | |
node.change -= change; | |
node.shift += shift; | |
node.prelim += shift; | |
node.mod += shift; | |
} | |
function d3_layout_treeAncestor(vim, node, ancestor) { | |
return vim._tree.ancestor.parent == node.parent ? vim._tree.ancestor : ancestor; | |
} | |
d3.layout.pack = function() { | |
var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius; | |
function pack(d, i) { | |
var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() { | |
return radius; | |
}; | |
root.x = root.y = 0; | |
d3_layout_treeVisitAfter(root, function(d) { | |
d.r = +r(d.value); | |
}); | |
d3_layout_treeVisitAfter(root, d3_layout_packSiblings); | |
if (padding) { | |
var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2; | |
d3_layout_treeVisitAfter(root, function(d) { | |
d.r += dr; | |
}); | |
d3_layout_treeVisitAfter(root, d3_layout_packSiblings); | |
d3_layout_treeVisitAfter(root, function(d) { | |
d.r -= dr; | |
}); | |
} | |
d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h)); | |
return nodes; | |
} | |
pack.size = function(_) { | |
if (!arguments.length) return size; | |
size = _; | |
return pack; | |
}; | |
pack.radius = function(_) { | |
if (!arguments.length) return radius; | |
radius = _ == null || typeof _ === "function" ? _ : +_; | |
return pack; | |
}; | |
pack.padding = function(_) { | |
if (!arguments.length) return padding; | |
padding = +_; | |
return pack; | |
}; | |
return d3_layout_hierarchyRebind(pack, hierarchy); | |
}; | |
function d3_layout_packSort(a, b) { | |
return a.value - b.value; | |
} | |
function d3_layout_packInsert(a, b) { | |
var c = a._pack_next; | |
a._pack_next = b; | |
b._pack_prev = a; | |
b._pack_next = c; | |
c._pack_prev = b; | |
} | |
function d3_layout_packSplice(a, b) { | |
a._pack_next = b; | |
b._pack_prev = a; | |
} | |
function d3_layout_packIntersects(a, b) { | |
var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r; | |
return .999 * dr * dr > dx * dx + dy * dy; | |
} | |
function d3_layout_packSiblings(node) { | |
if (!(nodes = node.children) || !(n = nodes.length)) return; | |
var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n; | |
function bound(node) { | |
xMin = Math.min(node.x - node.r, xMin); | |
xMax = Math.max(node.x + node.r, xMax); | |
yMin = Math.min(node.y - node.r, yMin); | |
yMax = Math.max(node.y + node.r, yMax); | |
} | |
nodes.forEach(d3_layout_packLink); | |
a = nodes[0]; | |
a.x = -a.r; | |
a.y = 0; | |
bound(a); | |
if (n > 1) { | |
b = nodes[1]; | |
b.x = b.r; | |
b.y = 0; | |
bound(b); | |
if (n > 2) { | |
c = nodes[2]; | |
d3_layout_packPlace(a, b, c); | |
bound(c); | |
d3_layout_packInsert(a, c); | |
a._pack_prev = c; | |
d3_layout_packInsert(c, b); | |
b = a._pack_next; | |
for (i = 3; i < n; i++) { | |
d3_layout_packPlace(a, b, c = nodes[i]); | |
var isect = 0, s1 = 1, s2 = 1; | |
for (j = b._pack_next; j !== b; j = j._pack_next, s1++) { | |
if (d3_layout_packIntersects(j, c)) { | |
isect = 1; | |
break; | |
} | |
} | |
if (isect == 1) { | |
for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) { | |
if (d3_layout_packIntersects(k, c)) { | |
break; | |
} | |
} | |
} | |
if (isect) { | |
if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b); | |
i--; | |
} else { | |
d3_layout_packInsert(a, c); | |
b = c; | |
bound(c); | |
} | |
} | |
} | |
} | |
var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0; | |
for (i = 0; i < n; i++) { | |
c = nodes[i]; | |
c.x -= cx; | |
c.y -= cy; | |
cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y)); | |
} | |
node.r = cr; | |
nodes.forEach(d3_layout_packUnlink); | |
} | |
function d3_layout_packLink(node) { | |
node._pack_next = node._pack_prev = node; | |
} | |
function d3_layout_packUnlink(node) { | |
delete node._pack_next; | |
delete node._pack_prev; | |
} | |
function d3_layout_packTransform(node, x, y, k) { | |
var children = node.children; | |
node.x = x += k * node.x; | |
node.y = y += k * node.y; | |
node.r *= k; | |
if (children) { | |
var i = -1, n = children.length; | |
while (++i < n) d3_layout_packTransform(children[i], x, y, k); | |
} | |
} | |
function d3_layout_packPlace(a, b, c) { | |
var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y; | |
if (db && (dx || dy)) { | |
var da = b.r + c.r, dc = dx * dx + dy * dy; | |
da *= da; | |
db *= db; | |
var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc); | |
c.x = a.x + x * dx + y * dy; | |
c.y = a.y + x * dy - y * dx; | |
} else { | |
c.x = a.x + db; | |
c.y = a.y; | |
} | |
} | |
d3.layout.cluster = function() { | |
var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false; | |
function cluster(d, i) { | |
var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0; | |
d3_layout_treeVisitAfter(root, function(node) { | |
var children = node.children; | |
if (children && children.length) { | |
node.x = d3_layout_clusterX(children); | |
node.y = d3_layout_clusterY(children); | |
} else { | |
node.x = previousNode ? x += separation(node, previousNode) : 0; | |
node.y = 0; | |
previousNode = node; | |
} | |
}); | |
var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2; | |
d3_layout_treeVisitAfter(root, nodeSize ? function(node) { | |
node.x = (node.x - root.x) * size[0]; | |
node.y = (root.y - node.y) * size[1]; | |
} : function(node) { | |
node.x = (node.x - x0) / (x1 - x0) * size[0]; | |
node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1]; | |
}); | |
return nodes; | |
} | |
cluster.separation = function(x) { | |
if (!arguments.length) return separation; | |
separation = x; | |
return cluster; | |
}; | |
cluster.size = function(x) { | |
if (!arguments.length) return nodeSize ? null : size; | |
nodeSize = (size = x) == null; | |
return cluster; | |
}; | |
cluster.nodeSize = function(x) { | |
if (!arguments.length) return nodeSize ? size : null; | |
nodeSize = (size = x) != null; | |
return cluster; | |
}; | |
return d3_layout_hierarchyRebind(cluster, hierarchy); | |
}; | |
function d3_layout_clusterY(children) { | |
return 1 + d3.max(children, function(child) { | |
return child.y; | |
}); | |
} | |
function d3_layout_clusterX(children) { | |
return children.reduce(function(x, child) { | |
return x + child.x; | |
}, 0) / children.length; | |
} | |
function d3_layout_clusterLeft(node) { | |
var children = node.children; | |
return children && children.length ? d3_layout_clusterLeft(children[0]) : node; | |
} | |
function d3_layout_clusterRight(node) { | |
var children = node.children, n; | |
return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node; | |
} | |
d3.layout.treemap = function() { | |
var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5)); | |
function scale(children, k) { | |
var i = -1, n = children.length, child, area; | |
while (++i < n) { | |
area = (child = children[i]).value * (k < 0 ? 0 : k); | |
child.area = isNaN(area) || area <= 0 ? 0 : area; | |
} | |
} | |
function squarify(node) { | |
var children = node.children; | |
if (children && children.length) { | |
var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n; | |
scale(remaining, rect.dx * rect.dy / node.value); | |
row.area = 0; | |
while ((n = remaining.length) > 0) { | |
row.push(child = remaining[n - 1]); | |
row.area += child.area; | |
if (mode !== "squarify" || (score = worst(row, u)) <= best) { | |
remaining.pop(); | |
best = score; | |
} else { | |
row.area -= row.pop().area; | |
position(row, u, rect, false); | |
u = Math.min(rect.dx, rect.dy); | |
row.length = row.area = 0; | |
best = Infinity; | |
} | |
} | |
if (row.length) { | |
position(row, u, rect, true); | |
row.length = row.area = 0; | |
} | |
children.forEach(squarify); | |
} | |
} | |
function stickify(node) { | |
var children = node.children; | |
if (children && children.length) { | |
var rect = pad(node), remaining = children.slice(), child, row = []; | |
scale(remaining, rect.dx * rect.dy / node.value); | |
row.area = 0; | |
while (child = remaining.pop()) { | |
row.push(child); | |
row.area += child.area; | |
if (child.z != null) { | |
position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length); | |
row.length = row.area = 0; | |
} | |
} | |
children.forEach(stickify); | |
} | |
} | |
function worst(row, u) { | |
var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length; | |
while (++i < n) { | |
if (!(r = row[i].area)) continue; | |
if (r < rmin) rmin = r; | |
if (r > rmax) rmax = r; | |
} | |
s *= s; | |
u *= u; | |
return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity; | |
} | |
function position(row, u, rect, flush) { | |
var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o; | |
if (u == rect.dx) { | |
if (flush || v > rect.dy) v = rect.dy; | |
while (++i < n) { | |
o = row[i]; | |
o.x = x; | |
o.y = y; | |
o.dy = v; | |
x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0); | |
} | |
o.z = true; | |
o.dx += rect.x + rect.dx - x; | |
rect.y += v; | |
rect.dy -= v; | |
} else { | |
if (flush || v > rect.dx) v = rect.dx; | |
while (++i < n) { | |
o = row[i]; | |
o.x = x; | |
o.y = y; | |
o.dx = v; | |
y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0); | |
} | |
o.z = false; | |
o.dy += rect.y + rect.dy - y; | |
rect.x += v; | |
rect.dx -= v; | |
} | |
} | |
function treemap(d) { | |
var nodes = stickies || hierarchy(d), root = nodes[0]; | |
root.x = 0; | |
root.y = 0; | |
root.dx = size[0]; | |
root.dy = size[1]; | |
if (stickies) hierarchy.revalue(root); | |
scale([ root ], root.dx * root.dy / root.value); | |
(stickies ? stickify : squarify)(root); | |
if (sticky) stickies = nodes; | |
return nodes; | |
} | |
treemap.size = function(x) { | |
if (!arguments.length) return size; | |
size = x; | |
return treemap; | |
}; | |
treemap.padding = function(x) { | |
if (!arguments.length) return padding; | |
function padFunction(node) { | |
var p = x.call(treemap, node, node.depth); | |
return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p); | |
} | |
function padConstant(node) { | |
return d3_layout_treemapPad(node, x); | |
} | |
var type; | |
pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ], | |
padConstant) : padConstant; | |
return treemap; | |
}; | |
treemap.round = function(x) { | |
if (!arguments.length) return round != Number; | |
round = x ? Math.round : Number; | |
return treemap; | |
}; | |
treemap.sticky = function(x) { | |
if (!arguments.length) return sticky; | |
sticky = x; | |
stickies = null; | |
return treemap; | |
}; | |
treemap.ratio = function(x) { | |
if (!arguments.length) return ratio; | |
ratio = x; | |
return treemap; | |
}; | |
treemap.mode = function(x) { | |
if (!arguments.length) return mode; | |
mode = x + ""; | |
return treemap; | |
}; | |
return d3_layout_hierarchyRebind(treemap, hierarchy); | |
}; | |
function d3_layout_treemapPadNull(node) { | |
return { | |
x: node.x, | |
y: node.y, | |
dx: node.dx, | |
dy: node.dy | |
}; | |
} | |
function d3_layout_treemapPad(node, padding) { | |
var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2]; | |
if (dx < 0) { | |
x += dx / 2; | |
dx = 0; | |
} | |
if (dy < 0) { | |
y += dy / 2; | |
dy = 0; | |
} | |
return { | |
x: x, | |
y: y, | |
dx: dx, | |
dy: dy | |
}; | |
} | |
d3.random = { | |
normal: function(µ, σ) { | |
var n = arguments.length; | |
if (n < 2) σ = 1; | |
if (n < 1) µ = 0; | |
return function() { | |
var x, y, r; | |
do { | |
x = Math.random() * 2 - 1; | |
y = Math.random() * 2 - 1; | |
r = x * x + y * y; | |
} while (!r || r > 1); | |
return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r); | |
}; | |
}, | |
logNormal: function() { | |
var random = d3.random.normal.apply(d3, arguments); | |
return function() { | |
return Math.exp(random()); | |
}; | |
}, | |
irwinHall: function(m) { | |
return function() { | |
for (var s = 0, j = 0; j < m; j++) s += Math.random(); | |
return s / m; | |
}; | |
} | |
}; | |
d3.scale = {}; | |
function d3_scaleExtent(domain) { | |
var start = domain[0], stop = domain[domain.length - 1]; | |
return start < stop ? [ start, stop ] : [ stop, start ]; | |
} | |
function d3_scaleRange(scale) { | |
return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range()); | |
} | |
function d3_scale_bilinear(domain, range, uninterpolate, interpolate) { | |
var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]); | |
return function(x) { | |
return i(u(x)); | |
}; | |
} | |
function d3_scale_nice(domain, nice) { | |
var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx; | |
if (x1 < x0) { | |
dx = i0, i0 = i1, i1 = dx; | |
dx = x0, x0 = x1, x1 = dx; | |
} | |
domain[i0] = nice.floor(x0); | |
domain[i1] = nice.ceil(x1); | |
return domain; | |
} | |
function d3_scale_niceStep(step) { | |
return step ? { | |
floor: function(x) { | |
return Math.floor(x / step) * step; | |
}, | |
ceil: function(x) { | |
return Math.ceil(x / step) * step; | |
} | |
} : d3_scale_niceIdentity; | |
} | |
var d3_scale_niceIdentity = { | |
floor: d3_identity, | |
ceil: d3_identity | |
}; | |
function d3_scale_polylinear(domain, range, uninterpolate, interpolate) { | |
var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1; | |
if (domain[k] < domain[0]) { | |
domain = domain.slice().reverse(); | |
range = range.slice().reverse(); | |
} | |
while (++j <= k) { | |
u.push(uninterpolate(domain[j - 1], domain[j])); | |
i.push(interpolate(range[j - 1], range[j])); | |
} | |
return function(x) { | |
var j = d3.bisect(domain, x, 1, k) - 1; | |
return i[j](u[j](x)); | |
}; | |
} | |
d3.scale.linear = function() { | |
return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false); | |
}; | |
function d3_scale_linear(domain, range, interpolate, clamp) { | |
var output, input; | |
function rescale() { | |
var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber; | |
output = linear(domain, range, uninterpolate, interpolate); | |
input = linear(range, domain, uninterpolate, d3_interpolate); | |
return scale; | |
} | |
function scale(x) { | |
return output(x); | |
} | |
scale.invert = function(y) { | |
return input(y); | |
}; | |
scale.domain = function(x) { | |
if (!arguments.length) return domain; | |
domain = x.map(Number); | |
return rescale(); | |
}; | |
scale.range = function(x) { | |
if (!arguments.length) return range; | |
range = x; | |
return rescale(); | |
}; | |
scale.rangeRound = function(x) { | |
return scale.range(x).interpolate(d3_interpolateRound); | |
}; | |
scale.clamp = function(x) { | |
if (!arguments.length) return clamp; | |
clamp = x; | |
return rescale(); | |
}; | |
scale.interpolate = function(x) { | |
if (!arguments.length) return interpolate; | |
interpolate = x; | |
return rescale(); | |
}; | |
scale.ticks = function(m) { | |
return d3_scale_linearTicks(domain, m); | |
}; | |
scale.tickFormat = function(m, format) { | |
return d3_scale_linearTickFormat(domain, m, format); | |
}; | |
scale.nice = function(m) { | |
d3_scale_linearNice(domain, m); | |
return rescale(); | |
}; | |
scale.copy = function() { | |
return d3_scale_linear(domain, range, interpolate, clamp); | |
}; | |
return rescale(); | |
} | |
function d3_scale_linearRebind(scale, linear) { | |
return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp"); | |
} | |
function d3_scale_linearNice(domain, m) { | |
return d3_scale_nice(domain, d3_scale_niceStep(m ? d3_scale_linearTickRange(domain, m)[2] : d3_scale_linearNiceStep(domain))); | |
} | |
function d3_scale_linearNiceStep(domain) { | |
var extent = d3_scaleExtent(domain), span = extent[1] - extent[0]; | |
return Math.pow(10, Math.round(Math.log(span) / Math.LN10) - 1); | |
} | |
function d3_scale_linearTickRange(domain, m) { | |
var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step; | |
if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2; | |
extent[0] = Math.ceil(extent[0] / step) * step; | |
extent[1] = Math.floor(extent[1] / step) * step + step * .5; | |
extent[2] = step; | |
return extent; | |
} | |
function d3_scale_linearTicks(domain, m) { | |
return d3.range.apply(d3, d3_scale_linearTickRange(domain, m)); | |
} | |
function d3_scale_linearTickFormat(domain, m, format) { | |
var precision = -Math.floor(Math.log(d3_scale_linearTickRange(domain, m)[2]) / Math.LN10 + .01); | |
return d3.format(format ? format.replace(d3_format_re, function(a, b, c, d, e, f, g, h, i, j) { | |
return [ b, c, d, e, f, g, h, i || "." + (precision - (j === "%") * 2), j ].join(""); | |
}) : ",." + precision + "f"); | |
} | |
d3.scale.log = function() { | |
return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]); | |
}; | |
function d3_scale_log(linear, base, positive, domain) { | |
function log(x) { | |
return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base); | |
} | |
function pow(x) { | |
return positive ? Math.pow(base, x) : -Math.pow(base, -x); | |
} | |
function scale(x) { | |
return linear(log(x)); | |
} | |
scale.invert = function(x) { | |
return pow(linear.invert(x)); | |
}; | |
scale.domain = function(x) { | |
if (!arguments.length) return domain; | |
positive = x[0] >= 0; | |
linear.domain((domain = x.map(Number)).map(log)); | |
return scale; | |
}; | |
scale.base = function(_) { | |
if (!arguments.length) return base; | |
base = +_; | |
linear.domain(domain.map(log)); | |
return scale; | |
}; | |
scale.nice = function() { | |
var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative); | |
linear.domain(niced); | |
domain = niced.map(pow); | |
return scale; | |
}; | |
scale.ticks = function() { | |
var extent = d3_scaleExtent(domain), ticks = []; | |
if (extent.every(isFinite)) { | |
var u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base; | |
if (positive) { | |
for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k); | |
ticks.push(pow(i)); | |
} else { | |
ticks.push(pow(i)); | |
for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k); | |
} | |
for (i = 0; ticks[i] < u; i++) {} | |
for (j = ticks.length; ticks[j - 1] > v; j--) {} | |
ticks = ticks.slice(i, j); | |
} | |
return ticks; | |
}; | |
scale.tickFormat = function(n, format) { | |
if (!arguments.length) return d3_scale_logFormat; | |
if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format); | |
var k = Math.max(.1, n / scale.ticks().length), f = positive ? (e = 1e-12, Math.ceil) : (e = -1e-12, | |
Math.floor), e; | |
return function(d) { | |
return d / pow(f(log(d) + e)) <= k ? format(d) : ""; | |
}; | |
}; | |
scale.copy = function() { | |
return d3_scale_log(linear.copy(), base, positive, domain); | |
}; | |
return d3_scale_linearRebind(scale, linear); | |
} | |
var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = { | |
floor: function(x) { | |
return -Math.ceil(-x); | |
}, | |
ceil: function(x) { | |
return -Math.floor(-x); | |
} | |
}; | |
d3.scale.pow = function() { | |
return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]); | |
}; | |
function d3_scale_pow(linear, exponent, domain) { | |
var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent); | |
function scale(x) { | |
return linear(powp(x)); | |
} | |
scale.invert = function(x) { | |
return powb(linear.invert(x)); | |
}; | |
scale.domain = function(x) { | |
if (!arguments.length) return domain; | |
linear.domain((domain = x.map(Number)).map(powp)); | |
return scale; | |
}; | |
scale.ticks = function(m) { | |
return d3_scale_linearTicks(domain, m); | |
}; | |
scale.tickFormat = function(m, format) { | |
return d3_scale_linearTickFormat(domain, m, format); | |
}; | |
scale.nice = function(m) { | |
return scale.domain(d3_scale_linearNice(domain, m)); | |
}; | |
scale.exponent = function(x) { | |
if (!arguments.length) return exponent; | |
powp = d3_scale_powPow(exponent = x); | |
powb = d3_scale_powPow(1 / exponent); | |
linear.domain(domain.map(powp)); | |
return scale; | |
}; | |
scale.copy = function() { | |
return d3_scale_pow(linear.copy(), exponent, domain); | |
}; | |
return d3_scale_linearRebind(scale, linear); | |
} | |
function d3_scale_powPow(e) { | |
return function(x) { | |
return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e); | |
}; | |
} | |
d3.scale.sqrt = function() { | |
return d3.scale.pow().exponent(.5); | |
}; | |
d3.scale.ordinal = function() { | |
return d3_scale_ordinal([], { | |
t: "range", | |
a: [ [] ] | |
}); | |
}; | |
function d3_scale_ordinal(domain, ranger) { | |
var index, range, rangeBand; | |
function scale(x) { | |
return range[((index.get(x) || index.set(x, domain.push(x))) - 1) % range.length]; | |
} | |
function steps(start, step) { | |
return d3.range(domain.length).map(function(i) { | |
return start + step * i; | |
}); | |
} | |
scale.domain = function(x) { | |
if (!arguments.length) return domain; | |
domain = []; | |
index = new d3_Map(); | |
var i = -1, n = x.length, xi; | |
while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi)); | |
return scale[ranger.t].apply(scale, ranger.a); | |
}; | |
scale.range = function(x) { | |
if (!arguments.length) return range; | |
range = x; | |
rangeBand = 0; | |
ranger = { | |
t: "range", | |
a: arguments | |
}; | |
return scale; | |
}; | |
scale.rangePoints = function(x, padding) { | |
if (arguments.length < 2) padding = 0; | |
var start = x[0], stop = x[1], step = (stop - start) / (Math.max(1, domain.length - 1) + padding); | |
range = steps(domain.length < 2 ? (start + stop) / 2 : start + step * padding / 2, step); | |
rangeBand = 0; | |
ranger = { | |
t: "rangePoints", | |
a: arguments | |
}; | |
return scale; | |
}; | |
scale.rangeBands = function(x, padding, outerPadding) { | |
if (arguments.length < 2) padding = 0; | |
if (arguments.length < 3) outerPadding = padding; | |
var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding); | |
range = steps(start + step * outerPadding, step); | |
if (reverse) range.reverse(); | |
rangeBand = step * (1 - padding); | |
ranger = { | |
t: "rangeBands", | |
a: arguments | |
}; | |
return scale; | |
}; | |
scale.rangeRoundBands = function(x, padding, outerPadding) { | |
if (arguments.length < 2) padding = 0; | |
if (arguments.length < 3) outerPadding = padding; | |
var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding)), error = stop - start - (domain.length - padding) * step; | |
range = steps(start + Math.round(error / 2), step); | |
if (reverse) range.reverse(); | |
rangeBand = Math.round(step * (1 - padding)); | |
ranger = { | |
t: "rangeRoundBands", | |
a: arguments | |
}; | |
return scale; | |
}; | |
scale.rangeBand = function() { | |
return rangeBand; | |
}; | |
scale.rangeExtent = function() { | |
return d3_scaleExtent(ranger.a[0]); | |
}; | |
scale.copy = function() { | |
return d3_scale_ordinal(domain, ranger); | |
}; | |
return scale.domain(domain); | |
} | |
d3.scale.category10 = function() { | |
return d3.scale.ordinal().range(d3_category10); | |
}; | |
d3.scale.category20 = function() { | |
return d3.scale.ordinal().range(d3_category20); | |
}; | |
d3.scale.category20b = function() { | |
return d3.scale.ordinal().range(d3_category20b); | |
}; | |
d3.scale.category20c = function() { | |
return d3.scale.ordinal().range(d3_category20c); | |
}; | |
var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString); | |
var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString); | |
var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString); | |
var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString); | |
d3.scale.quantile = function() { | |
return d3_scale_quantile([], []); | |
}; | |
function d3_scale_quantile(domain, range) { | |
var thresholds; | |
function rescale() { | |
var k = 0, q = range.length; | |
thresholds = []; | |
while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q); | |
return scale; | |
} | |
function scale(x) { | |
if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)]; | |
} | |
scale.domain = function(x) { | |
if (!arguments.length) return domain; | |
domain = x.filter(function(d) { | |
return !isNaN(d); | |
}).sort(d3.ascending); | |
return rescale(); | |
}; | |
scale.range = function(x) { | |
if (!arguments.length) return range; | |
range = x; | |
return rescale(); | |
}; | |
scale.quantiles = function() { | |
return thresholds; | |
}; | |
scale.invertExtent = function(y) { | |
y = range.indexOf(y); | |
return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ]; | |
}; | |
scale.copy = function() { | |
return d3_scale_quantile(domain, range); | |
}; | |
return rescale(); | |
} | |
d3.scale.quantize = function() { | |
return d3_scale_quantize(0, 1, [ 0, 1 ]); | |
}; | |
function d3_scale_quantize(x0, x1, range) { | |
var kx, i; | |
function scale(x) { | |
return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))]; | |
} | |
function rescale() { | |
kx = range.length / (x1 - x0); | |
i = range.length - 1; | |
return scale; | |
} | |
scale.domain = function(x) { | |
if (!arguments.length) return [ x0, x1 ]; | |
x0 = +x[0]; | |
x1 = +x[x.length - 1]; | |
return rescale(); | |
}; | |
scale.range = function(x) { | |
if (!arguments.length) return range; | |
range = x; | |
return rescale(); | |
}; | |
scale.invertExtent = function(y) { | |
y = range.indexOf(y); | |
y = y < 0 ? NaN : y / kx + x0; | |
return [ y, y + 1 / kx ]; | |
}; | |
scale.copy = function() { | |
return d3_scale_quantize(x0, x1, range); | |
}; | |
return rescale(); | |
} | |
d3.scale.threshold = function() { | |
return d3_scale_threshold([ .5 ], [ 0, 1 ]); | |
}; | |
function d3_scale_threshold(domain, range) { | |
function scale(x) { | |
if (x <= x) return range[d3.bisect(domain, x)]; | |
} | |
scale.domain = function(_) { | |
if (!arguments.length) return domain; | |
domain = _; | |
return scale; | |
}; | |
scale.range = function(_) { | |
if (!arguments.length) return range; | |
range = _; | |
return scale; | |
}; | |
scale.invertExtent = function(y) { | |
y = range.indexOf(y); | |
return [ domain[y - 1], domain[y] ]; | |
}; | |
scale.copy = function() { | |
return d3_scale_threshold(domain, range); | |
}; | |
return scale; | |
} | |
d3.scale.identity = function() { | |
return d3_scale_identity([ 0, 1 ]); | |
}; | |
function d3_scale_identity(domain) { | |
function identity(x) { | |
return +x; | |
} | |
identity.invert = identity; | |
identity.domain = identity.range = function(x) { | |
if (!arguments.length) return domain; | |
domain = x.map(identity); | |
return identity; | |
}; | |
identity.ticks = function(m) { | |
return d3_scale_linearTicks(domain, m); | |
}; | |
identity.tickFormat = function(m, format) { | |
return d3_scale_linearTickFormat(domain, m, format); | |
}; | |
identity.copy = function() { | |
return d3_scale_identity(domain); | |
}; | |
return identity; | |
} | |
d3.svg.arc = function() { | |
var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle; | |
function arc() { | |
var r0 = innerRadius.apply(this, arguments), r1 = outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) + d3_svg_arcOffset, a1 = endAngle.apply(this, arguments) + d3_svg_arcOffset, da = (a1 < a0 && (da = a0, | |
a0 = a1, a1 = da), a1 - a0), df = da < π ? "0" : "1", c0 = Math.cos(a0), s0 = Math.sin(a0), c1 = Math.cos(a1), s1 = Math.sin(a1); | |
return da >= d3_svg_arcMax ? r0 ? "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "M0," + r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + -r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + r0 + "Z" : "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "Z" : r0 ? "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L" + r0 * c1 + "," + r0 * s1 + "A" + r0 + "," + r0 + " 0 " + df + ",0 " + r0 * c0 + "," + r0 * s0 + "Z" : "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L0,0" + "Z"; | |
} | |
arc.innerRadius = function(v) { | |
if (!arguments.length) return innerRadius; | |
innerRadius = d3_functor(v); | |
return arc; | |
}; | |
arc.outerRadius = function(v) { | |
if (!arguments.length) return outerRadius; | |
outerRadius = d3_functor(v); | |
return arc; | |
}; | |
arc.startAngle = function(v) { | |
if (!arguments.length) return startAngle; | |
startAngle = d3_functor(v); | |
return arc; | |
}; | |
arc.endAngle = function(v) { | |
if (!arguments.length) return endAngle; | |
endAngle = d3_functor(v); | |
return arc; | |
}; | |
arc.centroid = function() { | |
var r = (innerRadius.apply(this, arguments) + outerRadius.apply(this, arguments)) / 2, a = (startAngle.apply(this, arguments) + endAngle.apply(this, arguments)) / 2 + d3_svg_arcOffset; | |
return [ Math.cos(a) * r, Math.sin(a) * r ]; | |
}; | |
return arc; | |
}; | |
var d3_svg_arcOffset = -π / 2, d3_svg_arcMax = 2 * π - 1e-6; | |
function d3_svg_arcInnerRadius(d) { | |
return d.innerRadius; | |
} | |
function d3_svg_arcOuterRadius(d) { | |
return d.outerRadius; | |
} | |
function d3_svg_arcStartAngle(d) { | |
return d.startAngle; | |
} | |
function d3_svg_arcEndAngle(d) { | |
return d.endAngle; | |
} | |
d3.svg.line.radial = function() { | |
var line = d3_svg_line(d3_svg_lineRadial); | |
line.radius = line.x, delete line.x; | |
line.angle = line.y, delete line.y; | |
return line; | |
}; | |
function d3_svg_lineRadial(points) { | |
var point, i = -1, n = points.length, r, a; | |
while (++i < n) { | |
point = points[i]; | |
r = point[0]; | |
a = point[1] + d3_svg_arcOffset; | |
point[0] = r * Math.cos(a); | |
point[1] = r * Math.sin(a); | |
} | |
return points; | |
} | |
function d3_svg_area(projection) { | |
var x0 = d3_svg_lineX, x1 = d3_svg_lineX, y0 = 0, y1 = d3_svg_lineY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7; | |
function area(data) { | |
var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() { | |
return x; | |
} : d3_functor(x1), fy1 = y0 === y1 ? function() { | |
return y; | |
} : d3_functor(y1), x, y; | |
function segment() { | |
segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z"); | |
} | |
while (++i < n) { | |
if (defined.call(this, d = data[i], i)) { | |
points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]); | |
points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]); | |
} else if (points0.length) { | |
segment(); | |
points0 = []; | |
points1 = []; | |
} | |
} | |
if (points0.length) segment(); | |
return segments.length ? segments.join("") : null; | |
} | |
area.x = function(_) { | |
if (!arguments.length) return x1; | |
x0 = x1 = _; | |
return area; | |
}; | |
area.x0 = function(_) { | |
if (!arguments.length) return x0; | |
x0 = _; | |
return area; | |
}; | |
area.x1 = function(_) { | |
if (!arguments.length) return x1; | |
x1 = _; | |
return area; | |
}; | |
area.y = function(_) { | |
if (!arguments.length) return y1; | |
y0 = y1 = _; | |
return area; | |
}; | |
area.y0 = function(_) { | |
if (!arguments.length) return y0; | |
y0 = _; | |
return area; | |
}; | |
area.y1 = function(_) { | |
if (!arguments.length) return y1; | |
y1 = _; | |
return area; | |
}; | |
area.defined = function(_) { | |
if (!arguments.length) return defined; | |
defined = _; | |
return area; | |
}; | |
area.interpolate = function(_) { | |
if (!arguments.length) return interpolateKey; | |
if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; | |
interpolateReverse = interpolate.reverse || interpolate; | |
L = interpolate.closed ? "M" : "L"; | |
return area; | |
}; | |
area.tension = function(_) { | |
if (!arguments.length) return tension; | |
tension = _; | |
return area; | |
}; | |
return area; | |
} | |
d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter; | |
d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore; | |
d3.svg.area = function() { | |
return d3_svg_area(d3_identity); | |
}; | |
d3.svg.area.radial = function() { | |
var area = d3_svg_area(d3_svg_lineRadial); | |
area.radius = area.x, delete area.x; | |
area.innerRadius = area.x0, delete area.x0; | |
area.outerRadius = area.x1, delete area.x1; | |
area.angle = area.y, delete area.y; | |
area.startAngle = area.y0, delete area.y0; | |
area.endAngle = area.y1, delete area.y1; | |
return area; | |
}; | |
d3.svg.chord = function() { | |
var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle; | |
function chord(d, i) { | |
var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i); | |
return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z"; | |
} | |
function subgroup(self, f, d, i) { | |
var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) + d3_svg_arcOffset, a1 = endAngle.call(self, subgroup, i) + d3_svg_arcOffset; | |
return { | |
r: r, | |
a0: a0, | |
a1: a1, | |
p0: [ r * Math.cos(a0), r * Math.sin(a0) ], | |
p1: [ r * Math.cos(a1), r * Math.sin(a1) ] | |
}; | |
} | |
function equals(a, b) { | |
return a.a0 == b.a0 && a.a1 == b.a1; | |
} | |
function arc(r, p, a) { | |
return "A" + r + "," + r + " 0 " + +(a > π) + ",1 " + p; | |
} | |
function curve(r0, p0, r1, p1) { | |
return "Q 0,0 " + p1; | |
} | |
chord.radius = function(v) { | |
if (!arguments.length) return radius; | |
radius = d3_functor(v); | |
return chord; | |
}; | |
chord.source = function(v) { | |
if (!arguments.length) return source; | |
source = d3_functor(v); | |
return chord; | |
}; | |
chord.target = function(v) { | |
if (!arguments.length) return target; | |
target = d3_functor(v); | |
return chord; | |
}; | |
chord.startAngle = function(v) { | |
if (!arguments.length) return startAngle; | |
startAngle = d3_functor(v); | |
return chord; | |
}; | |
chord.endAngle = function(v) { | |
if (!arguments.length) return endAngle; | |
endAngle = d3_functor(v); | |
return chord; | |
}; | |
return chord; | |
}; | |
function d3_svg_chordRadius(d) { | |
return d.radius; | |
} | |
d3.svg.diagonal = function() { | |
var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection; | |
function diagonal(d, i) { | |
var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, { | |
x: p0.x, | |
y: m | |
}, { | |
x: p3.x, | |
y: m | |
}, p3 ]; | |
p = p.map(projection); | |
return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3]; | |
} | |
diagonal.source = function(x) { | |
if (!arguments.length) return source; | |
source = d3_functor(x); | |
return diagonal; | |
}; | |
diagonal.target = function(x) { | |
if (!arguments.length) return target; | |
target = d3_functor(x); | |
return diagonal; | |
}; | |
diagonal.projection = function(x) { | |
if (!arguments.length) return projection; | |
projection = x; | |
return diagonal; | |
}; | |
return diagonal; | |
}; | |
function d3_svg_diagonalProjection(d) { | |
return [ d.x, d.y ]; | |
} | |
d3.svg.diagonal.radial = function() { | |
var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection; | |
diagonal.projection = function(x) { | |
return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection; | |
}; | |
return diagonal; | |
}; | |
function d3_svg_diagonalRadialProjection(projection) { | |
return function() { | |
var d = projection.apply(this, arguments), r = d[0], a = d[1] + d3_svg_arcOffset; | |
return [ r * Math.cos(a), r * Math.sin(a) ]; | |
}; | |
} | |
d3.svg.symbol = function() { | |
var type = d3_svg_symbolType, size = d3_svg_symbolSize; | |
function symbol(d, i) { | |
return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i)); | |
} | |
symbol.type = function(x) { | |
if (!arguments.length) return type; | |
type = d3_functor(x); | |
return symbol; | |
}; | |
symbol.size = function(x) { | |
if (!arguments.length) return size; | |
size = d3_functor(x); | |
return symbol; | |
}; | |
return symbol; | |
}; | |
function d3_svg_symbolSize() { | |
return 64; | |
} | |
function d3_svg_symbolType() { | |
return "circle"; | |
} | |
function d3_svg_symbolCircle(size) { | |
var r = Math.sqrt(size / π); | |
return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z"; | |
} | |
var d3_svg_symbols = d3.map({ | |
circle: d3_svg_symbolCircle, | |
cross: function(size) { | |
var r = Math.sqrt(size / 5) / 2; | |
return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z"; | |
}, | |
diamond: function(size) { | |
var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30; | |
return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z"; | |
}, | |
square: function(size) { | |
var r = Math.sqrt(size) / 2; | |
return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z"; | |
}, | |
"triangle-down": function(size) { | |
var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; | |
return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z"; | |
}, | |
"triangle-up": function(size) { | |
var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; | |
return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z"; | |
} | |
}); | |
d3.svg.symbolTypes = d3_svg_symbols.keys(); | |
var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians); | |
function d3_transition(groups, id) { | |
d3_subclass(groups, d3_transitionPrototype); | |
groups.id = id; | |
return groups; | |
} | |
var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit; | |
d3_transitionPrototype.call = d3_selectionPrototype.call; | |
d3_transitionPrototype.empty = d3_selectionPrototype.empty; | |
d3_transitionPrototype.node = d3_selectionPrototype.node; | |
d3_transitionPrototype.size = d3_selectionPrototype.size; | |
d3.transition = function(selection) { | |
return arguments.length ? d3_transitionInheritId ? selection.transition() : selection : d3_selectionRoot.transition(); | |
}; | |
d3.transition.prototype = d3_transitionPrototype; | |
d3_transitionPrototype.select = function(selector) { | |
var id = this.id, subgroups = [], subgroup, subnode, node; | |
selector = d3_selection_selector(selector); | |
for (var j = -1, m = this.length; ++j < m; ) { | |
subgroups.push(subgroup = []); | |
for (var group = this[j], i = -1, n = group.length; ++i < n; ) { | |
if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) { | |
if ("__data__" in node) subnode.__data__ = node.__data__; | |
d3_transitionNode(subnode, i, id, node.__transition__[id]); | |
subgroup.push(subnode); | |
} else { | |
subgroup.push(null); | |
} | |
} | |
} | |
return d3_transition(subgroups, id); | |
}; | |
d3_transitionPrototype.selectAll = function(selector) { | |
var id = this.id, subgroups = [], subgroup, subnodes, node, subnode, transition; | |
selector = d3_selection_selectorAll(selector); | |
for (var j = -1, m = this.length; ++j < m; ) { | |
for (var group = this[j], i = -1, n = group.length; ++i < n; ) { | |
if (node = group[i]) { | |
transition = node.__transition__[id]; | |
subnodes = selector.call(node, node.__data__, i, j); | |
subgroups.push(subgroup = []); | |
for (var k = -1, o = subnodes.length; ++k < o; ) { | |
if (subnode = subnodes[k]) d3_transitionNode(subnode, k, id, transition); | |
subgroup.push(subnode); | |
} | |
} | |
} | |
} | |
return d3_transition(subgroups, id); | |
}; | |
d3_transitionPrototype.filter = function(filter) { | |
var subgroups = [], subgroup, group, node; | |
if (typeof filter !== "function") filter = d3_selection_filter(filter); | |
for (var j = 0, m = this.length; j < m; j++) { | |
subgroups.push(subgroup = []); | |
for (var group = this[j], i = 0, n = group.length; i < n; i++) { | |
if ((node = group[i]) && filter.call(node, node.__data__, i)) { | |
subgroup.push(node); | |
} | |
} | |
} | |
return d3_transition(subgroups, this.id); | |
}; | |
d3_transitionPrototype.tween = function(name, tween) { | |
var id = this.id; | |
if (arguments.length < 2) return this.node().__transition__[id].tween.get(name); | |
return d3_selection_each(this, tween == null ? function(node) { | |
node.__transition__[id].tween.remove(name); | |
} : function(node) { | |
node.__transition__[id].tween.set(name, tween); | |
}); | |
}; | |
function d3_transition_tween(groups, name, value, tween) { | |
var id = groups.id; | |
return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) { | |
node.__transition__[id].tween.set(name, tween(value.call(node, node.__data__, i, j))); | |
} : (value = tween(value), function(node) { | |
node.__transition__[id].tween.set(name, value); | |
})); | |
} | |
d3_transitionPrototype.attr = function(nameNS, value) { | |
if (arguments.length < 2) { | |
for (value in nameNS) this.attr(value, nameNS[value]); | |
return this; | |
} | |
var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS); | |
function attrNull() { | |
this.removeAttribute(name); | |
} | |
function attrNullNS() { | |
this.removeAttributeNS(name.space, name.local); | |
} | |
function attrTween(b) { | |
return b == null ? attrNull : (b += "", function() { | |
var a = this.getAttribute(name), i; | |
return a !== b && (i = interpolate(a, b), function(t) { | |
this.setAttribute(name, i(t)); | |
}); | |
}); | |
} | |
function attrTweenNS(b) { | |
return b == null ? attrNullNS : (b += "", function() { | |
var a = this.getAttributeNS(name.space, name.local), i; | |
return a !== b && (i = interpolate(a, b), function(t) { | |
this.setAttributeNS(name.space, name.local, i(t)); | |
}); | |
}); | |
} | |
return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween); | |
}; | |
d3_transitionPrototype.attrTween = function(nameNS, tween) { | |
var name = d3.ns.qualify(nameNS); | |
function attrTween(d, i) { | |
var f = tween.call(this, d, i, this.getAttribute(name)); | |
return f && function(t) { | |
this.setAttribute(name, f(t)); | |
}; | |
} | |
function attrTweenNS(d, i) { | |
var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local)); | |
return f && function(t) { | |
this.setAttributeNS(name.space, name.local, f(t)); | |
}; | |
} | |
return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween); | |
}; | |
d3_transitionPrototype.style = function(name, value, priority) { | |
var n = arguments.length; | |
if (n < 3) { | |
if (typeof name !== "string") { | |
if (n < 2) value = ""; | |
for (priority in name) this.style(priority, name[priority], value); | |
return this; | |
} | |
priority = ""; | |
} | |
function styleNull() { | |
this.style.removeProperty(name); | |
} | |
function styleString(b) { | |
return b == null ? styleNull : (b += "", function() { | |
var a = d3_window.getComputedStyle(this, null).getPropertyValue(name), i; | |
return a !== b && (i = d3_interpolate(a, b), function(t) { | |
this.style.setProperty(name, i(t), priority); | |
}); | |
}); | |
} | |
return d3_transition_tween(this, "style." + name, value, styleString); | |
}; | |
d3_transitionPrototype.styleTween = function(name, tween, priority) { | |
if (arguments.length < 3) priority = ""; | |
function styleTween(d, i) { | |
var f = tween.call(this, d, i, d3_window.getComputedStyle(this, null).getPropertyValue(name)); | |
return f && function(t) { | |
this.style.setProperty(name, f(t), priority); | |
}; | |
} | |
return this.tween("style." + name, styleTween); | |
}; | |
d3_transitionPrototype.text = function(value) { | |
return d3_transition_tween(this, "text", value, d3_transition_text); | |
}; | |
function d3_transition_text(b) { | |
if (b == null) b = ""; | |
return function() { | |
this.textContent = b; | |
}; | |
} | |
d3_transitionPrototype.remove = function() { | |
return this.each("end.transition", function() { | |
var p; | |
if (!this.__transition__ && (p = this.parentNode)) p.removeChild(this); | |
}); | |
}; | |
d3_transitionPrototype.ease = function(value) { | |
var id = this.id; | |
if (arguments.length < 1) return this.node().__transition__[id].ease; | |
if (typeof value !== "function") value = d3.ease.apply(d3, arguments); | |
return d3_selection_each(this, function(node) { | |
node.__transition__[id].ease = value; | |
}); | |
}; | |
d3_transitionPrototype.delay = function(value) { | |
var id = this.id; | |
return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { | |
node.__transition__[id].delay = value.call(node, node.__data__, i, j) | 0; | |
} : (value |= 0, function(node) { | |
node.__transition__[id].delay = value; | |
})); | |
}; | |
d3_transitionPrototype.duration = function(value) { | |
var id = this.id; | |
return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { | |
node.__transition__[id].duration = Math.max(1, value.call(node, node.__data__, i, j) | 0); | |
} : (value = Math.max(1, value | 0), function(node) { | |
node.__transition__[id].duration = value; | |
})); | |
}; | |
d3_transitionPrototype.each = function(type, listener) { | |
var id = this.id; | |
if (arguments.length < 2) { | |
var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId; | |
d3_transitionInheritId = id; | |
d3_selection_each(this, function(node, i, j) { | |
d3_transitionInherit = node.__transition__[id]; | |
type.call(node, node.__data__, i, j); | |
}); | |
d3_transitionInherit = inherit; | |
d3_transitionInheritId = inheritId; | |
} else { | |
d3_selection_each(this, function(node) { | |
var transition = node.__transition__[id]; | |
(transition.event || (transition.event = d3.dispatch("start", "end"))).on(type, listener); | |
}); | |
} | |
return this; | |
}; | |
d3_transitionPrototype.transition = function() { | |
var id0 = this.id, id1 = ++d3_transitionId, subgroups = [], subgroup, group, node, transition; | |
for (var j = 0, m = this.length; j < m; j++) { | |
subgroups.push(subgroup = []); | |
for (var group = this[j], i = 0, n = group.length; i < n; i++) { | |
if (node = group[i]) { | |
transition = Object.create(node.__transition__[id0]); | |
transition.delay += transition.duration; | |
d3_transitionNode(node, i, id1, transition); | |
} | |
subgroup.push(node); | |
} | |
} | |
return d3_transition(subgroups, id1); | |
}; | |
function d3_transitionNode(node, i, id, inherit) { | |
var lock = node.__transition__ || (node.__transition__ = { | |
active: 0, | |
count: 0 | |
}), transition = lock[id]; | |
if (!transition) { | |
var time = inherit.time; | |
transition = lock[id] = { | |
tween: new d3_Map(), | |
time: time, | |
ease: inherit.ease, | |
delay: inherit.delay, | |
duration: inherit.duration | |
}; | |
++lock.count; | |
d3.timer(function(elapsed) { | |
var d = node.__data__, ease = transition.ease, delay = transition.delay, duration = transition.duration, tweened = []; | |
if (delay <= elapsed) return start(elapsed); | |
d3_timer_replace(start, delay, time); | |
function start(elapsed) { | |
if (lock.active > id) return stop(); | |
lock.active = id; | |
transition.event && transition.event.start.call(node, d, i); | |
transition.tween.forEach(function(key, value) { | |
if (value = value.call(node, d, i)) { | |
tweened.push(value); | |
} | |
}); | |
if (tick(elapsed)) return 1; | |
d3_timer_replace(tick, 0, time); | |
} | |
function tick(elapsed) { | |
if (lock.active !== id) return stop(); | |
var t = (elapsed - delay) / duration, e = ease(t), n = tweened.length; | |
while (n > 0) { | |
tweened[--n].call(node, e); | |
} | |
if (t >= 1) { | |
stop(); | |
transition.event && transition.event.end.call(node, d, i); | |
return 1; | |
} | |
} | |
function stop() { | |
if (--lock.count) delete lock[id]; else delete node.__transition__; | |
return 1; | |
} | |
}, 0, time); | |
} | |
} | |
d3.svg.axis = function() { | |
var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, tickMajorSize = 6, tickMinorSize = 6, tickEndSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_, tickSubdivide = 0; | |
function axis(g) { | |
g.each(function() { | |
var g = d3.select(this); | |
var ticks = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments_) : scale.domain() : tickValues, tickFormat = tickFormat_ == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments_) : String : tickFormat_; | |
var subticks = d3_svg_axisSubdivide(scale, ticks, tickSubdivide), subtick = g.selectAll(".tick.minor").data(subticks, String), subtickEnter = subtick.enter().insert("line", ".tick").attr("class", "tick minor").style("opacity", 1e-6), subtickExit = d3.transition(subtick.exit()).style("opacity", 1e-6).remove(), subtickUpdate = d3.transition(subtick).style("opacity", 1); | |
var tick = g.selectAll(".tick.major").data(ticks, String), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick major").style("opacity", 1e-6), tickExit = d3.transition(tick.exit()).style("opacity", 1e-6).remove(), tickUpdate = d3.transition(tick).style("opacity", 1), tickTransform; | |
var range = d3_scaleRange(scale), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"), | |
d3.transition(path)); | |
var scale1 = scale.copy(), scale0 = this.__chart__ || scale1; | |
this.__chart__ = scale1; | |
tickEnter.append("line"); | |
tickEnter.append("text"); | |
var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text"); | |
switch (orient) { | |
case "bottom": | |
{ | |
tickTransform = d3_svg_axisX; | |
subtickEnter.attr("y2", tickMinorSize); | |
subtickUpdate.attr("x2", 0).attr("y2", tickMinorSize); | |
lineEnter.attr("y2", tickMajorSize); | |
textEnter.attr("y", Math.max(tickMajorSize, 0) + tickPadding); | |
lineUpdate.attr("x2", 0).attr("y2", tickMajorSize); | |
textUpdate.attr("x", 0).attr("y", Math.max(tickMajorSize, 0) + tickPadding); | |
text.attr("dy", ".71em").style("text-anchor", "middle"); | |
pathUpdate.attr("d", "M" + range[0] + "," + tickEndSize + "V0H" + range[1] + "V" + tickEndSize); | |
break; | |
} | |
case "top": | |
{ | |
tickTransform = d3_svg_axisX; | |
subtickEnter.attr("y2", -tickMinorSize); | |
subtickUpdate.attr("x2", 0).attr("y2", -tickMinorSize); | |
lineEnter.attr("y2", -tickMajorSize); | |
textEnter.attr("y", -(Math.max(tickMajorSize, 0) + tickPadding)); | |
lineUpdate.attr("x2", 0).attr("y2", -tickMajorSize); | |
textUpdate.attr("x", 0).attr("y", -(Math.max(tickMajorSize, 0) + tickPadding)); | |
text.attr("dy", "0em").style("text-anchor", "middle"); | |
pathUpdate.attr("d", "M" + range[0] + "," + -tickEndSize + "V0H" + range[1] + "V" + -tickEndSize); | |
break; | |
} | |
case "left": | |
{ | |
tickTransform = d3_svg_axisY; | |
subtickEnter.attr("x2", -tickMinorSize); | |
subtickUpdate.attr("x2", -tickMinorSize).attr("y2", 0); | |
lineEnter.attr("x2", -tickMajorSize); | |
textEnter.attr("x", -(Math.max(tickMajorSize, 0) + tickPadding)); | |
lineUpdate.attr("x2", -tickMajorSize).attr("y2", 0); | |
textUpdate.attr("x", -(Math.max(tickMajorSize, 0) + tickPadding)).attr("y", 0); | |
text.attr("dy", ".32em").style("text-anchor", "end"); | |
pathUpdate.attr("d", "M" + -tickEndSize + "," + range[0] + "H0V" + range[1] + "H" + -tickEndSize); | |
break; | |
} | |
case "right": | |
{ | |
tickTransform = d3_svg_axisY; | |
subtickEnter.attr("x2", tickMinorSize); | |
subtickUpdate.attr("x2", tickMinorSize).attr("y2", 0); | |
lineEnter.attr("x2", tickMajorSize); | |
textEnter.attr("x", Math.max(tickMajorSize, 0) + tickPadding); | |
lineUpdate.attr("x2", tickMajorSize).attr("y2", 0); | |
textUpdate.attr("x", Math.max(tickMajorSize, 0) + tickPadding).attr("y", 0); | |
text.attr("dy", ".32em").style("text-anchor", "start"); | |
pathUpdate.attr("d", "M" + tickEndSize + "," + range[0] + "H0V" + range[1] + "H" + tickEndSize); | |
break; | |
} | |
} | |
if (scale.rangeBand) { | |
var dx = scale1.rangeBand() / 2, x = function(d) { | |
return scale1(d) + dx; | |
}; | |
tickEnter.call(tickTransform, x); | |
tickUpdate.call(tickTransform, x); | |
} else { | |
tickEnter.call(tickTransform, scale0); | |
tickUpdate.call(tickTransform, scale1); | |
tickExit.call(tickTransform, scale1); | |
subtickEnter.call(tickTransform, scale0); | |
subtickUpdate.call(tickTransform, scale1); | |
subtickExit.call(tickTransform, scale1); | |
} | |
}); | |
} | |
axis.scale = function(x) { | |
if (!arguments.length) return scale; | |
scale = x; | |
return axis; | |
}; | |
axis.orient = function(x) { | |
if (!arguments.length) return orient; | |
orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient; | |
return axis; | |
}; | |
axis.ticks = function() { | |
if (!arguments.length) return tickArguments_; | |
tickArguments_ = arguments; | |
return axis; | |
}; | |
axis.tickValues = function(x) { | |
if (!arguments.length) return tickValues; | |
tickValues = x; | |
return axis; | |
}; | |
axis.tickFormat = function(x) { | |
if (!arguments.length) return tickFormat_; | |
tickFormat_ = x; | |
return axis; | |
}; | |
axis.tickSize = function(x, y) { | |
if (!arguments.length) return tickMajorSize; | |
var n = arguments.length - 1; | |
tickMajorSize = +x; | |
tickMinorSize = n > 1 ? +y : tickMajorSize; | |
tickEndSize = n > 0 ? +arguments[n] : tickMajorSize; | |
return axis; | |
}; | |
axis.tickPadding = function(x) { | |
if (!arguments.length) return tickPadding; | |
tickPadding = +x; | |
return axis; | |
}; | |
axis.tickSubdivide = function(x) { | |
if (!arguments.length) return tickSubdivide; | |
tickSubdivide = +x; | |
return axis; | |
}; | |
return axis; | |
}; | |
var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = { | |
top: 1, | |
right: 1, | |
bottom: 1, | |
left: 1 | |
}; | |
function d3_svg_axisX(selection, x) { | |
selection.attr("transform", function(d) { | |
return "translate(" + x(d) + ",0)"; | |
}); | |
} | |
function d3_svg_axisY(selection, y) { | |
selection.attr("transform", function(d) { | |
return "translate(0," + y(d) + ")"; | |
}); | |
} | |
function d3_svg_axisSubdivide(scale, ticks, m) { | |
subticks = []; | |
if (m && ticks.length > 1) { | |
var extent = d3_scaleExtent(scale.domain()), subticks, i = -1, n = ticks.length, d = (ticks[1] - ticks[0]) / ++m, j, v; | |
while (++i < n) { | |
for (j = m; --j > 0; ) { | |
if ((v = +ticks[i] - j * d) >= extent[0]) { | |
subticks.push(v); | |
} | |
} | |
} | |
for (--i, j = 0; ++j < m && (v = +ticks[i] + j * d) < extent[1]; ) { | |
subticks.push(v); | |
} | |
} | |
return subticks; | |
} | |
d3.svg.brush = function() { | |
var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, resizes = d3_svg_brushResizes[0], extent = [ [ 0, 0 ], [ 0, 0 ] ], clamp = [ true, true ], extentDomain; | |
function brush(g) { | |
g.each(function() { | |
var g = d3.select(this), bg = g.selectAll(".background").data([ 0 ]), fg = g.selectAll(".extent").data([ 0 ]), tz = g.selectAll(".resize").data(resizes, String), e; | |
g.style("pointer-events", "all").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart); | |
bg.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"); | |
fg.enter().append("rect").attr("class", "extent").style("cursor", "move"); | |
tz.enter().append("g").attr("class", function(d) { | |
return "resize " + d; | |
}).style("cursor", function(d) { | |
return d3_svg_brushCursor[d]; | |
}).append("rect").attr("x", function(d) { | |
return /[ew]$/.test(d) ? -3 : null; | |
}).attr("y", function(d) { | |
return /^[ns]/.test(d) ? -3 : null; | |
}).attr("width", 6).attr("height", 6).style("visibility", "hidden"); | |
tz.style("display", brush.empty() ? "none" : null); | |
tz.exit().remove(); | |
if (x) { | |
e = d3_scaleRange(x); | |
bg.attr("x", e[0]).attr("width", e[1] - e[0]); | |
redrawX(g); | |
} | |
if (y) { | |
e = d3_scaleRange(y); | |
bg.attr("y", e[0]).attr("height", e[1] - e[0]); | |
redrawY(g); | |
} | |
redraw(g); | |
}); | |
} | |
function redraw(g) { | |
g.selectAll(".resize").attr("transform", function(d) { | |
return "translate(" + extent[+/e$/.test(d)][0] + "," + extent[+/^s/.test(d)][1] + ")"; | |
}); | |
} | |
function redrawX(g) { | |
g.select(".extent").attr("x", extent[0][0]); | |
g.selectAll(".extent,.n>rect,.s>rect").attr("width", extent[1][0] - extent[0][0]); | |
} | |
function redrawY(g) { | |
g.select(".extent").attr("y", extent[0][1]); | |
g.selectAll(".extent,.e>rect,.w>rect").attr("height", extent[1][1] - extent[0][1]); | |
} | |
function brushstart() { | |
var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(), center, origin = mouse(), offset; | |
var w = d3.select(d3_window).on("keydown.brush", keydown).on("keyup.brush", keyup); | |
if (d3.event.changedTouches) { | |
w.on("touchmove.brush", brushmove).on("touchend.brush", brushend); | |
} else { | |
w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend); | |
} | |
if (dragging) { | |
origin[0] = extent[0][0] - origin[0]; | |
origin[1] = extent[0][1] - origin[1]; | |
} else if (resizing) { | |
var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing); | |
offset = [ extent[1 - ex][0] - origin[0], extent[1 - ey][1] - origin[1] ]; | |
origin[0] = extent[ex][0]; | |
origin[1] = extent[ey][1]; | |
} else if (d3.event.altKey) center = origin.slice(); | |
g.style("pointer-events", "none").selectAll(".resize").style("display", null); | |
d3.select("body").style("cursor", eventTarget.style("cursor")); | |
event_({ | |
type: "brushstart" | |
}); | |
brushmove(); | |
function mouse() { | |
var touches = d3.event.changedTouches; | |
return touches ? d3.touches(target, touches)[0] : d3.mouse(target); | |
} | |
function keydown() { | |
if (d3.event.keyCode == 32) { | |
if (!dragging) { | |
center = null; | |
origin[0] -= extent[1][0]; | |
origin[1] -= extent[1][1]; | |
dragging = 2; | |
} | |
d3_eventPreventDefault(); | |
} | |
} | |
function keyup() { | |
if (d3.event.keyCode == 32 && dragging == 2) { | |
origin[0] += extent[1][0]; | |
origin[1] += extent[1][1]; | |
dragging = 0; | |
d3_eventPreventDefault(); | |
} | |
} | |
function brushmove() { | |
var point = mouse(), moved = false; | |
if (offset) { | |
point[0] += offset[0]; | |
point[1] += offset[1]; | |
} | |
if (!dragging) { | |
if (d3.event.altKey) { | |
if (!center) center = [ (extent[0][0] + extent[1][0]) / 2, (extent[0][1] + extent[1][1]) / 2 ]; | |
origin[0] = extent[+(point[0] < center[0])][0]; | |
origin[1] = extent[+(point[1] < center[1])][1]; | |
} else center = null; | |
} | |
if (resizingX && move1(point, x, 0)) { | |
redrawX(g); | |
moved = true; | |
} | |
if (resizingY && move1(point, y, 1)) { | |
redrawY(g); | |
moved = true; | |
} | |
if (moved) { | |
redraw(g); | |
event_({ | |
type: "brush", | |
mode: dragging ? "move" : "resize" | |
}); | |
} | |
} | |
function move1(point, scale, i) { | |
var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], size = extent[1][i] - extent[0][i], min, max; | |
if (dragging) { | |
r0 -= position; | |
r1 -= size + position; | |
} | |
min = clamp[i] ? Math.max(r0, Math.min(r1, point[i])) : point[i]; | |
if (dragging) { | |
max = (min += position) + size; | |
} else { | |
if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min)); | |
if (position < min) { | |
max = min; | |
min = position; | |
} else { | |
max = position; | |
} | |
} | |
if (extent[0][i] !== min || extent[1][i] !== max) { | |
extentDomain = null; | |
extent[0][i] = min; | |
extent[1][i] = max; | |
return true; | |
} | |
} | |
function brushend() { | |
brushmove(); | |
g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null); | |
d3.select("body").style("cursor", null); | |
w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null); | |
dragRestore(); | |
event_({ | |
type: "brushend" | |
}); | |
} | |
} | |
brush.x = function(z) { | |
if (!arguments.length) return x; | |
x = z; | |
resizes = d3_svg_brushResizes[!x << 1 | !y]; | |
return brush; | |
}; | |
brush.y = function(z) { | |
if (!arguments.length) return y; | |
y = z; | |
resizes = d3_svg_brushResizes[!x << 1 | !y]; | |
return brush; | |
}; | |
brush.clamp = function(z) { | |
if (!arguments.length) return x && y ? clamp : x || y ? clamp[+!x] : null; | |
if (x && y) clamp = [ !!z[0], !!z[1] ]; else if (x || y) clamp[+!x] = !!z; | |
return brush; | |
}; | |
brush.extent = function(z) { | |
var x0, x1, y0, y1, t; | |
if (!arguments.length) { | |
z = extentDomain || extent; | |
if (x) { | |
x0 = z[0][0], x1 = z[1][0]; | |
if (!extentDomain) { | |
x0 = extent[0][0], x1 = extent[1][0]; | |
if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1); | |
if (x1 < x0) t = x0, x0 = x1, x1 = t; | |
} | |
} | |
if (y) { | |
y0 = z[0][1], y1 = z[1][1]; | |
if (!extentDomain) { | |
y0 = extent[0][1], y1 = extent[1][1]; | |
if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1); | |
if (y1 < y0) t = y0, y0 = y1, y1 = t; | |
} | |
} | |
return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ]; | |
} | |
extentDomain = [ [ 0, 0 ], [ 0, 0 ] ]; | |
if (x) { | |
x0 = z[0], x1 = z[1]; | |
if (y) x0 = x0[0], x1 = x1[0]; | |
extentDomain[0][0] = x0, extentDomain[1][0] = x1; | |
if (x.invert) x0 = x(x0), x1 = x(x1); | |
if (x1 < x0) t = x0, x0 = x1, x1 = t; | |
extent[0][0] = x0 | 0, extent[1][0] = x1 | 0; | |
} | |
if (y) { | |
y0 = z[0], y1 = z[1]; | |
if (x) y0 = y0[1], y1 = y1[1]; | |
extentDomain[0][1] = y0, extentDomain[1][1] = y1; | |
if (y.invert) y0 = y(y0), y1 = y(y1); | |
if (y1 < y0) t = y0, y0 = y1, y1 = t; | |
extent[0][1] = y0 | 0, extent[1][1] = y1 | 0; | |
} | |
return brush; | |
}; | |
brush.clear = function() { | |
extentDomain = null; | |
extent[0][0] = extent[0][1] = extent[1][0] = extent[1][1] = 0; | |
return brush; | |
}; | |
brush.empty = function() { | |
return x && extent[0][0] === extent[1][0] || y && extent[0][1] === extent[1][1]; | |
}; | |
return d3.rebind(brush, event, "on"); | |
}; | |
var d3_svg_brushCursor = { | |
n: "ns-resize", | |
e: "ew-resize", | |
s: "ns-resize", | |
w: "ew-resize", | |
nw: "nwse-resize", | |
ne: "nesw-resize", | |
se: "nwse-resize", | |
sw: "nesw-resize" | |
}; | |
var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ]; | |
d3.time = {}; | |
var d3_time = Date, d3_time_daySymbols = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ]; | |
function d3_time_utc() { | |
this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]); | |
} | |
d3_time_utc.prototype = { | |
getDate: function() { | |
return this._.getUTCDate(); | |
}, | |
getDay: function() { | |
return this._.getUTCDay(); | |
}, | |
getFullYear: function() { | |
return this._.getUTCFullYear(); | |
}, | |
getHours: function() { | |
return this._.getUTCHours(); | |
}, | |
getMilliseconds: function() { | |
return this._.getUTCMilliseconds(); | |
}, | |
getMinutes: function() { | |
return this._.getUTCMinutes(); | |
}, | |
getMonth: function() { | |
return this._.getUTCMonth(); | |
}, | |
getSeconds: function() { | |
return this._.getUTCSeconds(); | |
}, | |
getTime: function() { | |
return this._.getTime(); | |
}, | |
getTimezoneOffset: function() { | |
return 0; | |
}, | |
valueOf: function() { | |
return this._.valueOf(); | |
}, | |
setDate: function() { | |
d3_time_prototype.setUTCDate.apply(this._, arguments); | |
}, | |
setDay: function() { | |
d3_time_prototype.setUTCDay.apply(this._, arguments); | |
}, | |
setFullYear: function() { | |
d3_time_prototype.setUTCFullYear.apply(this._, arguments); | |
}, | |
setHours: function() { | |
d3_time_prototype.setUTCHours.apply(this._, arguments); | |
}, | |
setMilliseconds: function() { | |
d3_time_prototype.setUTCMilliseconds.apply(this._, arguments); | |
}, | |
setMinutes: function() { | |
d3_time_prototype.setUTCMinutes.apply(this._, arguments); | |
}, | |
setMonth: function() { | |
d3_time_prototype.setUTCMonth.apply(this._, arguments); | |
}, | |
setSeconds: function() { | |
d3_time_prototype.setUTCSeconds.apply(this._, arguments); | |
}, | |
setTime: function() { | |
d3_time_prototype.setTime.apply(this._, arguments); | |
} | |
}; | |
var d3_time_prototype = Date.prototype; | |
var d3_time_formatDateTime = "%a %b %e %X %Y", d3_time_formatDate = "%m/%d/%Y", d3_time_formatTime = "%H:%M:%S"; | |
var d3_time_days = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], d3_time_dayAbbreviations = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], d3_time_months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], d3_time_monthAbbreviations = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; | |
function d3_time_interval(local, step, number) { | |
function round(date) { | |
var d0 = local(date), d1 = offset(d0, 1); | |
return date - d0 < d1 - date ? d0 : d1; | |
} | |
function ceil(date) { | |
step(date = local(new d3_time(date - 1)), 1); | |
return date; | |
} | |
function offset(date, k) { | |
step(date = new d3_time(+date), k); | |
return date; | |
} | |
function range(t0, t1, dt) { | |
var time = ceil(t0), times = []; | |
if (dt > 1) { | |
while (time < t1) { | |
if (!(number(time) % dt)) times.push(new Date(+time)); | |
step(time, 1); | |
} | |
} else { | |
while (time < t1) times.push(new Date(+time)), step(time, 1); | |
} | |
return times; | |
} | |
function range_utc(t0, t1, dt) { | |
try { | |
d3_time = d3_time_utc; | |
var utc = new d3_time_utc(); | |
utc._ = t0; | |
return range(utc, t1, dt); | |
} finally { | |
d3_time = Date; | |
} | |
} | |
local.floor = local; | |
local.round = round; | |
local.ceil = ceil; | |
local.offset = offset; | |
local.range = range; | |
var utc = local.utc = d3_time_interval_utc(local); | |
utc.floor = utc; | |
utc.round = d3_time_interval_utc(round); | |
utc.ceil = d3_time_interval_utc(ceil); | |
utc.offset = d3_time_interval_utc(offset); | |
utc.range = range_utc; | |
return local; | |
} | |
function d3_time_interval_utc(method) { | |
return function(date, k) { | |
try { | |
d3_time = d3_time_utc; | |
var utc = new d3_time_utc(); | |
utc._ = date; | |
return method(utc, k)._; | |
} finally { | |
d3_time = Date; | |
} | |
}; | |
} | |
d3.time.year = d3_time_interval(function(date) { | |
date = d3.time.day(date); | |
date.setMonth(0, 1); | |
return date; | |
}, function(date, offset) { | |
date.setFullYear(date.getFullYear() + offset); | |
}, function(date) { | |
return date.getFullYear(); | |
}); | |
d3.time.years = d3.time.year.range; | |
d3.time.years.utc = d3.time.year.utc.range; | |
d3.time.day = d3_time_interval(function(date) { | |
var day = new d3_time(2e3, 0); | |
day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); | |
return day; | |
}, function(date, offset) { | |
date.setDate(date.getDate() + offset); | |
}, function(date) { | |
return date.getDate() - 1; | |
}); | |
d3.time.days = d3.time.day.range; | |
d3.time.days.utc = d3.time.day.utc.range; | |
d3.time.dayOfYear = function(date) { | |
var year = d3.time.year(date); | |
return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5); | |
}; | |
d3_time_daySymbols.forEach(function(day, i) { | |
day = day.toLowerCase(); | |
i = 7 - i; | |
var interval = d3.time[day] = d3_time_interval(function(date) { | |
(date = d3.time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7); | |
return date; | |
}, function(date, offset) { | |
date.setDate(date.getDate() + Math.floor(offset) * 7); | |
}, function(date) { | |
var day = d3.time.year(date).getDay(); | |
return Math.floor((d3.time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i); | |
}); | |
d3.time[day + "s"] = interval.range; | |
d3.time[day + "s"].utc = interval.utc.range; | |
d3.time[day + "OfYear"] = function(date) { | |
var day = d3.time.year(date).getDay(); | |
return Math.floor((d3.time.dayOfYear(date) + (day + i) % 7) / 7); | |
}; | |
}); | |
d3.time.week = d3.time.sunday; | |
d3.time.weeks = d3.time.sunday.range; | |
d3.time.weeks.utc = d3.time.sunday.utc.range; | |
d3.time.weekOfYear = d3.time.sundayOfYear; | |
d3.time.format = function(template) { | |
var n = template.length; | |
function format(date) { | |
var string = [], i = -1, j = 0, c, p, f; | |
while (++i < n) { | |
if (template.charCodeAt(i) === 37) { | |
string.push(template.substring(j, i)); | |
if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i); | |
if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p); | |
string.push(c); | |
j = i + 1; | |
} | |
} | |
string.push(template.substring(j, i)); | |
return string.join(""); | |
} | |
format.parse = function(string) { | |
var d = { | |
y: 1900, | |
m: 0, | |
d: 1, | |
H: 0, | |
M: 0, | |
S: 0, | |
L: 0 | |
}, i = d3_time_parse(d, template, string, 0); | |
if (i != string.length) return null; | |
if ("p" in d) d.H = d.H % 12 + d.p * 12; | |
var date = new d3_time(); | |
if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("w" in d && ("W" in d || "U" in d)) { | |
date.setFullYear(d.y, 0, 1); | |
date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7); | |
} else date.setFullYear(d.y, d.m, d.d); | |
date.setHours(d.H, d.M, d.S, d.L); | |
return date; | |
}; | |
format.toString = function() { | |
return template; | |
}; | |
return format; | |
}; | |
function d3_time_parse(date, template, string, j) { | |
var c, p, i = 0, n = template.length, m = string.length; | |
while (i < n) { | |
if (j >= m) return -1; | |
c = template.charCodeAt(i++); | |
if (c === 37) { | |
p = d3_time_parsers[template.charAt(i++)]; | |
if (!p || (j = p(date, string, j)) < 0) return -1; | |
} else if (c != string.charCodeAt(j++)) { | |
return -1; | |
} | |
} | |
return j; | |
} | |
function d3_time_formatRe(names) { | |
return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i"); | |
} | |
function d3_time_formatLookup(names) { | |
var map = new d3_Map(), i = -1, n = names.length; | |
while (++i < n) map.set(names[i].toLowerCase(), i); | |
return map; | |
} | |
function d3_time_formatPad(value, fill, width) { | |
var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length; | |
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string); | |
} | |
var d3_time_dayRe = d3_time_formatRe(d3_time_days), d3_time_dayLookup = d3_time_formatLookup(d3_time_days), d3_time_dayAbbrevRe = d3_time_formatRe(d3_time_dayAbbreviations), d3_time_dayAbbrevLookup = d3_time_formatLookup(d3_time_dayAbbreviations), d3_time_monthRe = d3_time_formatRe(d3_time_months), d3_time_monthLookup = d3_time_formatLookup(d3_time_months), d3_time_monthAbbrevRe = d3_time_formatRe(d3_time_monthAbbreviations), d3_time_monthAbbrevLookup = d3_time_formatLookup(d3_time_monthAbbreviations), d3_time_percentRe = /^%/; | |
var d3_time_formatPads = { | |
"-": "", | |
_: " ", | |
"0": "0" | |
}; | |
var d3_time_formats = { | |
a: function(d) { | |
return d3_time_dayAbbreviations[d.getDay()]; | |
}, | |
A: function(d) { | |
return d3_time_days[d.getDay()]; | |
}, | |
b: function(d) { | |
return d3_time_monthAbbreviations[d.getMonth()]; | |
}, | |
B: function(d) { | |
return d3_time_months[d.getMonth()]; | |
}, | |
c: d3.time.format(d3_time_formatDateTime), | |
d: function(d, p) { | |
return d3_time_formatPad(d.getDate(), p, 2); | |
}, | |
e: function(d, p) { | |
return d3_time_formatPad(d.getDate(), p, 2); | |
}, | |
H: function(d, p) { | |
return d3_time_formatPad(d.getHours(), p, 2); | |
}, | |
I: function(d, p) { | |
return d3_time_formatPad(d.getHours() % 12 || 12, p, 2); | |
}, | |
j: function(d, p) { | |
return d3_time_formatPad(1 + d3.time.dayOfYear(d), p, 3); | |
}, | |
L: function(d, p) { | |
return d3_time_formatPad(d.getMilliseconds(), p, 3); | |
}, | |
m: function(d, p) { | |
return d3_time_formatPad(d.getMonth() + 1, p, 2); | |
}, | |
M: function(d, p) { | |
return d3_time_formatPad(d.getMinutes(), p, 2); | |
}, | |
p: function(d) { | |
return d.getHours() >= 12 ? "PM" : "AM"; | |
}, | |
S: function(d, p) { | |
return d3_time_formatPad(d.getSeconds(), p, 2); | |
}, | |
U: function(d, p) { | |
return d3_time_formatPad(d3.time.sundayOfYear(d), p, 2); | |
}, | |
w: function(d) { | |
return d.getDay(); | |
}, | |
W: function(d, p) { | |
return d3_time_formatPad(d3.time.mondayOfYear(d), p, 2); | |
}, | |
x: d3.time.format(d3_time_formatDate), | |
X: d3.time.format(d3_time_formatTime), | |
y: function(d, p) { | |
return d3_time_formatPad(d.getFullYear() % 100, p, 2); | |
}, | |
Y: function(d, p) { | |
return d3_time_formatPad(d.getFullYear() % 1e4, p, 4); | |
}, | |
Z: d3_time_zone, | |
"%": function() { | |
return "%"; | |
} | |
}; | |
var d3_time_parsers = { | |
a: d3_time_parseWeekdayAbbrev, | |
A: d3_time_parseWeekday, | |
b: d3_time_parseMonthAbbrev, | |
B: d3_time_parseMonth, | |
c: d3_time_parseLocaleFull, | |
d: d3_time_parseDay, | |
e: d3_time_parseDay, | |
H: d3_time_parseHour24, | |
I: d3_time_parseHour24, | |
j: d3_time_parseDayOfYear, | |
L: d3_time_parseMilliseconds, | |
m: d3_time_parseMonthNumber, | |
M: d3_time_parseMinutes, | |
p: d3_time_parseAmPm, | |
S: d3_time_parseSeconds, | |
U: d3_time_parseWeekNumberSunday, | |
w: d3_time_parseWeekdayNumber, | |
W: d3_time_parseWeekNumberMonday, | |
x: d3_time_parseLocaleDate, | |
X: d3_time_parseLocaleTime, | |
y: d3_time_parseYear, | |
Y: d3_time_parseFullYear, | |
"%": d3_time_parseLiteralPercent | |
}; | |
function d3_time_parseWeekdayAbbrev(date, string, i) { | |
d3_time_dayAbbrevRe.lastIndex = 0; | |
var n = d3_time_dayAbbrevRe.exec(string.substring(i)); | |
return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; | |
} | |
function d3_time_parseWeekday(date, string, i) { | |
d3_time_dayRe.lastIndex = 0; | |
var n = d3_time_dayRe.exec(string.substring(i)); | |
return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; | |
} | |
function d3_time_parseWeekdayNumber(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i, i + 1)); | |
return n ? (date.w = +n[0], i + n[0].length) : -1; | |
} | |
function d3_time_parseWeekNumberSunday(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i)); | |
return n ? (date.U = +n[0], i + n[0].length) : -1; | |
} | |
function d3_time_parseWeekNumberMonday(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i)); | |
return n ? (date.W = +n[0], i + n[0].length) : -1; | |
} | |
function d3_time_parseMonthAbbrev(date, string, i) { | |
d3_time_monthAbbrevRe.lastIndex = 0; | |
var n = d3_time_monthAbbrevRe.exec(string.substring(i)); | |
return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; | |
} | |
function d3_time_parseMonth(date, string, i) { | |
d3_time_monthRe.lastIndex = 0; | |
var n = d3_time_monthRe.exec(string.substring(i)); | |
return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; | |
} | |
function d3_time_parseLocaleFull(date, string, i) { | |
return d3_time_parse(date, d3_time_formats.c.toString(), string, i); | |
} | |
function d3_time_parseLocaleDate(date, string, i) { | |
return d3_time_parse(date, d3_time_formats.x.toString(), string, i); | |
} | |
function d3_time_parseLocaleTime(date, string, i) { | |
return d3_time_parse(date, d3_time_formats.X.toString(), string, i); | |
} | |
function d3_time_parseFullYear(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i, i + 4)); | |
return n ? (date.y = +n[0], i + n[0].length) : -1; | |
} | |
function d3_time_parseYear(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i, i + 2)); | |
return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1; | |
} | |
function d3_time_expandYear(d) { | |
return d + (d > 68 ? 1900 : 2e3); | |
} | |
function d3_time_parseMonthNumber(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i, i + 2)); | |
return n ? (date.m = n[0] - 1, i + n[0].length) : -1; | |
} | |
function d3_time_parseDay(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i, i + 2)); | |
return n ? (date.d = +n[0], i + n[0].length) : -1; | |
} | |
function d3_time_parseDayOfYear(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i, i + 3)); | |
return n ? (date.j = +n[0], i + n[0].length) : -1; | |
} | |
function d3_time_parseHour24(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i, i + 2)); | |
return n ? (date.H = +n[0], i + n[0].length) : -1; | |
} | |
function d3_time_parseMinutes(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i, i + 2)); | |
return n ? (date.M = +n[0], i + n[0].length) : -1; | |
} | |
function d3_time_parseSeconds(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i, i + 2)); | |
return n ? (date.S = +n[0], i + n[0].length) : -1; | |
} | |
function d3_time_parseMilliseconds(date, string, i) { | |
d3_time_numberRe.lastIndex = 0; | |
var n = d3_time_numberRe.exec(string.substring(i, i + 3)); | |
return n ? (date.L = +n[0], i + n[0].length) : -1; | |
} | |
var d3_time_numberRe = /^\s*\d+/; | |
function d3_time_parseAmPm(date, string, i) { | |
var n = d3_time_amPmLookup.get(string.substring(i, i += 2).toLowerCase()); | |
return n == null ? -1 : (date.p = n, i); | |
} | |
var d3_time_amPmLookup = d3.map({ | |
am: 0, | |
pm: 1 | |
}); | |
function d3_time_zone(d) { | |
var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = ~~(Math.abs(z) / 60), zm = Math.abs(z) % 60; | |
return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2); | |
} | |
function d3_time_parseLiteralPercent(date, string, i) { | |
d3_time_percentRe.lastIndex = 0; | |
var n = d3_time_percentRe.exec(string.substring(i, i + 1)); | |
return n ? i + n[0].length : -1; | |
} | |
d3.time.format.utc = function(template) { | |
var local = d3.time.format(template); | |
function format(date) { | |
try { | |
d3_time = d3_time_utc; | |
var utc = new d3_time(); | |
utc._ = date; | |
return local(utc); | |
} finally { | |
d3_time = Date; | |
} | |
} | |
format.parse = function(string) { | |
try { | |
d3_time = d3_time_utc; | |
var date = local.parse(string); | |
return date && date._; | |
} finally { | |
d3_time = Date; | |
} | |
}; | |
format.toString = local.toString; | |
return format; | |
}; | |
var d3_time_formatIso = d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ"); | |
d3.time.format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso; | |
function d3_time_formatIsoNative(date) { | |
return date.toISOString(); | |
} | |
d3_time_formatIsoNative.parse = function(string) { | |
var date = new Date(string); | |
return isNaN(date) ? null : date; | |
}; | |
d3_time_formatIsoNative.toString = d3_time_formatIso.toString; | |
d3.time.second = d3_time_interval(function(date) { | |
return new d3_time(Math.floor(date / 1e3) * 1e3); | |
}, function(date, offset) { | |
date.setTime(date.getTime() + Math.floor(offset) * 1e3); | |
}, function(date) { | |
return date.getSeconds(); | |
}); | |
d3.time.seconds = d3.time.second.range; | |
d3.time.seconds.utc = d3.time.second.utc.range; | |
d3.time.minute = d3_time_interval(function(date) { | |
return new d3_time(Math.floor(date / 6e4) * 6e4); | |
}, function(date, offset) { | |
date.setTime(date.getTime() + Math.floor(offset) * 6e4); | |
}, function(date) { | |
return date.getMinutes(); | |
}); | |
d3.time.minutes = d3.time.minute.range; | |
d3.time.minutes.utc = d3.time.minute.utc.range; | |
d3.time.hour = d3_time_interval(function(date) { | |
var timezone = date.getTimezoneOffset() / 60; | |
return new d3_time((Math.floor(date / 36e5 - timezone) + timezone) * 36e5); | |
}, function(date, offset) { | |
date.setTime(date.getTime() + Math.floor(offset) * 36e5); | |
}, function(date) { | |
return date.getHours(); | |
}); | |
d3.time.hours = d3.time.hour.range; | |
d3.time.hours.utc = d3.time.hour.utc.range; | |
d3.time.month = d3_time_interval(function(date) { | |
date = d3.time.day(date); | |
date.setDate(1); | |
return date; | |
}, function(date, offset) { | |
date.setMonth(date.getMonth() + offset); | |
}, function(date) { | |
return date.getMonth(); | |
}); | |
d3.time.months = d3.time.month.range; | |
d3.time.months.utc = d3.time.month.utc.range; | |
function d3_time_scale(linear, methods, format) { | |
function scale(x) { | |
return linear(x); | |
} | |
scale.invert = function(x) { | |
return d3_time_scaleDate(linear.invert(x)); | |
}; | |
scale.domain = function(x) { | |
if (!arguments.length) return linear.domain().map(d3_time_scaleDate); | |
linear.domain(x); | |
return scale; | |
}; | |
scale.nice = function(m) { | |
return scale.domain(d3_scale_nice(scale.domain(), m)); | |
}; | |
scale.ticks = function(m, k) { | |
var extent = d3_scaleExtent(scale.domain()); | |
if (typeof m !== "function") { | |
var span = extent[1] - extent[0], target = span / m, i = d3.bisect(d3_time_scaleSteps, target); | |
if (i == d3_time_scaleSteps.length) return methods.year(extent, m); | |
if (!i) return linear.ticks(m).map(d3_time_scaleDate); | |
if (target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target) --i; | |
m = methods[i]; | |
k = m[1]; | |
m = m[0].range; | |
} | |
return m(extent[0], new Date(+extent[1] + 1), k); | |
}; | |
scale.tickFormat = function() { | |
return format; | |
}; | |
scale.copy = function() { | |
return d3_time_scale(linear.copy(), methods, format); | |
}; | |
return d3_scale_linearRebind(scale, linear); | |
} | |
function d3_time_scaleDate(t) { | |
return new Date(t); | |
} | |
function d3_time_scaleFormat(formats) { | |
return function(date) { | |
var i = formats.length - 1, f = formats[i]; | |
while (!f[1](date)) f = formats[--i]; | |
return f[0](date); | |
}; | |
} | |
function d3_time_scaleSetYear(y) { | |
var d = new Date(y, 0, 1); | |
d.setFullYear(y); | |
return d; | |
} | |
function d3_time_scaleGetYear(d) { | |
var y = d.getFullYear(), d0 = d3_time_scaleSetYear(y), d1 = d3_time_scaleSetYear(y + 1); | |
return y + (d - d0) / (d1 - d0); | |
} | |
var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ]; | |
var d3_time_scaleLocalMethods = [ [ d3.time.second, 1 ], [ d3.time.second, 5 ], [ d3.time.second, 15 ], [ d3.time.second, 30 ], [ d3.time.minute, 1 ], [ d3.time.minute, 5 ], [ d3.time.minute, 15 ], [ d3.time.minute, 30 ], [ d3.time.hour, 1 ], [ d3.time.hour, 3 ], [ d3.time.hour, 6 ], [ d3.time.hour, 12 ], [ d3.time.day, 1 ], [ d3.time.day, 2 ], [ d3.time.week, 1 ], [ d3.time.month, 1 ], [ d3.time.month, 3 ], [ d3.time.year, 1 ] ]; | |
var d3_time_scaleLocalFormats = [ [ d3.time.format("%Y"), d3_true ], [ d3.time.format("%B"), function(d) { | |
return d.getMonth(); | |
} ], [ d3.time.format("%b %d"), function(d) { | |
return d.getDate() != 1; | |
} ], [ d3.time.format("%a %d"), function(d) { | |
return d.getDay() && d.getDate() != 1; | |
} ], [ d3.time.format("%I %p"), function(d) { | |
return d.getHours(); | |
} ], [ d3.time.format("%I:%M"), function(d) { | |
return d.getMinutes(); | |
} ], [ d3.time.format(":%S"), function(d) { | |
return d.getSeconds(); | |
} ], [ d3.time.format(".%L"), function(d) { | |
return d.getMilliseconds(); | |
} ] ]; | |
var d3_time_scaleLinear = d3.scale.linear(), d3_time_scaleLocalFormat = d3_time_scaleFormat(d3_time_scaleLocalFormats); | |
d3_time_scaleLocalMethods.year = function(extent, m) { | |
return d3_time_scaleLinear.domain(extent.map(d3_time_scaleGetYear)).ticks(m).map(d3_time_scaleSetYear); | |
}; | |
d3.time.scale = function() { | |
return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat); | |
}; | |
var d3_time_scaleUTCMethods = d3_time_scaleLocalMethods.map(function(m) { | |
return [ m[0].utc, m[1] ]; | |
}); | |
var d3_time_scaleUTCFormats = [ [ d3.time.format.utc("%Y"), d3_true ], [ d3.time.format.utc("%B"), function(d) { | |
return d.getUTCMonth(); | |
} ], [ d3.time.format.utc("%b %d"), function(d) { | |
return d.getUTCDate() != 1; | |
} ], [ d3.time.format.utc("%a %d"), function(d) { | |
return d.getUTCDay() && d.getUTCDate() != 1; | |
} ], [ d3.time.format.utc("%I %p"), function(d) { | |
return d.getUTCHours(); | |
} ], [ d3.time.format.utc("%I:%M"), function(d) { | |
return d.getUTCMinutes(); | |
} ], [ d3.time.format.utc(":%S"), function(d) { | |
return d.getUTCSeconds(); | |
} ], [ d3.time.format.utc(".%L"), function(d) { | |
return d.getUTCMilliseconds(); | |
} ] ]; | |
var d3_time_scaleUTCFormat = d3_time_scaleFormat(d3_time_scaleUTCFormats); | |
function d3_time_scaleUTCSetYear(y) { | |
var d = new Date(Date.UTC(y, 0, 1)); | |
d.setUTCFullYear(y); | |
return d; | |
} | |
function d3_time_scaleUTCGetYear(d) { | |
var y = d.getUTCFullYear(), d0 = d3_time_scaleUTCSetYear(y), d1 = d3_time_scaleUTCSetYear(y + 1); | |
return y + (d - d0) / (d1 - d0); | |
} | |
d3_time_scaleUTCMethods.year = function(extent, m) { | |
return d3_time_scaleLinear.domain(extent.map(d3_time_scaleUTCGetYear)).ticks(m).map(d3_time_scaleUTCSetYear); | |
}; | |
d3.time.scale.utc = function() { | |
return d3_time_scale(d3.scale.linear(), d3_time_scaleUTCMethods, d3_time_scaleUTCFormat); | |
}; | |
d3.text = d3_xhrType(function(request) { | |
return request.responseText; | |
}); | |
d3.json = function(url, callback) { | |
return d3_xhr(url, "application/json", d3_json, callback); | |
}; | |
function d3_json(request) { | |
return JSON.parse(request.responseText); | |
} | |
d3.html = function(url, callback) { | |
return d3_xhr(url, "text/html", d3_html, callback); | |
}; | |
function d3_html(request) { | |
var range = d3_document.createRange(); | |
range.selectNode(d3_document.body); | |
return range.createContextualFragment(request.responseText); | |
} | |
d3.xml = d3_xhrType(function(request) { | |
return request.responseXML; | |
}); | |
return d3; | |
}(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>LDAvis</title> | |
<script src="d3.v3.js"></script> | |
<script src="ldavis.js"></script> | |
<link rel="stylesheet" type="text/css" href="lda.css"> | |
</head> | |
<body> | |
<div id = "lda"></div> | |
<script> | |
var vis = new LDAvis("#lda", "lda.json"); | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path { | |
fill: none; | |
stroke: none; | |
} | |
.xaxis .tick.major { | |
fill: black; | |
stroke: black; | |
stroke-width: 0.1; | |
opacity: 0.7; | |
} | |
.slideraxis { | |
fill: black; | |
stroke: black; | |
stroke-width: 0.4; | |
opacity: 1; | |
} | |
text { | |
font-family: sans-serif; | |
font-size: 11px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"mdsDat": { | |
"x": [ -0.092142, 0.25177, 0.011246, 0.20615, -0.12158, 0.01699, 0.097756, -0.2491, 0.16113, 0.016235, 0.29004, -0.14266, -0.28802, 0.20617, -0.18342, 0.24572, -0.034285, -0.26777, -0.079403, -0.044839 ], | |
"y": [ 0.083993, -0.12112, 0.15709, -0.041345, 0.15041, 0.13302, -0.0886, -0.14298, 0.03017, 0.021601, -0.11948, -0.15082, -0.13266, -0.0064203, -0.23423, -0.093191, 0.20474, -0.073975, 0.25306, 0.17073 ], | |
"topics": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ], | |
"Freq": [ 4.7754, 5.4792, 5.358, 5.1367, 4.8545, 5.1213, 5.308, 4.659, 5.0044, 4.9914, 5.5418, 4.735, 3.8734, 5.4297, 4.8777, 5.5556, 4.4689, 4.5484, 4.8302, 5.4513 ], | |
"cluster": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] | |
}, | |
"tinfo": { | |
"Term": [ "staff", "pain", "hospital", "room", "care", "hours", "waiting", "surgery", "er", "great", "doctor", "place", "people", "worst", "dr", "nurse", "wait", "medical", "nurses", "told", "good", "i'm", "emergency", "insurance", "rude", "call", "family", "time", "patients", "bill", "mother", "t", "aunt", "mother's", "hospice", "mom", "brother", "didn", "niece", "grandma", "nephew", "sister", "grandmother", "mom's", "closely", "loma", "wasn", "riverside", "younger", "dementia", "linda", "couldn", "updates", "brothers", "don", "grandfather", "helpless", "oklahoma", "sisters", "bethesda", "arm", "broken", "leg", "accident", "cut", "stitches", "wheelchair", "fall", "finger", "wheel", "wrist", "wound", "injury", "foot", "fractured", "fell", "rolled", "ankle", "veins", "elbow", "cast", "dislocated", "gauze", "lip", "stitched", "bruised", "rays", "truck", "bones", "sprain", "bill", "pay", "insurance", "billing", "company", "bills", "payment", "billed", "collections", "credit", "collection", "cost", "agency", "account", "charged", "paid", "mail", "financial", "owe", "payments", "price", "balance", "charges", "afford", "debt", "outrageous", "network", "fee", "deductible", "paying", "waiting", "triage", "lobby", "sat", "sitting", "packed", "waited", "counting", "seats", "triaged", "longest", "ambulances", "ahead", "chatting", "chairs", "wait", "chit", "quicker", "overcrowded", "ers", "sit", "hrs", "hour", "mins", "puking", "faster", "crowded", "hallway", "min", "urgency", "va", "west", "cleveland", "veterans", "presbyterian", "lee", "growing", "colorado", "serving", "ridge", "gulf", "city", "referrals", "war", "kansas", "retired", "orange", "portland", "columbus", "improving", "model", "residents", "detroit", "specialty", "parkland", "cities", "local", "oregon", "coast", "challenge", "he's", "i'd", "reviews", "here's", "what's", "you'd", "we're", "energy", "there's", "write", "we'd", "they'd", "hardest", "hey", "judging", "bat", "someone's", "i'm", "harsh", "wow", "compelled", "haha", "hopefully", "screening", "nope", "caution", "hoping", "funny", "grow", "harder", "bathroom", "shower", "toilet", "tv", "tray", "button", "bags", "trash", "pan", "bathrooms", "dressing", "husbands", "washed", "restroom", "sheets", "alarm", "wash", "dust", "bedding", "blankets", "dried", "dinner", "soiled", "germs", "shift", "sandwich", "noisy", "poop", "linens", "curtain", "bedside", "manner", "personable", "genuinely", "luke's", "timely", "highly", "notch", "utmost", "professionally", "anthony's", "courteous", "superb", "dedicated", "extraordinary", "thorough", "knowledgable", "prompt", "appreciative", "manor", "joes", "competent", "efficiently", "talented", "joseph's", "asset", "exceptionally", "dietary", "fortunate", "francis", "infection", "ear", "fever", "diagnose", "temp", "cough", "flu", "strep", "seizures", "staph", "sinus", "abscess", "ent", "bacterial", "throat", "antibiotics", "temperature", "examine", "epilepsy", "eve", "swab", "ears", "bug", "rash", "spider", "aches", "hives", "viral", "diff", "tonsils", "heart", "attack", "cancer", "pneumonia", "breathing", "oxygen", "lung", "asthma", "lungs", "died", "liver", "killed", "saved", "tumor", "coma", "blockage", "colon", "ccu", "dialysis", "sacred", "chemo", "alive", "shortness", "stage", "failure", "cardiologist", "cardio", "pulmonary", "oncologist", "survived", "saturday", "draw", "thursday", "wednesday", "transfusion", "sugar", "fluids", "dehydrated", "uti", "urinary", "glucose", "mix", "afternoon", "drawn", "tract", "ultra", "tuesday", "drew", "insulin", "noon", "papers", "thyroid", "charts", "consult", "evening", "observation", "sample", "o'clock", "dehydration", "insisting", "child", "delivery", "children", "delivered", "birth", "baby", "nicu", "pregnant", "children's", "babies", "ob", "labor", "born", "birthing", "epidural", "deliver", "nursery", "contractions", "obgyn", "lactation", "baby's", "natural", "gyn", "boy", "maternity", "breastfeeding", "pregnancy", "midwife", "delivering", "formula", "de", "la", "el", "muy", "en", "mi", "es", "las", "con", "por", "para", "lo", "se", "bien", "gracias", "todo", "excelente", "este", "atenci", "le", "del", "yo", "ya", "su", "enfermeras", "buen", "si", "buena", "una", "como", "appointment", "answered", "message", "guard", "supervisor", "schedule", "messages", "directed", "appt", "answering", "hold", "answer", "operator", "scheduling", "telephone", "guards", "hung", "reschedule", "apt", "clerk", "pen", "backs", "extension", "documents", "faxed", "rudely", "voicemail", "refill", "stolen", "transferring", "surgeon", "pre", "op", "therapy", "replacement", "ease", "pt", "surgical", "surgery", "successful", "bless", "surgeries", "gratitude", "underwent", "smith", "kelly", "anesthesia", "relaxed", "teams", "johnson", "prepped", "arkansas", "worries", "steven", "spectacular", "miller", "melissa", "williams", "jason", "team", "drug", "stone", "allergic", "reaction", "excruciating", "morphine", "pill", "migraine", "ct", "stones", "abdomen", "cyst", "relief", "chronic", "intense", "nausea", "scan", "muscle", "headaches", "addict", "unbearable", "abdominal", "migraines", "numbness", "appendix", "tooth", "drugged", "junkie", "tap", "medication", "dont", "unorganized", "wanna", "shit", "absolute", "plague", "hated", "hosptial", "ppl", "dam", "bull", "sucks", "unfriendly", "morons", "cuz", "bullshit", "havent", "unhelpful", "worthless", "enemy", "ur", "crappy", "waist", "fiancee", "snotty", "omg", "worst", "smh", "bout", "suck", "parking", "valet", "coffee", "cafeteria", "shop", "hotel", "guest", "garage", "construction", "restaurant", "cafe", "dated", "wifi", "delicious", "taste", "sinai", "dc", "shore", "campus", "fancy", "mt", "outdated", "cons", "nicest", "traffic", "kitchen", "cleanest", "navigate", "variety", "offers", "cares", "deserve", "hire", "jobs", "racist", "grady", "fired", "train", "boss", "homeless", "beings", "quit", "treats", "passion", "employees", "jesus", "acts", "hateful", "race", "obnoxious", "gossiping", "gossip", "lord", "christ", "facebook", "rudeness", "ignorant", "rating", "peoples", "play", "social", "lack", "mentally", "disregard", "depression", "allowing", "abusive", "suicide", "reporting", "advocate", "lacked", "investigation", "committed", "certified", "abused", "psychiatric", "differently", "one's", "appalling", "judgmental", "goal", "religious", "accountable", "increase", "despicable", "psychiatrist", "hospitalization", "dismissive", "inappropriate", "commission", "member", "hand", "car", "falling", "fracture", "needle", "dollars", "claim", "hours", "center", "valley", "veteran", "california", "mayo", "atlanta", "clinics", "washington", "you're", "that's", "sleep", "filthy", "breakfast", "gross", "thrown", "hesitate", "antibiotic", "brain", "death", "saving", "friday", "labs", "pediatric", "daughters", "los", "reception", "success", "amy", "meds", "cat", "headache", "pain", "pills", "ive", "updated", "nicer", "thier", "mental", "rights", "safety", "appropriate", "protocol", "family", "bone", "injured", "pocket", "accept", "medicare", "texas", "vets", "dallas", "sleeping", "aide", "considerate", "responsive", "seizure", "cath", "massive", "attacks", "miscarriage", "al", "phone", "call", "voice", "conversation", "operating", "rns", "therapist", "kidney", "severe", "dose", "menu", "atmosphere", "gift", "white", "patient's", "violation", "abuse", "head", "travel", "centers", "yeah", "cup", "compassionate", "sore", "life", "treatments", "stroke", "discharge", "servicio", "spoke", "reach", "recovery", "surgeons", "operation", "extreme", "horrible", "suicidal", "require", "elderly", "clinic", "states", "regional", "healthcare", "it's", "bed", "floors", "impressed", "mary's", "pleased", "christmas", "breath", "lab", "monday", "newborn", "question", "smaller", "star", "psych", "members", "amount", "half", "reading", "floor", "professional", "transplant", "blood", "speak", "therapists", "angels", "didnt", "modern", "students", "law", "hurt", "expensive", "won't", "wet", "blanket", "caring", "bite", "cardiac", "hadn't", "security", "questions", "organized", "current", "skills", "cases", "worker", "emergency", "beach", "station", "eye", "test", "called", "hip", "terrible", "clean", "private", "treat", "neglect", "ray", "hit", "rose", "they're", "loud", "st", "knowledgeable", "infections", "urine", "kids", "love", "super", "forever", "food", "administration", "actions", "injuries", "card", "room", "county", "read", "attentive", "sunday", "daughter", "dr", "anesthesiologist", "place", "cant", "meals", "human", "director", "dangerous", "long", "cleaning", "excellent", "kindness", "outpatient", "post", "physical", "free", "animal", "communication", "broke", "busy", "medical", "review", "who's", "cleaned", "virus", "morning", "admissions", "bladder", "rude", "entrance", "people", "sad", "complaint", "health", "negative", "change", "dead", "tests", "son", "lady", "calling", "drugs", "joke", "institution", "baptist", "diagnosis", "threatening", "ultrasound", "number", "absolutely", "slow", "patients", "practice", "minutes", "bay", "night", "changed", "release", "great", "answers", "fill", "good", "loved", "walk", "department", "charge", "pm", "realize", "kind", "fast", "avoid", "building", "workers", "patient", "money", "general", "sure", "satisfied", "chest", "receptionist", "procedure", "awful", "stays", "staffs", "relative", "vitals", "pretty", "recommend", "iv", "rn", "lots", "rooms", "xrays", "guess", "awesome", "dog", "board", "despite", "shoulder", "registration", "country", "hall", "top", "visit", "father", "wife", "helpful", "mary", "shame", "quality", "system", "going", "thing", "nurse", "water", "info", "stomach", "nice", "working", "arrived", "hard", "nursing", "efficient", "er", "doctor", "dying", "small", "management", "covered", "community", "hospitals", "friendly", "performed", "holy", "medicine", "job", "knowledge", "longer", "years", "room", "disgusting", "appreciate", "ward", "nice", "dr's", "black", "comments", "urgent", "running", "talked", "lower", "work", "risk", "services", "care", "things", "staff", "symptoms", "icu", "testing", "best", "asked", "person", "staff", "lot", "respect", "facility", "moved", "care", "professionalism", "dad", "checked", "paperwork", "rehab", "patients", "aware", "open", "feel", "pa", "discharged", "staff", "front", "wouldn't", "drive", "stars", "medical", "state", "passed", "dirty", "extremely", "days", "amazing", "service", "quick", "desk", "large", "place", "patient", "months", "er", "received", "diagnosed", "told", "woman", "special", "waste", "hospitals", "poor", "hospital", "she's", "eat", "experience", "service", "die", "rude", "help", "care", "xray", "kaiser", "wrong", "high", "condition", "ridiculous", "facilities", "bad", "stay", "great", "treatment", "dad", "face", "desk", "sick", "admitted", "doctors", "sick", "year", "nurses", "personal", "unprofessional", "hospital", "received", "understand", "worse", "doctor", "pressure", "issues", "hope", "checked", "office", "wonderful", "hospital", "experience", "complain", "health", "time", "asked", "nurse", "girl", "told", "told", "friendly", "attitude", "keep", "business", "people", "hospital", "good", "will", "talking", "front", "live", "week", "doctor", "beautiful", "real", "facility", "time", "father", "pm", "better", "nurses", "time", "emergency", "helpful", "area", "treated", "case", "send", "area", "fantastic", "unprofessional", "physician", "day", "work", "finally", "amazing", "refused", "will", "treated", "florida", "keep", "days", "well", "hate", "nurses", "proper", "hospital", "save", "felt", "dr", "doctors", "complete", "will", "left", "memorial", "well", "wonderful", "er", "bad", "well", "nurses", "best", "ambulance", "hours", "talk", "well", "choice", "serious", "needed", "nurses", "hospital", "looked", "husband", "problem", "nurses", "feel", "time", "primary", "bring", "son", "doctors", "night", "great", "staff", "literally", "treatment", "treatment", "weeks", "ordered", "based", "nurse", "told", "treated", "problems", "hospital", "stay", "stay", "better", "help", "daughter", "left", "day", "times", "ambulance", "will", "month", "going", "time", "best", "it's", "die", "er", "worse", "help", "doctors", "work", "days", "hospital", "years", "care", "concern", "condition", "people", "brought", "provide", "office", "compassion", "experience", "food", "leave", "completely", "experience", "will", "crying", "experience", "pretty", "better", "better", "find", "prescription", "care", "cold", "going", "ago", "day", "service", "year", "friend", "visit", "full", "emergency", "leave", "stayed", "bad", "recommend", "time", "best", "help", "going", "door", "stay", "nurse", "asked", "check", "care", "doctors", "god", "hour", "minutes", "wrong", "hospital", "sure", "wonderful", "nurse", "er", "person", "bad", "lot", "er", "left", "amazing", "treated", "fact", "hospital", "admitted", "second", "comfortable", "things", "definitely", "check", "experiences", "minutes", "doctors", "feel", "couldn't", "doctor", "full", "facility", "husband", "doctor", "called", "area", "will", "husband", "will", "long", "hospital", "time", "day", "husband", "friendly", "point", "finally", "times", "day", "side", "needed", "good", "nursing", "couldn't", "dr", "excellent", "times", "hospital", "left", "great", "today", "hours", "review", "room", "service", "wife", "compassion", "finally", "will", "money", "needed", "emergency", "hours", "day", "worse", "care", "recommend", "understand", "times", "times", "asked", "staff", "pain", "check", "experience", "nurse", "going", "care", "wait", "excellent", "blood", "years", "nurse", "i'm", "walked", "second", "doctor", "received", "floor", "issue", "procedure", "doctors", "well", "times", "needed", "time", "helped" ], | |
"logprob": [ 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, -3.167, -4.4881, -5.7707, -6.0334, -6.0476, -3.4036, -4.6161, -6.4673, -6.5582, -5.8692, -6.7993, -4.2899, -5.1014, -6.0716, -7.3687, -6.7793, -7.5227, -6.4893, -6.8094, -6.7031, -6.1635, -7.5437, -6.6323, -7.1895, -6.2017, -6.0716, -7.6096, -7.656, -6.83, -7.405, -4.2299, -4.312, -4.5794, -4.6056, -4.849, -5.067, -5.2771, -5.2864, -5.4119, -5.6135, -5.656, -5.0716, -4.8263, -4.6793, -6.1506, -5.1452, -6.3792, -5.3765, -6.504, -6.5167, -6.5361, -6.6687, -6.779, -6.9513, -6.9713, -6.9917, -4.9063, -7.0777, -6.3848, -7.1355, -3.0498, -3.5442, -2.9065, -3.6317, -4.4765, -4.4889, -4.75, -4.8491, -5.0559, -5.15, -5.3169, -4.6849, -5.4366, -5.4518, -4.7774, -4.1536, -5.6232, -5.7834, -5.8081, -5.8144, -5.956, -5.9929, -5.3017, -6.2057, -6.2631, -6.3033, -5.3169, -6.4405, -6.4405, -5.0268, -2.4097, -4.3105, -5.1235, -4.3397, -4.1341, -6.4528, -3.4007, -7.0245, -7.4685, -6.5359, -7.2695, -7.6957, -5.3007, -6.5493, -6.2091, -2.6374, -7.7615, -7.0577, -7.882, -6.8015, -4.6095, -4.4889, -3.2641, -5.182, -7.7391, -6.2891, -6.7507, -5.2047, -5.053, -6.4903, -4.1517, -5.2272, -6.2012, -5.4976, -6.3941, -6.6668, -6.8941, -6.9487, -7.0678, -7.0934, -7.203, -4.967, -7.2475, -7.2782, -7.3099, -6.65, -6.65, -7.4116, -7.4857, -7.5051, -7.5051, -6.3941, -7.5249, -6.8322, -7.545, -7.5656, -5.1611, -7.6301, -6.9047, -7.6526, -5.0715, -4.4397, -4.2102, -6.9692, -5.2396, -6.564, -5.3624, -6.9912, -5.065, -4.9635, -7.1471, -6.3496, -7.9067, -6.564, -7.8014, -7.8527, -7.1602, -2.806, -7.7062, -5.3324, -7.8793, -7.9348, -5.9501, -7.5987, -6.7816, -7.9067, -6.3914, -5.9192, -7.6193, -7.7527, -4.667, -5.9091, -6.1377, -5.9128, -6.6469, -5.3259, -6.8035, -5.5795, -7.091, -6.4532, -7.178, -6.5385, -7.2732, -5.7634, -5.9888, -6.7946, -6.4162, -7.5702, -7.5896, -6.4852, -6.9576, -6.2543, -7.7147, -7.7371, -4.6883, -7.0559, -7.7836, -7.8323, -7.8576, -6.4532, -4.7136, -4.4196, -6.0901, -6.0949, -6.1291, -5.5492, -4.1369, -5.0474, -6.4979, -6.604, -6.6616, -4.9209, -6.3025, -6.1697, -7.321, -5.0679, -6.7049, -5.773, -7.4615, -6.7688, -7.603, -5.0958, -6.9435, -7.6474, -6.527, -7.6703, -6.6448, -7.0626, -6.6873, -5.8603, -3.8769, -5.0645, -4.5417, -5.6799, -6.0132, -6.0307, -5.4135, -6.1731, -6.199, -6.6636, -6.7061, -6.7326, -6.7876, -6.9184, -5.0918, -4.857, -6.0002, -6.4883, -7.3076, -7.3236, -7.4253, -6.3332, -6.7782, -6.1234, -7.6003, -7.7126, -7.0564, -7.1604, -7.1881, -7.4076, -3.2278, -4.3296, -4.4195, -5.0562, -4.5608, -5.3539, -5.5242, -5.6818, -5.6881, -4.5076, -5.9592, -5.4233, -4.4064, -6.4064, -6.5004, -6.5583, -6.6603, -6.6854, -6.7832, -6.8117, -6.8409, -5.4209, -6.2523, -6.2858, -5.6187, -5.6363, -7.0865, -6.4, -7.1384, -7.2363, -5.4737, -5.8293, -6.0556, -6.37, -7.1779, -5.8389, -5.4626, -5.9291, -5.9538, -7.3798, -7.4735, -7.577, -5.7739, -6.2767, -7.713, -6.6082, -6.0556, -6.6082, -6.7097, -6.6722, -5.0543, -7.2408, -7.336, -6.725, -5.4539, -6.0676, -5.7329, -7.633, -6.455, -7.6722, -3.7048, -3.9991, -4.3709, -4.6539, -4.0321, -3.0157, -5.1376, -4.4163, -5.1686, -5.1925, -5.3237, -3.9643, -4.1722, -5.6624, -5.8155, -5.217, -5.9609, -5.974, -5.9918, -6.2929, -6.3175, -6.4152, -6.4221, -5.7326, -5.3541, -6.4862, -5.1281, -6.603, -5.9059, -6.6713, -4.189, -4.4477, -4.5059, -4.6768, -4.7346, -4.8111, -5.1841, -5.2848, -5.3728, -5.4121, -5.5264, -5.5652, -5.7461, -5.7767, -5.9096, -5.9563, -5.9724, -5.9778, -6.028, -6.0453, -6.0747, -6.099, -6.1365, -6.1623, -6.1688, -6.1955, -6.251, -6.28, -5.6245, -6.3886, -3.9304, -5.0246, -5.783, -5.8728, -5.3837, -5.3277, -6.476, -6.593, -6.0015, -6.0325, -4.7511, -4.3416, -6.3123, -6.3333, -7.1268, -6.4223, -5.7799, -7.2653, -7.3949, -6.4458, -7.6178, -7.7403, -7.7847, -7.1268, -7.2519, -6.1018, -7.0477, -7.4421, -7.1151, -7.175, -4.1483, -5.0582, -5.0834, -5.125, -5.3159, -5.5042, -5.7562, -4.9019, -2.3865, -6.6723, -5.2575, -4.9528, -6.7963, -7.0407, -7.1288, -7.1554, -6.0618, -7.211, -7.2399, -7.2698, -7.285, -7.3989, -7.4163, -7.4339, -7.4519, -7.4703, -7.5673, -7.5879, -7.6305, -4.0811, -4.7588, -5.3678, -5.3737, -5.3998, -5.5344, -5.5919, -5.8746, -5.9422, -4.4297, -5.6346, -6.3616, -6.3996, -5.7991, -5.8082, -6.5874, -5.4823, -4.2069, -5.996, -6.7001, -6.0336, -6.8443, -5.0288, -6.9065, -6.9927, -5.8616, -6.2948, -7.0652, -7.1551, -7.2157, -3.9204, -3.9619, -6.0181, -6.3186, -6.4879, -5.0568, -6.812, -6.2022, -6.9608, -5.7352, -7.2441, -7.2607, -4.6355, -6.0877, -7.0647, -6.1794, -6.711, -7.1356, -6.1406, -6.5596, -6.1794, -5.8876, -6.2679, -7.3846, -7.5481, -7.691, -6.3121, -2.525, -6.0181, -7.1504, -5.5627, -4.3225, -5.7505, -5.862, -5.0926, -6.3367, -5.7951, -6.5796, -6.5964, -6.7323, -6.8343, -6.8452, -7.0763, -7.1923, -7.1923, -7.2395, -6.5468, -7.3412, -6.6308, -6.3173, -7.4952, -6.8131, -6.8783, -7.6286, -6.5229, -6.948, -6.2858, -7.7286, -7.7552, -7.4347, -7.0361, -5.3988, -5.0579, -5.7804, -5.1912, -6.1876, -6.3794, -5.7424, -6.8239, -6.9747, -6.3479, -7.1114, -6.5166, -6.2253, -7.4213, -4.4319, -7.0722, -7.0851, -7.1248, -7.2857, -7.2699, -6.8647, -6.9517, -6.6842, -7.0101, -6.7752, -6.747, -6.0966, -4.9434, -7.4213, -6.3294, -5.2839, -4.351, -6.7784, -6.8653, -6.8837, -6.9214, -6.9408, -7.0331, -7.0884, -5.6884, -7.2218, -7.2218, -7.2349, -7.2615, -7.3029, -6.6606, -7.3911, -7.4066, -7.4066, -7.4066, -7.4066, -7.4711, -7.6533, -7.694, -7.694, -7.0119, -6.9911, -6.9911, -7.0119, -7.7366, -4.2957, -4.2917, -4.3732, -6.4133, -6.1914, -5.7232, -5.2961, -5.7957, -2.3731, -3.2575, -5.0293, -5.8693, -6.3256, -6.1698, -6.5472, -6.2065, -6.4539, -4.3598, -4.1462, -4.6893, -5.6251, -6.4917, -6.6168, -6.8398, -6.3698, -5.6644, -5.1779, -4.7219, -5.7969, -5.3066, -5.9683, -5.451, -6.019, -5.0381, -6.2227, -7.0407, -7.0407, -3.7827, -5.3836, -5.5252, -1.9795, -5.4801, -5.4261, -6.1361, -6.3904, -6.693, -5.4636, -6.1065, -6.3511, -6.1862, -6.4846, -2.8555, -5.5385, -5.8696, -5.8431, -5.8693, -5.8894, -5.9083, -6.4817, -6.4959, -6.1331, -6.897, -6.2067, -6.1749, -5.6195, -6.1431, -6.158, -6.5289, -6.019, -5.8796, -3.716, -2.9537, -5.7984, -6.0809, -6.0394, -6.5846, -5.8803, -4.5361, -3.9835, -5.9887, -6.4768, -6.2024, -6.4996, -5.3314, -5.8425, -7.0225, -6.2382, -4.0853, -5.9909, -6.4677, -5.8746, -6.2239, -4.591, -6.3154, -2.9875, -5.8691, -4.7112, -4.2997, -6.0688, -4.8595, -6.0809, -4.5074, -5.7798, -5.6609, -5.1848, -2.9181, -7.0659, -6.7867, -5.3149, -4.1851, -5.9364, -4.7249, -4.6682, -3.2091, -3.6477, -5.9055, -4.7468, -5.7977, -5.1846, -6.3886, -5.1357, -4.7706, -5.2644, -5.9696, -4.9171, -6.7226, -3.9651, -6.562, -4.588, -4.691, -4.386, -5.4975, -3.5829, -3.4068, -6.1731, -3.146, -4.4967, -6.504, -6.6976, -4.6416, -6.2983, -6.3243, -4.8352, -4.9752, -5.6336, -4.7253, -6.7429, -5.7293, -3.3307, -6.5167, -5.2418, -5.5641, -4.5164, -4.1165, -6.0345, -6.3296, -5.9977, -6.442, -5.6077, -2.9069, -6.3941, -5.1926, -4.9653, -3.9218, -3.1016, -5.3223, -3.6322, -3.7163, -5.052, -3.8943, -6.5097, -4.5254, -5.3502, -6.4539, -4.9932, -5.6334, -3.6138, -4.8645, -6.3574, -4.9745, -4.7462, -3.5245, -4.5146, -4.9148, -3.6609, -5.5001, -6.7061, -5.9427, -5.3342, -2.3103, -5.1744, -4.8503, -4.4169, -5.6012, -3.4157, -2.6295, -5.7202, -2.577, -5.2051, -6.0994, -5.1416, -6.0896, -6.2333, -3.6843, -5.7171, -3.4496, -5.4091, -5.1538, -4.8137, -5.1092, -4.9839, -6.7018, -5.0353, -5.1148, -4.5733, -2.8149, -4.5808, -6.5496, -5.6334, -6.2472, -4.297, -6.36, -5.79, -3.0092, -6.054, -2.607, -5.0717, -4.9475, -3.5901, -4.8503, -4.762, -5.3427, -4.262, -3.3697, -4.3344, -4.9459, -5.1766, -4.5014, -6.5161, -5.4589, -4.8076, -5.3494, -5.0645, -4.6002, -4.0669, -4.644, -3.1598, -5.6968, -3.6694, -6.2671, -3.6199, -5.0656, -5.6934, -2.4265, -5.3694, -5.8047, -2.7862, -4.4374, -4.2112, -4.0185, -4.4496, -4.2772, -6.0107, -3.7618, -4.1827, -4.5534, -5.1669, -5.4256, -3.202, -4.0754, -5.0113, -3.9201, -5.9312, -4.3589, -5.1714, -4.3709, -4.5456, -6.1202, -6.2702, -6.5193, -5.4442, -4.7253, -3.6486, -4.2411, -4.9862, -5.6179, -4.435, -5.7707, -4.9768, -4.0589, -5.325, -5.8758, -5.4908, -5.5409, -5.5704, -5.381, -5.5821, -4.3098, -3.8961, -4.3731, -3.6633, -3.7251, -6.0618, -5.5744, -4.7953, -4.6522, -3.3299, -4.2545, -2.7509, -4.9431, -5.3553, -4.8841, -3.5174, -4.5965, -4.811, -4.8233, -4.1288, -5.0274, -2.6314, -2.7359, -4.9739, -4.8616, -5.2188, -5.3841, -5.2619, -4.0727, -3.6144, -5.5492, -6.1666, -4.5578, -4.1365, -5.8524, -5.0838, -3.8582, -2.7816, -5.4892, -5.4716, -5.3517, -3.3798, -5.6489, -5.7734, -5.8764, -4.8448, -5.4524, -5.2456, -5.5092, -3.7503, -5.6181, -4.4408, -2.502, -4.3463, -2.4422, -4.9456, -4.5095, -5.5425, -3.3111, -3.5778, -4.0879, -2.5511, -4.3698, -4.9373, -3.9924, -5.0485, -2.4913, -5.3014, -4.6653, -4.5794, -5.1848, -5.6609, -3.7115, -5.8524, -4.8346, -4.1001, -5.3993, -4.6576, -2.3731, -4.4791, -4.2842, -4.585, -4.5178, -3.5767, -5.0649, -5.2922, -5.0362, -4.278, -3.6679, -4.0661, -3.3194, -4.5809, -4.5871, -5.5592, -3.4373, -3.7129, -4.2972, -3.0562, -3.9332, -5.0798, -3.2369, -4.9197, -5.4736, -5.1451, -4.2486, -4.7225, -2.4698, -5.4047, -5.3178, -3.2896, -3.5705, -4.6662, -3.7536, -3.8655, -2.9731, -5.4119, -5.5269, -4.2699, -4.7446, -4.6485, -5.2082, -5.2192, -3.8992, -4.0285, -3.4099, -4.2597, -4.9716, -5.0837, -4.798, -4.568, -4.1002, -3.1933, -4.5339, -4.5103, -3.0887, -4.7828, -4.6538, -2.4963, -4.0677, -4.8464, -4.6024, -3.2606, -4.993, -4.8917, -4.9863, -4.7818, -4.737, -4.326, -2.5163, -3.6452, -5.5433, -4.3938, -3.3796, -3.9504, -3.4038, -5.2788, -3.421, -3.4739, -4.2933, -5.0014, -4.7589, -5.0427, -3.6314, -2.4092, -3.3819, -3.3892, -4.9603, -4.7624, -4.9969, -4.698, -3.368, -5.4952, -5.0409, -4.5023, -3.5906, -4.9209, -4.6258, -4.1133, -3.5071, -3.5508, -3.9013, -4.5355, -4.5978, -4.1097, -5.1726, -4.6588, -4.6232, -5.2759, -4.8914, -5.1126, -4.0625, -4.1895, -4.39, -4.5103, -5.0135, -3.6811, -4.2379, -5.6478, -4.6499, -4.2223, -4.0218, -5.1695, -3.6294, -5.5873, -2.8728, -5.226, -4.5945, -3.8863, -3.8797, -5.4569, -3.8411, -4.1767, -5.2053, -3.9872, -4.4036, -3.5669, -4.0918, -4.1197, -3.7562, -4.0624, -4.7231, -3.852, -4.8402, -4.1885, -5.137, -5.0884, -4.4647, -3.6967, -3.157, -4.9204, -4.5139, -4.7631, -3.4633, -4.4754, -3.7975, -5.2413, -5.1288, -4.52, -3.8591, -4.4852, -3.927, -3.5625, -5.0605, -4.5152, -4.379, -4.7008, -5.403, -5.758, -3.821, -3.9282, -4.1863, -4.8298, -3.3146, -4.4607, -4.5131, -4.215, -4.3592, -4.6056, -4.4392, -4.2916, -4.5532, -4.8588, -3.8614, -4.8575, -4.2627, -3.848, -4.3827, -4.4439, -4.8675, -3.8981, -4.6863, -4.337, -4.314, -4.269, -4.5184, -3.535, -4.4471, -3.7795, -5.5672, -5.2383, -4.076, -4.9445, -5.5747, -4.8419, -5.0357, -4.2412, -4.839, -4.7467, -5.299, -4.1568, -4.1888, -5.3178, -4.1681, -5.1252, -4.473, -4.5311, -4.6743, -5.2491, -4.2209, -5.3675, -4.4584, -4.7314, -4.4527, -4.565, -4.9896, -5.0002, -4.5563, -4.8956, -4.3817, -4.9293, -5.3382, -4.595, -4.5986, -4.1269, -4.4644, -4.5525, -4.6003, -5.0172, -4.5835, -4.38, -4.4835, -4.7795, -3.9624, -4.3671, -4.9507, -4.6754, -4.6115, -4.8252, -3.7967, -4.7183, -4.7553, -4.3853, -4.1696, -4.7251, -4.5502, -4.7534, -4.2166, -4.8022, -4.7315, -4.6613, -5.4156, -4.1482, -4.9613, -4.9345, -4.9831, -5.0758, -5.0296, -4.8306, -5.3013, -4.7543, -4.4826, -4.775, -4.8649, -4.4618, -5.2179, -4.7581, -4.7694, -4.4877, -4.7306, -4.967, -4.3727, -4.9702, -4.9056, -4.6585, -4.4714, -4.7111, -4.7385, -4.8414, -4.7849, -5.0645, -4.8351, -4.7089, -4.7533, -5.2561, -4.9148, -4.5417, -4.9543, -5.1075, -4.6441, -4.8776, -5.0359, -4.8198, -4.8075, -4.6886, -5.0075, -4.8756, -5.4481, -4.6364, -4.7653, -4.8805, -5.5024, -4.8637, -4.8137, -4.9603, -5.0703, -4.7148, -4.7682, -4.757, -5.1766, -4.8527, -4.9486, -5.4817, -4.7323, -5.0959, -5.1182, -4.76, -4.843, -4.9441, -4.8958, -4.8366, -5.1213, -4.7818, -4.9655, -5.0336, -5.1653, -5.0079, -5.0122, -5.1685, -5.0374, -5.0249, -4.8992, -5.1801, -5.0885, -5.5476, -5.0369, -5.0142, -5.0946, -5.0332, -5.0506, -5.0631, -5.1206 ], | |
"loglift": [ 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 3.0412, 3.0398, 3.0384, 3.0374, 3.0373, 3.0368, 3.0362, 3.0351, 3.0344, 3.0342, 3.0325, 3.0315, 3.0312, 3.0278, 3.0255, 3.0231, 3.0228, 3.0208, 3.0125, 3.0067, 3.0066, 3.0031, 3.0012, 2.9996, 2.9897, 2.9812, 2.9793, 2.9754, 2.9647, 2.9569, 2.9036, 2.9035, 2.9033, 2.9033, 2.9031, 2.9028, 2.9025, 2.9024, 2.9022, 2.9018, 2.9016, 2.9013, 2.9007, 2.9002, 2.9, 2.8994, 2.8989, 2.8982, 2.8982, 2.8981, 2.898, 2.8971, 2.8963, 2.8948, 2.8947, 2.8945, 2.8942, 2.8936, 2.8934, 2.893, 2.9264, 2.9263, 2.9261, 2.9259, 2.9258, 2.9258, 2.9255, 2.9254, 2.9251, 2.925, 2.9247, 2.9245, 2.9245, 2.9244, 2.9243, 2.9241, 2.924, 2.9236, 2.9235, 2.9235, 2.923, 2.9229, 2.9227, 2.922, 2.9217, 2.9215, 2.9208, 2.9208, 2.9208, 2.9208, 2.9685, 2.968, 2.9671, 2.9657, 2.9574, 2.9561, 2.938, 2.9356, 2.9342, 2.9276, 2.927, 2.926, 2.9148, 2.9137, 2.9005, 2.8809, 2.8793, 2.8785, 2.8421, 2.8063, 2.7666, 2.7514, 2.7316, 2.7199, 2.7068, 2.6921, 2.6818, 2.6813, 2.6782, 2.6247, 3.0239, 3.0214, 3.0203, 3.0201, 3.0192, 3.0173, 3.0153, 3.0147, 3.0134, 3.0131, 3.0117, 3.0115, 3.0111, 3.0106, 3.0102, 3.0095, 3.0092, 3.0086, 3.0073, 3.0069, 3.0069, 3.0066, 3.0066, 3.0064, 3.0062, 3.0058, 3.0051, 3.0045, 3.0044, 3.0041, 2.9653, 2.965, 2.9643, 2.9616, 2.9584, 2.9579, 2.9543, 2.9506, 2.9494, 2.946, 2.9346, 2.9213, 2.9185, 2.9088, 2.9006, 2.8991, 2.8964, 2.8663, 2.8655, 2.8487, 2.8474, 2.8415, 2.839, 2.8241, 2.8211, 2.8186, 2.8124, 2.804, 2.8005, 2.8004, 2.934, 2.9325, 2.9317, 2.9289, 2.9288, 2.9283, 2.9276, 2.9259, 2.9248, 2.924, 2.9238, 2.9228, 2.9226, 2.9209, 2.9206, 2.9189, 2.9186, 2.9181, 2.9177, 2.9171, 2.9162, 2.916, 2.9153, 2.9149, 2.9147, 2.9144, 2.9139, 2.9128, 2.9122, 2.9116, 3.0652, 3.0627, 3.0617, 3.0617, 3.0615, 3.0608, 3.0608, 3.0594, 3.0593, 3.0586, 3.0581, 3.0575, 3.0546, 3.0506, 3.0504, 3.0487, 3.0487, 3.0486, 3.0481, 3.0477, 3.0453, 3.0444, 3.0444, 3.0444, 3.044, 3.0439, 3.0421, 3.0413, 3.0402, 3.0399, 2.9944, 2.9933, 2.9929, 2.992, 2.9908, 2.9908, 2.9903, 2.9901, 2.99, 2.9872, 2.9868, 2.9866, 2.9861, 2.9849, 2.9847, 2.9842, 2.9825, 2.9815, 2.9803, 2.98, 2.9784, 2.9777, 2.9772, 2.9765, 2.9753, 2.973, 2.9716, 2.969, 2.9685, 2.9628, 2.9972, 2.9967, 2.9966, 2.9959, 2.9955, 2.9954, 2.995, 2.9946, 2.9945, 2.9937, 2.9936, 2.9928, 2.9924, 2.9915, 2.9909, 2.9905, 2.9898, 2.9896, 2.9888, 2.9885, 2.9882, 2.9881, 2.987, 2.9864, 2.9861, 2.986, 2.9857, 2.9854, 2.9851, 2.9838, 2.8907, 2.8898, 2.8891, 2.8822, 2.8812, 2.8802, 2.8797, 2.8789, 2.8787, 2.8787, 2.8773, 2.8756, 2.875, 2.8732, 2.8731, 2.8725, 2.8695, 2.8652, 2.8639, 2.8635, 2.8569, 2.8549, 2.8514, 2.8475, 2.8412, 2.8374, 2.8371, 2.837, 2.8363, 2.8355, 3.0498, 3.0496, 3.0494, 3.0491, 3.049, 3.0485, 3.0484, 3.0484, 3.0484, 3.0483, 3.0481, 3.048, 3.0473, 3.0472, 3.0467, 3.0462, 3.0462, 3.0461, 3.046, 3.0446, 3.0444, 3.0438, 3.0438, 3.0435, 3.0434, 3.0434, 3.0429, 3.0425, 3.0423, 3.042, 3.2502, 3.2499, 3.2499, 3.2497, 3.2496, 3.2495, 3.2488, 3.2485, 3.2483, 3.2482, 3.2478, 3.2477, 3.2471, 3.2469, 3.2463, 3.2461, 3.246, 3.246, 3.2458, 3.2457, 3.2455, 3.2454, 3.2452, 3.245, 3.245, 3.2448, 3.2445, 3.2443, 3.2438, 3.2435, 2.9123, 2.9119, 2.9103, 2.91, 2.9092, 2.9074, 2.9074, 2.9067, 2.9057, 2.9055, 2.9045, 2.903, 2.903, 2.9029, 2.902, 2.9017, 2.9009, 2.9003, 2.8986, 2.8956, 2.8949, 2.8926, 2.8916, 2.8902, 2.8871, 2.8839, 2.8819, 2.8815, 2.8786, 2.8777, 3.0192, 3.0189, 3.0189, 3.0188, 3.0184, 3.018, 3.0173, 3.0163, 3.0148, 3.0125, 3.0125, 3.0117, 3.0115, 3.009, 3.0079, 3.0076, 3.0072, 3.0069, 3.0065, 3.0061, 3.0058, 3.0041, 3.0038, 3.0035, 3.0032, 3.0029, 3.0011, 3.0007, 2.9998, 2.9991, 2.8893, 2.8885, 2.8885, 2.8884, 2.8881, 2.888, 2.8872, 2.887, 2.8865, 2.8853, 2.8852, 2.885, 2.8844, 2.8843, 2.8839, 2.8838, 2.8835, 2.8832, 2.8832, 2.8827, 2.882, 2.8819, 2.8815, 2.8807, 2.8805, 2.8805, 2.88, 2.879, 2.8783, 2.8771, 3.1075, 3.1035, 3.1019, 3.1008, 3.0991, 3.098, 3.0971, 3.0964, 3.0937, 3.0927, 3.0924, 3.0899, 3.0879, 3.0818, 3.0804, 3.0803, 3.0796, 3.0764, 3.0757, 3.0756, 3.0747, 3.0733, 3.0717, 3.0661, 3.0593, 3.0587, 3.0535, 3.0523, 3.0509, 3.0485, 3.0896, 3.087, 3.0866, 3.0849, 3.0843, 3.0831, 3.0826, 3.0825, 3.0813, 3.0804, 3.0803, 3.0776, 3.0761, 3.0761, 3.0754, 3.0748, 3.0738, 3.0735, 3.0719, 3.0711, 3.0701, 3.0691, 3.0683, 3.0675, 3.0674, 3.0665, 3.066, 3.0654, 3.0535, 3.0526, 3.028, 3.0271, 3.027, 3.0265, 3.0253, 3.0243, 3.0237, 3.0209, 3.0194, 3.0185, 3.0178, 3.0162, 3.0142, 3.0133, 3.0097, 3.0057, 3.0053, 3.0046, 3.0006, 3.0005, 2.9996, 2.9971, 2.9961, 2.9956, 2.9936, 2.9866, 2.9835, 2.9828, 2.9797, 2.9785, 2.9057, 2.9056, 2.9014, 2.9007, 2.9005, 2.9002, 2.9, 2.8991, 2.8985, 2.8981, 2.897, 2.897, 2.8968, 2.8965, 2.896, 2.895, 2.8947, 2.8945, 2.8945, 2.8945, 2.8945, 2.8935, 2.8904, 2.8896, 2.8896, 2.8894, 2.8892, 2.8891, 2.8888, 2.8888, 2.9277, 2.8826, 2.8795, 2.8929, 2.8905, 2.8842, 2.919, 2.9172, 2.6013, 3.0023, 2.9995, 2.9992, 3.0017, 3, 3.0033, 2.9997, 2.9983, 2.7926, 2.7722, 2.902, 2.9065, 2.9108, 2.9076, 2.909, 3.0343, 2.9546, 2.9794, 2.9733, 2.9806, 2.8296, 2.8241, 3.0401, 3.0413, 3.2428, 2.8705, 2.9976, 2.997, 2.8674, 2.8763, 2.8763, 2.8355, 2.8685, 3.0355, 3.05, 3.051, 2.9728, 2.887, 2.888, 2.888, 2.8824, 2.885, 2.8999, 2.878, 2.8843, 2.9168, 2.9164, 2.9164, 2.9879, 2.9973, 2.9974, 2.8935, 2.9076, 3.0225, 3.0194, 2.9517, 2.9786, 2.9779, 2.9836, 3.037, 3.2369, 2.836, 2.8087, 2.8585, 2.8633, 2.9851, 2.9908, 2.9725, 2.8564, 2.8432, 2.8719, 3.0475, 3.0406, 3.046, 2.9462, 2.8705, 2.8886, 2.8717, 2.8353, 2.9838, 2.9914, 2.7763, 2.8924, 2.9688, 2.9448, 2.9041, 2.9688, 2.9329, 2.788, 3.2398, 2.8189, 2.8566, 2.94, 2.9683, 2.9576, 2.8506, 2.9222, 2.8875, 2.8767, 2.9062, 2.9055, 2.9733, 2.9206, 2.9175, 2.6751, 2.8036, 2.8763, 2.9647, 2.9991, 2.972, 2.9367, 2.942, 2.7767, 2.7893, 3.0293, 2.7987, 3.0445, 2.8884, 2.869, 2.871, 2.8597, 2.5507, 2.7184, 2.748, 2.8717, 2.9736, 2.661, 2.7759, 2.9716, 2.9776, 2.9404, 3.0253, 2.8566, 2.8402, 2.8054, 2.9028, 2.6621, 2.9035, 2.8388, 2.8605, 2.928, 2.9153, 2.7761, 2.7392, 2.709, 3.0049, 2.8483, 2.8243, 2.8507, 2.7954, 2.4161, 2.9746, 2.7942, 2.8169, 2.6539, 2.6381, 2.8635, 2.8208, 2.8519, 2.9233, 2.7516, 2.8524, 2.7298, 2.8013, 2.9785, 2.6449, 2.8164, 2.7946, 2.8901, 2.908, 2.6943, 2.9161, 3.0291, 3.1026, 2.8907, 2.78, 2.7743, 2.8649, 2.8513, 2.8669, 2.3392, 2.8664, 2.6304, 2.836, 2.7415, 2.7711, 2.5776, 2.8672, 2.6531, 2.8974, 2.9834, 2.8243, 2.8093, 2.8219, 2.4282, 2.8051, 2.7186, 2.9263, 2.8089, 2.7669, 2.794, 2.8688, 2.9623, 2.692, 2.7521, 2.5092, 2.5669, 2.5239, 2.7585, 2.7868, 2.8653, 2.5664, 2.9269, 2.8159, 2.5887, 2.9679, 2.4967, 2.7716, 2.6571, 2.6152, 2.5292, 2.6725, 2.8521, 2.5551, 2.6611, 2.6187, 2.6933, 2.7371, 2.7653, 2.8408, 2.8393, 2.6505, 2.8496, 2.6371, 2.6418, 2.691, 2.7755, 2.4325, 2.72, 2.2915, 2.9543, 2.4732, 2.6909, 2.725, 2.6372, 2.7388, 2.8066, 2.4145, 2.5469, 2.5446, 2.6111, 2.6826, 2.3793, 2.6872, 2.5793, 2.9214, 2.7341, 2.7895, 2.7428, 2.2542, 2.6094, 2.7114, 2.2848, 2.9541, 2.6471, 2.6875, 2.5637, 2.728, 2.9538, 2.8816, 2.8682, 2.5484, 2.4295, 2.4867, 2.4033, 2.6529, 2.8572, 2.6136, 2.8151, 2.4784, 2.8193, 2.8489, 2.693, 2.6068, 2.7638, 2.5351, 2.7501, 2.7017, 2.5856, 2.2858, 2.5562, 2.4903, 2.7211, 2.8607, 2.7077, 2.5983, 2.5498, 2.0883, 2.3059, 2.0188, 2.5343, 2.6705, 2.596, 2.3144, 2.4552, 2.2999, 2.4072, 2.506, 2.7298, 1.9278, 1.9542, 2.7466, 2.6224, 2.492, 2.8062, 2.6763, 2.3369, 2.5717, 2.7005, 2.873, 2.4773, 2.257, 2.643, 2.3708, 2.2717, 1.8679, 2.6429, 2.8431, 2.8506, 2.4519, 2.7205, 2.7035, 2.7309, 2.5356, 2.6041, 2.5965, 2.7307, 2.0515, 2.5665, 2.4711, 1.7886, 2.1822, 1.8854, 2.4084, 2.432, 2.6187, 2.3446, 2.0669, 2.2174, 1.7766, 2.3579, 2.4157, 2.2438, 2.4834, 1.7993, 2.7843, 2.4611, 2.2932, 2.5768, 2.7035, 1.8808, 2.6235, 2.4812, 2.053, 2.5295, 2.3075, 1.9546, 2.3197, 2.3817, 2.4917, 2.241, 1.8051, 2.34, 2.3877, 2.4556, 2.3811, 2.0911, 2.3167, 2.2579, 2.7303, 2.344, 2.6938, 1.7928, 1.7433, 2.3225, 1.503, 2.2264, 2.3649, 1.7093, 2.4686, 2.6271, 2.6645, 2.1609, 2.1792, 1.1782, 2.5316, 2.5576, 1.9288, 2.0068, 2.4536, 1.8443, 1.7276, 1.3174, 2.6876, 2.7232, 1.9918, 2.1963, 2.4257, 2.3262, 2.5762, 1.8361, 1.9636, 1.6538, 1.886, 2.1548, 2.5266, 2.1331, 2.0631, 2.1531, 1.9327, 2.0972, 1.9927, 1.6151, 2.6956, 2.3545, 1.1518, 2.0919, 2.2314, 2.0248, 1.4295, 2.3838, 2.0928, 2.0977, 2.0908, 2.2758, 1.9646, 1.1318, 1.5732, 2.5686, 1.8114, 1.3654, 1.6942, 1.366, 2.6564, 1.5252, 1.4724, 1.8927, 2.2361, 1.9585, 2.5735, 1.4723, 1.2389, 1.8189, 1.5247, 2.2111, 2.0364, 2.3505, 1.9608, 1.3221, 2.559, 2.2536, 1.7339, 1.1544, 2.0083, 2.0307, 1.6617, 1.1967, 1.1942, 1.4217, 1.9107, 1.9407, 1.609, 2.1491, 2.2931, 1.9153, 2.4527, 2.1169, 2.0955, 1.532, 1.6124, 1.7626, 1.8725, 2.2549, 1.2328, 1.4808, 2.7541, 2.0675, 1.5366, 1.4791, 2.5264, 1.0744, 2.4216, 0.7753, 2.6292, 1.9781, 1.3208, 1.2463, 2.3096, 1.0728, 1.6351, 2.3918, 1.5137, 1.887, 0.9922, 1.6435, 1.3812, 0.9476, 1.5933, 2.1908, 1.1225, 2.1032, 1.3124, 2.3013, 2.126, 1.6342, 1.0071, 0.4911, 2.2177, 1.6043, 1.7927, 1.2405, 1.6777, 0.9475, 2.3854, 2.1804, 1.5108, 1.2669, 1.608, 1.1367, 0.7652, 2.4367, 1.6306, 1.7668, 1.9078, 2.4893, 2.5237, 0.9487, 1.0181, 1.5324, 2.214, 0.3335, 1.5314, 1.479, 1.56, 1.2339, 1.5813, 1.3725, 1.3029, 1.2431, 2.0551, 1.0525, 2.224, 1.1555, 0.8971, 1.273, 1.4403, 2.2522, 0.6611, 1.9409, 1.2561, 0.812, 1.5329, 1.2406, 0.113, 1.6828, 0.511, 2.2743, 1.836, 1.0276, 1.7957, 2.2726, 2.1709, 2.3955, 0.9772, 1.6018, 1.7758, 1.8511, 1.0616, 0.7251, 2.4016, 1.0503, 2.0297, 1.302, 1.2439, 1.6301, 2.2925, 0.0697, 2.3495, 0.9597, 1.8534, 1.1418, 1.0123, 1.5134, 2.1885, 1.6255, 2.1804, 0.9414, 1.5932, 2.2996, 1.1403, 1.5368, 0.6181, 1.1914, 1.0406, 0.8179, 2.1955, 1.4086, 0.3897, 1.1611, 1.6006, 0.3281, 0.7589, 2.0807, 1.3203, 1.3494, 1.4365, -0.1486, 1.4866, 1.5353, 0.3845, 0.3895, 1.5802, 1.1851, 1.9744, 0.3426, 1.0096, 1.6513, 1.0573, 1.8714, -0.5002, 1.292, 1.9228, 1.9791, 1.4527, 2.3018, 1.5494, 2.0279, 1.2067, 0.6434, 1.378, 1.5189, 0.2284, 1.8581, 1.4782, 1.3488, 0.2025, 1.009, 1.5715, 0.5412, 1.1479, 0.0082, 1.454, -0.8233, 0.0339, 0.856, 1.2768, 1.4011, 2.0002, 1.3175, 1.0874, 0.8412, 1.9313, 1.1842, 0.6591, 1.6805, 1.2762, 0.5629, 1.2906, 0.7604, -1.1717, 1.0043, 0.3751, 1.8665, 0.0988, 1.6566, 0.0131, 0.8121, 1.2731, 1.9288, 1.2889, 0.1001, 1.7246, 1.0287, 0.6083, 0.2062, 0.8375, 1.4505, -0.5622, 1.1867, 1.5961, 1.0641, 0.7005, 0.5264, -0.4324, -0.028, 1.4359, 0.3226, -0.0668, 0.2969, -0.4913, 0.5527, 1.1346, 0.6417, 1.1219, -0.2425, 0.5037, 1.9113, 1.8323, -0.2091, 0.9795, 1.2424, 1.6124, 1.8977, 0.1118, 0.4062, 0.7632, 1.0483, -0.318, 2.0558 ], | |
"Freq": [ 21240, 13046, 41908, 15395, 22043, 11124, 7428, 7259, 16850, 10174, 14781, 8614, 9775, 6080, 8815, 13651, 6458, 7401, 14581, 11442, 8871, 5536, 7850, 4716, 5963, 5059, 5094, 13992, 5997, 4085, 3237.8, 863.97, 239.59, 184.24, 181.65, 2555.5, 760.19, 119.38, 109.01, 217.1, 85.657, 1053.4, 467.89, 177.32, 48.471, 87.387, 41.553, 116.79, 84.792, 94.305, 161.76, 40.688, 101.22, 57.984, 155.7, 177.32, 38.094, 36.364, 83.063, 46.742, 1283.3, 1182.2, 904.82, 881.42, 690.95, 555.61, 450.34, 446.16, 393.53, 321.68, 308.32, 553.1, 706.82, 818.77, 188.01, 513.83, 149.58, 407.73, 132.04, 130.37, 127.86, 111.99, 100.29, 84.421, 82.75, 81.079, 652.52, 74.395, 148.75, 70.218, 4084.4, 2491.3, 4713.9, 2282.5, 980.68, 968.55, 746.04, 675.65, 549.43, 500.07, 423.21, 796.21, 375.47, 369.8, 725.81, 1354.5, 311.55, 265.43, 258.96, 257.34, 223.36, 215.26, 429.68, 174, 164.29, 157.82, 423.21, 137.59, 137.59, 565.61, 7426.6, 1109.9, 492.27, 1078, 1324.1, 130.29, 2756.8, 73.554, 47.185, 119.9, 57.573, 37.596, 412.36, 118.3, 166.25, 5914.8, 35.199, 71.157, 31.204, 91.933, 823.08, 928.56, 3160.4, 464.3, 35.998, 153.46, 96.727, 453.91, 528.23, 125.49, 1229.6, 419.42, 158.36, 320.05, 130.57, 99.414, 79.203, 74.992, 66.571, 64.886, 58.149, 544.06, 55.623, 53.939, 52.254, 101.1, 101.1, 47.202, 43.833, 42.991, 42.991, 130.57, 42.149, 84.255, 41.307, 40.464, 448.06, 37.938, 78.36, 37.096, 517.01, 972.52, 1223.4, 77.504, 437.03, 116.23, 386.51, 75.82, 520.38, 575.95, 64.874, 144.02, 30.353, 116.23, 33.721, 32.037, 64.032, 4982, 37.089, 398.3, 31.195, 29.511, 214.75, 41.299, 93.501, 30.353, 138.13, 221.48, 40.457, 35.405, 803.04, 231.89, 184.5, 231.04, 110.89, 415.5, 94.811, 322.42, 71.119, 134.58, 65.196, 123.58, 59.273, 268.27, 214.12, 95.657, 139.66, 44.042, 43.196, 130.35, 81.272, 164.19, 38.119, 37.273, 786.11, 73.657, 35.58, 33.888, 33.042, 134.58, 672.73, 902.64, 169.84, 169.02, 163.34, 291.7, 1197.5, 481.81, 112.97, 101.59, 95.906, 546.8, 137.34, 156.84, 49.598, 472.06, 91.844, 233.21, 43.099, 86.157, 37.412, 459.06, 72.346, 35.787, 109.72, 34.975, 97.531, 64.222, 93.469, 213.71, 1668.3, 508.74, 858.15, 274.94, 197.01, 193.59, 358.87, 167.9, 163.61, 102.81, 98.528, 95.959, 90.82, 79.687, 495.04, 626.06, 199.58, 122.51, 53.995, 53.139, 48.001, 143.06, 91.677, 176.46, 40.293, 36.011, 69.41, 62.559, 60.847, 48.857, 3184.5, 1058.1, 967.19, 511.66, 839.71, 379.93, 320.44, 273.7, 272, 885.61, 207.41, 354.44, 979.94, 132.62, 120.72, 113.93, 102.88, 100.33, 90.979, 88.429, 85.879, 355.29, 154.72, 149.62, 291.55, 286.45, 67.182, 133.47, 63.783, 57.834, 374.21, 262.21, 209.11, 152.7, 68.072, 259.72, 378.36, 237.32, 231.51, 55.628, 50.65, 45.672, 277.14, 167.63, 39.864, 120.34, 209.11, 120.34, 108.72, 112.87, 569.18, 63.924, 58.116, 107.07, 381.68, 206.62, 288.76, 43.183, 140.25, 41.524, 1875, 1396.9, 963.14, 725.78, 1351.6, 3734.6, 447.44, 920.45, 433.78, 423.53, 371.45, 1446.4, 1174.9, 264.72, 227.16, 413.29, 196.42, 193.86, 190.44, 140.92, 137.51, 124.7, 123.85, 246.79, 360.35, 116.16, 451.71, 103.35, 207.52, 96.523, 945.08, 729.63, 688.43, 580.28, 547.66, 507.32, 349.39, 315.91, 289.3, 278.15, 248.1, 238.66, 199.18, 193.17, 169.14, 161.41, 158.84, 157.98, 150.25, 147.68, 143.39, 139.95, 134.8, 131.37, 130.51, 127.08, 120.21, 116.78, 224.93, 104.76, 1715.8, 574.45, 269.09, 245.98, 401.14, 424.25, 134.57, 119.71, 216.27, 209.67, 755.19, 1137.3, 158.5, 155.2, 70.192, 141.99, 269.92, 61.114, 53.686, 138.69, 42.957, 38.005, 36.355, 70.192, 61.939, 195.64, 75.969, 51.21, 71.017, 66.891, 1239.6, 499.02, 486.6, 466.74, 385.65, 319.45, 248.29, 583.42, 7218.2, 99.34, 408.82, 554.46, 87.755, 68.723, 62.93, 61.275, 182.92, 57.965, 56.311, 54.656, 53.828, 48.036, 47.208, 46.381, 45.553, 44.726, 40.588, 39.761, 38.106, 1325.7, 766.74, 417.05, 414.58, 403.91, 353.02, 333.32, 251.23, 234.81, 1065.5, 319.36, 154.37, 148.62, 270.93, 268.47, 123.17, 371.9, 1331.5, 222.5, 110.04, 214.29, 95.263, 585.33, 89.517, 82.129, 254.51, 165.04, 76.383, 69.816, 65.711, 1773.1, 1368.4, 175.08, 129.64, 109.44, 457.83, 79.145, 145.63, 68.205, 232.3, 51.375, 50.533, 697.66, 163.3, 61.473, 148.99, 87.56, 57.265, 154.88, 101.87, 148.99, 199.48, 136.37, 44.643, 37.91, 32.861, 130.48, 5757.7, 175.08, 56.424, 276.06, 971.06, 232.85, 208.3, 449.57, 129.57, 222.69, 101.63, 99.938, 87.239, 78.773, 77.927, 61.842, 55.069, 55.069, 52.53, 105.02, 47.45, 96.551, 132.11, 40.678, 80.467, 75.387, 35.598, 107.56, 70.308, 136.34, 32.212, 31.365, 43.217, 64.382, 351.52, 494.31, 239.99, 432.63, 159.73, 131.85, 249.29, 84.532, 72.703, 136.07, 63.409, 114.95, 153.81, 46.511, 924.36, 65.944, 65.099, 62.565, 53.271, 54.116, 81.152, 74.393, 97.205, 70.169, 88.756, 91.291, 174.94, 554.29, 46.511, 138.61, 445, 1131.2, 99.846, 91.529, 89.865, 86.538, 84.875, 77.39, 73.231, 296.96, 64.083, 64.083, 63.251, 61.587, 59.092, 112.32, 54.102, 53.27, 53.27, 53.27, 53.27, 49.944, 41.627, 39.963, 39.963, 79.053, 80.717, 80.717, 79.053, 38.3, 1047.3, 1206.4, 1112, 144.57, 180.5, 288.27, 432.11, 262.19, 7703.9, 3006.5, 511.22, 220.68, 139.84, 163.42, 112.05, 157.52, 122.99, 1053.3, 1304.3, 785.27, 308.04, 129.5, 114.27, 91.426, 128.4, 279.23, 453.02, 714.78, 243.96, 442.24, 228.19, 327.05, 185.32, 404.32, 173.35, 68.723, 68.723, 2035, 410.48, 356.3, 12350, 372.72, 316.45, 158.35, 122.8, 96.36, 371.81, 195.49, 153.07, 180.52, 133.95, 4420.8, 346.75, 249, 250.06, 243.58, 238.73, 212.26, 119.62, 117.94, 185.35, 86.349, 151.15, 156.03, 292.07, 172.57, 170.02, 117.32, 185.32, 174.29, 2126, 4556.5, 264.96, 199.76, 187.05, 108.44, 219.33, 958, 1664.8, 224.14, 112.64, 148.19, 110.1, 376.02, 254.54, 78.221, 171.37, 1482.9, 195.42, 121.31, 231.58, 169.27, 760.47, 145.63, 4049.7, 226.96, 722.43, 1210.5, 144.24, 677.62, 199.76, 865.59, 242.5, 273.11, 500.78, 3886.2, 74.895, 99.014, 377.96, 1189.1, 206.36, 693.12, 733.54, 3329.2, 2225.4, 232.73, 650.79, 227.52, 420.06, 135.35, 472.57, 755.85, 461.32, 194.71, 639.65, 88.086, 1474.4, 123.97, 781.81, 791.35, 1029.2, 337.67, 2374.3, 2485.2, 167.47, 3837.1, 973.9, 117.54, 96.857, 693.45, 134.65, 157.23, 610.58, 609.07, 308.31, 730.87, 100.73, 277.58, 2681.8, 119.08, 424.98, 341.85, 954.92, 1424.5, 175.28, 156.4, 217.95, 139.77, 321.91, 4517.2, 130.57, 474.73, 561.83, 1766.4, 3930.1, 383.17, 1902.7, 1780.4, 468.2, 1582.5, 130.62, 954.94, 418.59, 122.99, 559.11, 305.5, 2020.5, 578.48, 139.63, 616.47, 661.75, 1836.9, 682.42, 527.68, 1882, 358.5, 107.33, 231.46, 415.92, 8203.3, 442.16, 644.99, 905.08, 329.41, 2503.4, 5660.9, 257.39, 5465.7, 394.71, 164.28, 454.6, 198.82, 172.2, 2076, 280.96, 2381.2, 335.57, 453.5, 637.21, 474.19, 501.21, 95.515, 570.59, 529.71, 853.45, 4680.6, 844.54, 117.92, 305.5, 155.91, 1213.8, 135.75, 273.39, 3547.9, 171.9, 5733.5, 487.55, 622.99, 2155.9, 644.99, 730.27, 384.18, 1256.9, 2621.2, 1145.6, 621.49, 504.88, 797.8, 129.79, 332.68, 657.75, 381.63, 563.37, 878.16, 1232, 691.77, 3298.5, 294.46, 2107.2, 148.26, 2288, 539.04, 300.37, 5507.2, 406.92, 263.31, 4513.1, 908.93, 1307.5, 1550.3, 1007.4, 1147.5, 202.12, 1742.7, 951.08, 757.41, 417.4, 342.22, 3568.9, 1464.5, 520.48, 1635.2, 199.08, 1027.5, 496.05, 992.2, 763.3, 160.89, 147.05, 113.33, 357.22, 730.87, 1951.5, 1283.5, 536.25, 265.87, 867.78, 274.9, 568.37, 1076.4, 350.11, 246.23, 361.83, 345.91, 314.87, 359.63, 321.58, 1007.4, 1636.6, 1013.1, 1954.4, 1503, 182.92, 294.91, 645.96, 745.33, 2950.3, 1170.4, 5456, 609.27, 412.69, 676.44, 2172.3, 784.11, 672.86, 662.67, 1207.3, 491.56, 5797, 5221.5, 497.38, 566.4, 474.94, 395.7, 405.11, 1330.6, 1679, 305.38, 164.71, 937.48, 1242, 252.05, 512.24, 1648.9, 5291, 352.89, 315.26, 361.21, 2122.7, 276.42, 241.68, 218.03, 614.8, 345.17, 460.56, 362.05, 1827.6, 318.58, 1016.3, 6400.2, 1067.7, 6520.5, 572.97, 883.91, 349.32, 2273.8, 2441.3, 1465.8, 5709.3, 926.19, 557.67, 1441.8, 548.35, 6208.6, 373.75, 756.43, 915.14, 489.45, 273.11, 2144.2, 252.05, 700.97, 1365.7, 364.01, 846.28, 5809.3, 991.23, 991.35, 733.85, 848.32, 2453.6, 553.95, 386.6, 555.11, 1039.9, 2050.8, 1306.4, 2254.9, 638.65, 889.72, 281.95, 2499.2, 1875.8, 1173.3, 3890.7, 1468.1, 501.03, 3503.6, 638, 329.38, 419.12, 1045.6, 780.18, 6501.5, 370.51, 418.88, 2839.8, 2023.9, 676.62, 1821.6, 1610.3, 3930.5, 393.53, 310.79, 1126.2, 700.57, 769.17, 452.31, 422.79, 1669.7, 1520.6, 2418.7, 1239.3, 532.75, 546.42, 681.65, 835.88, 1330.9, 2557.9, 834.8, 885.55, 3471.6, 521.91, 685.04, 6031, 1475.9, 647.52, 807.62, 3421.5, 606.67, 658.75, 524.97, 692.83, 765.92, 1037.7, 5808.2, 1911.6, 304.2, 1083.7, 2807.2, 1716.6, 2965.2, 388.53, 2855.6, 2771.3, 999.84, 523.03, 659.01, 556.71, 2182.4, 5603.3, 2118.4, 2426.1, 545, 706.42, 528.06, 733.97, 3080.8, 300.57, 502.75, 972.3, 2119.6, 560.43, 873.66, 1197.1, 2561.3, 2311.4, 1628, 784.81, 737.41, 1275.8, 497.4, 817.24, 811.9, 401.37, 583.86, 528.17, 1469.8, 1351.5, 1106, 863.11, 594.36, 1958.5, 1109.6, 275.42, 788.13, 1181, 1406.8, 409.02, 1942.1, 328.56, 4541.7, 431.78, 770.18, 1834.7, 1512, 374.31, 1650.1, 1353.4, 428.69, 1529.1, 917.26, 2525.1, 1201.7, 1189.5, 1796.2, 1290.2, 713.93, 1894.1, 690.82, 1165.8, 459, 496.75, 1026.3, 1947.1, 3307.8, 643.33, 935.88, 687.72, 1952.8, 893.73, 1853.9, 413.53, 506.04, 876.99, 1693.8, 1005.6, 1546.6, 2226.8, 456.15, 854.81, 1007.1, 692.48, 401.59, 277, 1931.6, 1735.2, 1139.9, 641.69, 2769.8, 906.97, 802.59, 1217.5, 1092.4, 805.05, 1052.9, 1074.1, 809.48, 684.26, 1814.1, 669.99, 1256.1, 1624.8, 914.34, 913.37, 617.9, 1808.7, 663.16, 1016.5, 1028.3, 1153.5, 931.65, 2348.3, 940.85, 1792.4, 335.22, 465.79, 1403.2, 608.42, 332.72, 680.5, 487.49, 1129.6, 676.11, 758.49, 438.35, 1174, 1221.3, 438.39, 1113.4, 435.18, 887.18, 841.33, 815.44, 469.58, 1288.3, 398.58, 932.65, 707.98, 1038.8, 761.96, 523.24, 594.04, 905.44, 644.9, 976.92, 617.73, 410.42, 813.61, 627.49, 1409.7, 903.66, 942.41, 772.3, 584.01, 778.72, 962.55, 995.88, 749.21, 1185.4, 991.23, 568.61, 831.34, 868.26, 717.49, 1935.4, 680.53, 655.77, 1114, 1111.7, 689.48, 821.28, 710.67, 1184.8, 701.5, 549.38, 761.37, 390.11, 1233.8, 598.27, 548.19, 537.91, 457.19, 407.75, 697.42, 364.91, 768.29, 878.73, 642.96, 680.09, 954.13, 462.88, 643.48, 681.64, 991.7, 760.61, 544.06, 1039.9, 620.62, 649.6, 781.39, 976.5, 768.34, 704.85, 619.83, 626.42, 563.37, 656.88, 724.13, 753.54, 466.3, 563.88, 878.22, 553.63, 541, 772.57, 474.71, 475.81, 707.82, 675.25, 701.02, 584.36, 682.19, 377.63, 854.69, 734.71, 611.51, 357.67, 680.92, 634.17, 545, 536.5, 719.88, 610.99, 690.14, 504.88, 571.48, 540.51, 365.16, 725.82, 522.96, 535.25, 665.82, 695.12, 573.82, 466.12, 693.3, 533.61, 651.46, 501.59, 511.43, 510.63, 513.73, 507.21, 508.98, 572.31, 529.29, 651.21, 439.64, 484.12, 341.87, 559.95, 498.05, 467.08, 468.77, 564.8, 564.2, 455.12 ], | |
"Total": [ 21240, 13046, 41908, 15395, 22043, 11124, 7428, 7259, 16850, 10174, 14781, 8614, 9775, 6080, 8815, 13651, 6458, 7401, 14581, 11442, 8871, 5536, 7850, 4716, 5963, 5059, 5094, 13992, 5997, 4085, 3239.4, 865.61, 240.38, 185.04, 182.44, 2568.1, 764.38, 120.18, 109.8, 218.74, 86.451, 1064.1, 472.83, 179.81, 49.265, 89.026, 42.347, 119.25, 87.303, 97.668, 167.53, 42.291, 105.4, 60.476, 164.01, 188.39, 40.547, 38.856, 89.708, 50.877, 1284.1, 1183, 905.61, 882.22, 691.74, 556.4, 451.14, 446.96, 394.33, 322.48, 309.11, 554.73, 709.3, 822.06, 188.81, 516.31, 150.38, 410.19, 132.84, 131.16, 128.66, 112.79, 101.09, 85.216, 83.545, 81.874, 659.12, 75.191, 150.37, 71.013, 4085.2, 2492.1, 4716.4, 2284.2, 981.48, 969.34, 746.84, 676.45, 550.22, 500.87, 424, 797.83, 376.26, 370.6, 727.47, 1357.8, 312.34, 266.23, 259.75, 258.13, 224.15, 216.06, 431.33, 174.8, 165.09, 158.61, 425.65, 138.39, 138.39, 568.9, 7428.2, 1110.7, 493.06, 1081.3, 1339.3, 131.95, 2843, 76.036, 48.847, 124.94, 60.026, 39.24, 435.24, 125, 177.98, 6458.2, 38.493, 77.879, 35.418, 108.15, 1007.5, 1154, 4006.1, 595.51, 46.779, 202.38, 128.87, 605.09, 706.33, 177.02, 1231.2, 421.03, 159.16, 321.71, 131.37, 100.21, 79.997, 75.787, 67.365, 65.681, 58.944, 551.61, 56.418, 54.733, 53.049, 102.71, 102.73, 47.996, 44.628, 43.786, 43.786, 133.03, 42.943, 85.859, 42.101, 41.259, 457.19, 38.733, 80.012, 37.891, 520.37, 979.12, 1232.6, 78.298, 442.9, 117.86, 393.32, 77.444, 532.16, 590.95, 67.331, 151.48, 32.013, 123.79, 36.209, 34.45, 69.043, 5536, 41.248, 450.46, 35.326, 33.616, 245.24, 47.871, 108.7, 35.376, 161.98, 261.95, 48.016, 42.024, 804.63, 232.68, 185.3, 232.66, 111.68, 418.69, 95.605, 325.68, 71.913, 136.2, 65.99, 125.22, 60.067, 272.35, 217.44, 97.301, 142.1, 44.837, 43.99, 132.83, 82.897, 167.5, 38.913, 38.067, 802.98, 75.261, 36.375, 34.683, 33.837, 137.9, 673.52, 905.99, 170.63, 169.82, 164.13, 293.33, 1204.3, 485.16, 113.76, 102.39, 96.703, 551.65, 138.97, 159.32, 50.395, 480.47, 93.482, 237.39, 43.895, 87.779, 38.208, 469.23, 73.951, 36.583, 112.2, 35.771, 99.926, 65.854, 95.95, 219.43, 1669.1, 509.53, 859.79, 275.74, 197.81, 194.38, 360.51, 168.69, 164.41, 103.6, 99.322, 96.753, 91.614, 80.481, 500.08, 632.76, 202.07, 124.15, 54.789, 53.933, 48.795, 145.54, 93.306, 179.73, 41.087, 36.805, 71.046, 64.195, 62.472, 50.45, 3185.3, 1058.9, 967.99, 512.46, 841.37, 380.73, 321.24, 274.49, 272.8, 888.93, 208.21, 356.09, 984.87, 133.42, 121.52, 114.72, 103.67, 101.12, 91.773, 89.223, 86.674, 358.62, 156.34, 151.28, 294.88, 289.74, 67.977, 135.09, 64.577, 58.628, 375.01, 263, 209.91, 154.33, 68.868, 263.02, 383.36, 240.66, 234.82, 56.423, 51.445, 46.467, 282.12, 170.96, 40.66, 122.82, 214.06, 123.71, 111.92, 116.23, 590.02, 66.398, 60.579, 112.03, 401.9, 218.41, 305.31, 45.661, 148.42, 43.975, 1875.8, 1397.7, 963.94, 726.58, 1353.3, 3741.1, 448.23, 922.09, 434.57, 424.33, 372.25, 1449.6, 1178.2, 265.52, 227.95, 414.93, 197.21, 194.65, 191.24, 141.72, 138.3, 125.49, 124.64, 248.45, 362.8, 116.96, 455.02, 104.15, 209.16, 97.318, 945.87, 730.43, 689.23, 581.08, 548.46, 508.12, 350.18, 316.71, 290.1, 278.94, 248.9, 239.46, 199.97, 193.96, 169.93, 162.2, 159.63, 158.77, 151.05, 148.47, 144.18, 140.75, 135.6, 132.16, 131.3, 127.87, 121, 117.57, 226.57, 105.55, 1717.5, 575.25, 269.89, 246.78, 402.78, 426.75, 135.36, 120.51, 217.91, 211.31, 761.86, 1149.1, 160.14, 156.82, 70.988, 143.64, 273.28, 61.909, 54.482, 141.16, 43.753, 38.801, 37.15, 71.829, 63.584, 201.47, 78.39, 52.864, 73.526, 69.311, 1241.3, 499.81, 487.4, 467.54, 386.45, 320.25, 249.08, 585.9, 7259.6, 100.14, 412.12, 559.36, 88.551, 69.518, 63.726, 62.071, 185.36, 58.761, 57.106, 55.451, 54.624, 48.831, 48.004, 47.176, 46.349, 45.521, 41.384, 40.556, 38.901, 1354.4, 767.54, 417.84, 415.38, 404.71, 353.81, 334.11, 252.02, 235.61, 1069.6, 321, 155.16, 149.42, 272.56, 270.1, 123.97, 374.35, 1340.6, 224.11, 110.83, 215.94, 96.059, 590.28, 90.312, 82.924, 257.04, 166.68, 77.178, 70.611, 66.507, 1796.9, 1369.1, 175.87, 130.43, 110.23, 461.93, 79.94, 147.23, 69, 235.65, 52.17, 51.328, 710.42, 166.62, 63.11, 153.17, 90.018, 58.919, 159.85, 105.22, 153.91, 206.24, 141.19, 46.294, 39.535, 34.501, 137.07, 6080.4, 185.11, 59.744, 292.98, 971.85, 233.64, 209.09, 452.06, 130.36, 224.33, 102.43, 100.73, 88.034, 79.568, 78.721, 62.637, 55.864, 55.864, 53.324, 106.67, 48.245, 98.2, 134.57, 41.472, 82.117, 77.011, 36.393, 110.05, 71.944, 139.64, 33.007, 32.16, 44.844, 66.86, 352.31, 495.9, 240.79, 434.27, 160.52, 132.64, 250.92, 85.326, 73.498, 137.69, 64.204, 116.58, 156.3, 47.306, 943.61, 67.585, 66.748, 64.195, 54.874, 55.752, 83.676, 76.9, 100.58, 72.646, 92.07, 95.371, 183.31, 581.27, 48.924, 145.97, 446.62, 1135.3, 100.64, 92.324, 90.661, 87.334, 85.67, 78.185, 74.027, 300.3, 64.878, 64.878, 64.046, 62.383, 59.888, 113.94, 54.897, 54.066, 54.066, 54.066, 54.066, 50.739, 42.422, 40.759, 40.759, 80.648, 82.358, 82.366, 80.695, 39.095, 1173.7, 1232.8, 1139.8, 146.21, 182.98, 294.09, 435.39, 264.67, 11124, 3076.4, 524.54, 226.52, 143.17, 167.6, 114.53, 161.6, 126.35, 1260, 1592.3, 812.38, 317.23, 132.8, 117.55, 93.92, 132.58, 290.71, 461.28, 732.23, 248.11, 471.12, 244.43, 330.36, 186.97, 407.65, 180.92, 70.317, 70.36, 2082.3, 416.29, 361.36, 13047, 380.96, 340.26, 164.88, 127.73, 102.06, 380.19, 199.7, 156.37, 185.44, 137.25, 5094.3, 355.96, 254.02, 252.51, 246.06, 241.17, 220.34, 123.01, 121.28, 193.39, 88.828, 157.92, 163.53, 304.94, 175.86, 173.37, 118.96, 187.78, 176.77, 2296.8, 5059, 279.89, 210, 193.8, 111.71, 230.12, 991.09, 1745.2, 228.32, 117.58, 155.76, 115.09, 408.99, 264.63, 79.863, 177.94, 1588.8, 203.68, 125.49, 281.57, 176.81, 838.44, 153.1, 4446.1, 233.56, 770.64, 1344.3, 145.88, 744.67, 211.4, 938.14, 255.49, 290.84, 521.11, 4679.9, 76.546, 102.3, 432.81, 1340.4, 217.38, 769.55, 817.03, 4478.8, 2540.3, 247.04, 720.4, 243.35, 461.64, 143.46, 499.5, 848.95, 511.66, 198.82, 717.33, 92.222, 1699.2, 129.06, 927.32, 846.08, 1563.5, 435.05, 2865.2, 3019.3, 171.52, 4838.3, 1117.4, 123.44, 101.11, 819.99, 143.7, 165.75, 746.88, 672.34, 315.72, 996.1, 104.06, 305.91, 3294.7, 127.32, 461.35, 384.19, 1136.5, 1747.4, 190.93, 166.24, 237.28, 148.21, 360.76, 7850.2, 137.35, 547.01, 671.24, 2243.2, 5175.3, 448.29, 2535.7, 2260, 553.34, 2091.1, 138.27, 1136.9, 463.97, 128.89, 775.3, 344.28, 2651.6, 689.99, 152.31, 751.84, 756.72, 2293.2, 791.64, 655.75, 2567, 410.35, 112.2, 244.04, 441.48, 15395, 518.27, 907.45, 1139.6, 383.25, 3309.2, 8815.2, 300.02, 8614.4, 487.28, 182.84, 558.6, 219.72, 187.93, 3564.5, 320.25, 3371.5, 386.02, 560.35, 821.11, 594.75, 625.55, 102.24, 709.08, 616.74, 1351.3, 7402, 1321.7, 145.95, 354.65, 177.47, 1682.4, 149.06, 294.52, 5963.9, 194.29, 9775.6, 631.51, 801.7, 3248.8, 1004.1, 950.39, 444.29, 1762, 3868.1, 1538, 774.4, 588.49, 1124, 138.99, 400.67, 928.14, 442.42, 727.56, 1152.1, 1869.6, 964.69, 5997.1, 355.85, 4147.9, 159.15, 3634.3, 688.74, 355.28, 10174, 484.49, 292.96, 8871.4, 1490.8, 1873.3, 2125.4, 1285.7, 2069, 268.64, 2836.2, 1322.4, 1100.8, 563.95, 456.2, 6871.5, 2011.1, 712.4, 3250, 222.74, 1458.6, 621.67, 1566.7, 1116.2, 184.43, 170.63, 134.81, 543.86, 1257, 3484.2, 2094.1, 774.5, 335.69, 1397.9, 300.52, 930.9, 1657.6, 453.67, 305.7, 489.64, 398.06, 485.8, 473.55, 406.45, 1629.3, 3325.8, 1575.1, 3421.1, 2553.2, 214.61, 407.17, 989.97, 1199, 7137.7, 2277.6, 13651, 910.39, 526.1, 907.97, 4720.2, 1393.6, 1313.5, 1165.4, 2114.3, 688.24, 16851, 14782, 713.92, 904.39, 720.93, 446.31, 574.29, 2648.5, 3311.8, 420.56, 190.89, 1417, 2691.4, 328.95, 931.5, 3503.3, 15395, 473.05, 394.14, 441.01, 4720.2, 373.13, 335.1, 294.13, 1003.2, 510.18, 632.21, 424.72, 4863.4, 448.87, 1602.6, 22044, 2351.5, 21241, 1029.9, 1555.8, 459.52, 5628.5, 5691.4, 2939.5, 21241, 1926.7, 1031.1, 3149.7, 862.15, 22044, 495.54, 1293.4, 1666.9, 685.26, 374.98, 5997.1, 335.44, 1070, 3422.9, 579.72, 1519.6, 21241, 1794.6, 2049.7, 1359.2, 1867.7, 7402, 978.86, 743.5, 897.45, 2063.5, 5076.2, 2720.4, 6087.4, 1075, 1572.1, 419.2, 8614.4, 6871.5, 2146.6, 16851, 3400.7, 940.67, 11442, 995.25, 488.14, 653.06, 2648.5, 1619.1, 41909, 575.39, 611.55, 8716.1, 6087.4, 1301.9, 5963.9, 5992.3, 22044, 488.73, 420.37, 3070.7, 1556.8, 1362.5, 860.04, 662.45, 5198, 4020.6, 10174, 3448, 1293.4, 797.13, 1572.1, 2122.3, 3096.5, 9559.8, 2122.3, 2412.4, 14582, 909.51, 1455.4, 41909, 3400.7, 1357.7, 2130.6, 14782, 1006.8, 1490.5, 1349.3, 1666.9, 1448.9, 2983.1, 41909, 8716.1, 482.69, 3248.8, 13992, 5691.4, 13651, 576.03, 11442, 11442, 3311.8, 1157.2, 1946.8, 792.42, 9775.6, 41909, 8871.4, 11819, 1236.4, 1794.6, 1036.9, 2064.3, 14782, 511.36, 1093.1, 3149.7, 13992, 1575.1, 2069, 4995.6, 14582, 13992, 7850.2, 2553.2, 2328.2, 5285.1, 1063.8, 1539.8, 2328.2, 708.16, 1455.4, 1191.9, 5984, 4863.4, 3424.6, 2720.4, 1122.1, 11819, 5285.1, 361.2, 1946.8, 5076.2, 6571.3, 731.75, 14582, 535.09, 41909, 624, 2250, 8815.2, 9559.8, 681.83, 11819, 4815.4, 807.73, 6571.3, 2983.1, 16851, 5198, 6571.3, 14582, 5628.5, 1599.5, 11124, 1553.1, 6571.3, 946.76, 1184.4, 3613.2, 14582, 41909, 1278.1, 3544.6, 2288.3, 14582, 3422.9, 13992, 784.17, 1077.3, 3868.1, 9559.8, 3634.3, 10174, 21241, 892.57, 3448, 3448, 2170.5, 601.24, 407.35, 13651, 11442, 5285.1, 1404.7, 41909, 4020.6, 4020.6, 4995.6, 5992.3, 3309.2, 4815.4, 5984, 4890.2, 1599.5, 11819, 1352.6, 7137.7, 13992, 5628.5, 4478.8, 1301.9, 16851, 2130.6, 5992.3, 9559.8, 4863.4, 5076.2, 41909, 3503.3, 22044, 632.58, 1362.5, 9775.6, 1902.9, 628.96, 1448.9, 953.48, 8716.1, 2567, 2365.7, 1263.1, 8716.1, 11819, 714.73, 8716.1, 1257, 4995.6, 4995.6, 2942.1, 853.81, 22044, 716.5, 7137.7, 2222.7, 5984, 6087.4, 2412.4, 1215.1, 3325.8, 1360.1, 7850.2, 2365.7, 775.52, 5198, 3484.2, 13992, 5628.5, 5992.3, 7137.7, 1186.4, 4020.6, 13651, 5691.4, 2727.9, 22044, 9559.8, 1422.2, 4006.1, 4147.9, 3070.7, 41909, 3250, 2983.1, 13651, 16851, 2939.5, 5198, 1926.7, 16851, 4815.4, 2720.4, 5285.1, 1101.4, 41909, 3096.5, 1692.7, 1524, 2351.5, 1053.5, 2727.9, 1055.9, 4147.9, 9559.8, 3422.9, 2717.7, 14782, 1360.1, 3149.7, 3544.6, 14782, 5175.3, 2328.2, 11819, 3544.6, 11819, 3564.5, 41909, 13992, 5984, 3544.6, 3311.8, 1375.5, 3424.6, 4890.2, 5984, 1216.7, 3613.2, 8871.4, 2114.3, 2717.7, 8815.2, 3371.5, 4890.2, 41909, 4815.4, 10174, 1664.5, 11124, 1321.7, 15395, 6087.4, 3421.1, 953.48, 3424.6, 11819, 2011.1, 3613.2, 7850.2, 11124, 5984, 2130.6, 22044, 3484.2, 1357.7, 4890.2, 4890.2, 5691.4, 21241, 13047, 2727.9, 8716.1, 13651, 7137.7, 22044, 6458.2, 3371.5, 4838.3, 3503.3, 13651, 5536, 1544.8, 1692.7, 14782, 3400.7, 2865.2, 1250.5, 1566.7, 9559.8, 6571.3, 4890.2, 3613.2, 13992, 1230.3 ], | |
"Category": [ "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Default", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic1", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic3", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic4", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic6", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic8", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic9", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic10", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic11", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic12", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic13", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic14", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic15", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic17", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic18", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic19", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic1", "Topic2", "Topic2", "Topic2", "Topic2", "Topic2", "Topic3", "Topic3", "Topic4", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic5", "Topic6", "Topic6", "Topic7", "Topic7", "Topic7", "Topic7", "Topic7", "Topic8", "Topic9", "Topic10", "Topic10", "Topic10", "Topic11", "Topic11", "Topic12", "Topic12", "Topic13", "Topic14", "Topic15", "Topic15", "Topic16", "Topic16", "Topic16", "Topic16", "Topic16", "Topic17", "Topic18", "Topic18", "Topic19", "Topic20", "Topic20", "Topic20", "Topic20", "Topic20", "Topic1", "Topic2", "Topic2", "Topic3", "Topic3", "Topic3", "Topic5", "Topic5", "Topic5", "Topic7", "Topic7", "Topic8", "Topic8", "Topic9", "Topic10", "Topic10", "Topic10", "Topic12", "Topic13", "Topic14", "Topic14", "Topic14", "Topic14", "Topic15", "Topic15", "Topic15", "Topic16", "Topic16", "Topic16", "Topic18", "Topic18", "Topic18", "Topic19", "Topic20", "Topic20", "Topic20", "Topic2", "Topic5", "Topic5", "Topic6", "Topic7", "Topic8", "Topic9", "Topic10", "Topic10", "Topic10", "Topic11", "Topic13", "Topic14", "Topic14", "Topic15", "Topic15", "Topic15", "Topic16", "Topic17", "Topic20", "Topic20", "Topic1", "Topic5", "Topic5", "Topic5", "Topic5", "Topic6", "Topic7", "Topic7", "Topic8", "Topic8", "Topic8", "Topic9", "Topic10", "Topic11", "Topic11", "Topic12", "Topic14", "Topic18", "Topic19", "Topic20", "Topic1", "Topic3", "Topic4", "Topic6", "Topic7", "Topic8", "Topic10", "Topic11", "Topic14", "Topic15", "Topic15", "Topic17", "Topic18", "Topic20", "Topic1", "Topic2", "Topic3", "Topic6", "Topic7", "Topic7", "Topic8", "Topic9", "Topic10", "Topic11", "Topic14", "Topic14", "Topic18", "Topic20", "Topic20", "Topic20", "Topic20", "Topic4", "Topic5", "Topic7", "Topic9", "Topic11", "Topic14", "Topic15", "Topic17", "Topic18", "Topic18", "Topic19", "Topic20", "Topic2", "Topic2", "Topic5", "Topic6", "Topic7", "Topic8", "Topic8", "Topic9", "Topic11", "Topic12", "Topic13", "Topic13", "Topic17", "Topic18", "Topic20", "Topic20", "Topic2", "Topic3", "Topic4", "Topic5", "Topic6", "Topic8", "Topic11", "Topic12", "Topic15", "Topic15", "Topic17", "Topic17", "Topic18", "Topic19", "Topic20", "Topic20", "Topic4", "Topic7", "Topic8", "Topic8", "Topic15", "Topic15", "Topic15", "Topic18", "Topic19", "Topic20", "Topic2", "Topic4", "Topic5", "Topic6", "Topic6", "Topic7", "Topic9", "Topic11", "Topic15", "Topic16", "Topic17", "Topic18", "Topic19", "Topic19", "Topic20", "Topic5", "Topic6", "Topic7", "Topic10", "Topic11", "Topic12", "Topic14", "Topic14", "Topic16", "Topic17", "Topic20", "Topic5", "Topic9", "Topic10", "Topic11", "Topic14", "Topic17", "Topic17", "Topic19", "Topic20", "Topic4", "Topic5", "Topic7", "Topic7", "Topic11", "Topic13", "Topic14", "Topic14", "Topic18", "Topic1", "Topic2", "Topic3", "Topic3", "Topic4", "Topic6", "Topic8", "Topic13", "Topic17", "Topic18", "Topic19", "Topic20", "Topic3", "Topic5", "Topic6", "Topic8", "Topic10", "Topic14", "Topic15", "Topic17", "Topic18", "Topic19", "Topic1", "Topic4", "Topic6", "Topic8", "Topic11", "Topic15", "Topic18", "Topic18", "Topic2", "Topic6", "Topic13", "Topic17", "Topic20", "Topic20", "Topic2", "Topic4", "Topic5", "Topic7", "Topic8", "Topic9", "Topic10", "Topic12", "Topic13", "Topic15", "Topic19", "Topic5", "Topic5", "Topic6", "Topic6", "Topic7", "Topic7", "Topic14", "Topic16", "Topic18", "Topic19", "Topic4", "Topic6", "Topic8", "Topic8", "Topic9", "Topic9", "Topic17", "Topic18", "Topic20", "Topic3", "Topic5", "Topic5", "Topic13", "Topic15", "Topic15", "Topic16", "Topic19", "Topic20", "Topic4", "Topic5", "Topic7", "Topic7", "Topic8", "Topic12", "Topic13", "Topic15", "Topic19", "Topic19", "Topic5", "Topic9", "Topic14", "Topic16", "Topic19", "Topic20", "Topic3", "Topic5", "Topic6", "Topic8", "Topic9", "Topic10", "Topic11", "Topic13", "Topic14", "Topic14", "Topic18", "Topic18", "Topic19", "Topic5", "Topic7", "Topic8", "Topic8", "Topic10", "Topic11", "Topic14", "Topic15", "Topic20", "Topic20", "Topic2", "Topic6", "Topic9", "Topic11", "Topic13", "Topic14", "Topic17", "Topic17", "Topic19", "Topic20", "Topic20", "Topic1", "Topic7", "Topic8", "Topic10", "Topic12", "Topic13", "Topic13", "Topic14", "Topic18", "Topic19", "Topic1", "Topic3", "Topic4", "Topic8", "Topic9", "Topic11", "Topic14", "Topic15", "Topic17", "Topic18", "Topic20", "Topic1", "Topic6", "Topic7", "Topic12", "Topic17", "Topic17", "Topic19", "Topic1", "Topic1", "Topic2", "Topic5", "Topic9", "Topic9", "Topic10", "Topic4", "Topic5", "Topic6", "Topic7", "Topic18", "Topic20", "Topic1", "Topic2", "Topic4", "Topic9", "Topic10", "Topic13", "Topic19", "Topic9", "Topic12", "Topic13", "Topic17", "Topic18", "Topic3", "Topic6", "Topic9", "Topic11", "Topic16", "Topic20", "Topic1", "Topic4", "Topic14", "Topic15", "Topic17", "Topic18", "Topic19", "Topic20", "Topic6", "Topic11", "Topic11", "Topic12", "Topic14", "Topic16", "Topic18", "Topic19", "Topic1", "Topic3", "Topic6", "Topic13", "Topic13", "Topic17", "Topic19", "Topic4", "Topic5", "Topic9", "Topic16", "Topic18", "Topic19", "Topic20", "Topic1", "Topic1", "Topic11", "Topic18", "Topic7", "Topic9", "Topic9", "Topic18", "Topic18", "Topic19", "Topic20", "Topic3", "Topic4", "Topic15", "Topic19", "Topic20", "Topic7", "Topic11", "Topic11", "Topic15", "Topic16", "Topic19", "Topic1", "Topic5", "Topic6", "Topic9", "Topic15", "Topic17", "Topic18", "Topic20", "Topic10", "Topic10", "Topic12", "Topic16", "Topic18", "Topic20", "Topic1", "Topic2", "Topic5", "Topic6", "Topic8", "Topic16", "Topic17", "Topic18", "Topic1", "Topic8", "Topic10", "Topic11", "Topic14", "Topic1", "Topic5", "Topic9", "Topic11", "Topic15", "Topic19", "Topic2", "Topic7", "Topic9", "Topic13", "Topic15", "Topic4", "Topic5", "Topic7", "Topic9", "Topic10", "Topic11", "Topic15", "Topic15", "Topic17", "Topic5", "Topic10", "Topic12", "Topic11", "Topic20", "Topic2", "Topic2", "Topic8", "Topic10", "Topic12", "Topic15", "Topic18", "Topic6", "Topic7", "Topic9", "Topic11", "Topic15", "Topic1", "Topic2", "Topic3", "Topic3", "Topic11", "Topic12", "Topic18", "Topic19", "Topic10", "Topic11", "Topic17", "Topic19", "Topic1", "Topic6", "Topic7", "Topic9", "Topic10", "Topic15", "Topic20", "Topic20", "Topic4", "Topic7", "Topic20", "Topic3", "Topic8", "Topic15", "Topic7", "Topic14", "Topic20", "Topic8", "Topic9", "Topic16", "Topic17", "Topic18", "Topic19", "Topic5", "Topic14", "Topic16", "Topic20", "Topic7", "Topic9", "Topic10", "Topic11", "Topic18", "Topic1", "Topic2", "Topic3", "Topic3", "Topic5", "Topic7", "Topic7", "Topic9", "Topic13", "Topic14", "Topic15", "Topic16", "Topic1", "Topic2", "Topic12", "Topic1", "Topic2", "Topic11", "Topic13", "Topic5", "Topic10", "Topic11", "Topic14", "Topic16", "Topic3", "Topic12", "Topic12", "Topic16", "Topic17", "Topic19", "Topic19", "Topic6", "Topic10", "Topic7", "Topic13", "Topic9", "Topic20", "Topic5", "Topic7", "Topic12", "Topic15", "Topic18", "Topic13", "Topic14", "Topic18", "Topic11", "Topic19", "Topic12", "Topic2", "Topic4", "Topic7", "Topic8", "Topic10", "Topic2", "Topic3", "Topic5", "Topic6", "Topic16", "Topic20", "Topic6", "Topic7", "Topic7", "Topic9", "Topic15", "Topic8", "Topic11", "Topic4", "Topic10", "Topic14", "Topic16", "Topic1", "Topic6", "Topic15", "Topic16", "Topic10", "Topic13", "Topic18", "Topic20", "Topic4", "Topic12", "Topic14", "Topic16", "Topic20", "Topic2", "Topic3", "Topic9", "Topic20", "Topic2", "Topic5", "Topic19", "Topic7", "Topic10", "Topic17", "Topic10", "Topic16", "Topic18", "Topic12", "Topic20", "Topic6", "Topic7", "Topic16", "Topic19", "Topic2", "Topic9", "Topic13", "Topic14", "Topic16", "Topic19", "Topic17", "Topic15", "Topic16", "Topic1", "Topic12", "Topic16", "Topic2", "Topic9", "Topic14", "Topic5", "Topic15", "Topic20", "Topic3", "Topic8", "Topic12", "Topic17", "Topic2", "Topic11", "Topic12" ] | |
}, | |
"token.table": { | |
"Term": [ "abdomen", "abdominal", "abdominal", "abdominal", "abscess", "absolute", "absolute", "absolute", "absolutely", "absolutely", "absolutely", "absolutely", "absolutely", "absolutely", "absolutely", "absolutely", "absolutely", "abuse", "abuse", "abuse", "abused", "abusive", "accept", "accept", "accident", "account", "accountable", "aches", "actions", "actions", "actions", "actions", "acts", "acts", "addict", "addict", "administration", "administration", "administration", "administration", "admissions", "admissions", "admissions", "admissions", "admissions", "admissions", "admitted", "admitted", "admitted", "admitted", "admitted", "admitted", "admitted", "admitted", "advocate", "advocate", "afford", "afternoon", "afternoon", "afternoon", "afternoon", "afternoon", "agency", "ago", "ago", "ago", "ago", "ago", "ago", "ago", "ago", "ahead", "ahead", "ahead", "ahead", "ahead", "ahead", "aide", "aide", "al", "al", "al", "alarm", "alarm", "alive", "alive", "allergic", "allowing", "amazing", "amazing", "amazing", "amazing", "ambulance", "ambulance", "ambulance", "ambulance", "ambulances", "ambulances", "amount", "amount", "amount", "amy", "amy", "anesthesia", "anesthesia", "anesthesiologist", "anesthesiologist", "angels", "angels", "angels", "animal", "animal", "animal", "ankle", "ankle", "ankle", "answer", "answer", "answer", "answer", "answer", "answer", "answered", "answering", "answering", "answers", "answers", "answers", "answers", "anthony's", "antibiotic", "antibiotic", "antibiotic", "antibiotic", "antibiotics", "antibiotics", "antibiotics", "appalling", "appendix", "appendix", "appointment", "appointment", "appreciate", "appreciate", "appreciate", "appreciate", "appreciate", "appreciative", "appropriate", "appropriate", "appropriate", "appropriate", "appt", "appt", "apt", "area", "area", "area", "area", "area", "area", "area", "arkansas", "arm", "arrived", "arrived", "arrived", "arrived", "arrived", "asked", "asked", "asked", "asked", "asked", "asset", "asthma", "atenci", "atlanta", "atlanta", "atmosphere", "atmosphere", "atmosphere", "atmosphere", "atmosphere", "attack", "attacks", "attacks", "attentive", "attentive", "attentive", "attentive", "attitude", "attitude", "attitude", "attitude", "attitude", "attitude", "attitude", "aunt", "avoid", "avoid", "avoid", "avoid", "aware", "aware", "aware", "awesome", "awesome", "awesome", "awesome", "awful", "awful", "awful", "awful", "awful", "awful", "awful", "babies", "baby", "baby", "baby's", "backs", "bacterial", "bad", "bad", "bad", "bad", "bad", "bad", "bad", "bad", "bad", "bags", "balance", "baptist", "baptist", "baptist", "baptist", "baptist", "based", "based", "based", "based", "based", "bat", "bat", "bathroom", "bathroom", "bathrooms", "bathrooms", "bay", "bay", "bay", "bay", "bay", "beach", "beach", "beach", "beautiful", "beautiful", "beautiful", "beautiful", "bed", "bed", "bedding", "bedside", "beings", "best", "best", "best", "best", "best", "best", "best", "bethesda", "bethesda", "better", "better", "better", "better", "better", "better", "better", "better", "better", "better", "bien", "bill", "billed", "billing", "billing", "bills", "birth", "birth", "birthing", "bite", "bite", "bite", "bite", "bite", "black", "black", "black", "bladder", "bladder", "bladder", "bladder", "blanket", "blanket", "blanket", "blankets", "blankets", "bless", "bless", "bless", "blockage", "blood", "blood", "blood", "blood", "board", "board", "board", "board", "board", "bone", "bone", "bone", "bones", "bones", "born", "born", "born", "boss", "bout", "bout", "bout", "boy", "boy", "brain", "brain", "brain", "breakfast", "breakfast", "breakfast", "breastfeeding", "breath", "breath", "breath", "breath", "breathing", "breathing", "bring", "bring", "bring", "bring", "bring", "bring", "bring", "bring", "bring", "broke", "broke", "broken", "brother", "brother", "brother", "brothers", "brothers", "brothers", "brought", "brought", "brought", "brought", "brought", "brought", "brought", "bruised", "buen", "buena", "bug", "bug", "building", "building", "building", "building", "building", "building", "bull", "bullshit", "bullshit", "business", "business", "business", "business", "business", "busy", "busy", "busy", "busy", "busy", "busy", "button", "button", "cafe", "cafeteria", "cafeteria", "cafeteria", "california", "california", "call", "call", "call", "call", "call", "called", "called", "called", "called", "calling", "calling", "campus", "campus", "campus", "cancer", "cant", "cant", "cant", "cant", "car", "car", "car", "car", "card", "card", "cardiac", "cardiac", "cardio", "cardiologist", "cardiologist", "cardiologist", "care", "care", "care", "care", "care", "care", "care", "care", "care", "care", "care", "cares", "caring", "caring", "caring", "caring", "caring", "case", "case", "case", "case", "case", "case", "case", "cases", "cases", "cases", "cast", "cat", "cat", "cat", "cath", "cath", "cath", "caution", "caution", "caution", "caution", "ccu", "center", "center", "center", "center", "centers", "centers", "centers", "certified", "chairs", "chairs", "chairs", "chairs", "chairs", "challenge", "change", "change", "change", "change", "change", "change", "change", "changed", "changed", "changed", "changed", "changed", "changed", "charge", "charge", "charge", "charged", "charged", "charges", "charges", "charts", "charts", "charts", "chatting", "chatting", "chatting", "check", "check", "check", "check", "check", "check", "check", "checked", "checked", "checked", "checked", "checked", "checked", "checked", "checked", "chemo", "chest", "chest", "chest", "child", "children", "children's", "chit", "chit", "chit", "choice", "choice", "choice", "choice", "choice", "choice", "choice", "christ", "christ", "christmas", "christmas", "chronic", "chronic", "cities", "city", "city", "claim", "claim", "clean", "clean", "clean", "clean", "cleaned", "cleaned", "cleaned", "cleaned", "cleanest", "cleaning", "cleaning", "cleaning", "clerk", "clerk", "clerk", "cleveland", "clinic", "clinic", "clinic", "clinic", "clinics", "clinics", "clinics", "closely", "coast", "coast", "coffee", "cold", "cold", "cold", "cold", "cold", "collection", "collections", "colon", "colorado", "columbus", "coma", "comfortable", "comfortable", "comfortable", "comfortable", "comfortable", "comments", "comments", "comments", "comments", "commission", "committed", "communication", "communication", "communication", "communication", "community", "community", "community", "community", "community", "como", "company", "compassion", "compassion", "compassion", "compassion", "compassionate", "compassionate", "compassionate", "compassionate", "compassionate", "compelled", "compelled", "compelled", "competent", "competent", "competent", "complain", "complain", "complain", "complain", "complain", "complain", "complain", "complain", "complaint", "complaint", "complaint", "complaint", "complaint", "complaint", "complete", "complete", "complete", "complete", "complete", "complete", "completely", "completely", "completely", "completely", "completely", "completely", "completely", "con", "concern", "concern", "concern", "condition", "condition", "condition", "cons", "considerate", "considerate", "construction", "consult", "consult", "consult", "contractions", "conversation", "conversation", "conversation", "cost", "cost", "cough", "couldn", "couldn", "couldn't", "couldn't", "couldn't", "couldn't", "couldn't", "couldn't", "couldn't", "couldn't", "counting", "counting", "country", "country", "country", "country", "county", "county", "county", "county", "courteous", "courteous", "courteous", "covered", "covered", "covered", "crappy", "crappy", "crappy", "credit", "crowded", "crowded", "crowded", "crying", "crying", "crying", "crying", "crying", "ct", "ct", "cup", "cup", "cup", "cup", "current", "current", "current", "curtain", "curtain", "curtain", "cut", "cuz", "cuz", "cuz", "cyst", "dad", "dad", "dad", "dallas", "dallas", "dam", "dangerous", "dangerous", "dated", "daughter", "daughter", "daughters", "daughters", "day", "day", "day", "day", "day", "day", "day", "day", "day", "day", "day", "days", "days", "days", "days", "days", "days", "days", "days", "dc", "de", "dead", "dead", "death", "death", "death", "debt", "dedicated", "dedicated", "deductible", "definitely", "definitely", "definitely", "definitely", "definitely", "definitely", "definitely", "dehydrated", "dehydrated", "dehydration", "dehydration", "dehydration", "del", "delicious", "deliver", "deliver", "delivered", "delivering", "delivering", "delivery", "dementia", "dementia", "department", "department", "department", "department", "department", "department", "department", "department", "depression", "deserve", "deserve", "desk", "desk", "despicable", "despite", "despite", "despite", "despite", "despite", "detroit", "diagnose", "diagnosed", "diagnosed", "diagnosed", "diagnosis", "diagnosis", "diagnosis", "diagnosis", "diagnosis", "diagnosis", "dialysis", "didn", "didnt", "didnt", "didnt", "didnt", "die", "die", "die", "die", "die", "died", "died", "dietary", "dietary", "diff", "diff", "differently", "dinner", "dinner", "dinner", "directed", "director", "director", "director", "director", "director", "dirty", "dirty", "dirty", "dirty", "dirty", "discharge", "discharge", "discharge", "discharge", "discharge", "discharge", "discharged", "discharged", "discharged", "discharged", "discharged", "disgusting", "disgusting", "disgusting", "dislocated", "dismissive", "dismissive", "disregard", "doctor", "doctor", "doctor", "doctor", "doctor", "doctor", "doctor", "doctor", "doctor", "doctors", "doctors", "doctors", "doctors", "doctors", "doctors", "doctors", "doctors", "doctors", "doctors", "documents", "documents", "dog", "dog", "dollars", "dollars", "don", "don", "don", "dont", "door", "door", "door", "door", "door", "dose", "dose", "dr", "dr", "dr", "dr", "dr", "dr", "dr", "dr", "dr's", "dr's", "dr's", "dr's", "draw", "drawn", "drawn", "drawn", "dressing", "drew", "drew", "dried", "dried", "drive", "drive", "drive", "drive", "drug", "drugged", "drugs", "drugs", "drugs", "drugs", "dust", "dying", "dying", "dying", "ear", "ears", "ears", "ease", "eat", "eat", "eat", "efficient", "efficient", "efficient", "efficient", "efficiently", "efficiently", "el", "elbow", "elderly", "elderly", "emergency", "emergency", "emergency", "emergency", "emergency", "employees", "employees", "employees", "employees", "employees", "employees", "en", "enemy", "enemy", "enemy", "enemy", "energy", "energy", "enfermeras", "ent", "entrance", "entrance", "entrance", "epidural", "epilepsy", "er", "er", "er", "er", "er", "er", "er", "ers", "ers", "ers", "es", "este", "eve", "evening", "evening", "evening", "evening", "examine", "examine", "excelente", "excellent", "excellent", "excellent", "excellent", "exceptionally", "exceptionally", "excruciating", "expensive", "expensive", "expensive", "experience", "experience", "experience", "experience", "experience", "experience", "experience", "experience", "experience", "experiences", "experiences", "experiences", "experiences", "experiences", "experiences", "extension", "extraordinary", "extreme", "extreme", "extreme", "extreme", "extreme", "extremely", "extremely", "extremely", "extremely", "extremely", "extremely", "extremely", "extremely", "extremely", "eye", "eye", "face", "face", "face", "face", "facebook", "facebook", "facebook", "facebook", "facilities", "facilities", "facilities", "facility", "facility", "facility", "facility", "fact", "fact", "fact", "fact", "fact", "fact", "fact", "failure", "failure", "failure", "fall", "falling", "falling", "family", "family", "family", "family", "family", "family", "family", "fancy", "fantastic", "fantastic", "fantastic", "fantastic", "fantastic", "fast", "fast", "fast", "fast", "fast", "fast", "faster", "faster", "faster", "faster", "faster", "father", "father", "father", "faxed", "faxed", "fee", "feel", "feel", "feel", "feel", "feel", "feel", "feel", "feel", "fell", "fell", "fell", "felt", "felt", "felt", "felt", "felt", "felt", "felt", "fever", "fever", "fiancee", "fiancee", "fill", "fill", "fill", "fill", "filthy", "filthy", "filthy", "finally", "finally", "finally", "finally", "finally", "finally", "finally", "financial", "find", "find", "find", "find", "find", "find", "find", "find", "find", "find", "find", "finger", "fired", "fired", "floor", "floor", "floor", "floor", "floors", "floors", "floors", "floors", "florida", "florida", "flu", "flu", "fluids", "fluids", "food", "food", "food", "foot", "foot", "foot", "forever", "forever", "forever", "forever", "forever", "forever", "formula", "fortunate", "fortunate", "fracture", "fracture", "fractured", "francis", "francis", "free", "free", "free", "free", "free", "free", "friday", "friday", "friday", "friend", "friend", "friend", "friend", "friend", "friend", "friend", "friendly", "friendly", "friendly", "friendly", "friendly", "friendly", "front", "front", "front", "front", "front", "front", "full", "full", "full", "full", "full", "full", "full", "funny", "funny", "funny", "garage", "gauze", "general", "general", "general", "general", "general", "general", "genuinely", "germs", "gift", "gift", "gift", "gift", "girl", "girl", "girl", "glucose", "goal", "god", "god", "god", "god", "god", "god", "god", "god", "god", "going", "going", "going", "going", "going", "going", "going", "going", "going", "good", "good", "good", "good", "good", "good", "good", "good", "good", "good", "good", "gossip", "gossip", "gossiping", "gossiping", "gracias", "grady", "grandfather", "grandfather", "grandfather", "grandma", "grandma", "grandmother", "grandmother", "grandmother", "gratitude", "great", "great", "great", "great", "gross", "gross", "gross", "grow", "grow", "grow", "grow", "growing", "guard", "guards", "guards", "guess", "guess", "guess", "guess", "guess", "guess", "guest", "gulf", "gyn", "hadn't", "hadn't", "hadn't", "hadn't", "haha", "haha", "half", "half", "half", "half", "half", "hall", "hall", "hall", "hallway", "hallway", "hand", "hand", "hand", "hard", "hard", "hard", "hard", "hard", "hard", "harder", "harder", "harder", "hardest", "hardest", "harsh", "harsh", "harsh", "hate", "hate", "hate", "hate", "hate", "hated", "hated", "hateful", "hateful", "havent", "havent", "he's", "he's", "he's", "head", "head", "head", "head", "headache", "headache", "headache", "headaches", "health", "health", "health", "health", "healthcare", "healthcare", "healthcare", "heart", "help", "help", "help", "help", "help", "help", "help", "help", "help", "helped", "helped", "helped", "helped", "helped", "helpful", "helpful", "helpful", "helpless", "helpless", "here's", "hesitate", "hesitate", "hey", "hey", "hey", "hey", "high", "high", "high", "high", "high", "high", "highly", "highly", "highly", "hip", "hip", "hire", "hit", "hit", "hit", "hives", "hives", "hold", "hold", "hold", "holy", "holy", "holy", "holy", "homeless", "homeless", "hope", "hope", "hope", "hope", "hope", "hope", "hopefully", "hopefully", "hopefully", "hoping", "hoping", "hoping", "hoping", "horrible", "horrible", "horrible", "horrible", "horrible", "horrible", "hospice", "hospital", "hospital", "hospital", "hospital", "hospital", "hospital", "hospital", "hospital", "hospital", "hospital", "hospital", "hospital", "hospital", "hospitalization", "hospitalization", "hospitals", "hospitals", "hospitals", "hospitals", "hospitals", "hospitals", "hospitals", "hosptial", "hotel", "hotel", "hour", "hour", "hour", "hour", "hours", "hours", "hours", "hours", "hours", "hours", "hours", "hrs", "hrs", "hrs", "human", "human", "human", "human", "hung", "hung", "hung", "hurt", "hurt", "hurt", "hurt", "husband", "husband", "husband", "husband", "husband", "husband", "husbands", "husbands", "i'd", "i'd", "i'm", "i'm", "i'm", "i'm", "i'm", "i'm", "icu", "icu", "icu", "icu", "icu", "ignorant", "ignorant", "impressed", "impressed", "impressed", "improving", "inappropriate", "inappropriate", "increase", "infection", "infections", "infections", "infections", "info", "info", "info", "injured", "injured", "injured", "injured", "injuries", "injuries", "injury", "injury", "injury", "insisting", "insisting", "insisting", "institution", "institution", "institution", "institution", "insulin", "insulin", "insurance", "insurance", "intense", "investigation", "issue", "issue", "issue", "issue", "issue", "issue", "issue", "issue", "issues", "issues", "issues", "issues", "issues", "issues", "it's", "it's", "it's", "it's", "it's", "iv", "iv", "iv", "iv", "ive", "ive", "ive", "jason", "jesus", "jesus", "job", "job", "job", "job", "job", "job", "job", "jobs", "jobs", "joes", "johnson", "joke", "joke", "joke", "joseph's", "joseph's", "judging", "judging", "judgmental", "junkie", "kaiser", "kaiser", "kaiser", "kaiser", "kaiser", "kansas", "keep", "keep", "keep", "keep", "keep", "keep", "keep", "kelly", "kidney", "kidney", "kids", "kids", "kids", "killed", "killed", "kind", "kind", "kind", "kind", "kind", "kind", "kind", "kind", "kindness", "kindness", "kindness", "kitchen", "kitchen", "kitchen", "knowledgable", "knowledgable", "knowledge", "knowledge", "knowledge", "knowledge", "knowledge", "knowledge", "knowledgeable", "knowledgeable", "knowledgeable", "la", "lab", "lab", "lab", "lab", "labor", "labor", "labor", "labs", "labs", "labs", "lack", "lack", "lack", "lack", "lacked", "lactation", "lady", "lady", "lady", "large", "large", "large", "large", "large", "las", "law", "law", "law", "law", "le", "leave", "leave", "leave", "leave", "leave", "leave", "leave", "leave", "lee", "left", "left", "left", "left", "left", "left", "left", "left", "left", "leg", "life", "life", "life", "life", "life", "life", "linda", "linda", "linens", "lip", "literally", "literally", "literally", "live", "live", "live", "live", "live", "liver", "lo", "lobby", "local", "local", "local", "local", "loma", "loma", "long", "long", "long", "long", "long", "long", "longer", "longer", "longer", "longer", "longer", "longer", "longer", "longest", "longest", "longest", "looked", "looked", "looked", "looked", "looked", "looked", "looked", "lord", "lord", "lord", "los", "los", "lot", "lot", "lot", "lot", "lot", "lot", "lot", "lot", "lot", "lots", "lots", "lots", "lots", "loud", "loud", "loud", "loud", "love", "love", "love", "love", "loved", "loved", "loved", "loved", "loved", "loved", "lower", "lower", "lower", "luke's", "lung", "lungs", "mail", "management", "management", "management", "management", "management", "management", "management", "management", "manner", "manner", "manner", "manor", "manor", "mary", "mary", "mary", "mary's", "mary's", "massive", "massive", "massive", "massive", "maternity", "maternity", "mayo", "mayo", "meals", "meals", "meals", "medical", "medical", "medical", "medical", "medical", "medicare", "medicare", "medicare", "medication", "medication", "medication", "medicine", "medicine", "meds", "meds", "meds", "melissa", "member", "member", "member", "member", "members", "members", "memorial", "memorial", "memorial", "memorial", "memorial", "mental", "mental", "mental", "mental", "mental", "mentally", "menu", "menu", "menu", "menu", "message", "messages", "mi", "midwife", "migraine", "migraines", "miller", "min", "min", "min", "min", "mins", "mins", "mins", "mins", "minutes", "minutes", "minutes", "minutes", "minutes", "minutes", "minutes", "minutes", "minutes", "minutes", "miscarriage", "miscarriage", "miscarriage", "mix", "model", "modern", "modern", "modern", "mom", "mom", "mom", "mom's", "mom's", "mom's", "monday", "monday", "monday", "money", "money", "money", "month", "month", "month", "month", "month", "months", "months", "months", "months", "months", "morning", "morning", "morning", "morning", "morning", "morning", "morons", "morons", "morphine", "mother", "mother", "mother's", "moved", "moved", "moved", "moved", "moved", "moved", "moved", "moved", "moved", "moved", "mt", "mt", "muscle", "muscle", "muy", "natural", "nausea", "nausea", "navigate", "needed", "needed", "needed", "needed", "needed", "needed", "needed", "needed", "needed", "needle", "needle", "needle", "needle", "negative", "negative", "negative", "negative", "negative", "neglect", "neglect", "nephew", "network", "network", "newborn", "newborn", "nice", "nice", "nice", "nicer", "nicer", "nicer", "nicest", "nicest", "nicu", "niece", "night", "night", "night", "night", "night", "noisy", "noon", "noon", "nope", "nope", "nope", "nope", "notch", "notch", "notch", "number", "number", "number", "numbness", "nurse", "nurse", "nurse", "nurse", "nurse", "nurse", "nurse", "nurse", "nurse", "nurse", "nursery", "nurses", "nurses", "nurses", "nurses", "nurses", "nurses", "nurses", "nurses", "nurses", "nurses", "nursing", "nursing", "nursing", "nursing", "nursing", "nursing", "nursing", "o'clock", "o'clock", "ob", "obgyn", "obnoxious", "obnoxious", "observation", "observation", "observation", "offers", "offers", "office", "office", "office", "oklahoma", "oklahoma", "oklahoma", "omg", "omg", "omg", "oncologist", "one's", "op", "open", "open", "open", "open", "open", "operating", "operating", "operating", "operation", "operation", "operation", "operation", "operation", "operator", "operator", "orange", "orange", "ordered", "ordered", "ordered", "ordered", "oregon", "organized", "organized", "organized", "organized", "outdated", "outdated", "outpatient", "outpatient", "outpatient", "outrageous", "overcrowded", "overcrowded", "overcrowded", "overcrowded", "owe", "oxygen", "pa", "pa", "pa", "packed", "packed", "paid", "paid", "pain", "pain", "pain", "pan", "papers", "papers", "paperwork", "paperwork", "paperwork", "paperwork", "para", "parking", "parkland", "passed", "passed", "passed", "passed", "passed", "passion", "patient", "patient", "patient", "patient", "patient", "patient", "patient", "patient", "patient", "patient's", "patient's", "patients", "patients", "patients", "patients", "patients", "pay", "paying", "paying", "payment", "payments", "pediatric", "pediatric", "pediatric", "pediatric", "pen", "people", "people", "people", "people", "people", "people", "people", "people", "peoples", "peoples", "performed", "performed", "performed", "performed", "performed", "person", "person", "person", "person", "person", "person", "person", "personable", "personal", "personal", "personal", "personal", "personal", "personal", "phone", "phone", "phone", "physical", "physical", "physician", "physician", "physician", "physician", "physician", "pill", "pills", "pills", "pills", "place", "place", "place", "place", "place", "place", "place", "plague", "play", "play", "pleased", "pleased", "pleased", "pm", "pm", "pm", "pm", "pm", "pm", "pm", "pneumonia", "pocket", "pocket", "pocket", "point", "point", "point", "point", "point", "point", "point", "point", "point", "poop", "poor", "poor", "poor", "poor", "poor", "poor", "poor", "poor", "poor", "por", "portland", "post", "post", "post", "post", "post", "post", "ppl", "ppl", "ppl", "practice", "practice", "practice", "practice", "pre", "pregnancy", "pregnancy", "pregnancy", "pregnant", "pregnant", "prepped", "presbyterian", "prescription", "prescription", "prescription", "pressure", "pressure", "pressure", "pressure", "pretty", "pretty", "pretty", "pretty", "pretty", "price", "primary", "primary", "primary", "primary", "private", "private", "private", "private", "private", "problem", "problem", "problem", "problem", "problem", "problem", "problem", "problems", "problems", "problems", "problems", "problems", "problems", "problems", "problems", "procedure", "procedure", "procedure", "procedure", "professional", "professional", "professional", "professionalism", "professionalism", "professionalism", "professionalism", "professionalism", "professionally", "prompt", "prompt", "prompt", "prompt", "proper", "proper", "proper", "proper", "proper", "proper", "proper", "protocol", "protocol", "provide", "provide", "provide", "provide", "psych", "psych", "psych", "psychiatric", "psychiatric", "psychiatrist", "psychiatrist", "pt", "puking", "puking", "puking", "puking", "pulmonary", "pulmonary", "quality", "quality", "quality", "question", "question", "question", "questions", "questions", "questions", "questions", "quick", "quick", "quick", "quicker", "quicker", "quicker", "quit", "quit", "race", "race", "racist", "rash", "rash", "rating", "rating", "rating", "rating", "ray", "ray", "ray", "ray", "ray", "rays", "rays", "reach", "reach", "reach", "reach", "reach", "reaction", "read", "read", "read", "read", "read", "read", "reading", "reading", "reading", "real", "real", "real", "real", "real", "real", "realize", "realize", "realize", "realize", "received", "received", "received", "received", "received", "reception", "reception", "reception", "reception", "receptionist", "receptionist", "receptionist", "recommend", "recommend", "recommend", "recommend", "recommend", "recommend", "recommend", "recovery", "recovery", "recovery", "referrals", "refill", "refill", "refused", "refused", "refused", "refused", "refused", "refused", "refused", "refused", "refused", "regional", "regional", "registration", "registration", "registration", "registration", "rehab", "rehab", "rehab", "relative", "relative", "relative", "relative", "relative", "relaxed", "release", "release", "release", "release", "relief", "relief", "religious", "replacement", "reporting", "require", "require", "require", "reschedule", "residents", "residents", "respect", "respect", "respect", "respect", "responsive", "responsive", "responsive", "restaurant", "restroom", "restroom", "retired", "retired", "review", "review", "review", "review", "review", "reviews", "reviews", "reviews", "ridge", "ridiculous", "ridiculous", "ridiculous", "ridiculous", "rights", "rights", "risk", "risk", "risk", "risk", "risk", "risk", "risk", "risk", "riverside", "riverside", "riverside", "rn", "rn", "rn", "rn", "rns", "rns", "rns", "rolled", "room", "room", "room", "room", "room", "room", "rooms", "rooms", "rooms", "rose", "rose", "rose", "rose", "rude", "rude", "rude", "rude", "rude", "rude", "rude", "rudely", "rudely", "rudely", "rudely", "rudeness", "rudeness", "rudeness", "running", "running", "running", "running", "running", "sacred", "sad", "sad", "sad", "sad", "sad", "sad", "safety", "safety", "safety", "sample", "sample", "sample", "sample", "sandwich", "sandwich", "sat", "sat", "sat", "satisfied", "satisfied", "saturday", "save", "save", "save", "save", "saved", "saved", "saving", "saving", "saving", "saving", "scan", "scan", "scan", "schedule", "schedule", "scheduling", "scheduling", "screening", "screening", "se", "seats", "seats", "second", "second", "second", "second", "second", "second", "second", "second", "second", "second", "second", "security", "security", "seizure", "seizure", "seizure", "seizures", "send", "send", "send", "send", "send", "serious", "serious", "serious", "serious", "serious", "service", "service", "service", "service", "service", "service", "service", "services", "services", "services", "services", "servicio", "servicio", "serving", "severe", "severe", "severe", "severe", "severe", "severe", "severe", "shame", "shame", "shame", "she's", "she's", "she's", "sheets", "sheets", "shift", "shift", "shift", "shift", "shit", "shop", "shore", "shore", "shortness", "shortness", "shoulder", "shoulder", "shoulder", "shoulder", "shower", "si", "sick", "sick", "sick", "sick", "sick", "sick", "side", "side", "side", "side", "side", "side", "side", "side", "sinai", "sinai", "sinus", "sister", "sister", "sisters", "sisters", "sisters", "sit", "sit", "sit", "sit", "sit", "sitting", "sitting", "sitting", "skills", "skills", "skills", "skills", "sleep", "sleep", "sleep", "sleeping", "sleeping", "sleeping", "slow", "slow", "slow", "slow", "small", "small", "small", "small", "small", "small", "small", "small", "smaller", "smaller", "smaller", "smaller", "smh", "smh", "smh", "smith", "snotty", "snotty", "social", "social", "soiled", "someone's", "someone's", "someone's", "someone's", "son", "son", "son", "sore", "sore", "sore", "speak", "speak", "speak", "special", "special", "special", "specialty", "specialty", "spectacular", "spider", "spoke", "spoke", "spoke", "spoke", "sprain", "st", "st", "st", "st", "st", "staff", "staff", "staff", "staff", "staff", "staff", "staff", "staff", "staffs", "staffs", "staffs", "staffs", "stage", "stage", "staph", "star", "star", "star", "star", "star", "star", "star", "stars", "stars", "stars", "stars", "stars", "state", "state", "state", "state", "states", "states", "states", "states", "station", "station", "station", "stay", "stay", "stay", "stay", "stay", "stay", "stayed", "stayed", "stayed", "stayed", "stayed", "stays", "stays", "stays", "steven", "stitched", "stitches", "stolen", "stolen", "stomach", "stomach", "stomach", "stomach", "stone", "stones", "stones", "strep", "stroke", "stroke", "stroke", "stroke", "students", "students", "students", "su", "success", "success", "successful", "suck", "suck", "suck", "suck", "suck", "sucks", "sucks", "sucks", "sugar", "sugar", "suicidal", "suicidal", "suicide", "sunday", "sunday", "sunday", "sunday", "super", "super", "super", "superb", "superb", "supervisor", "supervisor", "sure", "sure", "sure", "sure", "sure", "sure", "surgeon", "surgeon", "surgeons", "surgeons", "surgeons", "surgeries", "surgeries", "surgery", "surgery", "surgical", "surgical", "surgical", "survived", "swab", "symptoms", "symptoms", "symptoms", "symptoms", "symptoms", "system", "system", "system", "system", "t", "t", "talented", "talk", "talk", "talk", "talk", "talk", "talk", "talk", "talk", "talked", "talked", "talked", "talked", "talking", "talking", "talking", "talking", "talking", "talking", "talking", "talking", "talking", "tap", "taste", "team", "team", "team", "team", "teams", "telephone", "temp", "temperature", "temperature", "terrible", "terrible", "terrible", "terrible", "terrible", "terrible", "test", "test", "test", "test", "testing", "testing", "testing", "testing", "tests", "tests", "tests", "tests", "texas", "texas", "that's", "that's", "that's", "that's", "that's", "that's", "therapist", "therapist", "therapist", "therapist", "therapist", "therapists", "therapists", "therapists", "therapy", "there's", "there's", "there's", "they'd", "they'd", "they'd", "they'd", "they're", "they're", "they're", "they're", "thier", "thier", "thier", "thier", "thing", "thing", "thing", "thing", "thing", "thing", "thing", "thing", "things", "things", "things", "things", "things", "thorough", "thorough", "thorough", "threatening", "threatening", "threatening", "threatening", "throat", "throat", "thrown", "thrown", "thursday", "thyroid", "thyroid", "thyroid", "time", "time", "time", "time", "time", "time", "time", "time", "time", "time", "time", "time", "time", "timely", "timely", "times", "times", "times", "times", "times", "times", "times", "times", "times", "times", "times", "times", "today", "today", "today", "today", "today", "today", "today", "today", "todo", "toilet", "told", "told", "told", "told", "told", "told", "told", "told", "told", "tonsils", "tonsils", "tooth", "tooth", "top", "top", "top", "top", "top", "tract", "traffic", "traffic", "train", "transferring", "transferring", "transfusion", "transplant", "transplant", "transplant", "trash", "trash", "trash", "travel", "travel", "travel", "tray", "treat", "treat", "treat", "treat", "treated", "treated", "treated", "treated", "treated", "treated", "treated", "treated", "treated", "treated", "treated", "treatment", "treatment", "treatment", "treatment", "treatment", "treatment", "treatments", "treatments", "treats", "treats", "treats", "triage", "triaged", "triaged", "triaged", "truck", "tuesday", "tuesday", "tuesday", "tuesday", "tumor", "tv", "tv", "ultra", "ultra", "ultrasound", "ultrasound", "ultrasound", "una", "una", "unbearable", "understand", "understand", "understand", "understand", "understand", "understand", "underwent", "unfriendly", "unfriendly", "unfriendly", "unhelpful", "unhelpful", "unorganized", "unprofessional", "unprofessional", "unprofessional", "unprofessional", "unprofessional", "unprofessional", "updated", "updated", "updated", "updated", "updated", "updates", "updates", "ur", "ur", "ur", "urgency", "urgency", "urgent", "urgent", "urgent", "urgent", "urinary", "urine", "urine", "urine", "uti", "uti", "uti", "utmost", "va", "va", "valet", "valley", "valley", "valley", "valley", "variety", "variety", "veins", "veteran", "veteran", "veteran", "veterans", "veterans", "vets", "vets", "violation", "violation", "viral", "viral", "virus", "virus", "virus", "virus", "visit", "visit", "visit", "visit", "visit", "visit", "visit", "visit", "visit", "vitals", "vitals", "voice", "voice", "voice", "voice", "voicemail", "voicemail", "waist", "waist", "wait", "wait", "wait", "wait", "wait", "wait", "waited", "waited", "waited", "waited", "waited", "waited", "waiting", "waiting", "walk", "walk", "walk", "walk", "walk", "walk", "walk", "walked", "walked", "walked", "walked", "walked", "wanna", "war", "ward", "ward", "wash", "wash", "washed", "washington", "washington", "wasn", "waste", "waste", "waste", "waste", "waste", "water", "water", "we'd", "we'd", "we'd", "we're", "we're", "we're", "wednesday", "wednesday", "week", "week", "week", "week", "week", "week", "week", "week", "weeks", "weeks", "weeks", "weeks", "weeks", "weeks", "weeks", "well", "well", "well", "well", "well", "well", "well", "well", "well", "west", "west", "wet", "wet", "wet", "what's", "what's", "what's", "what's", "wheel", "wheelchair", "white", "white", "white", "white", "white", "white", "who's", "who's", "who's", "who's", "who's", "who's", "wife", "wife", "wife", "wife", "wife", "wife", "wifi", "will", "will", "will", "will", "will", "will", "will", "will", "will", "will", "williams", "woman", "woman", "woman", "woman", "won't", "won't", "won't", "won't", "won't", "wonderful", "wonderful", "wonderful", "wonderful", "wonderful", "work", "work", "work", "work", "work", "work", "work", "work", "work", "worker", "worker", "worker", "worker", "workers", "workers", "workers", "workers", "working", "working", "working", "working", "working", "working", "working", "working", "working", "worries", "worse", "worse", "worse", "worse", "worse", "worse", "worst", "worst", "worst", "worst", "worst", "worthless", "worthless", "worthless", "wouldn't", "wouldn't", "wouldn't", "wouldn't", "wouldn't", "wouldn't", "wouldn't", "wouldn't", "wound", "wound", "wow", "wow", "wow", "wow", "wow", "wow", "wow", "wrist", "write", "write", "write", "write", "wrong", "wrong", "wrong", "wrong", "wrong", "wrong", "xray", "xray", "xrays", "xrays", "xrays", "ya", "yeah", "yeah", "yeah", "yeah", "year", "year", "year", "year", "year", "year", "year", "years", "years", "years", "years", "years", "years", "years", "years", "yo", "you'd", "you'd", "you're", "you're", "you're", "you're", "you're", "younger", "younger" ], | |
"Topic": [ 16, 2, 11, 16, 9, 16, 17, 20, 1, 4, 5, 8, 12, 13, 14, 17, 19, 16, 18, 20, 20, 20, 3, 6, 2, 3, 20, 9, 4, 6, 8, 20, 12, 19, 12, 16, 3, 5, 12, 20, 3, 7, 10, 14, 15, 19, 1, 7, 8, 10, 11, 13, 15, 20, 10, 20, 3, 3, 6, 9, 11, 16, 3, 1, 3, 5, 6, 9, 10, 12, 16, 2, 3, 4, 11, 19, 20, 5, 7, 7, 13, 18, 7, 10, 10, 19, 16, 20, 4, 12, 13, 15, 2, 4, 10, 16, 4, 18, 3, 6, 9, 6, 15, 14, 15, 12, 15, 1, 13, 15, 10, 15, 19, 2, 11, 15, 6, 11, 14, 17, 18, 19, 14, 6, 14, 3, 9, 14, 17, 8, 2, 4, 9, 16, 6, 7, 9, 20, 1, 16, 14, 20, 6, 8, 12, 15, 18, 8, 3, 7, 10, 20, 6, 14, 14, 2, 4, 5, 10, 13, 18, 20, 15, 2, 1, 2, 3, 4, 11, 2, 11, 13, 14, 16, 8, 10, 13, 5, 19, 1, 8, 12, 17, 18, 10, 10, 19, 8, 12, 15, 18, 1, 3, 5, 7, 14, 17, 19, 1, 3, 14, 17, 20, 3, 6, 20, 11, 12, 13, 15, 1, 2, 4, 11, 12, 17, 19, 12, 3, 12, 12, 14, 9, 1, 4, 6, 9, 12, 16, 17, 18, 19, 7, 3, 1, 5, 9, 13, 20, 1, 3, 8, 9, 20, 3, 6, 4, 7, 7, 15, 5, 10, 13, 15, 16, 5, 9, 18, 7, 12, 18, 20, 2, 7, 7, 8, 19, 1, 6, 8, 12, 13, 15, 18, 1, 2, 1, 5, 6, 7, 9, 10, 16, 17, 18, 19, 13, 3, 3, 3, 10, 3, 6, 12, 12, 4, 9, 15, 16, 17, 2, 4, 19, 4, 12, 15, 16, 4, 7, 16, 6, 7, 13, 15, 16, 10, 2, 10, 11, 16, 1, 2, 7, 15, 20, 2, 5, 17, 2, 11, 10, 12, 13, 19, 2, 17, 19, 1, 12, 10, 16, 19, 5, 7, 20, 12, 7, 9, 10, 16, 1, 10, 2, 5, 7, 9, 11, 12, 16, 17, 19, 2, 12, 2, 1, 7, 10, 1, 6, 9, 2, 4, 7, 9, 10, 11, 12, 2, 13, 13, 2, 9, 3, 4, 5, 6, 14, 18, 17, 17, 20, 1, 3, 5, 18, 19, 4, 7, 9, 14, 17, 18, 4, 7, 18, 12, 17, 18, 5, 19, 1, 3, 6, 10, 14, 3, 11, 12, 14, 3, 14, 5, 11, 18, 10, 7, 9, 17, 19, 1, 2, 8, 18, 3, 14, 10, 15, 10, 7, 10, 15, 1, 3, 5, 6, 8, 9, 13, 15, 18, 19, 20, 19, 8, 10, 13, 15, 19, 6, 7, 10, 11, 13, 14, 20, 12, 17, 20, 2, 7, 14, 16, 2, 10, 15, 6, 9, 18, 20, 10, 1, 3, 5, 12, 5, 7, 19, 20, 4, 7, 12, 16, 20, 5, 3, 6, 7, 8, 12, 19, 20, 1, 3, 7, 16, 17, 19, 3, 7, 20, 3, 9, 3, 12, 11, 14, 17, 4, 5, 7, 2, 3, 4, 5, 9, 11, 14, 1, 2, 3, 4, 9, 10, 11, 19, 10, 10, 11, 16, 12, 12, 12, 4, 5, 15, 1, 2, 5, 6, 10, 17, 18, 17, 19, 8, 9, 16, 20, 5, 5, 19, 3, 5, 7, 13, 15, 18, 2, 7, 14, 16, 18, 7, 12, 13, 14, 15, 18, 5, 5, 9, 11, 14, 5, 8, 19, 1, 5, 9, 18, 1, 2, 7, 9, 20, 3, 3, 10, 5, 5, 10, 6, 8, 12, 15, 18, 1, 6, 11, 19, 20, 20, 1, 7, 17, 20, 5, 8, 14, 19, 20, 13, 3, 8, 14, 15, 20, 5, 8, 9, 12, 15, 6, 17, 20, 1, 8, 10, 1, 3, 6, 7, 14, 16, 18, 19, 3, 7, 11, 14, 16, 20, 2, 11, 12, 14, 17, 20, 2, 3, 6, 7, 9, 14, 20, 13, 8, 19, 20, 9, 10, 20, 18, 8, 12, 18, 5, 11, 20, 12, 1, 11, 14, 3, 15, 9, 1, 3, 1, 2, 6, 7, 9, 11, 14, 16, 4, 5, 5, 14, 17, 19, 1, 5, 15, 19, 3, 8, 16, 2, 3, 7, 3, 4, 17, 3, 4, 13, 18, 2, 7, 12, 15, 16, 15, 16, 2, 6, 7, 9, 3, 9, 20, 7, 12, 16, 2, 10, 17, 20, 16, 1, 9, 10, 5, 18, 17, 11, 20, 18, 9, 12, 12, 13, 1, 2, 6, 7, 8, 9, 10, 11, 14, 15, 19, 1, 7, 9, 10, 11, 14, 15, 20, 18, 13, 2, 10, 10, 18, 20, 3, 8, 19, 3, 3, 8, 10, 11, 12, 13, 18, 10, 11, 8, 11, 16, 13, 18, 12, 19, 12, 7, 12, 12, 1, 9, 2, 3, 5, 6, 8, 13, 14, 18, 20, 4, 19, 4, 14, 20, 1, 3, 11, 12, 20, 5, 9, 9, 10, 16, 9, 10, 11, 12, 16, 20, 10, 1, 9, 16, 17, 20, 8, 10, 11, 17, 19, 6, 10, 2, 8, 9, 20, 20, 2, 6, 7, 14, 1, 14, 15, 18, 20, 4, 7, 15, 16, 17, 7, 11, 13, 15, 16, 20, 1, 2, 7, 11, 16, 4, 7, 17, 2, 12, 20, 20, 2, 4, 7, 9, 10, 11, 14, 16, 19, 1, 5, 8, 9, 10, 12, 13, 18, 19, 20, 14, 17, 2, 17, 3, 15, 1, 6, 20, 17, 2, 3, 4, 7, 20, 16, 19, 1, 6, 7, 10, 11, 13, 15, 16, 6, 10, 15, 17, 11, 9, 11, 14, 7, 11, 13, 7, 11, 5, 6, 9, 17, 16, 16, 12, 16, 17, 19, 7, 3, 10, 17, 9, 6, 9, 15, 7, 11, 18, 8, 11, 13, 18, 3, 8, 13, 2, 1, 20, 4, 5, 9, 10, 11, 5, 12, 14, 18, 19, 20, 13, 3, 10, 17, 19, 6, 11, 13, 9, 4, 14, 18, 12, 9, 2, 4, 9, 10, 11, 16, 17, 4, 9, 13, 13, 13, 9, 6, 7, 11, 20, 9, 12, 13, 8, 13, 15, 18, 4, 8, 16, 2, 3, 14, 1, 8, 11, 12, 13, 15, 16, 17, 18, 5, 6, 7, 8, 12, 18, 14, 8, 1, 9, 11, 13, 16, 1, 2, 8, 9, 12, 15, 16, 17, 18, 2, 9, 1, 2, 7, 9, 6, 9, 16, 19, 5, 8, 18, 5, 8, 18, 20, 1, 2, 3, 5, 6, 11, 20, 1, 2, 10, 2, 2, 19, 1, 8, 9, 14, 18, 19, 20, 18, 11, 12, 13, 15, 18, 1, 2, 6, 9, 13, 14, 4, 6, 8, 10, 18, 1, 8, 10, 10, 14, 3, 1, 2, 6, 12, 15, 17, 18, 19, 2, 12, 20, 2, 6, 8, 10, 11, 12, 16, 9, 19, 11, 17, 7, 14, 16, 19, 7, 14, 17, 2, 3, 4, 6, 11, 14, 16, 3, 1, 2, 5, 6, 8, 11, 14, 16, 17, 18, 19, 2, 6, 19, 1, 7, 11, 15, 5, 6, 7, 12, 5, 10, 5, 9, 11, 17, 7, 8, 18, 2, 4, 10, 5, 6, 12, 13, 16, 17, 12, 5, 8, 2, 19, 2, 8, 16, 2, 5, 10, 11, 18, 20, 10, 11, 14, 1, 2, 5, 9, 10, 13, 20, 2, 8, 13, 17, 18, 20, 4, 7, 11, 14, 15, 19, 2, 3, 7, 9, 16, 17, 19, 6, 11, 18, 18, 2, 1, 3, 5, 10, 19, 20, 8, 7, 2, 10, 17, 18, 4, 9, 12, 11, 20, 1, 8, 9, 10, 12, 15, 16, 19, 20, 1, 2, 6, 7, 9, 11, 14, 15, 16, 1, 5, 6, 11, 12, 13, 14, 15, 16, 18, 19, 9, 19, 1, 19, 13, 19, 1, 11, 13, 1, 19, 1, 5, 14, 15, 12, 13, 15, 18, 2, 7, 14, 5, 6, 7, 12, 5, 14, 12, 14, 2, 3, 6, 11, 14, 16, 18, 5, 12, 7, 11, 12, 14, 6, 15, 2, 4, 11, 16, 19, 4, 7, 15, 2, 4, 2, 13, 18, 1, 4, 6, 12, 16, 20, 6, 7, 11, 1, 6, 6, 11, 19, 9, 12, 14, 17, 19, 8, 17, 2, 19, 13, 17, 6, 9, 19, 2, 9, 14, 16, 1, 4, 16, 16, 5, 6, 12, 20, 5, 19, 20, 10, 1, 2, 6, 7, 14, 16, 17, 19, 20, 1, 6, 9, 12, 15, 12, 13, 18, 1, 11, 6, 7, 8, 6, 7, 10, 20, 5, 9, 10, 14, 16, 20, 8, 11, 12, 2, 15, 19, 2, 3, 18, 6, 9, 6, 14, 16, 3, 5, 13, 15, 16, 19, 1, 3, 6, 15, 19, 20, 6, 8, 14, 2, 6, 16, 17, 1, 7, 9, 12, 17, 19, 1, 1, 3, 5, 6, 7, 9, 10, 12, 13, 17, 18, 19, 20, 18, 20, 1, 4, 5, 8, 18, 19, 20, 17, 5, 18, 4, 7, 11, 13, 2, 4, 7, 9, 11, 16, 17, 4, 17, 20, 1, 17, 19, 20, 1, 5, 14, 2, 6, 16, 18, 7, 10, 11, 12, 15, 16, 7, 18, 6, 11, 2, 6, 7, 9, 10, 16, 1, 5, 7, 10, 15, 6, 19, 8, 15, 18, 5, 7, 20, 20, 9, 6, 9, 10, 3, 14, 18, 2, 5, 18, 19, 2, 5, 2, 11, 13, 3, 11, 18, 5, 6, 11, 20, 4, 11, 3, 5, 16, 20, 3, 5, 10, 13, 14, 16, 19, 20, 5, 6, 9, 10, 11, 20, 6, 14, 17, 18, 19, 2, 4, 11, 16, 10, 16, 17, 15, 7, 19, 1, 6, 7, 12, 13, 15, 19, 7, 19, 8, 15, 1, 17, 19, 8, 19, 6, 18, 20, 16, 1, 3, 5, 7, 9, 5, 1, 3, 6, 7, 11, 13, 18, 15, 10, 16, 2, 9, 12, 9, 10, 1, 6, 7, 8, 12, 13, 15, 18, 8, 15, 20, 7, 8, 18, 6, 8, 3, 5, 9, 12, 15, 20, 8, 13, 19, 13, 3, 6, 11, 19, 4, 8, 12, 3, 11, 20, 1, 2, 19, 20, 20, 12, 2, 4, 14, 3, 5, 16, 18, 20, 13, 1, 2, 4, 20, 13, 2, 4, 7, 11, 14, 15, 16, 18, 5, 1, 2, 4, 7, 9, 11, 14, 16, 18, 2, 1, 5, 10, 18, 19, 20, 1, 11, 7, 2, 2, 6, 17, 1, 5, 6, 10, 16, 10, 13, 4, 5, 6, 10, 11, 1, 7, 1, 2, 4, 6, 17, 18, 1, 3, 4, 7, 12, 14, 20, 3, 4, 18, 1, 2, 4, 7, 9, 11, 16, 1, 12, 19, 13, 19, 6, 10, 11, 12, 14, 15, 16, 18, 19, 6, 15, 17, 18, 4, 7, 9, 19, 9, 12, 13, 15, 1, 3, 7, 12, 18, 20, 3, 16, 20, 8, 10, 10, 3, 3, 8, 10, 11, 15, 16, 19, 20, 7, 8, 13, 8, 14, 5, 8, 15, 2, 8, 7, 9, 10, 13, 11, 12, 5, 18, 6, 7, 18, 3, 5, 8, 9, 20, 3, 4, 7, 6, 10, 16, 9, 16, 7, 11, 16, 15, 1, 9, 19, 20, 1, 20, 5, 10, 13, 15, 19, 4, 7, 9, 12, 20, 20, 4, 16, 17, 18, 14, 14, 13, 12, 16, 16, 15, 4, 9, 11, 16, 2, 3, 4, 7, 2, 4, 5, 9, 10, 11, 14, 15, 16, 20, 6, 12, 14, 11, 5, 3, 15, 18, 1, 8, 10, 1, 6, 7, 10, 11, 14, 3, 6, 19, 3, 9, 10, 12, 18, 3, 4, 5, 10, 12, 7, 9, 11, 14, 16, 19, 6, 17, 16, 1, 4, 1, 2, 5, 7, 8, 9, 11, 12, 15, 16, 19, 9, 18, 8, 16, 13, 12, 15, 16, 18, 1, 2, 7, 8, 9, 11, 12, 14, 15, 2, 13, 16, 18, 6, 11, 13, 19, 20, 9, 20, 1, 3, 14, 12, 15, 12, 13, 18, 11, 16, 18, 10, 18, 12, 1, 1, 7, 8, 11, 16, 7, 11, 12, 1, 6, 7, 18, 1, 8, 19, 3, 5, 14, 16, 1, 2, 3, 4, 7, 11, 12, 14, 16, 20, 12, 1, 7, 8, 10, 12, 13, 15, 17, 18, 19, 7, 8, 12, 15, 18, 19, 20, 11, 17, 12, 12, 17, 19, 5, 7, 11, 6, 18, 3, 9, 14, 1, 5, 9, 15, 17, 20, 10, 20, 15, 2, 3, 7, 10, 20, 7, 9, 15, 1, 10, 15, 17, 18, 7, 14, 5, 6, 7, 11, 16, 18, 5, 4, 8, 10, 18, 11, 18, 1, 3, 15, 3, 4, 7, 9, 13, 3, 10, 2, 9, 16, 1, 4, 3, 17, 2, 16, 17, 7, 2, 11, 10, 11, 14, 16, 13, 18, 5, 1, 3, 9, 10, 16, 19, 1, 5, 7, 8, 13, 14, 18, 19, 20, 19, 20, 1, 7, 13, 19, 20, 3, 3, 11, 3, 3, 7, 12, 15, 17, 14, 1, 4, 6, 10, 11, 17, 18, 19, 3, 19, 1, 2, 3, 11, 15, 1, 2, 6, 11, 14, 19, 20, 8, 7, 13, 14, 18, 19, 20, 3, 5, 14, 15, 20, 3, 5, 11, 16, 20, 16, 11, 14, 16, 1, 7, 13, 14, 17, 18, 19, 17, 16, 19, 8, 12, 15, 1, 4, 8, 11, 14, 17, 20, 10, 3, 4, 12, 2, 7, 11, 12, 13, 14, 15, 16, 20, 7, 1, 5, 7, 8, 9, 11, 17, 19, 20, 13, 5, 5, 12, 13, 15, 19, 20, 10, 12, 17, 3, 10, 13, 20, 15, 9, 12, 20, 6, 12, 15, 5, 4, 9, 16, 2, 6, 9, 16, 2, 6, 8, 16, 18, 3, 3, 5, 9, 12, 12, 17, 18, 19, 20, 3, 5, 6, 9, 10, 14, 16, 1, 3, 5, 6, 10, 12, 16, 20, 1, 3, 13, 15, 8, 13, 15, 2, 8, 13, 15, 20, 8, 8, 10, 11, 13, 1, 5, 9, 10, 15, 16, 20, 2, 20, 3, 5, 8, 20, 1, 17, 20, 14, 20, 4, 20, 15, 4, 5, 11, 16, 10, 15, 5, 8, 18, 6, 14, 19, 1, 8, 10, 14, 8, 9, 13, 4, 10, 14, 2, 19, 3, 19, 19, 9, 14, 15, 18, 19, 20, 2, 3, 10, 11, 16, 2, 11, 4, 9, 14, 18, 20, 16, 6, 11, 13, 16, 19, 20, 1, 6, 11, 6, 9, 10, 15, 16, 19, 6, 9, 11, 13, 1, 3, 5, 8, 18, 1, 8, 14, 17, 4, 6, 14, 8, 12, 13, 15, 16, 17, 20, 1, 12, 15, 5, 13, 14, 2, 3, 7, 11, 12, 13, 14, 16, 18, 5, 10, 4, 6, 14, 15, 5, 10, 15, 1, 3, 5, 8, 18, 15, 1, 10, 11, 20, 16, 20, 20, 15, 20, 10, 16, 20, 14, 5, 11, 1, 5, 8, 19, 7, 8, 20, 18, 7, 16, 5, 8, 2, 3, 6, 8, 20, 5, 6, 16, 5, 3, 4, 6, 17, 12, 20, 1, 2, 7, 9, 16, 17, 18, 20, 1, 8, 13, 3, 11, 15, 20, 8, 15, 20, 2, 2, 4, 7, 9, 11, 12, 4, 7, 18, 5, 7, 13, 19, 2, 5, 14, 16, 17, 18, 19, 2, 5, 10, 14, 3, 14, 19, 2, 9, 11, 14, 19, 10, 4, 6, 10, 18, 19, 20, 5, 15, 20, 9, 11, 14, 18, 3, 7, 4, 7, 14, 8, 18, 11, 5, 10, 17, 19, 10, 15, 6, 10, 15, 19, 11, 16, 19, 12, 14, 14, 15, 6, 14, 13, 1, 4, 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 16, 14, 19, 1, 9, 11, 9, 1, 3, 9, 16, 17, 2, 4, 9, 10, 20, 1, 3, 4, 5, 13, 17, 18, 3, 5, 8, 20, 5, 13, 5, 8, 10, 13, 15, 16, 18, 19, 2, 19, 20, 1, 6, 13, 7, 17, 1, 7, 12, 16, 17, 18, 12, 18, 10, 14, 2, 7, 9, 15, 7, 13, 1, 3, 4, 9, 19, 20, 2, 6, 7, 8, 10, 16, 18, 19, 12, 18, 9, 1, 11, 1, 18, 20, 2, 3, 4, 13, 16, 4, 6, 7, 5, 7, 17, 20, 7, 16, 18, 4, 7, 14, 4, 7, 9, 17, 1, 2, 5, 9, 12, 15, 16, 18, 15, 17, 18, 20, 7, 8, 17, 15, 17, 19, 15, 20, 7, 6, 7, 10, 16, 9, 12, 13, 2, 9, 11, 1, 10, 14, 12, 13, 15, 3, 5, 15, 9, 3, 6, 10, 14, 2, 2, 7, 8, 10, 14, 6, 8, 10, 12, 13, 15, 18, 19, 4, 12, 16, 19, 1, 10, 9, 4, 5, 6, 10, 13, 15, 19, 5, 6, 9, 17, 19, 1, 5, 7, 20, 1, 2, 5, 13, 4, 7, 14, 7, 9, 12, 15, 17, 18, 6, 7, 12, 15, 18, 5, 12, 18, 15, 2, 2, 9, 14, 6, 9, 11, 16, 16, 16, 17, 9, 1, 10, 11, 14, 9, 13, 20, 13, 4, 15, 15, 3, 9, 12, 17, 19, 6, 9, 17, 2, 11, 9, 20, 20, 8, 9, 11, 19, 6, 12, 13, 2, 8, 14, 19, 6, 8, 11, 12, 14, 18, 9, 15, 8, 15, 16, 15, 16, 7, 15, 10, 15, 20, 10, 9, 5, 9, 10, 11, 16, 3, 5, 10, 14, 1, 12, 8, 1, 2, 6, 11, 12, 14, 16, 19, 1, 5, 11, 14, 1, 4, 6, 7, 12, 14, 16, 17, 19, 16, 18, 8, 10, 15, 19, 15, 14, 9, 7, 9, 1, 2, 7, 10, 17, 19, 2, 9, 11, 14, 5, 6, 10, 11, 9, 10, 11, 16, 3, 5, 1, 6, 7, 9, 18, 19, 9, 11, 15, 16, 17, 1, 15, 18, 15, 6, 7, 15, 6, 7, 11, 20, 3, 6, 16, 19, 3, 4, 18, 19, 1, 6, 7, 9, 12, 14, 19, 20, 1, 6, 7, 12, 18, 5, 8, 18, 3, 10, 13, 19, 9, 10, 7, 10, 11, 11, 18, 20, 1, 3, 4, 6, 7, 9, 10, 11, 12, 13, 14, 17, 18, 8, 11, 1, 3, 5, 6, 7, 9, 10, 11, 12, 14, 17, 18, 1, 2, 3, 6, 9, 14, 15, 16, 13, 7, 2, 3, 7, 9, 10, 11, 14, 16, 19, 4, 9, 5, 16, 5, 7, 8, 9, 12, 11, 5, 18, 19, 8, 14, 11, 4, 10, 13, 3, 7, 14, 3, 5, 7, 7, 9, 13, 19, 20, 1, 5, 7, 8, 9, 10, 13, 16, 17, 19, 20, 2, 5, 8, 10, 11, 20, 10, 11, 5, 12, 19, 4, 4, 10, 18, 2, 9, 11, 14, 16, 10, 7, 11, 11, 17, 2, 11, 16, 13, 18, 16, 6, 10, 14, 15, 19, 20, 15, 8, 13, 17, 2, 17, 17, 6, 7, 14, 16, 17, 19, 3, 4, 9, 11, 18, 1, 18, 6, 12, 17, 4, 20, 5, 9, 14, 16, 11, 7, 9, 11, 10, 11, 20, 8, 1, 5, 18, 5, 11, 13, 16, 18, 20, 2, 3, 5, 18, 5, 13, 1, 5, 7, 20, 6, 9, 9, 11, 13, 14, 3, 5, 6, 8, 9, 11, 14, 16, 18, 4, 11, 2, 14, 16, 20, 8, 14, 9, 17, 2, 4, 6, 7, 10, 17, 3, 4, 11, 15, 17, 19, 4, 18, 2, 3, 4, 10, 14, 16, 19, 1, 2, 4, 14, 18, 17, 5, 12, 20, 7, 14, 7, 5, 12, 1, 6, 9, 14, 16, 17, 7, 11, 6, 16, 17, 1, 6, 13, 11, 17, 1, 3, 9, 10, 12, 14, 15, 16, 3, 9, 10, 12, 14, 15, 16, 1, 6, 8, 9, 10, 12, 15, 16, 18, 3, 5, 7, 17, 19, 6, 9, 18, 20, 2, 2, 12, 13, 15, 16, 19, 20, 1, 6, 7, 10, 12, 13, 4, 9, 11, 12, 14, 16, 18, 1, 3, 5, 6, 7, 9, 14, 17, 19, 20, 15, 1, 4, 12, 14, 3, 6, 9, 14, 17, 7, 8, 12, 13, 15, 1, 5, 6, 9, 11, 13, 15, 18, 19, 2, 5, 14, 20, 8, 10, 19, 20, 1, 2, 6, 7, 11, 12, 15, 18, 19, 15, 1, 7, 9, 15, 16, 17, 5, 13, 17, 19, 20, 9, 17, 19, 2, 6, 9, 10, 12, 16, 17, 19, 2, 20, 1, 2, 6, 12, 14, 16, 18, 2, 6, 9, 11, 19, 2, 3, 9, 11, 16, 17, 2, 16, 2, 7, 9, 13, 2, 3, 6, 17, 1, 2, 3, 8, 9, 10, 15, 1, 3, 5, 6, 9, 10, 12, 20, 13, 6, 15, 3, 4, 6, 14, 19, 1, 13 ], | |
"Freq": [ 0.99251, 0.0016941, 0.0050824, 0.99106, 0.99222, 0.0043297, 0.99149, 0.0043297, 0.041185, 0.0010698, 0.010163, 0.12409, 0.161, 0.0010698, 0.0010698, 0.65897, 0.0016046, 0.0281, 0.0056199, 0.961, 0.98518, 0.99218, 0.99161, 0.008128, 0.99862, 0.99838, 0.99005, 0.97812, 0.0089123, 0.0089123, 0.017825, 0.95362, 0.014982, 0.97382, 0.0046309, 0.99102, 0.11941, 0.0024369, 0.0024369, 0.87486, 0.0067085, 0.020126, 0.020126, 0.040251, 0.91236, 0.0067085, 0.13693, 0.19312, 0.05813, 0.42984, 0.17277, 0.00032294, 0.0077506, 0.00096883, 0.0099899, 0.989, 0.99545, 0.0035446, 0.0035446, 0.0070891, 0.98184, 0.0035446, 0.99664, 0.10168, 0.089979, 0.011697, 0.13632, 0.13227, 0.31852, 0.18221, 0.027444, 0.011488, 0.034464, 0.9466, 0.0022976, 0.0022976, 0.0022976, 0.022515, 0.96816, 0.005657, 0.98431, 0.005657, 0.98663, 0.010277, 0.98991, 0.0083655, 0.99909, 0.99618, 0.0003676, 0.48008, 0.20181, 0.31724, 0.42762, 0.12504, 0.44638, 0.00062518, 0.96841, 0.025484, 0.9349, 0.060278, 0.0035458, 0.014213, 0.98067, 0.01079, 0.98726, 0.13999, 0.8566, 0.029672, 0.0098906, 0.95939, 0.048906, 0.0097812, 0.939, 0.99467, 0.0024379, 0.0024379, 0.00087027, 0.00087027, 0.98949, 0.0017405, 0.0043513, 0.0026108, 0.99783, 0.0047325, 0.99382, 0.01032, 0.14655, 0.84006, 0.002064, 0.99273, 0.01032, 0.0068798, 0.95973, 0.020639, 0.0079019, 0.0015804, 0.98932, 0.98029, 0.0077809, 0.99207, 0.99914, 0.00058225, 0.020298, 0.79922, 0.06343, 0.091339, 0.025372, 0.97961, 0.010785, 0.0053926, 0.0053926, 0.97606, 0.0045891, 0.99124, 0.99116, 0.044669, 0.34876, 0.23365, 0.00042951, 0.011167, 0.31655, 0.04424, 0.98298, 0.99917, 0.0030454, 0.08984, 0.00076135, 0.51239, 0.39362, 0.175, 0.30168, 0.00035141, 0.42889, 0.094002, 0.97845, 0.9982, 0.99307, 0.97791, 0.017463, 0.00642, 0.00642, 0.01926, 0.01284, 0.95017, 0.99913, 0.98349, 0.0084059, 0.79415, 0.032468, 0.073711, 0.099159, 0.060488, 0.0017282, 0.00086412, 0.0025924, 0.27652, 0.2048, 0.45193, 0.99841, 0.21711, 0.0027252, 0.68766, 0.092657, 0.24148, 0.0059624, 0.75126, 0.00060328, 0.20089, 0.64913, 0.14901, 0.05286, 0.00089593, 0.00089593, 0.00089593, 0.013439, 0.68359, 0.24728, 0.99923, 0.0016038, 0.99838, 0.99783, 0.97936, 0.99402, 0.025202, 0.00019238, 0.32128, 0.1566, 0.015198, 0.05579, 0.23124, 0.036552, 0.15794, 0.99367, 0.99509, 0.1198, 0.83111, 0.037437, 0.0049916, 0.0074875, 0.0049098, 0.20376, 0.0024549, 0.10802, 0.68001, 0.058055, 0.92888, 0.0012428, 0.99798, 0.99118, 0.0073421, 0.92993, 0.0062833, 0.025133, 0.025133, 0.0062833, 0.95375, 0.036403, 0.0072805, 0.0058667, 0.4048, 0.58862, 0.0019556, 0.12361, 0.87587, 0.97749, 0.99923, 0.98125, 0.00017767, 0.00071067, 0.22919, 0.042818, 0.40402, 0.16061, 0.16239, 0.92379, 0.058966, 0.064256, 0.16835, 0.24381, 0.0010009, 0.016214, 0.01121, 0.0024021, 0.075666, 0.23961, 0.17755, 0.99503, 0.9997, 0.99934, 0.99948, 0.00043779, 0.99965, 0.00073895, 0.99907, 0.99805, 0.0078544, 0.93468, 0.015709, 0.023563, 0.023563, 0.26858, 0.0059683, 0.72217, 0.0067908, 0.057721, 0.0067908, 0.92694, 0.045765, 0.90876, 0.045765, 0.015057, 0.97871, 0.0024265, 0.99244, 0.004853, 0.99373, 0.077712, 0.023562, 0.79304, 0.10561, 0.013085, 0.15701, 0.016356, 0.0032711, 0.8047, 0.97483, 0.0084279, 0.016856, 0.99086, 0.0066501, 0.00084872, 0.99724, 0.0016974, 0.99323, 0.016738, 0.93733, 0.033476, 0.0040249, 0.99415, 0.98206, 0.010839, 0.0065037, 0.00753, 0.97889, 0.01506, 0.99183, 0.022022, 0.018018, 0.94696, 0.014014, 0.0011885, 0.99837, 0.0037131, 0.00092828, 0.46971, 0.038059, 0.0092828, 0.16431, 0.00092828, 0.27106, 0.041773, 0.85936, 0.13944, 0.99917, 0.99427, 0.0026165, 0.0026165, 0.95906, 0.016535, 0.016535, 0.084082, 0.18288, 0.31951, 0.089863, 0.20232, 0.096169, 0.024174, 0.98933, 0.99319, 0.99514, 0.010717, 0.986, 0.0017732, 0.0035464, 0.12235, 0.0017732, 0.12944, 0.73942, 0.99361, 0.97758, 0.022218, 0.0050478, 0.70291, 0.027763, 0.0063097, 0.25744, 0.63124, 0.1221, 0.00074002, 0.11174, 0.01628, 0.11692, 0.0047768, 0.99357, 0.99084, 0.0022121, 0.0022121, 0.99544, 0.97789, 0.020955, 0.00019767, 0.09567, 0.00019767, 0.0031627, 0.90076, 0.14705, 0.092749, 0.00057968, 0.75938, 0.19628, 0.80191, 0.0074309, 0.0074309, 0.98088, 0.99898, 0.0020522, 0.080037, 0.81063, 0.10672, 0.0017547, 0.97562, 0.0026321, 0.019302, 0.94229, 0.056628, 0.9212, 0.078031, 0.98563, 0.0034513, 0.98708, 0.0069026, 0.17828, 0.00054438, 0.29033, 4.5365e-05, 0.28167, 9.0729e-05, 0.053757, 0.081294, 0.025903, 0.029532, 0.05843, 0.99911, 0.81403, 0.00060703, 0.051598, 0.13051, 0.0030352, 0.21527, 0.0037602, 0.21057, 0.096826, 0.0028202, 0.0018801, 0.46721, 0.033736, 0.020242, 0.94461, 0.99488, 0.0072065, 0.0072065, 0.98489, 0.011373, 0.98374, 0.0056864, 0.84804, 0.028268, 0.084804, 0.028268, 0.98891, 0.00065011, 0.00032506, 0.97712, 0.021779, 0.96425, 0.015938, 0.015938, 0.99386, 0.93268, 0.03933, 0.0056185, 0.0056185, 0.016856, 0.97649, 0.037879, 0.12416, 0.7681, 0.0010522, 0.0031566, 0.063132, 0.0010522, 0.1902, 0.0029039, 0.78259, 0.010164, 0.0014519, 0.013067, 0.78324, 0.21467, 0.0015556, 0.99798, 0.0013746, 0.99692, 0.0023184, 0.95743, 0.016507, 0.016507, 0.94401, 0.040001, 0.0080001, 0.0025661, 0.069284, 0.18622, 0.0010997, 0.21042, 0.27457, 0.25551, 0.0065989, 0.020397, 0.0011998, 0.41573, 0.0053991, 0.0005999, 0.54891, 0.0011998, 0.99223, 0.70477, 0.11792, 0.17756, 0.99957, 0.99903, 0.99868, 0.90925, 0.025979, 0.051957, 0.18167, 0.0010562, 0.48481, 0.10879, 0.0021125, 0.059149, 0.1616, 0.027531, 0.96357, 0.048795, 0.94104, 0.99224, 0.0037024, 0.96948, 0.9862, 0.01269, 0.9899, 0.0075565, 0.12788, 0.080973, 0.0030973, 0.78761, 0.11843, 0.86282, 0.008459, 0.008459, 0.9695, 0.87744, 0.078064, 0.043716, 0.98469, 0.0070841, 0.0070841, 0.99273, 0.88704, 0.10743, 0.0014921, 0.0037302, 0.97774, 0.012376, 0.0061882, 0.97432, 0.97486, 0.012498, 0.99477, 0.030705, 0.089324, 0.55688, 0.32101, 0.0027914, 0.99764, 0.99778, 0.99353, 0.98962, 0.98593, 0.99573, 0.0019686, 0.24869, 0.23885, 0.35303, 0.15748, 0.15979, 0.095195, 0.0033998, 0.74116, 0.97199, 0.98367, 0.15231, 0.038077, 0.0042308, 0.80527, 0.70522, 0.21592, 0.0052238, 0.0017413, 0.071392, 0.99475, 0.99951, 0.51076, 0.0073416, 0.10593, 0.37547, 0.0023854, 0.90645, 0.0023854, 0.0047708, 0.083489, 0.87753, 0.028307, 0.084922, 0.0042623, 0.97819, 0.017049, 0.087012, 0.0020717, 0.0020717, 0.17195, 0.0020717, 0.0020717, 0.10151, 0.6298, 0.026194, 0.046152, 0.0024947, 0.1422, 0.0049894, 0.7771, 0.0087998, 0.19506, 0.0014666, 0.0132, 0.23173, 0.54852, 0.18685, 0.0015835, 0.011084, 0.1528, 0.17656, 0.1243, 0.34678, 0.99622, 0.46793, 0.0015808, 0.52958, 0.093213, 0.56442, 0.34203, 0.98921, 0.95616, 0.037993, 0.98826, 0.0089262, 0.9551, 0.026779, 0.99665, 0.038095, 0.0095237, 0.95237, 0.99771, 0.0012534, 0.99804, 0.96947, 0.023646, 0.026125, 0.25021, 0.057769, 0.15344, 0.058505, 0.13578, 0.11848, 0.19907, 0.97323, 0.026303, 0.76022, 0.0063352, 0.0084469, 0.22384, 0.011577, 0.85283, 0.0019295, 0.1312, 0.0054382, 0.99156, 0.0018127, 0.017925, 0.88728, 0.094105, 0.014165, 0.014165, 0.96325, 0.99827, 0.75269, 0.015519, 0.23279, 0.26863, 0.022386, 0.088145, 0.0055965, 0.61282, 0.0028047, 0.99659, 0.0056558, 0.028279, 0.95583, 0.0056558, 0.042108, 0.018046, 0.93841, 0.97895, 0.014503, 0.0072515, 0.99893, 0.019586, 0.97279, 0.0065288, 0.99722, 0.41211, 0.0023195, 0.58453, 0.97299, 0.024737, 0.97758, 0.079816, 0.91522, 0.98984, 0.24326, 0.75637, 0.98945, 0.0053484, 0.035428, 0.0013369, 0.0050134, 0.24566, 0.00033423, 0.11781, 0.11531, 0.17363, 0.126, 0.17948, 0.00033423, 0.0070919, 0.1836, 0.23265, 0.40404, 0.086678, 0.0027579, 0.082344, 0.00078798, 0.9742, 0.99908, 0.1328, 0.86429, 0.97647, 0.0013657, 0.021851, 0.99342, 0.98541, 0.012553, 0.99721, 0.0028476, 0.16896, 0.0056952, 0.0028476, 0.27527, 0.38727, 0.15662, 0.012465, 0.98477, 0.013476, 0.94329, 0.040427, 0.99182, 0.98453, 0.99536, 0.0024101, 0.99921, 0.004781, 0.99446, 0.99952, 0.96245, 0.030716, 0.00047051, 0.72929, 0.097395, 0.00094101, 0.059284, 0.00094101, 0.1101, 0.0014115, 0.99271, 0.0020165, 0.99617, 0.43381, 0.56611, 0.98139, 0.0020423, 0.010212, 0.23486, 0.012254, 0.73931, 0.97803, 0.99732, 0.5326, 0.32211, 0.14351, 0.70895, 0.070033, 0.058181, 0.0010774, 0.093736, 0.067878, 0.99158, 0.9902, 0.0024391, 0.1439, 0.84513, 0.0073172, 0.0015362, 0.47469, 0.0030725, 0.52001, 0.00076811, 0.0033749, 0.99671, 0.015185, 0.97185, 0.97643, 0.016007, 0.98365, 0.01194, 0.0059701, 0.97909, 0.9958, 0.027307, 0.054614, 0.0091024, 0.0045512, 0.90569, 0.0011143, 0.61842, 0.0011143, 0.0033428, 0.37551, 0.018598, 0.90012, 0.0007439, 0.029012, 0.020085, 0.0305, 0.084892, 0.1428, 0.084892, 0.55673, 0.1303, 0.0042279, 0.74622, 0.24733, 0.99304, 0.012141, 0.98342, 0.99649, 0.067109, 0.064538, 6.765e-05, 0.3532, 0.020972, 0.23143, 0.04404, 0.20843, 0.010148, 0.10753, 0.10366, 0.052093, 0.00020921, 0.1772, 0.040064, 0.26758, 0.15816, 0.091948, 0.0014645, 0.97453, 0.013922, 0.22704, 0.77149, 0.99222, 0.0068905, 0.95113, 0.018291, 0.030485, 0.99916, 0.49226, 0.0067433, 0.11379, 0.37762, 0.009272, 0.9811, 0.01314, 0.0026091, 0.00034032, 0.00034032, 0.087689, 0.055132, 0.0036301, 0.64219, 0.20816, 0.03216, 0.22244, 0.73968, 0.00268, 0.99618, 0.011698, 0.98267, 0.0058492, 0.985, 0.97001, 0.02425, 0.97712, 0.012063, 0.24868, 0.0022072, 0.20895, 0.54004, 0.9993, 0.98473, 0.010196, 0.85813, 0.020391, 0.11045, 0.98134, 0.0028014, 0.29835, 0.69616, 0.99895, 0.013742, 0.98256, 0.99611, 0.68515, 0.22729, 0.086665, 0.71487, 0.001453, 0.2165, 0.068291, 0.013522, 0.97361, 0.99822, 0.99112, 0.87336, 0.12477, 0.5754, 0.12446, 0.20738, 0.091718, 0.0010191, 0.010598, 0.0010598, 0.0010598, 0.0010598, 0.97922, 0.0063586, 0.99916, 0.012995, 0.0064974, 0.96811, 0.0064974, 0.98135, 0.012913, 0.99768, 0.9933, 0.10808, 0.0051469, 0.88527, 0.99583, 0.98559, 0.031572, 0.23091, 0.34402, 0.070324, 0.10736, 0.14985, 0.065992, 0.85069, 0.1387, 0.0092467, 0.99663, 0.99514, 0.9827, 0.0074645, 0.037322, 0.95048, 0.0024882, 0.9907, 0.0080545, 0.99605, 0.70622, 0.14089, 0.15157, 0.00088982, 0.020015, 0.98073, 0.9977, 0.0031674, 0.97554, 0.019004, 0.0050481, 0.13469, 0.00022946, 0.32583, 0.053464, 0.12964, 0.0040156, 0.12769, 0.21936, 0.34664, 0.10134, 0.0028413, 0.12596, 0.076715, 0.34569, 0.96904, 0.99217, 0.015352, 0.001919, 0.015352, 0.0057569, 0.96141, 0.084323, 0.0053308, 0.504, 0.12309, 0.16525, 0.00096923, 0.0014538, 0.0504, 0.065423, 0.16239, 0.83726, 0.007527, 0.68496, 0.021326, 0.28477, 0.010861, 0.010861, 0.010861, 0.96665, 0.63854, 0.025662, 0.33512, 0.45782, 0.20415, 0.028892, 0.3086, 0.00090796, 0.0027239, 0.17342, 0.00090796, 0.26331, 0.20429, 0.3541, 0.0033912, 0.0067825, 0.99024, 0.99785, 0.99171, 0.0068394, 0.86783, 0.085978, 0.0001963, 0.00039259, 0.011778, 0.00039259, 0.033567, 0.98861, 0.0028242, 0.090375, 0.33608, 0.56625, 0.0042363, 0.0007562, 0.021174, 0.030248, 0.21552, 0.71914, 0.012855, 0.756, 0.098823, 0.0049412, 0.014823, 0.11859, 0.35554, 0.00063489, 0.64314, 0.015727, 0.97508, 0.99721, 0.082095, 0.00087646, 0.39908, 0.18785, 0.26118, 0.00029215, 0.068656, 0.00029215, 0.99552, 0.0019368, 0.0019368, 0.048001, 0.18934, 0.16889, 0.0022223, 0.10489, 0.34223, 0.144, 0.99792, 0.0011631, 0.025294, 0.96118, 0.01024, 0.89772, 0.085335, 0.0068268, 0.97089, 0.0031523, 0.025218, 0.19886, 0.00058401, 0.19185, 0.0055481, 0.32296, 0.15476, 0.12527, 0.9954, 0.11828, 0.11828, 0.033649, 0.1713, 0.00033989, 0.15499, 0.27701, 0.1193, 0.0033989, 0.00033989, 0.0027191, 0.99917, 0.0039853, 0.99234, 0.0017451, 0.82856, 0.00034901, 0.16892, 0.02024, 0.024288, 0.94319, 0.012144, 0.76135, 0.23533, 0.0027739, 0.99582, 0.98601, 0.010434, 0.26335, 0.0031165, 0.73316, 0.99628, 0.0012165, 0.0024329, 0.0045749, 0.0091498, 0.064049, 0.1098, 0.0076248, 0.80518, 0.99674, 0.020844, 0.96926, 0.98371, 0.01093, 0.99571, 0.97526, 0.022786, 0.036767, 0.15027, 0.0015986, 0.0031972, 0.80089, 0.0047958, 0.0021226, 0.93819, 0.05731, 0.21067, 0.48883, 0.0074065, 0.0090524, 0.26005, 0.0090524, 0.01399, 0.0006039, 0.18902, 0.50698, 0.00090586, 0.30195, 0.0006039, 0.3934, 0.00055722, 0.0027861, 0.55221, 0.00055722, 0.05015, 0.04338, 0.47424, 0.34042, 0.11911, 0.00073526, 0.0066173, 0.014705, 0.84369, 0.022905, 0.1298, 0.99273, 0.98923, 0.021055, 0.0056148, 0.72992, 0.12353, 0.0014037, 0.11791, 0.99517, 0.97196, 0.017377, 0.0086885, 0.017377, 0.95573, 0.24825, 0.076385, 0.67531, 0.99135, 0.98029, 0.0098436, 0.006328, 0.00070312, 0.40007, 0.035156, 0.31148, 0.0014062, 0.23203, 0.0035156, 0.10816, 0.040209, 0.4133, 0.0016812, 0.13071, 0.17597, 0.05506, 0.0001401, 0.074814, 0.056812, 0.00011272, 0.09897, 0.00011272, 0.049485, 0.23874, 0.0010145, 0.045427, 0.00022544, 0.50871, 0.00033816, 0.026008, 0.96228, 0.023902, 0.96801, 0.99453, 0.99517, 0.93954, 0.0053082, 0.047773, 0.99203, 0.0045716, 0.98979, 0.0021149, 0.0063448, 0.99378, 0.0689, 0.54127, 0.15205, 0.23776, 0.0085068, 0.96978, 0.017014, 0.083306, 0.83306, 0.020826, 0.041653, 0.98753, 0.99685, 0.0069617, 0.98856, 0.14824, 0.034375, 0.61016, 0.05586, 0.10313, 0.047266, 0.99585, 0.98398, 0.99487, 0.026029, 0.89018, 0.0026029, 0.080689, 0.89244, 0.089244, 0.076113, 0.65816, 0.15798, 0.1049, 0.0019188, 0.19437, 0.79223, 0.012302, 0.2479, 0.75031, 0.97826, 0.012167, 0.0089228, 0.29431, 0.00085805, 0.56889, 0.133, 0.0017161, 0.0017161, 0.83286, 0.023796, 0.11898, 0.031238, 0.93713, 0.89701, 0.024244, 0.072731, 0.0027332, 0.0040998, 0.0013666, 0.55893, 0.43321, 0.006792, 0.99163, 0.015578, 0.98139, 0.016973, 0.96744, 0.99353, 0.0038435, 0.0019217, 0.93343, 0.024547, 0.00062942, 0.041542, 0.011069, 0.0027674, 0.98518, 0.99247, 0.66362, 0.0021546, 0.0006156, 0.33366, 0.89838, 0.09302, 0.0085676, 0.99991, 0.26868, 0.032709, 0.085777, 0.18223, 0.043222, 0.1572, 0.060077, 0.16955, 0.00033376, 0.19508, 0.071528, 0.008941, 0.36983, 0.35358, 0.10379, 0.58866, 0.30745, 0.93719, 0.049326, 0.99619, 0.022627, 0.96543, 0.93709, 0.040392, 0.0080784, 0.0080784, 0.084788, 0.45028, 0.1047, 0.015416, 0.21775, 0.12654, 0.99479, 0.0016608, 0.0033215, 0.14276, 0.85435, 0.99673, 0.90308, 0.092679, 0.0043107, 0.014075, 0.9712, 0.0065629, 0.99099, 0.0013126, 0.099536, 0.026194, 0.010477, 0.86439, 0.0072629, 0.98776, 0.3891, 0.0022234, 0.272, 0.0066703, 0.27274, 0.056327, 0.8767, 0.0040777, 0.11825, 0.0061735, 0.85195, 0.12347, 0.018521, 0.07842, 0.052351, 0.017949, 0.013248, 0.83036, 0.0076924, 0.99758, 0.15515, 0.046172, 0.029445, 0.0034122, 0.023289, 0.056027, 0.10838, 0.066096, 0.1337, 0.13859, 0.14391, 0.078934, 0.016894, 0.012142, 0.98351, 0.00037757, 0.0037757, 0.50254, 0.020766, 0.39494, 0.071738, 0.0060411, 0.98551, 0.0044578, 0.99408, 0.7888, 0.0017473, 0.20743, 0.0017473, 0.00035957, 0.69253, 0.00836, 0.012135, 0.17026, 0.061307, 0.054924, 0.805, 0.1941, 0.00086653, 0.0035804, 0.0017902, 0.81454, 0.18081, 0.0073184, 0.0036592, 0.98799, 0.90579, 0.004462, 0.087753, 0.0014873, 0.26407, 0.19241, 0.12921, 0.064324, 0.17492, 0.1752, 0.99025, 0.0079859, 0.99375, 0.0061279, 0.0012644, 0.89992, 0.0005419, 0.0059609, 0.00018063, 0.091943, 0.26481, 0.00064275, 0.037279, 0.56819, 0.12855, 0.043642, 0.95468, 0.90366, 0.087451, 0.0083287, 0.98206, 0.012392, 0.979, 0.98139, 0.99935, 0.013131, 0.91917, 0.065655, 0.20718, 0.78501, 0.0057023, 0.98023, 0.0039367, 0.01181, 0.0039367, 0.94656, 0.049172, 0.99675, 0.0014098, 0.0014098, 0.02274, 0.95509, 0.02274, 0.028779, 0.021584, 0.0071947, 0.93532, 0.01787, 0.97393, 0.99949, 0.00042405, 0.99219, 0.98647, 0.33426, 0.098358, 0.086363, 0.004798, 0.060774, 0.11195, 0.029587, 0.27348, 0.27037, 0.0060381, 0.0080507, 0.20664, 0.06709, 0.44212, 0.74328, 0.00022328, 0.026793, 0.025453, 0.20385, 0.17144, 0.0023877, 0.61269, 0.21298, 0.0029389, 0.064656, 0.9287, 0.97683, 0.014796, 0.97655, 0.086944, 0.1724, 0.0048302, 0.015977, 0.092517, 0.16608, 0.46147, 0.0023027, 0.99708, 0.96838, 0.99187, 0.0035588, 0.70999, 0.28649, 0.98036, 0.017825, 0.939, 0.055235, 0.98029, 0.99134, 0.088018, 0.15225, 0.73983, 0.0071366, 0.011894, 0.98022, 0.3385, 0.057015, 0.40476, 0.1428, 0.033387, 0.0051365, 0.018491, 0.98275, 0.032288, 0.96661, 0.0013215, 0.1229, 0.87482, 0.0028083, 0.99413, 0.043368, 0.030322, 0.0031733, 0.61455, 0.043015, 0.013751, 0.16289, 0.088851, 0.87041, 0.12434, 0.005181, 0.014323, 0.0071613, 0.97394, 0.010697, 0.98414, 0.00304, 0.00912, 0.02736, 0.0456, 0.14592, 0.76608, 0.83769, 0.15942, 0.0014493, 0.99942, 0.10719, 0.0011779, 0.89051, 0.0011779, 0.0013797, 0.00068984, 0.99751, 0.053185, 0.93278, 0.012273, 0.0008808, 0.0017616, 0.0008808, 0.99619, 0.98647, 0.99495, 0.0019505, 0.25227, 0.7451, 0.064408, 0.021469, 0.02624, 0.6727, 0.21469, 0.99777, 0.81807, 0.0013389, 0.0026778, 0.17807, 0.99682, 0.065943, 0.1285, 0.26123, 0.20079, 0.32041, 0.0038044, 0.018599, 0.00042271, 0.98794, 0.0045687, 0.28097, 0.14018, 0.14558, 0.026374, 0.21867, 0.093243, 0.089713, 0.000623, 0.99932, 0.0017993, 0.00022492, 0.91091, 0.00044983, 0.051281, 0.035312, 0.96699, 0.029845, 0.97528, 0.98573, 0.31482, 0.17366, 0.51088, 0.0038578, 0.50922, 0.06076, 0.41182, 0.014467, 0.99421, 0.9981, 0.99784, 0.97989, 0.0043745, 0.0021873, 0.013124, 0.97724, 0.011233, 0.069294, 0.016833, 0.58241, 0.2191, 0.072099, 0.040118, 0.146, 0.06978, 0.54965, 0.049383, 0.0021471, 0.10735, 0.076221, 0.01666, 0.96625, 0.01666, 0.0078241, 0.50309, 0.00078241, 0.10015, 0.17995, 0.151, 0.057116, 0.019884, 0.009942, 0.96438, 0.99105, 0.0073593, 0.36903, 0.00051903, 0.0072664, 0.070588, 0.0020761, 0.00051903, 0.0015571, 0.48062, 0.067474, 0.19959, 0.002979, 0.002979, 0.79241, 0.0029046, 0.88881, 0.0029046, 0.10457, 0.00043606, 0.1814, 0.80105, 0.017006, 0.60975, 0.00067079, 0.0080495, 0.1194, 0.18648, 0.075128, 0.11302, 0.85233, 0.032963, 0.99309, 0.99615, 0.99709, 0.9989, 0.0013871, 0.0027742, 0.0013871, 0.0041613, 0.047161, 0.030516, 0.25384, 0.65887, 0.0022075, 0.9967, 0.0011038, 0.97974, 0.011392, 0.0046595, 0.13979, 0.8527, 0.061639, 0.93691, 0.005768, 0.005768, 0.98055, 0.005768, 0.0055126, 0.99227, 0.97257, 0.0179, 0.0054694, 0.092979, 0.89698, 0.035801, 0.6324, 0.0002702, 0.0001351, 0.33153, 0.991, 0.0041465, 0.0041465, 0.00055652, 0.012244, 0.98672, 0.33804, 0.66126, 0.021131, 0.0014407, 0.9773, 0.99073, 0.89204, 0.00085199, 0.00085199, 0.10565, 0.84329, 0.15636, 0.53112, 0.26618, 0.089139, 0.0074283, 0.10523, 0.0026302, 0.013151, 0.0026302, 0.0026302, 0.97845, 0.99363, 0.0085052, 0.0085052, 0.025516, 0.96109, 0.99672, 0.99733, 0.9978, 0.98898, 0.99742, 0.99654, 0.98855, 0.74753, 0.18971, 0.0269, 0.035394, 0.20319, 0.0016792, 0.77917, 0.015113, 0.061718, 0.50797, 0.0033752, 0.0311, 0.00072326, 0.18515, 0.20926, 0.00024109, 0.00024109, 0.00024109, 0.0053253, 0.98519, 0.0053253, 0.98995, 0.98206, 0.006959, 0.048713, 0.93947, 0.99491, 0.0007788, 0.0035046, 0.98439, 0.0055615, 0.0055615, 0.0019544, 0.90099, 0.095767, 0.72845, 0.00049723, 0.27099, 0.49533, 0.34082, 0.0007393, 0.16191, 0.0014786, 0.54646, 0.00046586, 0.054506, 0.25902, 0.13929, 0.15038, 0.00059439, 0.72159, 0.051118, 0.074893, 0.0011888, 0.015845, 0.96657, 0.99667, 0.99957, 0.0003087, 0.9944, 0.027837, 0.013919, 0.63562, 0.0023198, 0.097431, 0.0092791, 0.041756, 0.12063, 0.035957, 0.013919, 0.012178, 0.97421, 0.0044622, 0.9906, 0.99815, 0.99607, 0.0053426, 0.99373, 0.96393, 0.15609, 0.15637, 0.14834, 0.00027676, 0.037086, 0.28396, 0.060888, 0.13783, 0.01882, 0.9793, 0.0068007, 0.010201, 0.0034003, 0.64237, 0.084654, 0.00099593, 0.26691, 0.0039837, 0.050627, 0.94746, 0.99479, 0.99377, 0.0046987, 0.98081, 0.015089, 0.089827, 0.44977, 0.46015, 0.023487, 0.0078291, 0.96298, 0.018173, 0.98136, 0.99725, 0.99271, 0.025039, 0.62956, 0.011282, 0.27681, 0.057233, 0.98969, 0.97221, 0.025811, 0.0091997, 0.86477, 0.1196, 0.0091997, 0.0020612, 0.99349, 0.0041224, 0.1736, 0.063364, 0.7621, 0.98885, 0.070544, 0.14153, 7.3254e-05, 0.0013918, 0.39967, 0.2172, 0.03714, 0.050765, 0.081605, 7.3254e-05, 0.99385, 0.12317, 0.17563, 0.029215, 0.00082295, 0.23811, 0.13394, 0.13352, 0.00013716, 0.13318, 0.032301, 0.020811, 0.57088, 0.00047297, 0.26203, 0.02223, 0.00047297, 0.12297, 0.94172, 0.043801, 0.99666, 0.99353, 0.017937, 0.96858, 0.0045785, 0.045785, 0.94774, 0.029913, 0.95722, 0.47001, 0.0013804, 0.52868, 0.92649, 0.025736, 0.025736, 0.029181, 0.9484, 0.014591, 0.99106, 0.98029, 0.99918, 0.65511, 0.00093454, 0.24111, 0.092519, 0.01028, 0.01548, 0.01548, 0.9649, 0.0034383, 0.0068767, 0.93866, 0.013753, 0.034383, 0.0062445, 0.98663, 0.98311, 0.0097338, 0.0049897, 0.66862, 0.31934, 0.0049897, 0.98108, 0.031425, 0.0052375, 0.0419, 0.91656, 0.012985, 0.97388, 0.0017846, 0.18738, 0.81021, 0.99613, 0.87526, 0.028234, 0.056469, 0.028234, 0.9971, 0.99809, 0.14662, 0.62789, 0.22425, 0.0075786, 0.98522, 0.99719, 0.0022094, 0.05327, 0.94659, 7.6647e-05, 0.9873, 0.033897, 0.96437, 0.0043779, 0.28019, 0.7136, 0.0014593, 0.99639, 0.99912, 0.97384, 0.52051, 0.004035, 0.02421, 0.3228, 0.12777, 0.99353, 0.27301, 0.011497, 0.0537, 0.065925, 0.00014553, 0.015572, 0.059085, 0.0017463, 0.51939, 0.03401, 0.96361, 0.058862, 0.030181, 0.003335, 0.5501, 0.35751, 0.99956, 0.99491, 0.0052734, 0.99888, 0.99561, 0.003027, 0.98982, 0.003027, 0.003027, 0.9828, 0.0063423, 0.14352, 0.22321, 0.00030689, 0.00061377, 0.030586, 0.0087974, 0.58656, 0.040879, 0.96067, 0.0023778, 0.0071333, 0.1712, 0.090356, 0.72522, 0.16669, 0.00068039, 0.081646, 0.00034019, 0.49872, 0.23439, 0.01769, 0.99629, 0.067069, 0.57393, 0.028587, 0.0010995, 0.0032985, 0.32655, 0.073582, 0.0004354, 0.92565, 0.79697, 0.20176, 0.13005, 0.30373, 0.075512, 0.046146, 0.443, 0.99593, 0.0078749, 0.013125, 0.97912, 0.011492, 0.028789, 0.00046434, 0.00046434, 0.63452, 0.034129, 0.2901, 0.98824, 0.047956, 0.95227, 0.9098, 0.017329, 0.071484, 0.00048332, 0.55485, 0.00048332, 0.42242, 0.019333, 0.00096663, 0.0014499, 0.99911, 0.99008, 0.0039603, 0.0039603, 0.092328, 0.001454, 0.4093, 0.00072699, 0.00072699, 0.21519, 0.001454, 0.11196, 0.16648, 0.98031, 0.12352, 0.11055, 0.051263, 0.0012352, 0.00061762, 0.00061762, 0.10006, 0.1297, 0.48175, 0.99663, 0.97924, 0.008525, 0.10961, 0.008525, 0.77578, 0.0012179, 0.096211, 0.0084872, 0.0042436, 0.98451, 0.13489, 0.0056203, 0.030911, 0.82618, 0.99838, 0.0021977, 0.99336, 0.0043954, 0.0010845, 0.99774, 0.98858, 0.9972, 0.0035137, 0.44506, 0.55047, 0.36254, 0.0019865, 0.032778, 0.60291, 0.070804, 0.58155, 0.00079555, 0.00079555, 0.34606, 0.99486, 0.0025505, 0.52795, 0.46036, 0.0089266, 0.0018072, 0.0018072, 0.84577, 0.036144, 0.11205, 0.11668, 0.10969, 0.22026, 0.30067, 0.056375, 0.071233, 0.12455, 0.054105, 0.015662, 0.17584, 0.10892, 0.45704, 0.017086, 0.00071191, 0.17086, 0.0063828, 0.35744, 0.0025531, 0.63318, 0.82303, 0.072202, 0.10433, 0.002018, 0.75473, 0.002018, 0.18566, 0.054486, 0.9962, 0.98151, 0.008425, 0.0042125, 0.0042125, 0.0018689, 0.11026, 0.014951, 0.15138, 0.0018689, 0.10652, 0.61485, 0.021858, 0.97634, 0.077906, 0.3625, 0.028618, 0.52944, 0.030993, 0.0077483, 0.96079, 0.0087764, 0.98296, 0.0124, 0.97957, 0.99565, 0.76957, 0.064131, 0.14964, 0.021377, 0.9845, 0.0074023, 0.65254, 0.23536, 0.11111, 0.0013941, 0.8922, 0.10595, 0.0022891, 0.17969, 0.0017168, 0.81548, 0.25581, 0.14884, 0.59442, 0.91168, 0.064202, 0.01284, 0.0085779, 0.98646, 0.018223, 0.96584, 0.99675, 0.97925, 0.016692, 0.0017204, 0.039569, 0.95309, 0.0051611, 0.84, 0.00087958, 0.028146, 0.094115, 0.036063, 0.99072, 0.0091031, 0.0047303, 0.0094606, 0.94606, 0.0047303, 0.037842, 0.99825, 0.71078, 0.20056, 0.002204, 0.072731, 0.0077139, 0.006612, 0.11263, 0.77692, 0.10803, 0.14728, 0.38513, 0.0009148, 0.0054888, 0.0018296, 0.46014, 0.75193, 0.2159, 0.026057, 0.0037224, 0.0038228, 0.43403, 0.12939, 0.43168, 0.00088218, 0.016582, 0.0055272, 0.95621, 0.016582, 0.19464, 0.0048257, 0.79785, 0.55995, 0.15527, 0.17995, 0.0043051, 0.00057402, 0.098731, 0.00086102, 0.0031978, 0.07355, 0.9231, 0.9926, 0.018916, 0.96474, 0.028517, 0.1916, 0.00089116, 0.11942, 0.0080204, 0.00089116, 0.12031, 0.52935, 0.00089116, 0.90053, 0.098759, 0.64842, 0.0041169, 0.28201, 0.063812, 0.26401, 0.0053336, 0.72804, 0.83824, 0.029672, 0.029672, 0.051927, 0.044509, 0.98705, 0.045035, 0.033776, 0.84441, 0.073182, 0.99428, 0.0036689, 0.98544, 0.99885, 0.98613, 0.0097751, 0.01955, 0.96773, 0.98531, 0.98476, 0.015035, 0.074677, 0.00096983, 0.38308, 0.54116, 0.018345, 0.95394, 0.018345, 0.99286, 0.98403, 0.011015, 0.9834, 0.0097366, 0.00075662, 0.072635, 0.63934, 0.0015132, 0.286, 0.0064902, 0.99219, 0.00081128, 0.98963, 0.15697, 0.52555, 0.0023255, 0.31394, 0.015022, 0.97646, 0.0089112, 0.0022278, 0.10471, 0.15372, 0.0022278, 0.0044556, 0.011139, 0.71067, 0.9811, 0.0083855, 0.0083855, 0.0025823, 0.18076, 0.69206, 0.12266, 0.0089515, 0.96676, 0.017903, 0.99748, 0.055537, 0.53283, 0.34368, 0.032023, 0.034686, 0.0011692, 0.055797, 0.32334, 0.62092, 0.95433, 0.0077588, 0.015518, 0.023276, 0.00016768, 0.00016768, 0.097755, 0.00016768, 0.59491, 0.0015091, 0.3055, 0.014891, 0.0049636, 0.0049636, 0.97286, 0.010485, 0.031456, 0.95417, 0.21365, 0.67624, 0.10193, 0.0039202, 0.0039202, 0.98629, 0.0063341, 0.12826, 0.0063341, 0.003167, 0.77276, 0.082343, 0.0063952, 0.01279, 0.97847, 0.0032754, 0.94659, 0.04258, 0.0065508, 0.013287, 0.98325, 0.99695, 0.0018496, 0.00092481, 0.89343, 0.10326, 0.99732, 0.0016026, 0.6923, 0.14102, 0.16346, 0.99505, 0.0040614, 0.0040305, 0.98344, 0.0040305, 0.008061, 0.0044755, 0.99356, 0.0022377, 0.0046866, 0.99356, 0.98839, 0.0063767, 0.85647, 0.12534, 0.99514, 0.020472, 0.96219, 0.00059079, 0.057306, 0.00059079, 0.12111, 0.056715, 0.0011816, 0.31253, 0.036038, 0.051398, 0.32375, 0.038992, 0.84028, 0.15926, 0.036073, 0.95757, 0.0032794, 0.99752, 0.068841, 0.5306, 0.055852, 0.097417, 0.24679, 0.091186, 0.035461, 0.41962, 0.23979, 0.21446, 0.0045997, 0.12074, 0.0006571, 0.045997, 0.37044, 0.33249, 0.12518, 0.63395, 0.25708, 0.089228, 0.019343, 0.0068549, 0.98711, 0.99458, 0.001719, 0.038392, 0.00057302, 0.0034381, 0.95407, 0.001146, 0.00057302, 0.0098239, 0.72451, 0.26279, 0.35281, 0.64478, 0.001738, 0.9842, 0.013797, 0.0049815, 0.97886, 0.0099629, 0.0062268, 0.9888, 0.99722, 0.010183, 0.98778, 0.99144, 0.0063964, 0.86922, 0.0025122, 0.0025122, 0.12561, 0.99707, 0.9917, 0.20166, 0.00047118, 0.0047118, 0.3939, 0.39343, 0.0056541, 0.33205, 0.081367, 0.16438, 0.0082189, 0.012328, 0.383, 0.01726, 0.00082189, 0.0093751, 0.98439, 0.99676, 0.98957, 0.0093976, 0.92522, 0.022295, 0.044589, 0.17469, 0.0049627, 0.81687, 0.00099255, 0.0019851, 0.98861, 0.0037334, 0.0067202, 0.03793, 0.012643, 0.029501, 0.91876, 0.9663, 0.030774, 0.0024619, 0.031026, 0.95663, 0.010342, 0.2747, 0.0062196, 0.0020732, 0.71733, 0.012163, 0.053075, 0.15038, 0.14596, 0.0044229, 0.0022114, 0.0044229, 0.62584, 0.010843, 0.021687, 0.95421, 0.010843, 0.043217, 0.010804, 0.94537, 0.98861, 0.95649, 0.028985, 0.002239, 0.99636, 0.97653, 0.92695, 0.014484, 0.043451, 0.014484, 0.22673, 0.6776, 0.095396, 0.03919, 0.95362, 0.0065316, 0.12708, 0.00089496, 0.87169, 0.32163, 0.0020486, 0.67399, 0.011647, 0.97835, 0.99248, 0.97354, 0.068487, 0.0026858, 0.0188, 0.91047, 0.98573, 0.00037714, 0.0011314, 0.76219, 0.19951, 0.036582, 4.708e-05, 0.30701, 0.00051788, 0.013936, 0.27349, 0.10485, 0.26878, 0.031355, 0.011721, 0.099632, 0.023443, 0.86153, 0.0066103, 0.99155, 0.99417, 0.00058853, 0.0023541, 0.12183, 0.0017656, 0.0029426, 0.0023541, 0.86749, 0.0010708, 0.32499, 0.0016062, 0.21738, 0.45403, 0.052101, 0.37595, 0.005108, 0.56596, 0.018401, 0.018401, 0.94766, 0.0092006, 0.018281, 0.86835, 0.11334, 0.3783, 0.0022385, 0.19375, 0.22559, 0.00049744, 0.19972, 0.0025789, 0.52868, 0.0012895, 0.31592, 0.15087, 0.11928, 0.005422, 0.87294, 0.97507, 0.99348, 0.99928, 0.027201, 0.96565, 0.0011014, 0.090311, 0.163, 0.74452, 0.99798, 0.99377, 0.0031153, 0.99591, 0.057095, 0.93688, 0.0025952, 0.0025952, 0.0181, 0.030166, 0.94722, 0.9912, 0.014221, 0.98126, 0.98866, 0.0034132, 0.0034132, 0.030719, 0.94204, 0.017066, 0.0028152, 0.014076, 0.98252, 0.011406, 0.98851, 0.013064, 0.9798, 0.98484, 0.0026093, 0.13307, 0.85846, 0.0026093, 0.0012632, 0.13643, 0.8615, 0.0071957, 0.98581, 0.99558, 0.0024828, 0.50307, 0.031077, 0.096615, 0.20954, 0.026769, 0.13292, 0.00080563, 0.99898, 0.043055, 0.94722, 0.0039141, 0.99042, 0.0071511, 0.0056477, 0.99427, 0.0017068, 0.99506, 0.0017068, 0.98929, 0.98371, 0.00097094, 0.55635, 0.02039, 0.13593, 0.28546, 0.32026, 0.62134, 0.001668, 0.056713, 0.99814, 0.0011553, 0.98405, 0.1423, 0.0038633, 0.17835, 0.0045071, 0.0019316, 0.44492, 0.0012878, 0.22278, 0.061688, 0.0031635, 0.20563, 0.72919, 0.13911, 0.088966, 0.021837, 0.042865, 0.0024263, 0.23697, 0.011323, 0.014558, 0.44078, 0.99238, 0.99392, 0.016244, 0.0036918, 0.97907, 0.00073836, 0.98063, 0.98609, 0.99592, 0.0098977, 0.98977, 0.00039436, 0.00078872, 0.057971, 0.0023662, 0.75047, 0.18811, 0.0008916, 0.21042, 0.78728, 0.0013374, 0.017409, 0.034819, 0.18497, 0.75948, 0.12883, 0.025539, 0.71338, 0.13167, 0.03177, 0.96217, 0.016957, 0.81896, 0.015701, 0.0043962, 0.016329, 0.12686, 0.0043456, 0.030419, 0.95168, 0.0043456, 0.0086912, 0.0081013, 0.95595, 0.032405, 0.99885, 0.97715, 0.018791, 0.0018791, 0.95065, 0.0066017, 0.019805, 0.019805, 0.0012898, 0.72102, 0.0012898, 0.27602, 0.019595, 0.019595, 0.019595, 0.94058, 0.040832, 0.51369, 0.15279, 0.21031, 0.0008781, 0.017123, 0.062784, 0.0017562, 0.15055, 0.45419, 0.12078, 0.080376, 0.19435, 0.0020813, 0.98238, 0.014569, 0.12884, 0.86343, 0.0022603, 0.0045206, 0.98984, 0.0079987, 0.9689, 0.021295, 0.99568, 0.96389, 0.015061, 0.015061, 0.15151, 0.0032875, 0.1325, 0.20061, 0.054887, 0.16516, 0.0062176, 0.040307, 0.11613, 0.0010005, 0.10077, 0.027515, 0.00014293, 0.99548, 0.0034092, 0.16543, 0.072799, 0.064006, 0.14846, 0.10695, 0.011656, 0.14805, 0.015132, 0.029038, 0.044988, 0.095907, 0.097338, 0.22529, 0.0024031, 0.029438, 0.11895, 0.13637, 0.35085, 0.061278, 0.074495, 0.99257, 0.9984, 0.15163, 0.026394, 0.00043698, 0.023335, 8.7396e-05, 0.30623, 0.2496, 0.24217, 8.7396e-05, 0.019822, 0.97125, 0.0059997, 0.98995, 0.22586, 0.15098, 0.61805, 0.0018413, 0.002455, 0.98377, 0.0139, 0.97297, 0.99617, 0.028855, 0.96665, 0.9874, 0.011661, 0.97367, 0.0058303, 0.0030705, 0.98871, 0.006141, 0.014729, 0.95739, 0.019639, 0.99389, 0.15781, 0.0014347, 0.75702, 0.084166, 0.21002, 0.00075684, 0.00056763, 0.2157, 0.14399, 0.077765, 0.00037842, 0.08382, 0.00037842, 0.24143, 0.025165, 0.0066705, 0.24797, 0.068445, 0.29205, 0.024942, 0.35934, 0.97191, 0.025689, 0.0063978, 0.0063978, 0.98526, 0.99933, 0.96043, 0.024011, 0.0080036, 0.98417, 0.0046717, 0.97638, 0.0093434, 0.0093434, 0.99688, 0.99285, 0.004298, 0.97705, 0.016284, 0.0041234, 0.77382, 0.22129, 0.99308, 0.0044137, 0.98898, 0.47729, 0.00073656, 0.067027, 0.00073656, 0.18561, 0.26884, 0.99254, 0.0060016, 0.012003, 0.97827, 0.025023, 0.96964, 0.99504, 0.0013742, 0.0013742, 0.12505, 0.00068709, 0.47065, 0.40126, 0.01213, 0.01213, 0.0060651, 0.01213, 0.95829, 0.95823, 0.028462, 0.0048487, 0.024243, 0.96489, 0.70612, 0.2881, 0.61307, 0.35787, 0.00099685, 0.027912, 0.9925, 0.17424, 0.0039902, 0.81932, 0.0042586, 0.98799, 0.0085171, 0.99329, 0.00081221, 0.99901, 0.99724, 0.97418, 0.013345, 0.0057192, 0.0057192, 0.95889, 0.0223, 0.99371, 0.0044147, 0.97564, 0.017659, 0.9947, 0.0031084, 0.024387, 0.9755, 0.012521, 0.97667, 0.015577, 0.98138, 0.87904, 0.10706, 0.0056349, 0.0056349, 0.27212, 0.068856, 0.051717, 0.0096218, 0.49222, 0.0012027, 0.061339, 0.0057129, 0.037284, 0.65642, 0.342, 0.010718, 0.9468, 0.0071456, 0.032155, 0.025514, 0.96952, 0.021601, 0.97205, 0.004955, 0.91589, 0.00046453, 0.00015484, 0.00092906, 0.077731, 0.0021105, 0.96976, 0.026733, 0.00070349, 0.00035175, 0.00035175, 0.99983, 0.00013462, 0.69769, 0.0053381, 0.064591, 0.0026691, 0.069395, 0.10676, 0.053381, 0.014241, 0.37027, 0.30684, 0.30748, 0.00064733, 0.9967, 0.9866, 0.81857, 0.17913, 0.98521, 0.014074, 0.98223, 0.97349, 0.023744, 0.99181, 0.056656, 0.23122, 0.065843, 0.0045937, 0.64159, 0.66894, 0.32953, 0.96538, 0.014852, 0.014852, 0.0025425, 0.98394, 0.012712, 0.99137, 0.0064795, 0.11965, 0.046504, 0.35556, 0.23397, 0.064427, 0.075085, 0.09107, 0.013564, 0.10689, 0.20733, 0.20502, 0.31882, 0.082471, 0.013822, 0.065424, 0.17744, 0.23268, 0.06924, 0.033327, 0.020239, 0.071066, 0.21411, 0.00076088, 0.18094, 0.0023751, 0.99518, 0.97063, 0.01922, 0.0096102, 0.98669, 0.0022579, 0.0067736, 0.0022579, 0.99851, 0.99748, 0.0024451, 0.0024451, 0.01956, 0.051346, 0.91934, 0.0048901, 0.013703, 0.80848, 0.075366, 0.054812, 0.0068515, 0.041109, 0.11867, 0.17889, 0.021046, 0.57116, 0.10991, 0.0002923, 0.98453, 0.13961, 0.15349, 0.053644, 0.087997, 0.0092227, 0.10331, 0.026653, 0.20527, 0.16576, 0.054998, 0.98628, 0.17081, 0.026124, 0.16177, 0.64105, 0.14155, 0.73386, 0.057223, 0.010039, 0.057223, 0.00033522, 0.3074, 0.2199, 0.12437, 0.34796, 0.013777, 0.051816, 0.23728, 0.021384, 0.278, 0.020562, 0.00061686, 0.00082248, 0.37587, 0.013859, 0.0055438, 0.085929, 0.89255, 0.004384, 0.013152, 0.74967, 0.23016, 0.12773, 0.00071757, 0.19374, 0.064581, 0.047359, 0.0014351, 0.00071757, 0.00071757, 0.56257, 0.97909, 0.04318, 0.029099, 0.37923, 0.00046934, 0.23702, 0.31118, 0.00016446, 0.00016446, 0.94697, 0.052463, 0.00016446, 0.019008, 0.96941, 0.009504, 0.12343, 0.14295, 0.10001, 0.0019515, 0.011221, 0.13075, 0.48348, 0.0058545, 0.99689, 0.0018027, 0.0044399, 0.028859, 0.88354, 0.0066599, 0.01776, 0.055499, 0.00222, 0.9964, 0.9747, 0.0033844, 0.016922, 0.0050766, 0.12245, 0.064154, 0.36669, 0.098674, 0.2335, 0.11431, 0.80618, 0.19234, 0.91508, 0.0033276, 0.079862, 0.9956, 0.15982, 0.010655, 0.82395, 0.0035515, 0.2168, 0.067983, 0.14177, 0.0016581, 0.36727, 0.20188, 0.0024872, 0.14672, 0.00028544, 0.4707, 0.10076, 0.0057089, 0.2686, 0.00028544, 0.0071361, 0.9947, 0.98425, 0.0084849, 0.0023809, 0.0015873, 0.83571, 0.0023809, 0.15794, 0.97362, 0.022909 ] | |
}, | |
"R": 30, | |
"lambda.step": 0.01, | |
"plot.opts": { | |
"xlab": "PC1", | |
"ylab": "PC2" | |
}, | |
"topic.order": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LDAvis = function(to_select, json_file) { | |
// This section sets up the logic for event handling | |
var current_clicked = { | |
what: "nothing", | |
element: undefined | |
}, | |
current_hover = { | |
what: "nothing", | |
element: undefined | |
}, | |
old_winning_state = { | |
what: "nothing", | |
element: undefined | |
}, | |
vis_state = { | |
lambda: 1, | |
topic: 0, | |
term: "" | |
}; | |
// Set up a few 'global' variables to hold the data: | |
var K, // number of topics | |
R, // number of terms to display in bar chart | |
mdsData, // (x,y) locations and topic proportions | |
mdsData3, // topic proportions for all terms in the viz | |
lamData, // all terms that are among the top-R most relevant for all topics, lambda values | |
lambda = { | |
old: 1, | |
current: 1 | |
}, | |
color1 = "#1f77b4", // baseline color for default topic circles and overall term frequencies | |
color2 = "#d62728"; // 'highlight' color for selected topics and term-topic frequencies | |
// Set the duration of each half of the transition: | |
var duration = 750; | |
// Set global margins used for everything | |
var margin = { | |
top: 30, | |
right: 30, | |
bottom: 70, | |
left: 30 | |
}, | |
mdswidth = 530, | |
mdsheight = 530, | |
barwidth = 530, | |
barheight = 530, | |
termwidth = 90, // width to add between two panels to display terms | |
mdsarea = mdsheight * mdswidth; | |
// controls how big the maximum circle can be | |
// doesn't depend on data, only on mds width and height: | |
var rMax = 60; | |
// proportion of area of MDS plot to which the sum of default topic circle areas is set | |
var circle_prop = 0.25; | |
var word_prop = 0.25; | |
// opacity of topic circles: | |
var base_opacity = 0.2, | |
highlight_opacity = 0.6; | |
// topic/lambda selection names are specific to *this* vis | |
var topic_select = to_select + "-topic"; | |
var lambda_select = to_select + "-lambda"; | |
// get rid of the # in the to_select (useful) for setting ID values | |
var parts = to_select.split("#"); | |
var visID = parts[parts.length - 1]; | |
var topicID = visID + "-topic"; | |
var lambdaID = visID + "-lambda"; | |
var termID = visID + "-term"; | |
var topicDown = topicID + "-down"; | |
var topicUp = topicID + "-up"; | |
var topicClear = topicID + "-clear"; | |
////////////////////////////////////////////////////////////////////////////// | |
// sort array according to a specified object key name | |
// Note that default is decreasing sort, set decreasing = -1 for increasing | |
// adpated from http://stackoverflow.com/questions/16648076/sort-array-on-key-value | |
function fancysort(key_name, decreasing) { | |
decreasing = (typeof decreasing === "undefined") ? 1 : decreasing; | |
return function(a, b) { | |
if (a[key_name] < b[key_name]) | |
return 1 * decreasing; | |
if (a[key_name] > b[key_name]) | |
return -1 * decreasing; | |
return 0; | |
}; | |
} | |
// The actual read-in of the data and main code: | |
d3.json(json_file, function(error, data) { | |
// set the number of topics to global variable K: | |
K = data['mdsDat'].x.length; | |
// R is the number of top relevant (or salient) words whose bars we display | |
R = data['R']; | |
// a (K x 5) matrix with columns x, y, topics, Freq, cluster (where x and y are locations for left panel) | |
mdsData = []; | |
for (var i = 0; i < K; i++) { | |
var obj = {}; | |
for (var key in data['mdsDat']) { | |
obj[key] = data['mdsDat'][key][i]; | |
} | |
mdsData.push(obj); | |
} | |
// a huge matrix with 3 columns: Term, Topic, Freq, where Freq is all non-zero probabilities of topics given terms | |
// for the terms that appear in the barcharts for this data | |
mdsData3 = []; | |
for (var i = 0; i < data['token.table'].Term.length; i++) { | |
var obj = {}; | |
for (var key in data['token.table']) { | |
obj[key] = data['token.table'][key][i]; | |
} | |
mdsData3.push(obj); | |
} | |
// large data for the widths of bars in bar-charts. 6 columns: Term, logprob, loglift, Freq, Total, Category | |
// Contains all possible terms for topics in (1, 2, ..., k) and lambda in the user-supplied grid of lambda values | |
// which defaults to (0, 0.01, 0.02, ..., 0.99, 1). | |
lamData = []; | |
for (var i = 0; i < data['tinfo'].Term.length; i++) { | |
var obj = {}; | |
for (var key in data['tinfo']) { | |
obj[key] = data['tinfo'][key][i]; | |
} | |
lamData.push(obj); | |
} | |
// Create the topic input & lambda slider forms. Inspired from: | |
// http://bl.ocks.org/d3noob/10632804 | |
// http://bl.ocks.org/d3noob/10633704 | |
init_forms(topicID, lambdaID, visID); | |
// When the value of lambda changes, update the visualization | |
d3.select(lambda_select) | |
.on("mouseup", function() { | |
// store the previous lambda value | |
lambda.old = lambda.current; | |
lambda.current = document.getElementById(lambdaID).value; | |
vis_state.lambda = +this.value; | |
// adjust the text on the range slider | |
d3.select(lambda_select).property("value", vis_state.lambda); | |
d3.select(lambda_select + "-value").text(vis_state.lambda); | |
// transition the order of the bars | |
var increased = lambda.old < vis_state.lambda; | |
if (vis_state.topic > 0) reorder_bars(increased); | |
// store the current lambda value | |
state_save(true); | |
document.getElementById(lambdaID).value = vis_state.lambda; | |
}); | |
d3.select("#" + topicUp) | |
.on("click", function() { | |
// remove term selection if it exists (from a saved URL) | |
var termElem = document.getElementById(termID + vis_state.term); | |
if (termElem !== undefined) term_off(termElem); | |
vis_state.term = ""; | |
var value_old = document.getElementById(topicID).value; | |
var value_new = Math.min(K, +value_old + 1).toFixed(0); | |
// increment the value in the input box | |
document.getElementById(topicID).value = value_new; | |
topic_off(document.getElementById(topicID + value_old)); | |
topic_on(document.getElementById(topicID + value_new)); | |
vis_state.topic = value_new; | |
state_save(true); | |
}) | |
d3.select("#" + topicDown) | |
.on("click", function() { | |
// remove term selection if it exists (from a saved URL) | |
var termElem = document.getElementById(termID + vis_state.term); | |
if (termElem !== undefined) term_off(termElem); | |
vis_state.term = ""; | |
var value_old = document.getElementById(topicID).value; | |
var value_new = Math.max(0, +value_old - 1).toFixed(0); | |
// increment the value in the input box | |
document.getElementById(topicID).value = value_new; | |
topic_off(document.getElementById(topicID + value_old)); | |
topic_on(document.getElementById(topicID + value_new)); | |
vis_state.topic = value_new; | |
state_save(true); | |
}) | |
d3.select("#" + topicID) | |
.on("keyup", function() { | |
// remove term selection if it exists (from a saved URL) | |
var termElem = document.getElementById(termID + vis_state.term); | |
if (termElem !== undefined) term_off(termElem); | |
vis_state.term = ""; | |
topic_off(document.getElementById(topicID + vis_state.topic)) | |
var value_new = document.getElementById(topicID).value; | |
if (!isNaN(value_new) && value_new > 0) { | |
value_new = Math.min(K, Math.max(1, value_new)) | |
topic_on(document.getElementById(topicID + value_new)); | |
vis_state.topic = value_new; | |
state_save(true); | |
document.getElementById(topicID).value = vis_state.topic; | |
} | |
}) | |
d3.select("#" + topicClear) | |
.on("click", function() { | |
state_reset(); | |
state_save(true); | |
}) | |
// create linear scaling to pixels (and add some padding on outer region of scatterplot) | |
var xrange = d3.extent(mdsData, function(d) { | |
return d.x; | |
}); //d3.extent returns min and max of an array | |
var xdiff = xrange[1] - xrange[0], | |
xpad = 0.05; | |
var yrange = d3.extent(mdsData, function(d) { | |
return d.y; | |
}); | |
var ydiff = yrange[1] - yrange[0], | |
ypad = 0.05; | |
if (xdiff > ydiff) { | |
var xScale = d3.scale.linear() | |
.range([0, mdswidth]) | |
.domain([xrange[0] - xpad * xdiff, xrange[1] + xpad * xdiff]); | |
var yScale = d3.scale.linear() | |
.range([mdsheight, 0]) | |
.domain([yrange[0] - 0.5*(xdiff - ydiff) - ypad*xdiff, yrange[1] + 0.5*(xdiff - ydiff) + ypad*xdiff]); | |
} else { | |
var xScale = d3.scale.linear() | |
.range([0, mdswidth]) | |
.domain([xrange[0] - 0.5*(ydiff - xdiff) - xpad*ydiff, xrange[1] + 0.5*(ydiff - xdiff) + xpad*ydiff]); | |
var yScale = d3.scale.linear() | |
.range([mdsheight, 0]) | |
.domain([yrange[0] - ypad * ydiff, yrange[1] + ypad * ydiff]); | |
} | |
// Create new svg element (that will contain everything): | |
var svg = d3.select(to_select).append("svg") | |
.attr("width", mdswidth + barwidth + margin.left + termwidth + margin.right) | |
.attr("height", mdsheight + 2 * margin.top + margin.bottom + 2 * rMax); | |
// Create a group for the mds plot | |
var mdsplot = svg.append("g") | |
.attr("id", "leftpanel") | |
.attr("class", "points") | |
.attr("transform", "translate(" + margin.left + "," + 2 * margin.top + ")"); | |
// Clicking on the mdsplot should clear the selection | |
mdsplot | |
.append("rect") | |
.attr("x", 0) | |
.attr("y", 0) | |
.attr("height", mdsheight) | |
.attr("width", mdswidth) | |
.style("fill", color1) | |
.attr("opacity", 0) | |
.on("click", function() { | |
state_reset(); | |
state_save(true); | |
}); | |
mdsplot.append("line") // draw x-axis | |
.attr("x1", 0) | |
.attr("x2", mdswidth) | |
.attr("y1", mdsheight / 2) | |
.attr("y2", mdsheight / 2) | |
.attr("stroke", "gray") | |
.attr("opacity", 0.3); | |
mdsplot.append("text") // label x-axis | |
.attr("x", 0) | |
.attr("y", mdsheight/2 - 5) | |
.text(data['plot.opts'].xlab) | |
.attr("fill", "gray"); | |
mdsplot.append("line") // draw y-axis | |
.attr("x1", mdswidth / 2) | |
.attr("x2", mdswidth / 2) | |
.attr("y1", 0) | |
.attr("y2", mdsheight) | |
.attr("stroke", "gray") | |
.attr("opacity", 0.3); | |
mdsplot.append("text") // label y-axis | |
.attr("x", mdswidth/2 + 5) | |
.attr("y", 7) | |
.text(data['plot.opts'].ylab) | |
.attr("fill", "gray"); | |
// new definitions based on fixing the sum of the areas of the default topic circles: | |
var newSmall = Math.sqrt(0.02*mdsarea*circle_prop/Math.PI); | |
var newMedium = Math.sqrt(0.05*mdsarea*circle_prop/Math.PI); | |
var newLarge = Math.sqrt(0.10*mdsarea*circle_prop/Math.PI); | |
var cx = 10 + newLarge, | |
cx2 = cx + 1.5 * newLarge; | |
// circle guide inspired from | |
// http://www.nytimes.com/interactive/2012/02/13/us/politics/2013-budget-proposal-graphic.html?_r=0 | |
circleGuide = function(rSize, size) { | |
d3.select("#leftpanel").append("circle") | |
.attr('class', "circleGuide" + size) | |
.attr('r', rSize) | |
.attr('cx', cx) | |
.attr('cy', mdsheight + rSize) | |
.style('fill', 'none') | |
.style('stroke-dasharray', '2 2') | |
.style('stroke', '#999'); | |
d3.select("#leftpanel").append("line") | |
.attr('class', "lineGuide" + size) | |
.attr("x1", cx) | |
.attr("x2", cx2) | |
.attr("y1", mdsheight + 2 * rSize) | |
.attr("y2", mdsheight + 2 * rSize) | |
.style("stroke", "gray") | |
.style("opacity", 0.3); | |
} | |
circleGuide(newSmall, "Small"); | |
circleGuide(newMedium, "Medium"); | |
circleGuide(newLarge, "Large"); | |
var defaultLabelSmall = "2%"; | |
var defaultLabelMedium = "5%"; | |
var defaultLabelLarge = "10%"; | |
d3.select("#leftpanel").append("text") | |
.attr("x", 10) | |
.attr("y", mdsheight - 10) | |
.attr('class', "circleGuideTitle") | |
.style("text-anchor", "left") | |
.style("fontWeight", "bold") | |
.text("Marginal topic distribution"); | |
d3.select("#leftpanel").append("text") | |
.attr("x", cx2 + 10) | |
.attr("y", mdsheight + 2 * newSmall) | |
.attr('class', "circleGuideLabelSmall") | |
.style("text-anchor", "start") | |
.text(defaultLabelSmall); | |
d3.select("#leftpanel").append("text") | |
.attr("x", cx2 + 10) | |
.attr("y", mdsheight + 2 * newMedium) | |
.attr('class', "circleGuideLabelMedium") | |
.style("text-anchor", "start") | |
.text(defaultLabelMedium); | |
d3.select("#leftpanel").append("text") | |
.attr("x", cx2 + 10) | |
.attr("y", mdsheight + 2 * newLarge) | |
.attr('class', "circleGuideLabelLarge") | |
.style("text-anchor", "start") | |
.text(defaultLabelLarge); | |
// bind mdsData to the points in the left panel: | |
var points = mdsplot.selectAll("points") | |
.data(mdsData) | |
.enter(); | |
// text to indicate topic | |
points.append("text") | |
.attr("class", "txt") | |
.attr("x", function(d) { | |
return (xScale(+d.x)); | |
}) | |
.attr("y", function(d) { | |
return (yScale(+d.y) + 4); | |
}) | |
.attr("stroke", "black") | |
.attr("opacity", 1) | |
.style("text-anchor", "middle") | |
.style("font-size", "11px") | |
.style("fontWeight", 100) | |
.text(function(d) { | |
return d.topics; | |
}); | |
// draw circles | |
points.append("circle") | |
.attr("class", "dot") | |
.style("opacity", 0.2) | |
.style("fill", color1) | |
.attr("r", function(d) { | |
//return (rScaleMargin(+d.Freq)); | |
return (Math.sqrt((d.Freq/100)*mdswidth*mdsheight*circle_prop/Math.PI)); | |
}) | |
.attr("cx", function(d) { | |
return (xScale(+d.x)); | |
}) | |
.attr("cy", function(d) { | |
return (yScale(+d.y)); | |
}) | |
.attr("stroke", "black") | |
.attr("id", function(d) { | |
return (topicID + d.topics) | |
}) | |
.on("mouseover", function(d) { | |
var old_topic = topicID + vis_state.topic; | |
if (vis_state.topic > 0 && old_topic != this.id) { | |
topic_off(document.getElementById(old_topic)); | |
} | |
topic_on(this); | |
}) | |
.on("click", function(d) { | |
// prevent click event defined on the div container from firing | |
// http://bl.ocks.org/jasondavies/3186840 | |
d3.event.stopPropagation(); | |
var old_topic = topicID + vis_state.topic; | |
if (vis_state.topic > 0 && old_topic != this.id) { | |
topic_off(document.getElementById(old_topic)); | |
} | |
// make sure topic input box value and fragment reflects clicked selection | |
document.getElementById(topicID).value = vis_state.topic = d.topics; | |
state_save(true); | |
topic_on(this); | |
}) | |
.on("mouseout", function(d) { | |
if (vis_state.topic != d.topics) topic_off(this); | |
if (vis_state.topic > 0) topic_on(document.getElementById(topicID + vis_state.topic)); | |
}); | |
svg.append("text") | |
.text("Intertopic Distance Map (via multidimensional scaling)") | |
.attr("x", mdswidth/2 + margin.left) | |
.attr("y", 30) | |
.style("font-size", "16px") | |
.style("text-anchor", "middle"); | |
// establish layout and vars for bar chart | |
var barDefault2 = lamData.filter(function(d) { | |
return d.Category == "Default" | |
}); | |
var y = d3.scale.ordinal() | |
.domain(barDefault2.map(function(d) { | |
return d.Term; | |
})) | |
.rangeRoundBands([0, barheight], 0.15); | |
var x = d3.scale.linear() | |
.domain([0, d3.max(barDefault2, function(d) { | |
return d.Total; | |
})]) | |
.range([0, barwidth]) | |
.nice(); | |
var yAxis = d3.svg.axis() | |
.scale(y); | |
// Add a group for the bar chart | |
var chart = svg.append("g") | |
.attr("transform", "translate(" + +(mdswidth + margin.left + termwidth) + "," + 2 * margin.top + ")") | |
.attr("id", "bar-freqs"); | |
// bar chart legend/guide: | |
var barguide = {"width": 100, "height": 15}; | |
d3.select("#bar-freqs").append("rect") | |
.attr("x", 0) | |
.attr("y", mdsheight + 10) | |
.attr("height", barguide.height) | |
.attr("width", barguide.width) | |
.style("fill", color1) | |
.attr("opacity", 0.4); | |
d3.select("#bar-freqs").append("text") | |
.attr("x", barguide.width + 5) | |
.attr("y", mdsheight + 10 + barguide.height/2) | |
.style("dominant-baseline", "middle") | |
.text("Overall term frequency"); | |
d3.select("#bar-freqs").append("rect") | |
.attr("x", 0) | |
.attr("y", mdsheight + 10 + barguide.height + 5) | |
.attr("height", barguide.height) | |
.attr("width", barguide.width/2) | |
.style("fill", color2) | |
.attr("opacity", 0.8); | |
d3.select("#bar-freqs").append("text") | |
.attr("x", barguide.width/2 + 5) | |
.attr("y", mdsheight + 10 + (3/2)*barguide.height + 5) | |
.style("dominant-baseline", "middle") | |
.text("Estimated term frequency within the selected topic"); | |
// footnotes: | |
d3.select("#bar-freqs") | |
.append("a") | |
.attr("xlink:href", "http://vis.stanford.edu/files/2012-Termite-AVI.pdf") | |
.attr("target", "_blank") | |
.append("text") | |
.attr("x", 0) | |
.attr("y", mdsheight + 10 + (6/2)*barguide.height + 5) | |
.style("dominant-baseline", "middle") | |
.text("1. saliency(term w) = frequency(w) * [sum_t p(t | w) * log(p(t | w)/p(t))] for topics t; see Chuang et. al (2012)"); | |
d3.select("#bar-freqs") | |
.append("a") | |
.attr("xlink:href", "http://nlp.stanford.edu/events/illvi2014/papers/sievert-illvi2014.pdf") | |
.attr("target", "_blank") | |
.append("text") | |
.attr("x", 0) | |
.attr("y", mdsheight + 10 + (8/2)*barguide.height + 5) | |
.style("dominant-baseline", "middle") | |
.text("2. relevance(term w | topic t) = \u03BB * p(w | t) + (1 - \u03BB) * p(w | t)/p(w); see Sievert & Shirley (2014)"); | |
// Bind 'default' data to 'default' bar chart | |
var basebars = chart.selectAll(".bar-totals") | |
.data(barDefault2) | |
.enter(); | |
// Draw the gray background bars defining the overall frequency of each word | |
basebars | |
.append("rect") | |
.attr("class", "bar-totals") | |
.attr("x", 0) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}) | |
.attr("height", y.rangeBand()) | |
.attr("width", function(d) { | |
return x(d.Total); | |
}) | |
.style("fill", color1) | |
.attr("opacity", 0.4); | |
// Add word labels to the side of each bar | |
basebars | |
.append("text") | |
.attr("x", -5) | |
.attr("class", "terms") | |
.attr("y", function(d) { | |
return y(d.Term) + 12; | |
}) | |
.attr("cursor", "pointer") | |
.attr("id", function(d) { | |
return (termID + d.Term) | |
}) | |
.style("text-anchor", "end") // right align text - use 'middle' for center alignment | |
.text(function(d) { | |
return d.Term; | |
}) | |
.on("mouseover", function() { | |
term_hover(this); | |
}) | |
// .on("click", function(d) { | |
// var old_term = termID + vis_state.term; | |
// if (vis_state.term != "" && old_term != this.id) { | |
// term_off(document.getElementById(old_term)); | |
// } | |
// vis_state.term = d.Term; | |
// state_save(true); | |
// term_on(this); | |
// debugger; | |
// }) | |
.on("mouseout", function() { | |
vis_state.term = ""; | |
term_off(this); | |
state_save(true); | |
}); | |
var title = chart.append("text") | |
.attr("x", barwidth/2) | |
.attr("y", -30) | |
.attr("class", "bubble-tool") // set class so we can remove it when highlight_off is called | |
.style("text-anchor", "middle") | |
.style("font-size", "16px") | |
.text("Top-" + R + " Most Salient Terms"); | |
title.append("tspan") | |
.attr("baseline-shift", "super") | |
.attr("font-size", "12px") | |
.text("(1)"); | |
// barchart axis adapted from http://bl.ocks.org/mbostock/1166403 | |
var xAxis = d3.svg.axis().scale(x) | |
.orient("top") | |
.tickSize(-barheight) | |
.tickSubdivide(true) | |
.ticks(6); | |
chart.attr("class", "xaxis") | |
.call(xAxis); | |
// dynamically create the topic and lambda input forms at the top of the page: | |
function init_forms(topicID, lambdaID, visID) { | |
// create container div for topic and lambda input: | |
var inputDiv = document.createElement("div"); | |
inputDiv.setAttribute("id", "top"); | |
inputDiv.setAttribute("style", "width: 1210px"); // to match the width of the main svg element | |
document.getElementById(visID).appendChild(inputDiv); | |
// topic input container: | |
var topicDiv = document.createElement("div"); | |
topicDiv.setAttribute("style", "padding: 5px; background-color: #e8e8e8; display: inline-block; width: " + mdswidth + "px; height: 50px; float: left"); | |
inputDiv.appendChild(topicDiv); | |
var topicLabel = document.createElement("label"); | |
topicLabel.setAttribute("for", topicID); | |
topicLabel.setAttribute("style", "font-family: sans-serif; font-size: 14px"); | |
topicLabel.innerHTML = "Selected Topic: <span id='" + topicID + "-value'></span>"; | |
topicDiv.appendChild(topicLabel); | |
var topicInput = document.createElement("input"); | |
topicInput.setAttribute("style", "width: 50px"); | |
topicInput.type = "text"; | |
topicInput.min = "0"; | |
topicInput.max = K; // assumes the data has already been read in | |
topicInput.step = "1"; | |
topicInput.value = "0"; // a value of 0 indicates no topic is selected | |
topicInput.id = topicID; | |
topicDiv.appendChild(topicInput); | |
var previous = document.createElement("button"); | |
previous.setAttribute("id", topicDown); | |
previous.setAttribute("style", "margin-left: 5px"); | |
previous.innerHTML = "Previous Topic"; | |
topicDiv.appendChild(previous); | |
var next = document.createElement("button"); | |
next.setAttribute("id", topicUp); | |
next.setAttribute("style", "margin-left: 5px"); | |
next.innerHTML = "Next Topic"; | |
topicDiv.appendChild(next); | |
var clear = document.createElement("button"); | |
clear.setAttribute("id", topicClear); | |
clear.setAttribute("style", "margin-left: 5px"); | |
clear.innerHTML = "Clear Topic"; | |
topicDiv.appendChild(clear); | |
// lambda inputs | |
//var lambdaDivLeft = 8 + mdswidth + margin.left + termwidth; | |
var lambdaDivWidth = barwidth; | |
var lambdaDiv = document.createElement("div"); | |
lambdaDiv.setAttribute("id", "lambdaInput"); | |
lambdaDiv.setAttribute("style", "padding: 5px; background-color: #e8e8e8; display: inline-block; height: 50px; width: " + lambdaDivWidth + "px; float: right; margin-right: 30px"); | |
inputDiv.appendChild(lambdaDiv); | |
var lambdaZero = document.createElement("div"); | |
lambdaZero.setAttribute("style", "padding: 5px; height: 20px; width: 220px; font-family: sans-serif; float: left"); | |
lambdaZero.setAttribute("id", "lambdaZero"); | |
lambdaDiv.appendChild(lambdaZero); | |
var xx = d3.select("#lambdaZero") | |
.append("text") | |
.attr("x", 0) | |
.attr("y", 0) | |
.style("font-size", "14px") | |
.text("Slide to adjust relevance metric:"); | |
var yy = d3.select("#lambdaZero") | |
.append("text") | |
.attr("x", 125) | |
.attr("y", -5) | |
.style("font-size", "10px") | |
.style("position", "absolute") | |
.text("(2)"); | |
var sliderDiv = document.createElement("div"); | |
sliderDiv.setAttribute("id", "sliderdiv"); | |
sliderDiv.setAttribute("style", "padding: 5px; height: 40px; width: 250px; float: right; margin-top: -5px; margin-right: 10px"); | |
lambdaDiv.appendChild(sliderDiv); | |
var lambdaInput = document.createElement("input"); | |
lambdaInput.setAttribute("style", "width: 250px; margin-left: 0px; margin-right: 0px"); | |
lambdaInput.type = "range"; | |
lambdaInput.min = 0; | |
lambdaInput.max = 1; | |
lambdaInput.step = data['lambda.step']; | |
lambdaInput.value = vis_state.lambda; | |
lambdaInput.id = lambdaID; | |
lambdaInput.setAttribute("list", "ticks"); // to enable automatic ticks (with no labels, see below) | |
sliderDiv.appendChild(lambdaInput); | |
var lambdaLabel = document.createElement("label"); | |
lambdaLabel.setAttribute("id", "lamlabel"); | |
lambdaLabel.setAttribute("for", lambdaID); | |
lambdaLabel.setAttribute("style", "height: 20px; width: 60px; font-family: sans-serif; font-size: 14px; margin-left: 80px"); | |
lambdaLabel.innerHTML = "λ = <span id='" + lambdaID + "-value'>" + vis_state.lambda + "</span>"; | |
lambdaDiv.appendChild(lambdaLabel); | |
// Create the svg to contain the slider scale: | |
var scaleContainer = d3.select("#sliderdiv").append("svg") | |
.attr("width", 250) | |
.attr("height", 25); | |
var sliderScale = d3.scale.linear() | |
.domain([0, 1]) | |
.range([7.5, 242.5]) // trimmed by 7.5px on each side to match the input type=range slider: | |
.nice(); | |
// adapted from http://bl.ocks.org/mbostock/1166403 | |
var sliderAxis = d3.svg.axis() | |
.scale(sliderScale) | |
.orient("bottom") | |
.tickSize(10) | |
.tickSubdivide(true) | |
.ticks(6); | |
// group to contain the elements of the slider axis: | |
var sliderAxisGroup = scaleContainer.append("g") | |
.attr("class", "slideraxis") | |
.attr("margin-top", "-10px") | |
.call(sliderAxis); | |
// Another strategy for tick marks on the slider; simpler, but not labels | |
// var sliderTicks = document.createElement("datalist"); | |
// sliderTicks.setAttribute("id", "ticks"); | |
// for (var tick = 0; tick <= 10; tick++) { | |
// var tickOption = document.createElement("option"); | |
// //tickOption.value = tick/10; | |
// tickOption.innerHTML = tick/10; | |
// sliderTicks.appendChild(tickOption); | |
// } | |
// append the forms to the containers | |
//lambdaDiv.appendChild(sliderTicks); | |
} | |
// function to re-order the bars (gray and red), and terms: | |
function reorder_bars(increase) { | |
// grab the bar-chart data for this topic only: | |
var dat2 = lamData.filter(function(d) { | |
//return d.Category == "Topic" + Math.min(K, Math.max(0, vis_state.topic)) // fails for negative topic numbers... | |
return d.Category == "Topic" + vis_state.topic; | |
}); | |
// define relevance: | |
for (var i = 0; i < dat2.length; i++) { | |
dat2[i].relevance = vis_state.lambda * dat2[i].logprob + | |
(1 - vis_state.lambda) * dat2[i].loglift; | |
} | |
// sort by relevance: | |
dat2.sort(fancysort("relevance")); | |
// truncate to the top R tokens: | |
var dat3 = dat2.slice(0, R); | |
var y = d3.scale.ordinal() | |
.domain(dat3.map(function(d) { | |
return d.Term; | |
})) | |
.rangeRoundBands([0, barheight], 0.15); | |
var x = d3.scale.linear() | |
.domain([0, d3.max(dat3, function(d) { | |
return d.Total; | |
})]) | |
.range([0, barwidth]) | |
.nice(); | |
// Change Total Frequency bars | |
var graybars = d3.select("#bar-freqs") | |
.selectAll(".bar-totals") | |
.data(dat3, function(d) { | |
return d.Term; | |
}); | |
// Change word labels | |
var labels = d3.select("#bar-freqs") | |
.selectAll(".terms") | |
.data(dat3, function(d) { | |
return d.Term; | |
}); | |
// Create red bars (drawn over the gray ones) to signify the frequency under the selected topic | |
var redbars = d3.select("#bar-freqs") | |
.selectAll(".overlay") | |
.data(dat3, function(d) { | |
return d.Term; | |
}); | |
// adapted from http://bl.ocks.org/mbostock/1166403 | |
var xAxis = d3.svg.axis().scale(x) | |
.orient("top") | |
.tickSize(-barheight) | |
.tickSubdivide(true) | |
.ticks(6); | |
// New axis definition: | |
var newaxis = d3.selectAll(".xaxis"); | |
// define the new elements to enter: | |
var graybarsEnter = graybars.enter().append("rect") | |
.attr("class", "bar-totals") | |
.attr("x", 0) | |
.attr("y", function(d) { | |
return y(d.Term) + barheight + margin.bottom + 2 * rMax; | |
}) | |
.attr("height", y.rangeBand()) | |
.style("fill", color1) | |
.attr("opacity", 0.4); | |
var labelsEnter = labels.enter() | |
.append("text") | |
.attr("x", -5) | |
.attr("class", "terms") | |
.attr("y", function(d) { | |
return y(d.Term) + 12 + barheight + margin.bottom + 2 * rMax; | |
}) | |
.attr("cursor", "pointer") | |
.style("text-anchor", "end") | |
.attr("id", function(d) { | |
return (termID + d.Term) | |
}) | |
.text(function(d) { | |
return d.Term; | |
}) | |
.on("mouseover", function() { | |
term_hover(this); | |
}) | |
// .on("click", function(d) { | |
// var old_term = termID + vis_state.term; | |
// if (vis_state.term != "" && old_term != this.id) { | |
// term_off(document.getElementById(old_term)); | |
// } | |
// vis_state.term = d.Term; | |
// state_save(true); | |
// term_on(this); | |
// }) | |
.on("mouseout", function() { | |
vis_state.term = ""; | |
term_off(this); | |
state_save(true); | |
}); | |
var redbarsEnter = redbars.enter().append("rect") | |
.attr("class", "overlay") | |
.attr("x", 0) | |
.attr("y", function(d) { | |
return y(d.Term) + barheight + margin.bottom + 2 * rMax; | |
}) | |
.attr("height", y.rangeBand()) | |
.style("fill", color2) | |
.attr("opacity", 0.8); | |
if (increase) { | |
graybarsEnter | |
.attr("width", function(d) { | |
return x(d.Total); | |
}) | |
.transition().duration(duration) | |
.delay(duration) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}); | |
labelsEnter | |
.transition().duration(duration) | |
.delay(duration) | |
.attr("y", function(d) { | |
return y(d.Term) + 12; | |
}); | |
redbarsEnter | |
.attr("width", function(d) { | |
return x(d.Freq); | |
}) | |
.transition().duration(duration) | |
.delay(duration) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}); | |
graybars.transition().duration(duration) | |
.attr("width", function(d) { | |
return x(d.Total); | |
}) | |
.transition().duration(duration) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}); | |
labels.transition().duration(duration) | |
.delay(duration) | |
.attr("y", function(d) { | |
return y(d.Term) + 12; | |
}); | |
redbars.transition().duration(duration) | |
.attr("width", function(d) { | |
return x(d.Freq); | |
}) | |
.transition().duration(duration) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}); | |
// Transition exiting rectangles to the bottom of the barchart: | |
graybars.exit() | |
.transition().duration(duration) | |
.attr("width", function(d) { | |
return x(d.Total); | |
}) | |
.transition().duration(duration) | |
.attr("y", function(d, i) { | |
return barheight + margin.bottom + 6 + i * 18; | |
}) | |
.remove(); | |
labels.exit() | |
.transition().duration(duration) | |
.delay(duration) | |
.attr("y", function(d, i) { | |
return barheight + margin.bottom + 18 + i * 18; | |
}) | |
.remove(); | |
redbars.exit() | |
.transition().duration(duration) | |
.attr("width", function(d) { | |
return x(d.Freq); | |
}) | |
.transition().duration(duration) | |
.attr("y", function(d, i) { | |
return barheight + margin.bottom + 6 + i * 18; | |
}) | |
.remove(); | |
// https://github.com/mbostock/d3/wiki/Transitions#wiki-d3_ease | |
newaxis.transition().duration(duration) | |
.call(xAxis) | |
.transition().duration(duration); | |
} else { | |
graybarsEnter | |
.attr("width", 100) // FIXME by looking up old width of these bars | |
.transition().duration(duration) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}) | |
.transition().duration(duration) | |
.attr("width", function(d) { | |
return x(d.Total); | |
}); | |
labelsEnter | |
.transition().duration(duration) | |
.attr("y", function(d) { | |
return y(d.Term) + 12; | |
}); | |
redbarsEnter | |
.attr("width", 50) // FIXME by looking up old width of these bars | |
.transition().duration(duration) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}) | |
.transition().duration(duration) | |
.attr("width", function(d) { | |
return x(d.Freq); | |
}); | |
graybars.transition().duration(duration) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}) | |
.transition().duration(duration) | |
.attr("width", function(d) { | |
return x(d.Total); | |
}); | |
labels.transition().duration(duration) | |
.attr("y", function(d) { | |
return y(d.Term) + 12; | |
}); | |
redbars.transition().duration(duration) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}) | |
.transition().duration(duration) | |
.attr("width", function(d) { | |
return x(d.Freq); | |
}); | |
// Transition exiting rectangles to the bottom of the barchart: | |
graybars.exit() | |
.transition().duration(duration) | |
.attr("y", function(d, i) { | |
return barheight + margin.bottom + 6 + i * 18 + 2 * rMax; | |
}) | |
.remove(); | |
labels.exit() | |
.transition().duration(duration) | |
.attr("y", function(d, i) { | |
return barheight + margin.bottom + 18 + i * 18 + 2 * rMax; | |
}) | |
.remove(); | |
redbars.exit() | |
.transition().duration(duration) | |
.attr("y", function(d, i) { | |
return barheight + margin.bottom + 6 + i * 18 + 2 * rMax; | |
}) | |
.remove(); | |
// https://github.com/mbostock/d3/wiki/Transitions#wiki-d3_ease | |
newaxis.transition().duration(duration) | |
.transition().duration(duration) | |
.call(xAxis); | |
} | |
} | |
////////////////////////////////////////////////////////////////////////////// | |
// function to update bar chart when a topic is selected | |
// the circle argument should be the appropriate circle element | |
function topic_on(circle) { | |
if (circle == null) return null; | |
// grab data bound to this element | |
var d = circle.__data__ | |
var Freq = Math.round(d.Freq * 10) / 10, | |
topics = d.topics; | |
// change opacity and fill of the selected circle | |
circle.style.opacity = highlight_opacity; | |
circle.style.fill = color2; | |
// Remove 'old' bar chart title | |
var text = d3.select(".bubble-tool"); | |
text.remove(); | |
// append text with info relevant to topic of interest | |
d3.select("#bar-freqs") | |
.append("text") | |
.attr("x", barwidth/2) | |
.attr("y", -30) | |
.attr("class", "bubble-tool") // set class so we can remove it when highlight_off is called | |
.style("text-anchor", "middle") | |
.style("font-size", "16px") | |
.text("Top-" + R + " Most Relevant Terms for Topic " + topics + " (" + Freq + "% of tokens)"); | |
// grab the bar-chart data for this topic only: | |
var dat2 = lamData.filter(function(d) { | |
return d.Category == "Topic" + topics | |
}); | |
// define relevance: | |
for (var i = 0; i < dat2.length; i++) { | |
dat2[i].relevance = lambda.current * dat2[i].logprob + | |
(1 - lambda.current) * dat2[i].loglift; | |
} | |
// sort by relevance: | |
dat2.sort(fancysort("relevance")); | |
// truncate to the top R tokens: | |
var dat3 = dat2.slice(0, R); | |
// scale the bars to the top R terms: | |
var y = d3.scale.ordinal() | |
.domain(dat3.map(function(d) { | |
return d.Term; | |
})) | |
.rangeRoundBands([0, barheight], 0.15); | |
var x = d3.scale.linear() | |
.domain([0, d3.max(dat3, function(d) { | |
return d.Total; | |
})]) | |
.range([0, barwidth]) | |
.nice(); | |
// remove the red bars if there are any: | |
d3.selectAll(".overlay").remove(); | |
// Change Total Frequency bars | |
d3.selectAll(".bar-totals") | |
.data(dat3) | |
.attr("x", 0) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}) | |
.attr("height", y.rangeBand()) | |
.attr("width", function(d) { | |
return x(d.Total); | |
}) | |
.style("fill", color1) | |
.attr("opacity", 0.4); | |
// Change word labels | |
d3.selectAll(".terms") | |
.data(dat3) | |
.attr("x", -5) | |
.attr("y", function(d) { | |
return y(d.Term) + 12; | |
}) | |
.attr("id", function(d) { | |
return (termID + d.Term) | |
}) | |
.style("text-anchor", "end") // right align text - use 'middle' for center alignment | |
.text(function(d) { | |
return d.Term; | |
}); | |
// Create red bars (drawn over the gray ones) to signify the frequency under the selected topic | |
d3.select("#bar-freqs").selectAll(".overlay") | |
.data(dat3) | |
.enter() | |
.append("rect") | |
.attr("class", "overlay") | |
.attr("x", 0) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}) | |
.attr("height", y.rangeBand()) | |
.attr("width", function(d) { | |
return x(d.Freq); | |
}) | |
.style("fill", color2) | |
.attr("opacity", 0.8); | |
// adapted from http://bl.ocks.org/mbostock/1166403 | |
var xAxis = d3.svg.axis().scale(x) | |
.orient("top") | |
.tickSize(-barheight) | |
.tickSubdivide(true) | |
.ticks(6); | |
// redraw x-axis | |
d3.selectAll(".xaxis") | |
//.attr("class", "xaxis") | |
.call(xAxis); | |
} | |
function topic_off(circle) { | |
if (circle == null) return circle; | |
// go back to original opacity/fill | |
circle.style.opacity = base_opacity; | |
circle.style.fill = color1; | |
var title = d3.selectAll(".bubble-tool") | |
.text("Top-" + R + " Most Salient Terms"); | |
title.append("tspan") | |
.attr("baseline-shift", "super") | |
.attr("font-size", 12) | |
.text(1); | |
// remove the red bars | |
d3.selectAll(".overlay").remove(); | |
// go back to 'default' bar chart | |
var dat2 = lamData.filter(function(d) { | |
return d.Category == "Default" | |
}); | |
var y = d3.scale.ordinal() | |
.domain(dat2.map(function(d) { | |
return d.Term; | |
})) | |
.rangeRoundBands([0, barheight], 0.15); | |
var x = d3.scale.linear() | |
.domain([0, d3.max(dat2, function(d) { | |
return d.Total; | |
})]) | |
.range([0, barwidth]) | |
.nice(); | |
// Change Total Frequency bars | |
d3.selectAll(".bar-totals") | |
.data(dat2) | |
.attr("x", 0) | |
.attr("y", function(d) { | |
return y(d.Term); | |
}) | |
.attr("height", y.rangeBand()) | |
.attr("width", function(d) { | |
return x(d.Total); | |
}) | |
.style("fill", color1) | |
.attr("opacity", 0.4); | |
//Change word labels | |
d3.selectAll(".terms") | |
.data(dat2) | |
.attr("x", -5) | |
.attr("y", function(d) { | |
return y(d.Term) + 12; | |
}) | |
.style("text-anchor", "end") // right align text - use 'middle' for center alignment | |
.text(function(d) { | |
return d.Term; | |
}); | |
// adapted from http://bl.ocks.org/mbostock/1166403 | |
var xAxis = d3.svg.axis().scale(x) | |
.orient("top") | |
.tickSize(-barheight) | |
.tickSubdivide(true) | |
.ticks(6); | |
// redraw x-axis | |
d3.selectAll(".xaxis") | |
.attr("class", "xaxis") | |
.call(xAxis); | |
} | |
// event definition for mousing over a term | |
function term_hover(term) { | |
var old_term = termID + vis_state.term; | |
if (vis_state.term != "" && old_term != term.id) { | |
term_off(document.getElementById(old_term)); | |
} | |
vis_state.term = term.innerHTML; | |
term_on(term); | |
state_save(true); | |
} | |
// updates vis when a term is selected via click or hover | |
function term_on(term) { | |
if (term == null) return null; | |
term.style["fontWeight"] = "bold"; | |
var d = term.__data__ | |
var Term = d.Term; | |
var dat2 = mdsData3.filter(function(d2) { | |
return d2.Term == Term | |
}); | |
var k = dat2.length; // number of topics for this token with non-zero frequency | |
var radius = []; | |
for (var i = 0; i < K; ++i) { | |
radius[i] = 0; | |
} | |
for (i = 0; i < k; i++) { | |
radius[dat2[i].Topic - 1] = dat2[i].Freq; | |
} | |
var size = []; | |
for (var i = 0; i < K; ++i) { | |
size[i] = 0; | |
} | |
for (i = 0; i < k; i++) { | |
// If we want to also re-size the topic number labels, do it here | |
// 11 is the default, so leaving this as 11 won't change anything. | |
size[dat2[i].Topic - 1] = 11; | |
} | |
var rScaleCond = d3.scale.sqrt() | |
.domain([0, 1]).range([0, rMax]); | |
// Change size of bubbles according to the word's distribution over topics | |
d3.selectAll(".dot") | |
.data(radius) | |
.transition() | |
.attr("r", function(d) { | |
//return (rScaleCond(d)); | |
return (Math.sqrt(d*mdswidth*mdsheight*word_prop/Math.PI)); | |
}); | |
// re-bind mdsData so we can handle multiple selection | |
d3.selectAll(".dot") | |
.data(mdsData) | |
// Change sizes of topic numbers: | |
d3.selectAll(".txt") | |
.data(size) | |
.transition() | |
.style("font-size", function(d) { | |
return +d; | |
}); | |
// Alter the guide | |
d3.select(".circleGuideTitle") | |
.text("Conditional topic distribution given term = '" + term.innerHTML + "'"); | |
} | |
function term_off(term) { | |
if (term == null) return null; | |
term.style["fontWeight"] = "normal"; | |
d3.selectAll(".dot") | |
.data(mdsData) | |
.transition() | |
.attr("r", function(d) { | |
//return (rScaleMargin(+d.Freq)); | |
return (Math.sqrt((d.Freq/100)*mdswidth*mdsheight*circle_prop/Math.PI)); | |
}); | |
// Change sizes of topic numbers: | |
d3.selectAll(".txt") | |
.transition() | |
.style("font-size", "11px"); | |
// Go back to the default guide | |
d3.select(".circleGuideTitle") | |
.text("Marginal topic distribution"); | |
d3.select(".circleGuideLabelLarge") | |
.text(defaultLabelLarge); | |
d3.select(".circleGuideLabelSmall") | |
.attr("y", mdsheight + 2 * newSmall) | |
.text(defaultLabelSmall); | |
d3.select(".circleGuideSmall") | |
.attr("r", newSmall) | |
.attr("cy", mdsheight + newSmall); | |
d3.select(".lineGuideSmall") | |
.attr("y1", mdsheight + 2 * newSmall) | |
.attr("y2", mdsheight + 2 * newSmall); | |
} | |
// serialize the visualization state using fragment identifiers -- http://en.wikipedia.org/wiki/Fragment_identifier | |
// location.hash holds the address information | |
var params = location.hash.split("&"); | |
if (params.length > 1) { | |
vis_state.topic = params[0].split("=")[1]; | |
vis_state.lambda = params[1].split("=")[1]; | |
vis_state.term = params[2].split("=")[1]; | |
// Idea: write a function to parse the URL string | |
// only accept values in [0,1] for lambda, {0, 1, ..., K} for topics (any string is OK for term) | |
// Allow for subsets of the three to be entered: | |
// (1) topic only (lambda = 1 term = "") | |
// (2) lambda only (topic = 0 term = "") visually the same but upon hovering a topic, the effect of lambda will be seen | |
// (3) term only (topic = 0 lambda = 1) only fires when the term is among the R most salient | |
// (4) topic + lambda (term = "") | |
// (5) topic + term (lambda = 1) | |
// (6) lambda + term (topic = 0) visually lambda doesn't make a difference unless a topic is hovered | |
// (7) topic + lambda + term | |
// Short-term: assume format of "#topic=k&lambda=l&term=s" where k, l, and s are strings (b/c they're from a URL) | |
// Force k (topic identifier) to be an integer between 0 and K: | |
vis_state.topic = Math.round(Math.min(K, Math.max(0, vis_state.topic))); | |
// Force l (lambda identifier) to be in [0, 1]: | |
vis_state.lambda = Math.min(1, Math.max(0, vis_state.lambda)); | |
// impose the value of lambda: | |
document.getElementById(lambdaID).value = vis_state.lambda; | |
document.getElementById(lambdaID + "-value").innerHTML = vis_state.lambda; | |
// select the topic and transition the order of the bars (if approporiate) | |
if (!isNaN(vis_state.topic)) { | |
document.getElementById(topicID).value = vis_state.topic; | |
if (vis_state.topic > 0) { | |
topic_on(document.getElementById(topicID + vis_state.topic)); | |
} | |
if (vis_state.lambda < 1 && vis_state.topic > 0) { | |
reorder_bars(false); | |
} | |
} | |
lambda.current = vis_state.lambda; | |
var termElem = document.getElementById(termID + vis_state.term); | |
if (termElem !== undefined) term_on(termElem); | |
} | |
function state_url() { | |
return location.origin + location.pathname + "#topic=" + vis_state.topic + | |
"&lambda=" + vis_state.lambda + "&term=" + vis_state.term; | |
} | |
function state_save(replace) { | |
if (replace) | |
history.replaceState(vis_state, "Query", state_url()); | |
else | |
history.pushState(vis_state, "Query", state_url()); | |
} | |
function state_reset() { | |
if (vis_state.topic > 0) { | |
topic_off(document.getElementById(topicID + vis_state.topic)); | |
} | |
if (vis_state.term != "") { | |
term_off(document.getElementById(termID + vis_state.term)); | |
} | |
vis_state.term = ""; | |
document.getElementById(topicID).value = vis_state.topic = 0; | |
state_save(true); | |
} | |
}); | |
// var current_clicked = { | |
// what: "nothing", | |
// element: undefined | |
// }, | |
//debugger; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment