2016-05-10 13:45:58 -04:00
|
|
|
import { registerUnbound } from 'discourse/lib/helpers';
|
2014-12-12 13:28:20 -05:00
|
|
|
|
|
|
|
registerUnbound('value-at-tl', function(data, params) {
|
|
|
|
var tl = parseInt(params.level, 10);
|
|
|
|
if (data) {
|
|
|
|
var item = data.find( function(d) { return parseInt(d.x, 10) === tl; } );
|
|
|
|
if (item) {
|
|
|
|
return item.y;
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|