{I" class:ETI"ProcessedAsset;FI"logical_path;TI"prosperity/graph.js.js;FI" pathname;TI"_/Users/simon/Documents/rainforest/prosperity/app/assets/javascripts/prosperity/graph.js.js;FI"content_type;TI"application/javascript;TI" mtime;Tl+"¦RI" length;Tiß I" digest;TI"%53dc28ed910c2627728199f3e34971a3;FI" source;TI"ß // Generated by CoffeeScript 1.6.2 (function() { var Graph; Graph = (function() { function Graph(option) { this.url = option.url; this.el = option.el; this.$el = $(option.el); } Graph.prototype.render = function() { var chart, getSeries, highchartsOptions, _this = this; highchartsOptions = { chart: { type: 'line', renderTo: this.el }, tooltip: { crosshairs: [true, true] }, series: [], xAxis: { type: 'datetime', dateTimeLabelFormats: { day: '%e of %b' } }, yAxis: [{}, {}, {}], title: { text: "Loading..." } }; chart = new Highcharts.Chart(highchartsOptions); getSeries = function(url, axisIndex) { return $.get(url, function(json) { var axisSettings, serie; serie = { data: json.data, name: json.key, yAxis: axisIndex, pointStart: Date.parse(json.start_time), pointInterval: json.period_milliseconds }; axisSettings = { title: { text: json.key }, min: Math.min.apply(Math, json.data), max: Math.max.apply(Math, json.data) }; if (json.key === 'change') { axisSettings = $.extend(axisSettings, { min: 0, max: Math.max.apply(Math, json.data), labels: { formatter: function() { return this.value + '%'; } }, opposite: true }); serie = $.extend(serie, { tooltip: { valueDecimals: 2, valueSuffix: '%' } }); } chart.yAxis[axisIndex].update(axisSettings); return chart.addSeries(serie); }); }; $.getJSON(this.url, function(json) { var extractor, index, _i, _len, _ref, _results; chart.setTitle({ text: json.title }); _ref = json.extractors; _results = []; for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { extractor = _ref[index]; _results.push(getSeries(extractor.url, index)); } return _results; }); return this; }; return Graph; })(); this.Prosperity.Graph = Graph; }).call(this); ;TI"dependency_digest;TI"%75f63ad5e3a1bbf5e65014eefc61ef22;FI"required_paths;T[I"_/Users/simon/Documents/rainforest/prosperity/app/assets/javascripts/prosperity/graph.js.js;FI"dependency_paths;T[{I" path;TI"_/Users/simon/Documents/rainforest/prosperity/app/assets/javascripts/prosperity/graph.js.js;FI" mtime;TI"2013-12-09T11:50:58-08:00;TI" digest;TI"%53dc28ed910c2627728199f3e34971a3;FI" _version;TI"%ad5851230fbdd4f8a862674697158df2;F