// Once generated by CoffeeScript 1.9.3, but now lives as pure JS /* eslint-disable */ (function() { this.Histogram = (function() { function Histogram(id, rawData) { this.id = id; this.rawData = rawData; this.xTicks = []; this.yTicks = []; this.data = []; this.calculate(); this.render(); } Histogram.prototype.calculate = function() { var count, i, len, log_count, ref, ref1, results, score; ref = this.rawData; results = []; for (i = 0, len = ref.length; i < len; i++) { ref1 = ref[i], score = ref1[0], count = ref1[1]; if (score === null) { continue; } log_count = Math.log(count + 1); this.data.push([score, log_count]); this.xTicks.push([score, score.toString()]); results.push(this.yTicks.push([log_count, count.toString()])); } return results; }; Histogram.prototype.render = function() { return $.plot($("#histogram_" + this.id), [ { data: this.data, bars: { show: true, align: 'center', lineWidth: 0, fill: 1.0 }, color: "#b72121" } ], { xaxis: { min: -1, max: Math.max.apply(Math, $.map(this.xTicks, function(data) { return data[0] + 1; })), ticks: this.xTicks, tickLength: 0 }, yaxis: { min: 0.0, max: Math.max.apply(Math, $.map(this.yTicks, function(data) { return data[0] * 1.1; })), ticks: this.yTicks, labelWidth: 50 } }); }; return Histogram; })(); }).call(this);