|
|
@ -1,7 +1,6 @@ |
|
|
|
// Generated by CoffeeScript 1.2.1-pre
|
|
|
|
// Generated by CoffeeScript 1.2.1-pre
|
|
|
|
(function() { |
|
|
|
(function() { |
|
|
|
var activate, add_class, deactivate, hover, padding, rm_class, svg, tooltip, tooltip_font_size, tooltip_timeout, untooltip, _, __, |
|
|
|
var activate, add_class, deactivate, has_class, hover, padding, rm_class, svg, tooltip, tooltip_font_size, tooltip_timeout, untooltip, _, __, |
|
|
|
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, |
|
|
|
|
|
|
|
__slice = [].slice; |
|
|
|
__slice = [].slice; |
|
|
|
|
|
|
|
|
|
|
|
_ = function(x) { |
|
|
|
_ = function(x) { |
|
|
@ -18,11 +17,22 @@ |
|
|
|
|
|
|
|
|
|
|
|
tooltip_font_size = parseInt("{{ font_sizes.tooltip }}"); |
|
|
|
tooltip_font_size = parseInt("{{ font_sizes.tooltip }}"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
has_class = function(e, class_name) { |
|
|
|
|
|
|
|
var cls, cn, i, _i, _len; |
|
|
|
|
|
|
|
if (!e) return; |
|
|
|
|
|
|
|
cn = e.getAttribute('class').split(' '); |
|
|
|
|
|
|
|
for (i = _i = 0, _len = cn.length; _i < _len; i = ++_i) { |
|
|
|
|
|
|
|
cls = cn[i]; |
|
|
|
|
|
|
|
if (cls === class_name) return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
add_class = function(e, class_name) { |
|
|
|
add_class = function(e, class_name) { |
|
|
|
var cn; |
|
|
|
var cn; |
|
|
|
if (!e) return; |
|
|
|
if (!e) return; |
|
|
|
cn = e.getAttribute('class').split(' '); |
|
|
|
cn = e.getAttribute('class').split(' '); |
|
|
|
if (__indexOf.call(cn, class_name) < 0) cn.push(class_name); |
|
|
|
if (!has_class(e, class_name)) cn.push(class_name); |
|
|
|
return e.setAttribute('class', cn.join(' ')); |
|
|
|
return e.setAttribute('class', cn.join(' ')); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -83,7 +93,7 @@ |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
tooltip = function(elt) { |
|
|
|
tooltip = function(elt) { |
|
|
|
var h, value, w, x, y, _rect, _text, _tooltip; |
|
|
|
var h, value, w, x, x_elt, y, y_elt, _rect, _text, _tooltip; |
|
|
|
clearTimeout(tooltip_timeout); |
|
|
|
clearTimeout(tooltip_timeout); |
|
|
|
_tooltip = __('tooltip'); |
|
|
|
_tooltip = __('tooltip'); |
|
|
|
_text = _tooltip.getElementsByTagName('text')[0]; |
|
|
|
_text = _tooltip.getElementsByTagName('text')[0]; |
|
|
@ -96,8 +106,12 @@ |
|
|
|
_rect.setAttribute('height', h); |
|
|
|
_rect.setAttribute('height', h); |
|
|
|
_text.setAttribute('x', padding); |
|
|
|
_text.setAttribute('x', padding); |
|
|
|
_text.setAttribute('y', padding + tooltip_font_size); |
|
|
|
_text.setAttribute('y', padding + tooltip_font_size); |
|
|
|
x = value.nextElementSibling.textContent - w / 2; |
|
|
|
x_elt = value.nextElementSibling; |
|
|
|
y = value.nextElementSibling.nextElementSibling.textContent - h / 2; |
|
|
|
y_elt = x_elt.nextElementSibling; |
|
|
|
|
|
|
|
x = x_elt.textContent; |
|
|
|
|
|
|
|
if (has_class(x_elt, 'centered')) x -= w / 2; |
|
|
|
|
|
|
|
y = y_elt.textContent; |
|
|
|
|
|
|
|
if (has_class(y_elt, 'centered')) y -= h / 2; |
|
|
|
return _tooltip.setAttribute('transform', "translate(" + x + " " + y + ")"); |
|
|
|
return _tooltip.setAttribute('transform', "translate(" + x + " " + y + ")"); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -131,7 +145,7 @@ |
|
|
|
_results = []; |
|
|
|
_results = []; |
|
|
|
for (_k = 0, _len3 = _ref3.length; _k < _len3; _k++) { |
|
|
|
for (_k = 0, _len3 = _ref3.length; _k < _len3; _k++) { |
|
|
|
element = _ref3[_k]; |
|
|
|
element = _ref3[_k]; |
|
|
|
_results.push(activate(element, reactive(element))); |
|
|
|
_results.push(activate(element)); |
|
|
|
} |
|
|
|
} |
|
|
|
return _results; |
|
|
|
return _results; |
|
|
|
}), (function() { |
|
|
|
}), (function() { |
|
|
@ -146,7 +160,7 @@ |
|
|
|
_results = []; |
|
|
|
_results = []; |
|
|
|
for (_k = 0, _len3 = _ref3.length; _k < _len3; _k++) { |
|
|
|
for (_k = 0, _len3 = _ref3.length; _k < _len3; _k++) { |
|
|
|
element = _ref3[_k]; |
|
|
|
element = _ref3[_k]; |
|
|
|
_results.push(deactivate(element, reactive(element))); |
|
|
|
_results.push(deactivate(element)); |
|
|
|
} |
|
|
|
} |
|
|
|
return _results; |
|
|
|
return _results; |
|
|
|
})); |
|
|
|
})); |
|
|
|