!function t(r,e,n){function i(o,s){if(!e[o]){if(!r[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var c=e[o]={exports:{}};r[o][0].call(c.exports,function(t){var e=r[o][1][t];return i(e?e:t)},c,c.exports,t,r,e,n)}return e[o].exports}for(var a="function"==typeof require&&require,o=0;or;r++)t=n[r],i.push(t());return i}},t}(),n=function(){function t(t,r){this.search=a(this.search,this),this.updateDataset=a(this.updateDataset,this),this.el=t,this.searchForm=r,this.searchForm.onSubmit(this.search),this.ctx=$(this.el+" .economy-index-chart")[0].getContext("2d")}return t.prototype.reloadData=function(){var t;return t=this.searchForm.url(),t!==this.current_url?(this.current_url=t,$.ajax({url:this.searchForm.url(),async:!1,beforeSend:function(t){return function(t){return t.overrideMimeType("text/plain; charset=Shift_JIS")}}(this),success:function(t){return function(r){var e;return e=$.csv.toArrays(r),t.updateDataset(e)}}(this),error:function(t){return function(r,e,n){return $(t.el).html("data loading error: "+e)}}(this)})):void 0},t.prototype.updateDataset=function(t){var r,e,n,i,a,o,s,u,h,c;for(this.dataset={},o="9999/99",a="0000/00",r=e=0,i=t.length;i>e;r=++e)u=t[r],u[3]&&(c=parseInt(u[1]),s=parseInt(u[2].replace(/月/,"")),h=parseFloat(u[3]),c&&s&&h&&(n=c+"/"+("0"+s).substr(-2),this.dataset[n]=h,o>n&&(o=n),n>a&&(a=n)));return this.min||(this.min=o),this.max||(this.max=a),this.updateSearchForm()},t.prototype.updateSearchForm=function(){var t,r;return r=this.searchForm.startAt()||this.min,t=this.searchForm.endAt()||this.max,this.searchForm.update(r,t)},t.prototype.drawChart=function(){var t,r,e,n,i,a,o;e=[],i=[],a=this.dataset;for(r in a)o=a[r],this.min&&rthis.max||(e.push(r),i.push(o));return n={responsive:!0},t={labels:e,datasets:[{fillColor:"rgba(220,220,220,0.2)",strokeColor:"rgba(220,220,220,1)",pointColor:"rgba(220,220,220,1)",pointStrokeColor:"#fff",pointHighlightFill:"#fff",pointHighlightStroke:"rgba(220,220,220,1)",data:i}]},new Chart(this.ctx).Line(t,n)},t.prototype.search=function(){return this.min=this.searchForm.startAt(),this.max=this.searchForm.endAt(),this.reloadData(),this.drawChart()},t}(),$(function(){var t,r;return r=new i("#search"),t=new n("#content",r),r.submit()})},{}]},{},[1]); //# sourceMappingURL=app.js.map