mirror of
https://github.com/bspeice/bspeice.github.io
synced 2024-12-21 22:18:07 -05:00
870 lines
1.8 MiB
HTML
870 lines
1.8 MiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html lang="en">
|
|||
|
<head>
|
|||
|
<meta charset="utf-8">
|
|||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|||
|
<meta name="description" content="MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\(','\)']]}}); In [1]: from bokeh.plotting import figure, output_notebook, show from bokeh.palettes import PuBuGn9 as Palette import pandas ...">
|
|||
|
<meta name="keywords" content="weather">
|
|||
|
<link rel="icon" href="/favicon.ico">
|
|||
|
|
|||
|
<title>Complaining about the Weather - Bradlee Speice</title>
|
|||
|
|
|||
|
<!-- Stylesheets -->
|
|||
|
<link href="/theme/css/bootstrap.min.css" rel="stylesheet">
|
|||
|
<link href="/theme/css/fonts.css" rel="stylesheet">
|
|||
|
<link href="/theme/css/nest.css" rel="stylesheet">
|
|||
|
<link href="/theme/css/pygment.css" rel="stylesheet">
|
|||
|
<!-- /Stylesheets -->
|
|||
|
|
|||
|
<!-- RSS Feeds -->
|
|||
|
<!-- /RSS Feeds -->
|
|||
|
|
|||
|
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
|||
|
<!--[if lt IE 9]>
|
|||
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
|||
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
|||
|
<![endif]-->
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</head>
|
|||
|
|
|||
|
<body>
|
|||
|
|
|||
|
<!-- Header -->
|
|||
|
<div class="header-container gradient">
|
|||
|
|
|||
|
<!-- Static navbar -->
|
|||
|
<div class="container">
|
|||
|
<div class="header-nav">
|
|||
|
<div class="header-logo">
|
|||
|
<a class="pull-left" href="/"><img class="mr20" src="images/logo.svg" alt="logo">Bradlee Speice</a>
|
|||
|
</div>
|
|||
|
<div class="nav pull-right">
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<!-- /Static navbar -->
|
|||
|
|
|||
|
<!-- Header -->
|
|||
|
<!-- Header -->
|
|||
|
<div class="container header-wrapper">
|
|||
|
<div class="row">
|
|||
|
<div class="col-lg-12">
|
|||
|
<div class="header-content">
|
|||
|
<h1 class="header-title">Complaining about the Weather</h1>
|
|||
|
<p class="header-date"> <a href="/author/bradlee-speice.html">Bradlee Speice</a>, Fri 01 January 2016, <a href="/category/blog.html">Blog</a></p>
|
|||
|
<div class="header-underline"></div>
|
|||
|
<div class="clearfix"></div>
|
|||
|
<p class="pull-right header-tags">
|
|||
|
<span class="glyphicon glyphicon-tags mr5" aria-hidden="true"></span>
|
|||
|
<a href="/tag/weather.html">weather</a> </p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<!-- /Header -->
|
|||
|
<!-- /Header -->
|
|||
|
|
|||
|
</div>
|
|||
|
<!-- /Header -->
|
|||
|
|
|||
|
|
|||
|
<!-- Content -->
|
|||
|
<div class="container content">
|
|||
|
<script type="text/x-mathjax-config">
|
|||
|
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\(','\)']]}});
|
|||
|
</script>
|
|||
|
|
|||
|
<script async src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML'></script>
|
|||
|
|
|||
|
<p>
|
|||
|
<div class="cell border-box-sizing code_cell rendered">
|
|||
|
<div class="input">
|
|||
|
<div class="prompt input_prompt">In [1]:</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="input_area">
|
|||
|
<div class=" highlight hl-ipython3"><pre><span class="kn">from</span> <span class="nn">bokeh.plotting</span> <span class="k">import</span> <span class="n">figure</span><span class="p">,</span> <span class="n">output_notebook</span><span class="p">,</span> <span class="n">show</span>
|
|||
|
<span class="kn">from</span> <span class="nn">bokeh.palettes</span> <span class="k">import</span> <span class="n">PuBuGn9</span> <span class="k">as</span> <span class="n">Palette</span>
|
|||
|
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
|||
|
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
|||
|
<span class="kn">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">datetime</span>
|
|||
|
<span class="kn">import</span> <span class="nn">pickle</span>
|
|||
|
|
|||
|
<span class="n">output_notebook</span><span class="p">()</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="output_wrapper">
|
|||
|
<div class="output">
|
|||
|
|
|||
|
|
|||
|
<div class="output_area"><div class="prompt"></div>
|
|||
|
|
|||
|
<div class="output_html rendered_html output_subarea ">
|
|||
|
|
|||
|
<script type="text/javascript">
|
|||
|
/* BEGIN C:\Users\Bradlee Speice\Anaconda3\lib\site-packages\bokeh\server\static\js/bokeh.min.js */
|
|||
|
!function(){var define=void 0;!function t(e,i,n){function r(o,a){if(!i[o]){if(!e[o]){var l="function"==typeof require&&require;if(!a&&l)return l(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var h=i[o]={exports:{}};e[o][0].call(h.exports,function(t){var i=e[o][1][t];return r(i?i:t)},h,h.exports,t,e,i,n)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,e,i){var n,r;n={},n.require=t,n.version="0.10.0",n._=t("underscore"),n.$=t("jquery"),t("jquery-ui"),n.Backbone=t("backbone"),n.Backbone.$=n.$,n.Backbone.$.ui=n.$.ui,r=t("./common/logging"),n.logger=r.logger,n.set_log_level=r.set_log_level,window.Float64Array||(n.logger.warn("Float64Array is not supported. Using generic Array instead."),window.Float64Array=Array),n.index=t("./common/base").index,n.Collections=t("./common/base").Collections,n.Config=t("./common/base").Config,n.CartesianFrame=t("./common/cartesian_frame"),n.Canvas=t("./common/canvas"),n.GMapPlot=t("./common/gmap_plot"),n.GeoJSPlot=t("./common/geojs_plot"),n.GridPlot=t("./common/grid_plot"),n.HasParent=t("./common/has_parent"),n.HasProperties=t("./common/has_properties"),n.LayoutBox=t("./common/layout_box"),n.Plot=t("./common/plot"),n.Properties=t("./common/properties"),n.SelectionManager=t("./common/selection_manager"),n.Selector=t("./common/selector"),n.ToolEvents=t("./common/tool_events"),n.build_views=t("./common/build_views"),n.bulk_save=t("./common/bulk_save"),n.ContinuumView=t("./common/continuum_view"),n.load_models=t("./common/load_models"),n.PlotContext=t("./common/plot_context"),n.PlotWidget=t("./common/plot_widget"),n.Random=t("./common/random"),n.SVGColors=t("./common/svg_colors"),n.LinearMapper=t("./mapper/linear_mapper"),n.LogMapper=t("./mapper/log_mapper"),n.CategoricalMapper=t("./mapper/categorical_mapper"),n.GridMapper=t("./mapper/grid_mapper"),n.LinearColorMapper=t("./mapper/linear_color_mapper"),n.Palettes=t("./palettes/palettes"),n.BoxAnnotation=t("./renderer/annotation/box_annotation"),n.Legend=t("./renderer/annotation/legend"),n.Span=t("./renderer/annotation/span"),n.Tooltip=t("./renderer/annotation/tooltip"),n.CategoricalAxis=t("./renderer/guide/categorical_axis"),n.DatetimeAxis=t("./renderer/guide/datetime_axis"),n.Grid=t("./renderer/guide/grid"),n.LinearAxis=t("./renderer/guide/linear_axis"),n.LogAxis=t("./renderer/guide/log_axis"),n.BoxSelection=t("./renderer/overlay/box_selection"),n.PolySelection=t("./renderer/overlay/poly_selection"),n.embed=t("./server/embed"),n.serverutils=t("./server/serverutils"),n.ColumnDataSource=t("./source/column_data_source"),n.AbstractTicker=t("./ticking/abstract_ticker"),n.AdaptiveTicker=t("./ticking/adaptive_ticker"),n.BasicTicker=t("./ticking/basic_ticker"),n.BasicTickFormatter=t("./ticking/basic_tick_formatter"),n.LogTicker=t("./ticking/log_ticker"),n.LogTickFormatter=t("./ticking/log_tick_formatter"),n.CategoricalTicker=t("./ticking/categorical_ticker"),n.CategoricalTickFormatter=t("./ticking/categorical_tick_formatter"),n.CompositeTicker=t("./ticking/composite_ticker"),n.DatetimeTicker=t("./ticking/datetime_ticker"),n.DatetimeTickFormatter=t("./ticking/datetime_tick_formatter"),n.DaysTicker=t("./ticking/days_ticker"),n.MonthsTicker=t("./ticking/months_ticker"),n.SingleIntervalTicker=t("./ticking/single_interval_ticker"),n.YearsTicker=t("./ticking/years_ticker"),n.ActionTool=t("./tool/actions/action_tool"),n.PreviewSaveTool=t("./tool/actions/preview_save_tool"),n.ResetTool=t("./tool/actions/reset_tool"),n.HelpTool=t("./tool/actions/help_tool"),n.BoxSelectTool=t("./tool/gestures/box_select_tool"),n.BoxZoomTool=t("./tool/gestures/box_zoom_tool"),n.LassoSelectTool=t("./tool/gestures/lasso_select_tool"),n.PanTool=t("./tool/gestures/pan_tool"),n.PolySelectTool=t("./tool/gestures/poly_select_tool"),n.ResizeTool=t("./tool/gestures/resize_tool"),n.SelectTool=t("./tool/gestures/select_tool"),n.TapTool=t("./tool/gestures/tap_tool"),n.WheelZoomTool=t("./tool/gestures/wheel_zoom_tool"),n.InspectTool=t("./tool/inspectors/inspec
|
|||
|
this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function st(t,e){return e=e||{},e.recognizers=d(e.recognizers,st.defaults.preset),new ot(t,e)}function ot(t,e){e=e||{},this.options=u(e,st.defaults),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.element=t,this.input=D(this),this.touchAction=new $(this,this.options.touchAction),at(this,!0),a(e.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function at(t,e){var i=t.element;a(t.options.cssProps,function(t,n){i.style[x(i.style,n)]=e?t:""})}function lt(t,e){var n=i.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}var ut=["","webkit","moz","MS","ms","o"],ht=i.createElement("div"),ct="function",pt=Math.round,dt=Math.abs,ft=Date.now,gt=1,mt=/mobile|tablet|ip(ad|hone|od)|android/i,_t="ontouchstart"in t,vt=x(t,"PointerEvent")!==r,yt=_t&&mt.test(navigator.userAgent),bt="touch",wt="pen",xt="mouse",kt="kinect",Mt=25,Ct=1,Dt=2,Tt=4,St=8,At=1,Pt=2,Et=4,It=8,Nt=16,Rt=Pt|Et,zt=It|Nt,jt=Rt|zt,Ot=["x","y"],Ft=["clientX","clientY"];C.prototype={handler:function(){},init:function(){this.evEl&&f(this.element,this.evEl,this.domHandler),this.evTarget&&f(this.target,this.evTarget,this.domHandler),this.evWin&&f(M(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(M(this.element),this.evWin,this.domHandler)}};var Lt={mousedown:Ct,mousemove:Dt,mouseup:Tt},Ht="mousedown",Bt="mousemove mouseup";h(L,C,{handler:function(t){var e=Lt[t.type];e&Ct&&0===t.button&&(this.pressed=!0),e&Dt&&1!==t.which&&(e=Tt),this.pressed&&this.allow&&(e&Tt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:xt,srcEvent:t}))}});var Wt={pointerdown:Ct,pointermove:Dt,pointerup:Tt,pointercancel:St,pointerout:St},qt={2:bt,3:wt,4:xt,5:kt},Yt="pointerdown",Vt="pointermove pointerup pointercancel";t.MSPointerEvent&&(Yt="MSPointerDown",Vt="MSPointerMove MSPointerUp MSPointerCancel"),h(H,C,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),r=Wt[n],s=qt[t.pointerType]||t.pointerType,o=s==bt,a=y(e,t.pointerId,"pointerId");r&Ct&&(0===t.button||o)?0>a&&(e.push(t),a=e.length-1):r&(Tt|St)&&(i=!0),0>a||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),i&&e.splice(a,1))}});var $t={touchstart:Ct,touchmove:Dt,touchend:Tt,touchcancel:St},Ut="touchstart",Gt="touchstart touchmove touchend touchcancel";h(B,C,{handler:function(t){var e=$t[t.type];if(e===Ct&&(this.started=!0),this.started){var i=W.call(this,t,e);e&(Tt|St)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:bt,srcEvent:t})}}});var Xt={touchstart:Ct,touchmove:Dt,touchend:Tt,touchcancel:St},Zt="touchstart touchmove touchend touchcancel";h(q,C,{handler:function(t){var e=Xt[t.type],i=Y.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:bt,srcEvent:t})}}),h(V,C,{handler:function(t,e,i){var n=i.pointerType==bt,r=i.pointerType==xt;if(n)this.mouse.allow=!1;else if(r&&!this.mouse.allow)return;e&(Tt|St)&&(this.mouse.allow=!0),this.callback(t,e,i)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Jt=x(ht.style,"touchAction"),Qt=Jt!==r,Kt="compute",te="auto",ee="manipulation",ie="none",ne="pan-x",re="pan-y";$.prototype={set:function(t){t==Kt&&(t=this.compute()),Qt&&(this.manager.element.style[Jt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return a(this.manager.recognizers,function(e){p(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),U(t.join(" "))},preventDefaults:function(t){if(!Qt){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var n=this.actions,r=_(n,ie),s=_(n,re),o=_(n,n
|
|||
|
}),i}var s="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+n]=function(i){return i===e?a["inner"+n].call(this):this.each(function(){t(this).css(o,r(this,i)+"px")})},t.fn["outer"+n]=function(e,i){return"number"!=typeof e?a["outer"+n].call(this,e):this.each(function(){t(this).css(o,r(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,n){var r,s=t.ui[e].prototype;for(r in n)s.plugins[r]=s.plugins[r]||[],s.plugins[r].push([i,n[r]])},call:function(t,e,i){var n,r=t.plugins[e];if(r&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(n=0;n<r.length;n++)t.options[r[n][0]]&&r[n][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",r=!1;return e[n]>0?!0:(e[n]=1,r=e[n]>0,e[n]=0,r)}})}(n)},{jquery:18}],8:[function(t,e,i){var n=t("jquery");t("./core"),function(t,e){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.dpDiv=n(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(s.inl
|
|||
|
R.setDate(R.getDate()+1),R=this._daylightSavingAdjust(R);T+=j+"</tr>"}K++,K>11&&(K=0,tt++),T+="</tbody></table>"+(X?"</div>"+($[0]>0&&M===$[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=T}b+=k}return b+=u,t._keyEvent=!1,b},_generateMonthYearHeader:function(t,e,i,n,r,s,o,a){var l,u,h,c,p,d,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),y="<div class='ui-datepicker-title'>",b="";if(s||!m)b+="<span class='ui-datepicker-month'>"+o[e]+"</span>";else{for(l=n&&n.getFullYear()===i,u=r&&r.getFullYear()===i,b+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",h=0;12>h;h++)(!l||h>=n.getMonth())&&(!u||h<=r.getMonth())&&(b+="<option value='"+h+"'"+(h===e?" selected='selected'":"")+">"+a[h]+"</option>");b+="</select>"}if(v||(y+=b+(!s&&m&&_?"":" ")),!t.yearshtml)if(t.yearshtml="",s||!_)y+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(c=this._get(t,"yearRange").split(":"),p=(new Date).getFullYear(),d=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?p+parseInt(t,10):parseInt(t,10);return isNaN(e)?p:e},f=d(c[0]),g=Math.max(f,d(c[1]||"")),f=n?Math.max(f,n.getFullYear()):f,g=r?Math.min(g,r.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",y+=t.yearshtml,t.yearshtml=null}return y+=this._get(t,"yearSuffix"),v&&(y+=(!s&&m&&_?"":" ")+b),y+="</div>"},_adjustInstDate:function(t,e,i){var n=t.drawYear+("Y"===i?e:0),r=t.drawMonth+("M"===i?e:0),s=Math.min(t.selectedDay,this._getDaysInMonth(n,r))+("D"===i?e:0),o=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(n,r,s)));t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),n=this._getMinMaxDate(t,"max"),r=i&&i>e?i:e;return n&&r>n?n:r},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,n){var r=this._getNumberOfMonths(t),s=this._daylightSavingAdjust(new Date(i,n+(0>e?e:r[0]*r[1]),1));return 0>e&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(t,s)},_isInRange:function(t,e){var i,n,r=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),o=null,a=null,l=this._get(t,"yearRange");return l&&(i=l.split(":"),n=(new Date).getFullYear(),o=parseInt(i[0],10),a=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=n),i[1].match(/[+\-].*/)&&(a+=n)),(!r||e.getTime()>=r.getTime())&&(!s||e.getTime()<=s.getTime())&&(!o||e.getFullYear()>=o)&&(!a||e.getFullYear()<=a)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,n){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var r=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(n,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),r,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===
|
|||
|
outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+n]=function(i){return i===e?a["inner"+n].call(this):this.each(function(){t(this).css(o,r(this,i)+"px")})},t.fn["outer"+n]=function(e,i){return"number"!=typeof e?a["outer"+n].call(this,e):this.each(function(){t(this).css(o,r(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,n){var r,s=t.ui[e].prototype;for(r in n)s.plugins[r]=s.plugins[r]||[],s.plugins[r].push([i,n[r]])},call:function(t,e,i){var n,r=t.plugins[e];if(r&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(n=0;n<r.length;n++)t.options[r[n][0]]&&r[n][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",r=!1;return e[n]>0?!0:(e[n]=1,r=e[n]>0,e[n]=0,r)}})}(n),function(t,e){var i=0,n=Array.prototype.slice,r=t.cleanData;t.cleanData=function(e){for(var i,n=0;null!=(i=e[n]);n++)try{t(i).triggerHandler("remove")}catch(s){}r(e)},t.widget=function(e,i,n){var r,s,o,a,l={},u=e.split(".")[0];e=e.split(".")[1],r=u+"-"+e,n||(n=i,i=t.Widget),t.expr[":"][r.toLowerCase()]=function(e){return!!t.data(e,r)},t[u]=t[u]||{},s=t[u][e],o=t[u][e]=function(t,e){return this._createWidget?void(arguments.length&&this._createWidget(t,e)):new o(t,e)},t.extend(o,s,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(n,function(e,n){return t.isFunction(n)?void(l[e]=function(){var t=function(){return i.prototype[e].apply(this,arguments)},r=function(t){return i.prototype[e].apply(this,t)};return function(){var e,i=this._super,s=this._superApply;return this._super=t,this._superApply=r,e=n.apply(this,arguments),this._super=i,this._superApply=s,e}}()):void(l[e]=n)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:s?a.widgetEventPrefix:e},l,{constructor:o,namespace:u,widgetName:e,widgetFullName:r}),s?(t.each(s._childConstructors,function(e,i){var n=i.prototype;t.widget(n.namespace+"."+n.widgetName,o,i._proto)}),delete s._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o)},t.widget.extend=function(i){for(var r,s,o=n.call(arguments,1),a=0,l=o.length;l>a;a++)for(r in o[a])s=o[a][r],o[a].hasOwnProperty(r)&&s!==e&&(t.isPlainObject(s)?i[r]=t.isPlainObject(i[r])?t.widget.extend({},i[r],s):t.widget.extend({},s):i[r]=s);return i},t.widget.bridge=function(i,r){var s=r.prototype.widgetFullName||i;t.fn[i]=function(o){var a="string"==typeof o,l=n.call(arguments,1),u=this;return o=!a&&l.length?t.widget.extend.apply(null,[o].concat(l)):o,a?this.each(function(){var n,r=t.data(this,s);return r?t.isFunction(r[o])&&"_"!==o.charAt(0)?(n=r[o].apply(r,l),n!==r&&n!==e?(u=n&&n.jquery?u.pushStack(n.get()):n,!1):void 0):t.error("no such method '"+o+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+o+"'")}):this.each(function(){var e=t.data(this,s);e?e.option(o||{})._init():t.data(this,s,new r(o,this))}),u}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,n){n=t(n||this.defaultElement||this)[0],this.element=t(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t
|
|||
|
return o>=h&&c>=a&&l>=p&&d>=u;case"intersect":return h<o+t.helperProportions.width/2&&a-t.helperProportions.width/2<c&&p<l+t.helperProportions.height/2&&u-t.helperProportions.height/2<d;case"pointer":return r=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,s=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,i(s,p,e.proportions.height)&&i(r,h,e.proportions.width);case"touch":return(l>=p&&d>=l||u>=p&&d>=u||p>l&&u>d)&&(o>=h&&c>=o||a>=h&&c>=a||h>o&&a>c);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var n,r,s=t.ui.ddmanager.droppables[e.options.scope]||[],o=i?i.type:null,a=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(n=0;n<s.length;n++)if(!(s[n].options.disabled||e&&!s[n].accept.call(s[n].element[0],e.currentItem||e.element))){for(r=0;r<a.length;r++)if(a[r]===s[n].element[0]){s[n].proportions.height=0;continue t}s[n].visible="none"!==s[n].element.css("display"),s[n].visible&&("mousedown"===o&&s[n]._activate.call(s[n],i),s[n].offset=s[n].element.offset(),s[n].proportions={width:s[n].element[0].offsetWidth,height:s[n].element[0].offsetHeight})}},drop:function(e,i){var n=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(n=this._drop.call(this,i)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),n},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var n,r,s,o=t.ui.intersect(e,this,this.options.tolerance),a=!o&&this.isover?"isout":o&&!this.isover?"isover":null;a&&(this.options.greedy&&(r=this.options.scope,s=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===r}),s.length&&(n=t.data(s[0],"ui-droppable"),n.greedyChild="isover"===a)),n&&"isover"===a&&(n.isover=!1,n.isout=!0,n._out.call(n,i)),this[a]=!0,this["isout"===a?"isover":"isout"]=!1,this["isover"===a?"_over":"_out"].call(this,i),n&&"isout"===a&&(n.isout=!1,n.isover=!0,n._over.call(n,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}}(n),function(t,e){function i(t){return parseInt(t,10)||0}function n(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,n,r,s,o=this,a=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBotto
|
|||
|
return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?d:s<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<o&&a<n+this.helperProportions.height/2&&r-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var e="x"===this.options.axis||i(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||i(this.positionAbs.left+this.offset.click.left,t.left,t.width),r=e&&n,s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return r?this.floating?o&&"right"===o||"down"===s?2:1:s&&("down"===s?2:1):!1},_intersectsWithSides:function(t){var e=i(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),n=i(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),r=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?"right"===s&&n||"left"===s&&!n:r&&("down"===r&&e||"up"===r&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i,n,r,s,o=[],a=[],l=this._connectWith();if(l&&e)for(i=l.length-1;i>=0;i--)for(r=t(l[i]),n=r.length-1;n>=0;n--)s=t.data(r[n],this.widgetFullName),s&&s!==this&&!s.options.disabled&&a.push([t.isFunction(s.options.items)?s.options.items.call(s.element):t(s.options.items,s.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),s]);for(a.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=a.length-1;i>=0;i--)a[i][0].each(function(){o.push(this)});return t(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;i<e.length;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,n,r,s,o,a,l,u,h=this.items,c=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],p=this._connectWith();if(p&&this.ready)for(i=p.length-1;i>=0;i--)for(r=t(p[i]),n=r.length-1;n>=0;n--)s=t.data(r[n],this.widgetFullName),s&&s!==this&&!s.options.disabled&&(c.push([t.isFunction(s.options.items)?s.options.items.call(s.element[0],e,{item:this.currentItem}):t(s.options.items,s.element),s]),this.containers.push(s));for(i=c.length-1;i>=0;i--)for(o=c[i][1],a=c[i][0],n=0,u=a.length;u>n;n++)l=t(a[n]),l.data(this.widgetName+"-item",o),h.push({item:l,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,n,r,s;for(i=this.items.length-1;i>=0;i--)n=this.items[i],n.instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]||(r=this.options.toleranceElement?t(this.options.toleranceElement,n.item):n.item,e||(n.width=r.outerWidth(),n.height=r.outerHeight()),s=r.offset(),n.left=s.left,n.top=s.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)s=this.containers[i].element.offset(),this.containers[i].containerCache.left=s.left,this.containers[i].containerCache.top=s.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e|
|
|||
|
this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var e,n=this.options,r=n.heightStyle,s=this.element.parent(),o=this.accordionId="ui-accordion-"+(this.element.attr("id")||++i);this.active=this._findActive(n.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),n=i.attr("id"),r=i.next(),s=r.attr("id");n||(n=o+"-header-"+e,i.attr("id",n)),s||(s=o+"-panel-"+e,r.attr("id",s)),i.attr("aria-controls",s),r.attr("aria-labelledby",n)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(n.event),"fill"===r?(e=s.height(),this.element.siblings(":visible").each(function(){var i=t(this),n=i.css("position");"absolute"!==n&&"fixed"!==n&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===r&&(e=0,this.headers.next().each(function(){e=Math.max(e,t(this).css("height","").height())}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,n=this.active,r=t(e.currentTarget),s=r[0]===n[0],o=s&&i.collapsible,a=o?t():r.next(),l=n.next(),u={oldHeader:n,oldPanel:l,newHeader:o?t():r,newPanel:a};e.preventDefault(),s&&!i.collapsible||this._trigger("beforeActivate",e,u)===!1||(i.active=o?!1:this.headers.index(r),this.active=s?t():r,this._toggle(u),n.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),s||(r.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&r.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),r.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,n=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=n,this.options.animate?this._animate(i,n,e):(n.hide(),i.show(),this._toggleComplete(e)),n.attr({"aria-expanded":"false","aria-hidden":"true"}),n.prev().attr("aria-selected","false"),i.length&&n.length?n.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(t,e,i){var s,o,a,l=this,u=0,h=t.length&&(!e.length||t.index()<e.index()),c=this.options.animate||{},p=h&&c.down||c,d=function(){l._toggleComplete(i)};return"number"==typeof p&&(a=p),"string"==typeof p&&(o=p),o=o||p.easing||c.easing,a=a||p.duration||c.duration,e.length?t.length?(s=t.show().outerHeight(),e.animate(n,{duration:a,easing:o,step:function(t,e){e.now=
|
|||
|
t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),o=!1,t(e).parents().each(function(){return o|="fixed"===t(this).css("position"),!o}),a={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),a=t.datepicker._checkOffset(i,a,o),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":o?"fixed":"absolute",display:"none",left:a.left+"px",top:a.top+"px"}),i.inline||(l=t.datepicker._get(i,"showAnim"),u=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[l]?i.dpDiv.show(l,t.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),t.datepicker._shouldFocusInput(i)&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,s=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,n=this._getNumberOfMonths(e),r=n[1],o=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),r>1&&e.dpDiv.addClass("ui-datepicker-multi-"+r).css("width",o*r+"em"),e.dpDiv[(1!==n[0]||1!==n[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,n){var r=e.dpDiv.outerWidth(),s=e.dpDiv.outerHeight(),o=e.input?e.input.outerWidth():0,a=e.input?e.input.outerHeight():0,l=document.documentElement.clientWidth+(n?0:t(document).scrollLeft()),u=document.documentElement.clientHeight+(n?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?r-o:0,i.left-=n&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=n&&i.top===e.input.offset().top+a?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+r>l&&l>r?Math.abs(i.left+r-l):0),i.top-=Math.min(i.top,i.top+s>u&&u>s?Math.abs(s+a):0),i},_findPos:function(e){for(var i,n=this._getInst(e),r=this._get(n,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[r?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,n,r,s,a=this._curInst;!a||e&&a!==t.data(e,o)||this._datepickerShowing&&(i=this._get(a,"showAnim"),n=this._get(a,"duration"),r=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),n,r):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?n:null,r),i||r(),this._datepickerShowing=!1,s=this._get(a,"onClose"),s&&s.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),n=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==n)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,n){var r=t(e),s=this._getInst(r[0]);this._isDisabledDatepicker(r[0])||(this._adju
|
|||
|
},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(n){e._allowInteraction(n)||(n.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,n=[],r=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(n=i.split?i.split(" "):[i[0],i[1]],1===n.length&&(n[1]=n[0]),t.each(["left","top"],function(t,e){+n[t]===n[t]&&(r[t]=n[t],n[t]=e)}),i={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})}(n),function(t,e){var i=/up|down|vertical/,n=/up|left|vertical|horizontal/;t.effects.effect.blind=function(e,r){var s,o,a,l=t(this),u=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(l,e.mode||"hide"),c=e.direction||"up",p=i.test(c),d=p?"height":"width",f=p?"top":"left",g=n.test(c),m={},_="show"===h;l.parent().is(".ui-effects-wrapper")?t.effects.save(l.parent(),u):t.effects.save(l,u),l.show(),s=t.effects.createWrapper(l).css({overflow:"hidden"}),o=s[d](),a=parseFloat(s.css(f))||0,m[d]=_?o:0,g||(l.css(p?"bottom":"right",0).css(p?"top":"left","auto").css({position:"absolute"}),m[f]=_?a:o+a),_&&(s.css(d,0),g||s.css(f,a+o)),s.animate(m,{duration:e.duration,easing:e.easing,queue:!1,complete:function(){"hide"===h&&l.hide(),t.effects.restore(l,u),t.effects.removeWrapper(l),r()}})}}(n),function(t,e){t.effects.effect.bounce=function(e,i){var n,r,s,o=t(this),a=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"effect"),u="hide"===l,h="show"===l,c=e.direction||"up",p=e.distance,d=e.times||5,f=2*d+(h||u?1:0),g=e.duration/f,m=e.easing,_="up"===c||"down"===c?"top":"left",v="up"===c||"left"===c,y=o.queue(),b=y.length;for((h||u)&&a.push("opacity"),t.effects.save(o,a),o.show(),t.effects.createWrapper(o),p||(p=o["top"===_?"outerHeight":"outerWidth"]()/3),h&&(s={opacity:1},s[_]=0,o.css("opacity",0).css(_,v?2*-p:2*p).animate(s,g,m)),u&&(p/=Math.pow(2,d-1)),s={},s[_]=0,n=0;d>n;n++)r={},r[_]=(v?"-=":"+=")+p,o.animate(r,g,m).animate(s,g,m),p=u?2*p:p/2;u&&(r={opacity:0},r[_]=(v?"-=":"+=")+p,o.animate(r,g,m)),o.queue(function(){u&&o.hide(),t.effects.restore(o,a),t.effects.removeWrapper(o),i()}),b>1&&y.splice.apply(y,[1,0].concat(y.splice(b,f+1))),o.dequeue()}}(n),function(t,e){t.effects.effect.clip=function(e,i){var n,r,s,o=t(this),a=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"hide"),u="show"===l,h=e.direction||"vertical",c="vertical"===h,p=c?"height":"width",d=c?"top":"left",f={};t.effects.save(o,a),o.show(),n=t.effects.createWrapper(o).css({overflow:"hidden"}),r="IMG"===o[0].tagName?n:o,s=r[p](),u&&(r.css(p,0),r.css(d,s/2)),f[p]=u?s:0,f[d]=u?0:s/2,r.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){u||o.hide(),t.effects.rest
|
|||
|
r.length>i&&(r.slice(i).remove(),r=r.slice(0,i)),e=r.length;i>e;e++)o.push(s);this.handles=r.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):this.range=t([])},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,n,r,s,o,a,l,u,h=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(i),r=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(n-h.values(e));(r>i||r===i&&(e===h._lastChangedValue||h.values(e)===c.min))&&(r=i,s=t(this),o=e)}),a=this._start(e,o),a===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),l=s.offset(),u=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=u?{left:0,top:0}:{left:e.pageX-l.left-s.width()/2,top:e.pageY-l.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,n),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,n,r,s;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),n=i/e,n>1&&(n=1),0>n&&(n=0),"vertical"===this.orientation&&(n=1-n),r=this._valueMax()-this._valueMin(),s=this._valueMin()+n*r,this._trimAlignValue(s)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var n,r,s;this.options.values&&this.options.values.length?(n=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>n||1===e&&n>i)&&(i=n),i!==this.values(e)&&(r=this.values(),r[e]=i,s=this._trigger("slide",t,{handle:this.handles[e],value:i,values:r}),n=this.values(e?0:1),s!==!1&&this.values(e,i,!0))):i!==this.value()&&(s=this._trigger("slide",t,{handle:this.handles[e],value:i}),s!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.
|
|||
|
t("./position"),function(t,e){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,s,o,a,l=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:l=!1,r=this.previousFilter||"",s=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),s===r?o=!0:s=r+s,a=new RegExp("^"+i(s),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return a.test(t(this).children("a").text())}),n=o&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n,n.length||(s=String.fromCharCode(e.keyCode),a=new RegExp("^"+i(s),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return a.test(t(this).children("a").text())})),n.length?(this.focus(e,n),n.length>1?(this.previousFilter=s,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&
|
|||
|
}}),e.placeholder=t(n.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),n.placeholder.update(e,e.placeholder)},_contactContainers:function(e){var r,s,o,a,l,u,h,c,p,d,f=null,g=null;for(r=this.containers.length-1;r>=0;r--)if(!t.contains(this.currentItem[0],this.containers[r].element[0]))if(this._intersectsWith(this.containers[r].containerCache)){if(f&&t.contains(this.containers[r].element[0],f.element[0]))continue;f=this.containers[r],g=r}else this.containers[r].containerCache.over&&(this.containers[r]._trigger("out",e,this._uiHash(this)),this.containers[r].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",e,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(o=1e4,a=null,d=f.floating||n(this.currentItem),l=d?"left":"top",u=d?"width":"height",h=this.positionAbs[l]+this.offset.click[l],s=this.items.length-1;s>=0;s--)t.contains(this.containers[g].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(!d||i(this.positionAbs.top+this.offset.click.top,this.items[s].top,this.items[s].height))&&(c=this.items[s].item.offset()[l],p=!1,Math.abs(c-h)>Math.abs(c+this.items[s][u]-h)&&(p=!0,c+=this.items[s][u]),Math.abs(c-h)<o&&(o=Math.abs(c-h),a=this.items[s],this.direction=p?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;a?this._rearrange(e,a,null,!0):this._rearrange(e,null,this.containers[g].element,!0),this._trigger("change",e,this._uiHash()),this.containers[g]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",e,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,n=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!n[0].style.width||i.forceHelperSize)&&n.width(this.currentItem.width()),(!n[0].style.height||i.forceHelperSize)&&n.height(this.currentItem.height()),n},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this
|
|||
|
for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&K.extend(!0,t,n),t}function F(t,e,i){for(var n,r,s,o,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(r in a)if(a[r]&&a[r].test(n)){l.unshift(r);break}if(l[0]in i)s=l[0];else{for(r in i){if(!l[0]||t.converters[r+" "+l[0]]){s=r;break}o||(o=r)}s=s||o}return s?(s!==l[0]&&l.unshift(s),i[s]):void 0}function L(t,e,i,n){var r,s,o,a,l,u={},h=t.dataTypes.slice();if(h[1])for(o in t.converters)u[o.toLowerCase()]=t.converters[o];for(s=h.shift();s;)if(t.responseFields[s]&&(i[t.responseFields[s]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=s,s=h.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(o=u[l+" "+s]||u["* "+s],!o)for(r in u)if(a=r.split(" "),a[1]===s&&(o=u[l+" "+a[0]]||u["* "+a[0]])){o===!0?o=u[r]:u[r]!==!0&&(s=a[0],h.unshift(a[1]));break}if(o!==!0)if(o&&t["throws"])e=o(e);else try{e=o(e)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+l+" to "+s}}}return{state:"success",data:e}}function H(t,e,i,n){var r;if(K.isArray(e))K.each(e,function(e,r){i||Me.test(t)?n(t,r):H(t+"["+("object"==typeof r?e:"")+"]",r,i,n)});else if(i||"object"!==K.type(e))n(t,e);else for(r in e)H(t+"["+r+"]",e[r],i,n)}function B(t){return K.isWindow(t)?t:9===t.nodeType&&t.defaultView}var W=[],q=W.slice,Y=W.concat,V=W.push,$=W.indexOf,U={},G=U.toString,X=U.hasOwnProperty,Z={},J=t.document,Q="2.1.3",K=function(t,e){return new K.fn.init(t,e)},tt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,et=/^-ms-/,it=/-([\da-z])/gi,nt=function(t,e){return e.toUpperCase()};K.fn=K.prototype={jquery:Q,constructor:K,selector:"",length:0,toArray:function(){return q.call(this)},get:function(t){return null!=t?0>t?this[t+this.length]:this[t]:q.call(this)},pushStack:function(t){var e=K.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t,e){return K.each(this,t,e)},map:function(t){return this.pushStack(K.map(this,function(e,i){return t.call(e,i,e)}))},slice:function(){return this.pushStack(q.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,i=+t+(0>t?e:0);return this.pushStack(i>=0&&e>i?[this[i]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:V,sort:W.sort,splice:W.splice},K.extend=K.fn.extend=function(){var t,e,i,n,r,s,o=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof o&&(u=o,o=arguments[a]||{},a++),"object"==typeof o||K.isFunction(o)||(o={}),a===l&&(o=this,a--);l>a;a++)if(null!=(t=arguments[a]))for(e in t)i=o[e],n=t[e],o!==n&&(u&&n&&(K.isPlainObject(n)||(r=K.isArray(n)))?(r?(r=!1,s=i&&K.isArray(i)?i:[]):s=i&&K.isPlainObject(i)?i:{},o[e]=K.extend(u,s,n)):void 0!==n&&(o[e]=n));return o},K.extend({expando:"jQuery"+(Q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===K.type(t)},isArray:Array.isArray,isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){return!K.isArray(t)&&t-parseFloat(t)+1>=0},isPlainObject:function(t){return"object"!==K.type(t)||t.nodeType||K.isWindow(t)?!1:t.constructor&&!X.call(t.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?U[G.call(t)]||"object":typeof t},globalEval:function(t){var e,i=eval;t=K.trim(t),t&&(1===t.indexOf("use strict")?(e=J.createElement("script"),e.text=t,J.head.appendChild(e).parentNode.removeChild(e)):i(t))},camelCase:function(t){return t.replace(et,"ms-").replace(it,nt)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,n){var r,s=0,o=t.length,a=i(t);if(n){if(a)for(;o>s&&(r=e.apply(t[s],n),r!==!1);s++);else for(s in t)if(r=e.apply(t[s],n),r===!1)break}else if(a)for(;o>s&&(r=e.call(t[s],s,t[s]),r!==!1);s++);else for(s in t)if(r=e.call(t[s],s,t[s]),r===!1)break;return t},trim:function(t){return null==t?"":(t+"").rep
|
|||
|
},removeData:function(t,e){vt.remove(t,e)},_data:function(t,e,i){return _t.access(t,e,i)},_removeData:function(t,e){_t.remove(t,e)}}),K.fn.extend({data:function(t,e){var i,n,r,s=this[0],o=s&&s.attributes;if(void 0===t){if(this.length&&(r=vt.get(s),1===s.nodeType&&!_t.get(s,"hasDataAttrs"))){for(i=o.length;i--;)o[i]&&(n=o[i].name,0===n.indexOf("data-")&&(n=K.camelCase(n.slice(5)),l(s,n,r[n])));_t.set(s,"hasDataAttrs",!0)}return r}return"object"==typeof t?this.each(function(){vt.set(this,t)}):mt(this,function(e){var i,n=K.camelCase(t);if(s&&void 0===e){if(i=vt.get(s,t),void 0!==i)return i;if(i=vt.get(s,n),void 0!==i)return i;if(i=l(s,n,void 0),void 0!==i)return i}else this.each(function(){var i=vt.get(this,n);vt.set(this,n,e),-1!==t.indexOf("-")&&void 0!==i&&vt.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){vt.remove(this,t)})}}),K.extend({queue:function(t,e,i){var n;return t?(e=(e||"fx")+"queue",n=_t.get(t,e),i&&(!n||K.isArray(i)?n=_t.access(t,e,K.makeArray(i)):n.push(i)),n||[]):void 0},dequeue:function(t,e){e=e||"fx";var i=K.queue(t,e),n=i.length,r=i.shift(),s=K._queueHooks(t,e),o=function(){K.dequeue(t,e)};"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===e&&i.unshift("inprogress"),delete s.stop,r.call(t,o,s)),!n&&s&&s.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return _t.get(t,i)||_t.access(t,i,{empty:K.Callbacks("once memory").add(function(){_t.remove(t,[e+"queue",i])})})}}),K.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?K.queue(this[0],t):void 0===e?this:this.each(function(){var i=K.queue(this,t,e);K._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&K.dequeue(this,t)})},dequeue:function(t){return this.each(function(){K.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,n=1,r=K.Deferred(),s=this,o=this.length,a=function(){--n||r.resolveWith(s,[s])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";o--;)i=_t.get(s[o],t+"queueHooks"),i&&i.empty&&(n++,i.empty.add(a));return a(),r.promise(e)}});var wt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,xt=["Top","Right","Bottom","Left"],kt=function(t,e){return t=e||t,"none"===K.css(t,"display")||!K.contains(t.ownerDocument,t)},Mt=/^(?:checkbox|radio)$/i;!function(){var t=J.createDocumentFragment(),e=t.appendChild(J.createElement("div")),i=J.createElement("input");i.setAttribute("type","radio"),i.setAttribute("checked","checked"),i.setAttribute("name","t"),e.appendChild(i),Z.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",Z.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Ct="undefined";Z.focusinBubbles="onfocusin"in t;var Dt=/^key/,Tt=/^(?:mouse|pointer|contextmenu)|click/,St=/^(?:focusinfocus|focusoutblur)$/,At=/^([^.]*)(?:\.(.+)|)$/;K.event={global:{},add:function(t,e,i,n,r){var s,o,a,l,u,h,c,p,d,f,g,m=_t.get(t);if(m)for(i.handler&&(s=i,i=s.handler,r=s.selector),i.guid||(i.guid=K.guid++),(l=m.events)||(l=m.events={}),(o=m.handle)||(o=m.handle=function(e){return typeof K!==Ct&&K.event.triggered!==e.type?K.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(dt)||[""],u=e.length;u--;)a=At.exec(e[u])||[],d=g=a[1],f=(a[2]||"").split(".").sort(),d&&(c=K.event.special[d]||{},d=(r?c.delegateType:c.bindType)||d,c=K.event.special[d]||{},h=K.extend({type:d,origType:g,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&K.expr.match.needsContext.test(r),namespace:f.join(".")},s),(p=l[d])||(p=l[d]=[],p.delegateCount=0,c.setup&&c.setup.call(t,n,f,o)!==!1||t.addEventListener&&t.addEventListener(d,o,!1)),c.add&&(c.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),r?p.splice(p.delegateCount++,0,h):p.push(h),K.event.global[d]=!0)},remove:function(t,e,i,n,r){var s,o,a,l,u,h,c,p,d,f,g,m=_t.hasData(t)&&_t.get(t);if(m&&(l=m.events)){for(e=(e||"").match(dt)||[""],u=e.length;u--;)if(a=At.exec(e[u])||[],d=g=a[1],f=(a[2]||"").split(".").sort(),d){for(c=K.event.special[d]||{},d=(n?c.delegateType:c.bindType)||d,p=l[d]||[],a=a[2]&&new RegExp("(^|\
|
|||
|
xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":K.parseJSON,"text xml":K.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?O(O(t,K.ajaxSettings),e):O(K.ajaxSettings,t)},ajaxPrefilter:z(ve),ajaxTransport:z(ye),ajax:function(t,e){function i(t,e,i,o){var l,h,_,v,b,x=e;2!==y&&(y=2,a&&clearTimeout(a),n=void 0,s=o||"",w.readyState=t>0?4:0,l=t>=200&&300>t||304===t,i&&(v=F(c,w,i)),v=L(c,v,w,l),l?(c.ifModified&&(b=w.getResponseHeader("Last-Modified"),b&&(K.lastModified[r]=b),b=w.getResponseHeader("etag"),b&&(K.etag[r]=b)),204===t||"HEAD"===c.type?x="nocontent":304===t?x="notmodified":(x=v.state,h=v.data,_=v.error,l=!_)):(_=x,(t||!x)&&(x="error",0>t&&(t=0))),w.status=t,w.statusText=(e||x)+"",l?f.resolveWith(p,[h,x,w]):f.rejectWith(p,[w,x,_]),w.statusCode(m),m=void 0,u&&d.trigger(l?"ajaxSuccess":"ajaxError",[w,c,l?h:_]),g.fireWith(p,[w,x]),u&&(d.trigger("ajaxComplete",[w,c]),--K.active||K.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,r,s,o,a,l,u,h,c=K.ajaxSetup({},e),p=c.context||c,d=c.context&&(p.nodeType||p.jquery)?K(p):K.event,f=K.Deferred(),g=K.Callbacks("once memory"),m=c.statusCode||{},_={},v={},y=0,b="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(2===y){if(!o)for(o={};e=de.exec(s);)o[e[1].toLowerCase()]=e[2];e=o[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===y?s:null},setRequestHeader:function(t,e){var i=t.toLowerCase();return y||(t=v[i]=v[i]||t,_[t]=e),this},overrideMimeType:function(t){return y||(c.mimeType=t),this},statusCode:function(t){var e;if(t)if(2>y)for(e in t)m[e]=[m[e],t[e]];else w.always(t[w.status]);return this},abort:function(t){var e=t||b;return n&&n.abort(e),i(0,e),this}};if(f.promise(w).complete=g.add,w.success=w.done,w.error=w.fail,c.url=((t||c.url||we)+"").replace(ce,"").replace(me,xe[1]+"//"),c.type=e.method||e.type||c.method||c.type,c.dataTypes=K.trim(c.dataType||"*").toLowerCase().match(dt)||[""],null==c.crossDomain&&(l=_e.exec(c.url.toLowerCase()),c.crossDomain=!(!l||l[1]===xe[1]&&l[2]===xe[2]&&(l[3]||("http:"===l[1]?"80":"443"))===(xe[3]||("http:"===xe[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=K.param(c.data,c.traditional)),j(ve,c,e,w),2===y)return w;u=K.event&&c.global,u&&0===K.active++&&K.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!ge.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(he.test(r)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=pe.test(r)?r.replace(pe,"$1_="+ue++):r+(he.test(r)?"&":"?")+"_="+ue++)),c.ifModified&&(K.lastModified[r]&&w.setRequestHeader("If-Modified-Since",K.lastModified[r]),K.etag[r]&&w.setRequestHeader("If-None-Match",K.etag[r])),(c.data&&c.hasContent&&c.contentType!==!1||e.contentType)&&w.setRequestHeader("Content-Type",c.contentType),w.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+be+"; q=0.01":""):c.accepts["*"]);for(h in c.headers)w.setRequestHeader(h,c.headers[h]);if(c.beforeSend&&(c.beforeSend.call(p,w,c)===!1||2===y))return w.abort();b="abort";for(h in{success:1,error:1,complete:1})w[h](c[h]);if(n=j(ye,c,e,w)){w.readyState=1,u&&d.trigger("ajaxSend",[w,c]),c.async&&c.timeout>0&&(a=setTimeout(function(){w.abort("timeout")},c.timeout));try{y=1,n.send(_,i)}catch(x){if(!(2>y))throw x;i(-1,x)}}else i(-1,"No Transport");return w},getJSON:function(t,e,i){return K.get(t,e,i,"json")},getScript:function(t,e){return K.get(t,void 0,e,"script")}}),K.each(["get","post"],function(t,e){K[e]=function(t,i,n,r){return K.isFunction(i)&&(r=r||n,n=i,i=void 0),K.ajax({url:t,type:e,dataType:r,data:i,success:n})}}),K._evalUrl=function(t){return K.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},K.fn.extend({wrapAll:function(t){var e;return K.isFunction(t)?this.each(function(e){K(this).wrapAll(t.call(this,e))
|
|||
|
e=0,k>0)i=n;else{if(!(0>k))return i=n,void(r=-this.b);i=-n}return o=w*w+x*x,s=Math.sqrt(o),a=k*h,u=Math.sqrt(a*a+o),d=a/u,g=s/u,f=d*d*d,l=k+this.b*this.ep2*f,y=s-this.a*this.es*g*g*g,p=Math.sqrt(l*l+y*y),m=l/p,_=y/p,v=this.a/Math.sqrt(1-this.es*m*m),r=_>=c?s/_-v:-c>=_?s/-_-v:k/m+v*(this.es-1),b===!1&&(i=Math.atan(m/_)),t.x=e,t.y=i,t.z=r,t},geocentric_to_wgs84:function(t){if(this.datum_type===r)t.x+=this.datum_params[0],t.y+=this.datum_params[1],t.z+=this.datum_params[2];else if(this.datum_type===s){var e=this.datum_params[0],i=this.datum_params[1],n=this.datum_params[2],o=this.datum_params[3],a=this.datum_params[4],l=this.datum_params[5],u=this.datum_params[6],h=u*(t.x-l*t.y+a*t.z)+e,c=u*(l*t.x+t.y-o*t.z)+i,p=u*(-a*t.x+o*t.y+t.z)+n;t.x=h,t.y=c,t.z=p}},geocentric_from_wgs84:function(t){if(this.datum_type===r)t.x-=this.datum_params[0],t.y-=this.datum_params[1],t.z-=this.datum_params[2];else if(this.datum_type===s){var e=this.datum_params[0],i=this.datum_params[1],n=this.datum_params[2],o=this.datum_params[3],a=this.datum_params[4],l=this.datum_params[5],u=this.datum_params[6],h=(t.x-e)/u,c=(t.y-i)/u,p=(t.z-n)/u;t.x=h+l*c-a*p,t.y=-l*h+c+o*p,t.z=a*h-o*c+p}}},e.exports=p},{}],50:[function(t,e,i){var n=1,r=2,s=3,o=5,a=6378137,l=.006694379990141316;e.exports=function(t,e,i){function u(t){return t===n||t===r}var h,c,p;if(t.compare_datums(e))return i;if(t.datum_type===o||e.datum_type===o)return i;var d=t.a,f=t.es,g=e.a,m=e.es,_=t.datum_type;if(_===s)if(0===this.apply_gridshift(t,0,i))t.a=a,t.es=l;else{if(!t.datum_params)return t.a=d,t.es=t.es,i;for(h=1,c=0,p=t.datum_params.length;p>c;c++)h*=t.datum_params[c];if(0===h)return t.a=d,t.es=t.es,i;_=t.datum_params.length>3?r:n}return e.datum_type===s&&(e.a=a,e.es=l),(t.es!==e.es||t.a!==e.a||u(_)||u(e.datum_type))&&(t.geodetic_to_geocentric(i),u(t.datum_type)&&t.geocentric_to_wgs84(i),u(e.datum_type)&&e.geocentric_from_wgs84(i),e.geocentric_to_geodetic(i)),e.datum_type===s&&this.apply_gridshift(e,1,i),t.a=d,t.es=f,e.a=g,e.es=m,i}},{}],51:[function(t,e,i){function n(t){var e=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?n[t]=s(arguments[1]):n[t]=o(arguments[1]):n[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?n.apply(e,t):n(t)});if("string"==typeof t){if(t in n)return n[t]}else"EPSG"in t?n["EPSG:"+t.EPSG]=t:"ESRI"in t?n["ESRI:"+t.ESRI]=t:"IAU2000"in t?n["IAU2000:"+t.IAU2000]=t:console.log(t);return}}var r=t("./global"),s=t("./projString"),o=t("./wkt");r(n),e.exports=n},{"./global":54,"./projString":58,"./wkt":86}],52:[function(t,e,i){var n=t("./constants/Datum"),r=t("./constants/Ellipsoid"),s=t("./extend"),o=t("./datum"),a=1e-10,l=.16666666666666666,u=.04722222222222222,h=.022156084656084655;e.exports=function(t){if(t.datumCode&&"none"!==t.datumCode){var e=n[t.datumCode];e&&(t.datum_params=e.towgs84?e.towgs84.split(","):null,t.ellps=e.ellipse,t.datumName=e.datumName?e.datumName:t.datumCode)}if(!t.a){var i=r[t.ellps]?r[t.ellps]:r.WGS84;s(t,i)}return t.rf&&!t.b&&(t.b=(1-1/t.rf)*t.a),(0===t.rf||Math.abs(t.a-t.b)<a)&&(t.sphere=!0,t.b=t.a),t.a2=t.a*t.a,t.b2=t.b*t.b,t.es=(t.a2-t.b2)/t.a2,t.e=Math.sqrt(t.es),t.R_A&&(t.a*=1-t.es*(l+t.es*(u+t.es*h)),t.a2=t.a*t.a,t.b2=t.b*t.b,t.es=0),t.ep2=(t.a2-t.b2)/t.b2,t.k0||(t.k0=1),t.axis||(t.axis="enu"),t.datum||(t.datum=o(t)),t}},{"./constants/Datum":44,"./constants/Ellipsoid":45,"./datum":49,"./extend":53}],53:[function(t,e,i){e.exports=function(t,e){t=t||{};var i,n;if(!e)return t;for(n in e)i=e[n],void 0!==i&&(t[n]=i);return t}},{}],54:[function(t,e,i){e.exports=function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:38
|
|||
|
this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},i.forward=function(t){var e,i=t.x,r=t.y,s=r-this.lat0,o=i-this.long0,a=s/n*1e-5,l=o,u=1,h=0;for(e=1;10>=e;e++)u*=a,h+=this.A[e]*u;var c,p,d=h,f=l,g=1,m=0,_=0,v=0;for(e=1;6>=e;e++)c=g*d-m*f,p=m*d+g*f,g=c,m=p,_=_+this.B_re[e]*g-this.B_im[e]*m,v=v+this.B_im[e]*g+this.B_re[e]*m;return t.x=v*this.a+this.x0,t.y=_*this.a+this.y0,t},i.inverse=function(t){var e,i,r,s=t.x,o=t.y,a=s-this.x0,l=o-this.y0,u=l/this.a,h=a/this.a,c=1,p=0,d=0,f=0;for(e=1;6>=e;e++)i=c*u-p*h,r=p*u+c*h,c=i,p=r,d=d+this.C_re[e]*c-this.C_im[e]*p,f=f+this.C_im[e]*c+this.C_re[e]*p;for(var g=0;g<this.iterations;g++){var m,_,v=d,y=f,b=u,w=h;for(e=2;6>=e;e++)m=v*d-y*f,_=y*d+v*f,v=m,y=_,b+=(e-1)*(this.B_re[e]*v-this.B_im[e]*y),w+=(e-1)*(this.B_im[e]*v+this.B_re[e]*y);v=1,y=0;var x=this.B_re[1],k=this.B_im[1];for(e=2;6>=e;e++)m=v*d-y*f,_=y*d+v*f,v=m,y=_,x+=e*(this.B_re[e]*v-this.B_im[e]*y),k+=e*(this.B_im[e]*v+this.B_re[e]*y);var M=x*x+k*k;d=(b*x+w*k)/M,f=(w*x-b*k)/M}var C=d,D=f,T=1,S=0;for(e=1;9>=e;e++)T*=C,S+=this.D[e]*T;var A=this.lat0+S*n*1e5,P=this.long0+D;return t.x=P,t.y=A,t},i.names=["New_Zealand_Map_Grid","nzmg"]},{}],76:[function(t,e,i){var n=t("../common/tsfnz"),r=t("../common/adjust_lon"),s=t("../common/phi2z"),o=Math.PI/2,a=Math.PI/4,l=1e-10;i.init=function(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),e=Math.cos(this.lat0),i=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(e,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-i*i);var s=n(this.e,this.lat0,t),o=this.bl/e*Math.sqrt((1-this.es)/(1-i*i));1>o*o&&(o=1);var a,l;if(isNaN(this.longc)){var u=n(this.e,this.lat1,Math.sin(this.lat1)),h=n(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(o+Math.sqrt(o*o-1))*Math.pow(s,this.bl):this.el=(o-Math.sqrt(o*o-1))*Math.pow(s,this.bl);var c=Math.pow(u,this.bl),p=Math.pow(h,this.bl);a=this.el/c,l=.5*(a-1/a);var d=(this.el*this.el-p*c)/(this.el*this.el+p*c),f=(p-c)/(p+c),g=r(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(d*Math.tan(.5*this.bl*g)/f)/this.bl,this.long0=r(this.long0);var m=r(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*m)/l),this.alpha=Math.asin(o*Math.sin(this.gamma0))}else a=this.lat0>=0?o+Math.sqrt(o*o-1):o-Math.sqrt(o*o-1),this.el=a*Math.pow(s,this.bl),l=.5*(a-1/a),this.gamma0=Math.asin(Math.sin(this.alpha)/o),this.long0=this.longc-Math.asin(l*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(o*o-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(o*o-1),Math.cos(this.alpha))},i.forward=function(t){var e,i,s,u=t.x,h=t.y,c=r(u-this.long0);if(Math.abs(Math.abs(h)-o)<=l)s=h>0?-1:1,i=this.al/this.bl*Math.log(Math.tan(a+s*this.gamma0*.5)),e=-1*s*o*this.al/this.bl;else{var p=n(this.e,h,Math.sin(h)),d=this.el/Math.pow(p,this.bl),f=.5*(d-1/d),g=.5*(d+1/d),m=Math.sin(this.bl*c),_=(f*Math.sin(this.gamma0)-m*Math.cos(this.gamma0))/g;i=Math.abs(Math.abs(_)-1)<=l?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-_)/(1+_))/this.bl,e=Math.abs(Math.cos(this.bl*c))<=l?this.al*this.bl*c:this.al*Math.atan2(f*Math.cos(this.gamma0)+m*Math.sin(this.gamma0),Math.cos(this.bl*c))/this.bl}return this.no_rot?(t.x=this.x0+e,t.y=this.y0+i):(e-=this.uc,t.x=this.x0+i*Math.cos(this.alpha)+e*Math.sin(this.alpha),t.y=this.y0+e*Math.cos(this.alpha)-i*Math.sin(this.alpha)),t},i.inverse=function(t){var e,i;this.no_rot?(i=t.y-this.y0,e=t.x-this.x0):(i=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),e=(t.y-this.y0)
|
|||
|
return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data={children:[],height:1,bbox:r(),leaf:!0},this},remove:function(t){if(!t)return this;for(var e,i,n,r,s=this.data,o=this.toBBox(t),a=[],l=[];s||a.length;){if(s||(s=a.pop(),i=a[a.length-1],e=l.pop(),r=!0),s.leaf&&(n=s.children.indexOf(t),-1!==n))return s.children.splice(n,1),a.push(s),this._condense(a),this;r||s.leaf||!p(s.bbox,o)?i?(e++,s=i.children[e],r=!1):s=null:(a.push(s),l.push(e),e=0,i=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:function(t,e){return t[0]-e[0]},compareMinY:function(t,e){return t[1]-e[1]},toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,n,r){var s,o=n-e+1,a=this._maxEntries;if(a>=o)return s={children:t.slice(e,n+1),height:1,bbox:null,leaf:!0},i(s,this.toBBox),s;r||(r=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,r-1))),s={children:[],height:r,bbox:null};var l,u,h,c,p=Math.ceil(o/a),d=p*Math.ceil(Math.sqrt(a));for(f(t,e,n,d,this.compareMinX),l=e;n>=l;l+=d)for(h=Math.min(l+d-1,n),f(t,l,h,p,this.compareMinY),u=l;h>=u;u+=p)c=Math.min(u+p-1,h),s.children.push(this._build(t,u,c,r-1));return i(s,this.toBBox),s},_chooseSubtree:function(t,e,i,n){for(var r,s,o,a,u,c,p,d;;){if(n.push(e),e.leaf||n.length-1===i)break;for(p=d=1/0,r=0,s=e.children.length;s>r;r++)o=e.children[r],u=l(o.bbox),c=h(t,o.bbox)-u,d>c?(d=c,p=p>u?u:p,a=o):c===d&&p>u&&(p=u,a=o);e=a}return e},_insert:function(t,e,i){var n=this.toBBox,r=i?t.bbox:n(t),o=[],a=this._chooseSubtree(r,this.data,e,o);for(a.children.push(t),s(a.bbox,r);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,s=this._minEntries;this._chooseSplitAxis(n,s,r);var o={children:n.children.splice(this._chooseSplitIndex(n,s,r)),height:n.height};n.leaf&&(o.leaf=!0),i(n,this.toBBox),i(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(n,o)},_splitRoot:function(t,e){this.data={children:[t,e],height:t.height+1},i(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var r,s,o,a,u,h,p,d;for(h=p=1/0,r=e;i-e>=r;r++)s=n(t,0,r,this.toBBox),o=n(t,r,i,this.toBBox),a=c(s,o),u=l(s)+l(o),h>a?(h=a,d=r,p=p>u?u:p):a===h&&p>u&&(p=u,d=r);return d},_chooseSplitAxis:function(t,e,i){var n=t.leaf?this.compareMinX:o,r=t.leaf?this.compareMinY:a,s=this._allDistMargin(t,e,i,n),l=this._allDistMargin(t,e,i,r);l>s&&t.children.sort(n)},_allDistMargin:function(t,e,i,r){t.children.sort(r);var o,a,l=this.toBBox,h=n(t,0,e,l),c=n(t,i-e,i,l),p=u(h)+u(c);for(o=e;i-e>o;o++)a=t.children[o],s(h,t.leaf?l(a):a.bbox),p+=u(h);for(o=i-e-1;o>=e;o--)a=t.children[o],s(c,t.leaf?l(a):a.bbox),p+=u(c);return p},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)s(e[n].bbox,t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():i(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return [a"+t.join(", a")+"];")}},"function"==typeof define&&define.amd?define("rbush",function(){return t}):"undefined"!=typeof e?e.exports=t:"undefined"!=typeof self?self.rbush=t:window.rbush=t}()},{}],90:[function(t,e,i){var n=function(){function t(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function e(t,e){for(var i=[];e>0;i[--e]=t);return i.join("")}var i=function(){return i.cache.hasOwnProperty(arguments[0])||(i.cache[arguments[0]]=i.parse(arguments[0])),i.format.call(null,i.cache[arguments[0]],arguments)};return i.object_stringify=function(t,e,n,r){var s="";if(null!=t)switch(typeof t){case"function":return"[Function"+(t.name?": "+t.name:"")+"]";case"object":if(t instanceof Error)return"["+t.toString()+"]";if(e>=n)return"[Object]";if(r&&(r=r.slice(0),r.push(t)),null!=t.length
|
|||
|
dimension:o,plot:e,ticker:i.get("ticker")}),c.push(a))}return c},C=function(t){var e;return t.x_range=c(t.x_range),t.y_range=c(t.y_range),e=n("Plot").create(t)},D=function(t){var e,i,r;i={};for(e in t)r=t[e],i[e]=n("ColumnDataSource").create({data:r});return i},v=function(t,e,i){return i=f(i,e),t.add_renderers(i)},y=function(t,e){var i,n,r,s,o;for(e=g(e,t),n=0,r=e.length;r>n;n++)i=e[n],o=i.get("location"),null!=o&&(s=t.get(o),s.push(i),t.set(o,s));return t.add_renderers(e)},_=function(t,e){return e=d(e),t.add_renderers(e)},b=function(t,e){var i,n,r;for(e=m(e,t),i=0,n=e.length;n>i;i++)r=e[i],r.set("plot",t);return t.set_obj("tools",e),t.get("tool_manager").set_obj("tools",e),t.get("tool_manager")._init_tools()},x=function(t){var e,i,n,r,s,o,a;return r=t.options,o=t.sources,i=t.glyphs,n=t.guides,e=t.annotations,a=t.tools,null==r&&(r={}),null==o&&(o={}),null==i&&(i=[]),null==n&&(n=[]),null==e&&(e={}),null==a&&(a=[]),s=C(r),o=D(o),v(s,o,i),y(s,n),_(s,e),b(s,a),s},e.exports=x},{"../common/base":99,"../common/logging":119,"../range/factor_range":145,"../range/range1d":146,"../source/column_data_source":204,underscore:92}],94:[function(t,e,i){var n,r,s,o;r=t("underscore"),n=t("../common/logging"),s=n.logger,o=function(t,e){var i;return s.debug("Scheduling render for plot "+e+" on target "+t),i=function(){var i;return i=new e.default_view({model:e}),t.append(i.$el)},r.defer(i)},e.exports={show:o}},{"../common/logging":119,underscore:92}],95:[function(t,e,i){var n,r,s,o,a,l,u,h;s=t("underscore"),n=t("jquery"),r=t("../common/logging"),a=t("./figure"),l=t("./helpers"),u=r.logger,h=l.show,o={figure:a},n.fn.bokeh=function(t,e){var i;return t in o?(i=o[t](e),h(this,i),i):(u.error("Unknown API type '"+t+"'. Recognized API types: "+Object.keys(o)),this)},e.exports=n.fn.bokeh},{"../common/logging":119,"./figure":93,"./helpers":94,jquery:18,underscore:92}],96:[function(t,e,i){var n,r,s,o=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},a={}.hasOwnProperty;n=t("../common/has_properties"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return o(e,t),e}(n),s=function(t){var e;return e={},e.Model=function(e){function i(){return i.__super__.constructor.apply(this,arguments)}return o(i,e),i.prototype.type=t,i}(r),e},e.exports={AutoEncode:s("AutoEncode"),BinarySegment:s("BinarySegment"),Const:s("Const"),Contour:s("Contour"),Count:s("Count"),CountCategories:s("CountCategories"),Cuberoot:s("Cuberoot"),Encode:s("Encode"),HDAlpha:s("HDAlpha"),Id:s("Id"),Interpolate:s("Interpolate"),InterpolateColor:s("InterpolateColor"),Log:s("Log"),NonZero:s("NonZero"),Ratio:s("Ratio"),Seq:s("Seq"),Spread:s("Spread"),ToCounts:s("ToCounts")}},{"../common/has_properties":115}],97:[function(t,e,i){var n,r,s,o=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},a={}.hasOwnProperty,l=[].slice;s=t("underscore"),r=t("../common/has_properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.type="CustomJS",e.prototype.initialize=function(t,i){return e.__super__.initialize.call(this,t,i),this.register_property("values",this._make_values,!0),this.add_dependencies("values",this,["args"]),this.register_property("func",this._make_func,!0),this.add_dependencies("func",this,["args","code"])},e.prototype.execute=function(t,e){return this.get("func").apply(null,l.call(this.get("values")).concat([t],[e]))},e.prototype._make_values=function(){return s.map(s.values(this.get("args")),this.resolve_ref)},e.prototype._make_func=function(){return function(t,e,i){i.prototype=t.prototype;var n=new i,r=t.apply(n,e);return Object(r)===r?r:n}(Function,l.call(s.keys(this.get("args"))).concat(["cb_obj"],["cb_data"],[this.get("code")]),function(){})},e.prototype.defaults=function(){return s.extend({},e.__super__.defaults.call(this),{args:{},code:""})},e}(r),e.exports={Model:n}},{"
|
|||
|
}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},a={}.hasOwnProperty;s=t("underscore"),n=t("backbone"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.initialize=function(t){return s.has(t,"id")?void 0:this.id=s.uniqueId("ContinuumView")},e.prototype.bind_bokeh_events=function(){return"pass"},e.prototype.delegateEvents=function(t){return e.__super__.delegateEvents.call(this,t)},e.prototype.remove=function(){var t,i,n;if(s.has(this,"eventers")){t=this.eventers;for(i in t)a.call(t,i)&&(n=t[i],n.off(null,null,this))}return this.trigger("remove",this),e.__super__.remove.call(this)},e.prototype.mget=function(){return this.model.get.apply(this.model,arguments)},e.prototype.mset=function(){return this.model.set.apply(this.model,arguments)},e.prototype.render_end=function(){return"pass"},e}(n.View),e.exports=r},{backbone:2,underscore:92}],110:[function(t,e,i){var n,r;n=t("underscore"),r=function(){return n.uniqueId=function(t){var e,i,n,r,s;for(r=[],e="0123456789ABCDEF",i=n=0;31>=n;i=++n)r[i]=e.substr(Math.floor(16*Math.random()),1);return r[12]="4",r[16]=e.substr(3&r[16]|8,1),s=r.join(""),t?t+"-"+s:s}},n.isNullOrUndefined=function(t){return n.isNull(t)||n.isUndefined(t)},n.setdefault=function(t,e,i){return n.has(t,e)?t[e]:(t[e]=i,i)},e.exports={monkey_patch:r}},{underscore:92}],111:[function(t,e,i){var n,r,s,o,a,l=function(t,e){function i(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},u={}.hasOwnProperty;a=t("underscore"),o=t("./solver"),s=t("./plot"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,a.defaults(t,this.default_options)),this.zoom_count=null},e.prototype.bind_bokeh_events=function(){var t,i,n,r,s;return e.__super__.bind_bokeh_events.call(this),s=this.frame.get("width"),i=this.frame.get("height"),n=this.canvas.vx_to_sx(this.frame.get("left")),r=this.canvas.vy_to_sy(this.frame.get("top")),this.canvas_view.map_div.attr("style","top: "+r+"px; left: "+n+"px; position: absolute"),this.canvas_view.map_div.attr("style","width:"+s+"px;"),this.canvas_view.map_div.attr("style","height:"+i+"px;"),this.canvas_view.map_div.width(s+"px").height(i+"px"),this.initial_zoom=this.mget("map_options").zoom,t=function(t){return function(){var e,i;return i=t.mget("map_options"),e={center:[i.lat,i.lng],zoom:i.zoom,node:t.canvas_view.map_div[0]},t.map=geo.map(e),t.map.createLayer("osm")}}(this),$.getScript("http://opengeoscience.github.io/geojs/lib/gl-matrix.js",function(){return $.getScript("http://opengeoscience.github.io/geojs/lib/d3.v3.min.js",function(){return $.getScript("http://opengeoscience.github.io/geojs/lib/proj4.js",function(){return $.getScript("http://opengeoscience.github.io/geojs/lib/vgl.js",function(){return $.getScript("http://opengeoscience.github.io/geojs/lib/geo.js",function(){return t()})})})})})},e.prototype._map_hook=function(t,e){var i,n,r,s;return n=e[0],r=e[1],s=e[2],i=e[3],this.canvas_view.map_div.attr("style","top: "+r+"px; left: "+n+"px;"),this.canvas_view.map_div.width(s+"px").height(i+"px")},e.prototype._paint_empty=function(t,e){var i,n,r,s,o,a;return o=this.canvas.get("width"),s=this.canvas.get("height"),r=e[0],a=e[1],n=e[2],i=e[3],t.clearRect(0,0,o,s),t.beginPath(),t.moveTo(0,0),t.lineTo(0,s),t.lineTo(o,s),t.lineTo(o,0),t.lineTo(0,0),t.moveTo(r,a),t.lineTo(r+n,a),t.lineTo(r+n,a+i),t.lineTo(r,a+i),t.lineTo(r,a),t.closePath(),t.fillStyle=this.mget("border_fill"),t.fill()},e}(s.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="GeoJSPlot",e.prototype.default_view=r,e.prototype.initialize=function(t,i){return this.use_map=!0,e.__super__.initialize.call(this,t,i)},e.prototype.parent_properties=["border_fill","min_border","min_border_top","min_border_bottom","min_border_left","min_border_right"],e.prototyp
|
|||
|
t.prototype=new i,t.__super__=e.prototype,t},E={}.hasOwnProperty;w=t("underscore"),n=t("jquery"),r=t("backbone"),null!=i._bokehTest?M={}:(M=t("kiwi"),h=M.Expression,a=M.Constraint,g=M.Operator,u=g.Eq,f=g.Le,c=g.Ge),x=t("./build_views"),s=t("./canvas"),o=t("./cartesian_frame"),l=t("./continuum_view"),b=t("./ui_events"),p=t("./has_parent"),d=t("./layout_box"),C=t("./logging").logger,T=t("./plot_utils"),v=t("./solver"),y=t("./tool_manager"),D=t("./plot_template"),S=t("./properties"),k=null,_=function(t){function e(){return this.resize=A(this.resize,this),this.remove=A(this.remove,this),this.request_render=A(this.request_render,this),e.__super__.constructor.apply(this,arguments)}return P(e,t),e.prototype.className="bk-plot",e.prototype.template=D,e.prototype.view_options=function(){return w.extend({plot_model:this.model,plot_view:this},this.options)},e.prototype.pause=function(){return this.is_paused=!0},e.prototype.unpause=function(){return this.is_paused=!1,this.request_render()},e.prototype.request_render=function(){this.is_paused||this.throttled_render(!0)},e.prototype.remove=function(){var t,i,n,r;e.__super__.remove.call(this),i=this.tools,n=[];for(t in i)r=i[t],n.push(r.remove());return n},e.prototype.initialize=function(t){var i,r,s,o,a,l,u,h,c,p;for(e.__super__.initialize.call(this,t),this.pause(),this.model.initialize_layout(this.model.solver),this.frame=this.mget("frame"),this.x_range=this.frame.get("x_ranges")["default"],this.y_range=this.frame.get("y_ranges")["default"],this.xmapper=this.frame.get("x_mappers")["default"],this.ymapper=this.frame.get("y_mappers")["default"],this.$el.html(this.template()),this.canvas=this.mget("canvas"),this.canvas_view=new this.canvas.default_view({model:this.canvas}),this.$(".bk-plot-canvas-wrapper").append(this.canvas_view.el),this.canvas_view.render(),(this.mget("webgl")||window.location.search.indexOf("webgl=1")>0)&&-1===window.location.search.indexOf("webgl=0")&&this.init_webgl(),this.throttled_render=T.throttle_animation(this.render,15),this.outline_props=new S.Line({obj:this.model,prefix:"outline_"}),this.title_props=new S.Text({obj:this.model,prefix:"title_"}),this.renderers={},this.tools={},this.levels={},a=T.LEVELS,r=0,s=a.length;s>r;r++)o=a[r],this.levels[o]={};this.build_levels(),this.bind_bokeh_events(),this.model.add_constraints(this.canvas.solver),this.listenTo(this.canvas.solver,"layout_update",this.request_render),this.ui_event_bus=new b({tool_manager:this.mget("tool_manager"),hit_area:this.canvas_view.$el}),l=this.tools;for(i in l)h=l[i],this.ui_event_bus.register_tool(h);return c=this.mget("toolbar_location"),null!=c&&(p=".bk-plot-"+c,C.debug("attaching toolbar to "+p+" for plot "+this.model.id),this.tm_view=new y.View({model:this.mget("tool_manager"),el:this.$(p)})),this.update_dataranges(),this.mget("responsive")&&(u=w.throttle(this.resize,100),n(window).on("resize",u),n(this.resize)),this.unpause(),C.debug("PlotView initialized"),this},e.prototype.init_webgl=function(){var t,e;return t=k,null==t&&(k=t=document.createElement("canvas"),e={premultipliedAlpha:!0},t.gl=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)),null!=t.gl?this.canvas_view.ctx.glcanvas=t:C.warn("WebGL is not supported, falling back to 2D canvas.")},e.prototype.update_dataranges=function(){var t,e,i,n,r,s,o,a,l,u,h,c,p,d,f;i=this.model.get("frame"),e={},l=this.renderers;for(r in l)p=l[r],t=null!=(u=p.glyph)&&"function"==typeof u.bounds?u.bounds():void 0,null!=t&&(e[r]=t);for(h=w.values(i.get("x_ranges")),n=0,o=h.length;o>n;n++)d=h[n],"function"==typeof d.update&&d.update(e,0,this);for(c=w.values(i.get("y_ranges")),s=0,a=c.length;a>s;s++)f=c[s],"function"==typeof f.update&&f.update(e,1,this);return this.range_update_timestamp=Date.now()},e.prototype.map_to_screen=function(t,e,i,n){return null==i&&(i="default"),null==n&&(n="default"),this.frame.map_to_screen(t,e,this.canvas,i,n)},e.prototype.update_range=function(t){var e,i,n,r,s,o;null==t&&(t=this.initial_range_info),this.pause(),i=this.frame.get("x_ranges");for(e in i)o=i[e],(o.get("start")!==t.xrs[e].start||o.get("end")!
|
|||
|
Text:v,factories:{coords:w,distances:x,angles:b,fields:k,visuals:C}}},{"./has_properties":115,"./svg_colors":132,underscore:92}],127:[function(t,e,i){var n;n=function(){function t(t){var e;this.seed=t,this.multiplier=1664525,this.modulo=4294967296,this.offset=1013904223,null!=this.seed&&0<=(e=this.seed)&&e<this.modulo||(this.seed=(new Date).valueOf()*(new Date).getMilliseconds()%this.modulo)}return t.prototype.seed=function(t){return this.seed=t},t.prototype.randn=function(){return this.seed=(this.multiplier*this.seed+this.offset)%this.modulo},t.prototype.randf=function(){return this.randn()/this.modulo},t.prototype.rand=function(t){return Math.floor(this.randf()*t)},t.prototype.rand2=function(t,e){return t+this.rand(e-t)},t}(),e.exports=n},{}],128:[function(t,e,i){var n,r,s,o,a,l,u=function(t,e){function i(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},h={}.hasOwnProperty;o=t("underscore"),n=t("./has_properties"),l=t("./logging").logger,s=t("./selector"),a=t("./hittest"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.type="SelectionManager",e.prototype.initialize=function(t,i){return e.__super__.initialize.call(this,t,i),this.selectors={}},e.prototype.set_selection=function(t){var e;return this._save_indices(t),e=this.get("source"),e.trigger("select")},e.prototype.select=function(t,e,i,n,r){var s,o,a;return null==r&&(r=!1),a=this.get("source"),a!==e.mget("data_source")&&l.warn("select called with mis-matched data sources"),s=e.hit_test(i),s?(o=this._get_selector(e),o.update(s,n,r),this._save_indices(o.get("indices")),a.trigger("select"),a.trigger("select-"+e.mget("id"))):void 0},e.prototype.inspect=function(t,e,i,n){var r,s;return s=this.get("source"),s!==e.mget("data_source")&&l.warn("inspect called with mis-matched data sources"),r=e.hit_test(i),null!=r?(s.trigger("inspect",r,t,e,s,n),s.trigger("inspect"+e.mget("id"),r,t,e,s,n)):void 0},e.prototype.clear=function(t){var e,i,n,r;if(null!=t)r=this._get_selector(t),r.clear();else{i=this.selectors;for(e in i)n=i[e],n.clear()}return this._save_indices(a.create_hit_test_result())},e.prototype._get_selector=function(t){return o.setdefault(this.selectors,t.model.id,new s),this.selectors[t.model.id]},e.prototype._save_indices=function(t){return this.get("source").save({selected:t},{patch:!0})},e}(n),e.exports=r},{"./has_properties":115,"./hittest":116,"./logging":119,"./selector":129,underscore:92}],129:[function(t,e,i){var n,r,s,o,a,l=function(t,e){function i(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},u={}.hasOwnProperty;s=t("underscore"),n=t("./has_properties"),o=t("./hittest"),a=t("./logging").logger,r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="Selector",e.prototype.update=function(t,e,i){return this.set("timestamp",new Date),this.set("final",e),i&&(t["0d"].indices=s.union(this.get("indices")["0d"].indices,t["0d"].indices),t["0d"].flag=this.get("indices")["0d"].flag||t["0d"].flag,t["1d"].indices=s.union(this.get("indices")["1d"].indices,t["1d"].indices),t["2d"].indices=s.union(this.get("indices")["2d"].indices,t["2d"].indices)),this.set("indices",t)},e.prototype.clear=function(){return this.set("timestamp",new Date),this.set("final",!0),this.set("indices",o.create_hit_test_result())},e.prototype.defaults=function(){return s.extend({},e.__super__.defaults.call(this),{indices:o.create_hit_test_result()})},e}(n),e.exports=r},{"./has_properties":115,"./hittest":116,"./logging":119,underscore:92}],130:[function(t,e,i){var n,r,s,o,a,l,u,h,c=function(t,e){return function(){return t.apply(e,arguments)}};n=t("jquery"),a=t("underscore"),r=t("backbone"),s=t("./base").Config,l=t("./load_models"),u=t("./logging").logger,o=function(){function t(t){this.onmessage=c(this.onmessage,this);var e;this.auth={},this.ws_conn_string=t,this._connected=n.Deferred(),this.connected=this._
|
|||
|
GnBu8:[546974,2854078,5157843,8113348,11066805,13429701,14742491,16252144],GnBu9:[540801,551084,2854078,5157843,8113348,11066805,13429701,14742491,16252144],BuGn3:[2925151,10082505,15070713],BuGn4:[2329413,6734500,11723490,15595771],BuGn5:[27948,2925151,6734500,11723490,15595771],BuGn6:[27948,2925151,6734500,10082505,13429990,15595771],BuGn7:[22564,2329413,4304502,6734500,10082505,13429990,15595771],BuGn8:[22564,2329413,4304502,6734500,10082505,13429990,15070713,16252157],BuGn9:[17435,27948,2329413,4304502,6734500,10082505,13429990,15070713,16252157],PuBuGn3:[1872025,10927579,15524592],PuBuGn4:[164234,6793679,12437985,16183287],PuBuGn5:[93273,1872025,6793679,12437985,16183287],PuBuGn6:[93273,1872025,6793679,10927579,13685222,16183287],PuBuGn7:[91216,164234,3576e3,6793679,10927579,13685222,16183287],PuBuGn8:[91216,164234,3576e3,6793679,10927579,13685222,15524592,16775163],PuBuGn9:[83510,93273,164234,3576e3,6793679,10927579,13685222,15524592,16775163],PuBu3:[2854078,10927579,15525874],PuBu4:[356528,7645647,12437985,15855350],PuBu5:[285325,2854078,7645647,12437985,15855350],PuBu6:[285325,2854078,7645647,10927579,13685222,15855350],PuBu7:[216699,356528,3576e3,7645647,10927579,13685222,15855350],PuBu8:[216699,356528,3576e3,7645647,10927579,13685222,15525874,16775163],PuBu9:[145496,285325,356528,3576e3,7645647,10927579,13685222,15525874,16775163],BuPu3:[8935079,10403034,14740724],BuPu4:[8929693,9213638,11783651,15595771],BuPu5:[8458108,8935079,9213638,11783651,15595771],BuPu6:[8458108,8935079,9213638,10403034,12571622,15595771],BuPu7:[7209323,8929693,9202609,9213638,10403034,12571622,15595771],BuPu8:[7209323,8929693,9202609,9213638,10403034,12571622,14740724,16252157],BuPu9:[5046347,8458108,8929693,9202609,9213638,10403034,12571622,14740724,16252157],RdPu3:[12917642,16424885,16638173],RdPu4:[11403646,16214177,16495801,16706530],RdPu5:[7995767,12917642,16214177,16495801,16706530],RdPu6:[7995767,12917642,16214177,16424885,16565696,16706530],RdPu7:[7995767,11403646,14496919,16214177,16424885,16565696,16706530],RdPu8:[7995767,11403646,14496919,16214177,16424885,16565696,16638173,16775155],RdPu9:[4784234,7995767,11403646,14496919,16214177,16424885,16565696,16638173,16775155],PuRd3:[14490743,13210823,15196655],PuRd4:[13505110,14640560,14136792,15855350],PuRd5:[9961539,14490743,14640560,14136792,15855350],PuRd6:[9961539,14490743,14640560,13210823,13941210,15855350],PuRd7:[9502783,13505110,15149450,14640560,13210823,13941210,15855350],PuRd8:[9502783,13505110,15149450,14640560,13210823,13941210,15196655,16250105],PuRd9:[6750239,9961539,13505110,15149450,14640560,13210823,13941210,15196655,16250105],OrRd3:[14895667,16628612,16705736],OrRd4:[14102559,16551257,16632970,16707801],OrRd5:[11730944,14895667,16551257,16632970,16707801],OrRd6:[11730944,14895667,16551257,16628612,16635038,16707801],OrRd7:[10027008,14102559,15689032,16551257,16628612,16635038,16707801],OrRd8:[10027008,14102559,15689032,16551257,16628612,16635038,16705736,16775148],OrRd9:[8323072,11730944,14102559,15689032,16551257,16628612,16635038,16705736,16775148],YlOrRd3:[15743776,16691788,16772512],YlOrRd4:[14883356,16616764,16698460,16777138],YlOrRd5:[12386342,15743776,16616764,16698460,16777138],YlOrRd6:[12386342,15743776,16616764,16691788,16701814,16777138],YlOrRd7:[11599910,14883356,16535082,16616764,16691788,16701814,16777138],YlOrRd8:[11599910,14883356,16535082,16616764,16691788,16701814,16772512,16777164],YlOrRd9:[8388646,12386342,14883356,16535082,16616764,16691788,16701814,16772512,16777164],YlOrBr3:[14245646,16696399,16775100],YlOrBr4:[13388802,16685353,16701838,16777172],YlOrBr5:[10040324,14245646,16685353,16701838,16777172],YlOrBr6:[10040324,14245646,16685353,16696399,16704401,16777172],YlOrBr7:[9186564,13388802,15495188,16685353,16696399,16704401,16777172],YlOrBr8:[9186564,13388802,15495188,16685353,16696399,16704401,16775100,16777189],YlOrBr9:[6694150,10040324,13388802,15495188,16685353,16696399,16704401,16775100,16777189],Purples3:[7695281,12369372,15724021],Purples4:[6967715,10394312,13355490,15921399],Purples5:[5515151,7695281,10394312,13355490,1592
|
|||
|
},e.prototype._render=function(t,e,i){var n,r,s,o,a,l,u,h;for(u=i.sx,h=i.sy,a=i.sinner_radius,l=i.souter_radius,o=[],r=0,s=e.length;s>r;r++)n=e[r],isNaN(u[n]+h[n]+a[n]+l[n])||(t.beginPath(),t.arc(u[n],h[n],a[n],0,2*Math.PI*2,!1),t.moveTo(u[n]+l[n],h[n]),t.arc(u[n],h[n],l[n],0,2*Math.PI*2,!0),this.visuals.fill.do_fill&&(this.visuals.fill.set_vectorize(t,n),t.fill()),this.visuals.line.do_stroke?(this.visuals.line.set_vectorize(t,n),o.push(t.stroke())):o.push(void 0));return o},e.prototype._hit_point=function(t){var e,i,n,r,s,l,u,h,c,p,d,f,g,m,_,v,y,b,w,x,k,M,C;for(c=[t.vx,t.vy],v=c[0],y=c[1],b=this.renderer.xmapper.map_from_target(v,!0),w=b-this.max_radius,x=b+this.max_radius,k=this.renderer.ymapper.map_from_target(y,!0),M=k-this.max_radius,C=k+this.max_radius,i=[],p=function(){var t,e,i,n;for(i=this.index.search([w,M,x,C]),n=[],t=0,e=i.length;e>t;t++)h=i[t],n.push(h[4].i);return n}.call(this),s=0,l=p.length;l>s;s++)n=p[s],u=Math.pow(this.souter_radius[n],2),r=Math.pow(this.sinner_radius[n],2),f=this.renderer.xmapper.map_to_target(b),g=this.renderer.xmapper.map_to_target(this.x[n]),m=this.renderer.ymapper.map_to_target(k),_=this.renderer.ymapper.map_to_target(this.y[n]),e=Math.pow(f-g,2)+Math.pow(m-_,2),u>=e&&e>=r&&i.push([n,e]);return d=a.create_hit_test_result(),d["1d"].indices=o.chain(i).sortBy(function(t){return t[1]}).map(function(t){return t[0]}).value(),d},e.prototype.draw_legend=function(t,e,i,n,r){var s,o,a,l,u,h,c,p,d;return u=null!=(l=this.get_reference_point())?l:0,o=[u],p={},p[u]=(e+i)/2,d={},d[u]=(n+r)/2,a=.5*Math.min(Math.abs(i-e),Math.abs(r-n)),h={},h[u]=.4*a,c={},c[u]=.8*a,s={sx:p,sy:d,sinner_radius:h,souter_radius:c},this._render(t,o,s)},e}(s.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=r,e.prototype.type="Annulus",e.prototype.distances=["inner_radius","outer_radius"],e}(s.Model),e.exports={Model:n,View:r}},{"../../common/hittest":116,"./glyph":158,underscore:92}],153:[function(t,e,i){var n,r,s,o,a=function(t,e){function i(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},l={}.hasOwnProperty;o=t("underscore"),s=t("./glyph"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){return"data"===this.distances.radius.units?this.sradius=this.sdist(this.renderer.xmapper,this.x,this.radius):this.sradius=this.radius},e.prototype._render=function(t,e,i){var n,r,s,o,a,l,u,h,c,p;if(c=i.sx,p=i.sy,u=i.sradius,h=i.start_angle,r=i.end_angle,n=i.direction,this.visuals.line.do_stroke){for(l=[],o=0,a=e.length;a>o;o++)s=e[o],isNaN(c[s]+p[s]+u[s]+h[s]+r[s]+n[s])||(t.beginPath(),t.arc(c[s],p[s],u[s],h[s],r[s],n[s]),this.visuals.line.set_vectorize(t,s),l.push(t.stroke()));return l}},e.prototype.draw_legend=function(t,e,i,n,r){return this._generic_line_legend(t,e,i,n,r)},e}(s.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.default_view=r,e.prototype.type="Arc",e.prototype.visuals=["line"],e.prototype.distances=["radius"],e.prototype.angles=["start_angle","end_angle"],e.prototype.fields=["direction:direction"],e.prototype.display_defaults=function(){return o.extend({},e.__super__.display_defaults.call(this),{direction:"anticlock"})},e}(s.Model),e.exports={Model:n,View:r}},{"./glyph":158,underscore:92}],154:[function(t,e,i){var n,r,s,o,a,l,u=function(t,e){function i(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},h={}.hasOwnProperty;o=t("underscore"),l=t("rbush"),s=t("./glyph"),a=function(t,e,i,n,r,s,o,a){var l,u,h,c,p,d,f,g,m,_,v,y,b,w,x,k,M;for(x=[],c=[[],[]],d=m=0;2>=m;d=++m)if(0===d?(u=6*t-12*i+6*r,l=-3*t+9*i-9*r+3*o,p=3*i-3*t):(u=6*e-12*n+6*s,l=-3*e+9*n-9*s+3*a,p=3*n-3*e),Math.abs(l)<1e-12){if(Math.abs(u)<1e-12)continue;y=-p/u,y>0&&1>y&&x.push(y)}else h=u*u-4*p*l,v=Math.s
|
|||
|
"../../mapper/categorical_mapper":138,proj4:56,rbush:89,underscore:92}],159:[function(t,e,i){var n,r,s,o,a,l,u,h,c=function(t,e){function i(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},p={}.hasOwnProperty;u=t("underscore"),h=t("../../common/logging").logger,o=t("../../common/has_parent"),a=t("../../common/plot_widget"),n=t("../../range/factor_range"),l=t("../../source/remote_data_source"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.initialize=function(t){var i,n,r;return e.__super__.initialize.call(this,t),this.glyph=this.build_glyph_view(this.mget("glyph")),r=this.mget("selection_glyph"),null==r&&(r=this.mget("glyph").clone(),r.set(this.model.selection_defaults,{silent:!0})),this.selection_glyph=this.build_glyph_view(r),n=this.mget("nonselection_glyph"),null==n&&(n=this.mget("glyph").clone(),n.set(this.model.nonselection_defaults,{silent:!0})),this.nonselection_glyph=this.build_glyph_view(n),i=this.mget("glyph").clone(),i.set(this.model.decimated_defaults,{silent:!0}),this.decimated_glyph=this.build_glyph_view(i),this.xmapper=this.plot_view.frame.get("x_mappers")[this.mget("x_range_name")],this.ymapper=this.plot_view.frame.get("y_mappers")[this.mget("y_range_name")],this.set_data(!1),this.mget("data_source")instanceof l.RemoteDataSource?this.mget("data_source").setup(this.plot_view,this.glyph):void 0},e.prototype.build_glyph_view=function(t){return new t.default_view({model:t,renderer:this})},e.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change",this.request_render),this.listenTo(this.mget("data_source"),"change",this.set_data),this.listenTo(this.mget("data_source"),"select",this.request_render),this.listenTo(this.mget("glyph"),"propchange",function(){return this.glyph.set_visuals(this.mget("data_source")),this.request_render()})},e.prototype.have_selection_glyphs=function(){return!0},e.prototype.setup_server_data=function(){},e.prototype.set_data=function(t,e){var i,n,r,s,o,a,l,u,c;for(null==t&&(t=!0),c=Date.now(),u=this.mget("data_source"),this.glyph.set_data(u,e),this.glyph.set_visuals(u),this.decimated_glyph.set_visuals(u),this.selection_glyph.set_visuals(u),this.nonselection_glyph.set_visuals(u),s=u.get_length(),null==s&&(s=1),this.all_indices=function(){l=[];for(var t=0;s>=0?s>t:t>s;s>=0?t++:t--)l.push(t);return l}.apply(this),o=this.plot_model.get("lod_factor"),this.decimated=[],n=r=0,a=Math.floor(this.all_indices.length/o);a>=0?a>r:r>a;n=a>=0?++r:--r)this.decimated.push(this.all_indices[n*o]);return i=Date.now()-c,h.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): set_data finished in "+i+"ms"),this.set_data_timestamp=Date.now(),t?this.request_render():void 0},e.prototype.render=function(){var t,e,i,n,r,s,o,a,l,u,c,p,d,f,g,m,_,v,y,b,w,x,k,M,C;if(w=Date.now(),o=this.glyph.glglyph,x=Date.now(),this.glyph.map_data(),e=Date.now()-w,k=Date.now(),u=o?this.all_indices:this.glyph._mask_data(this.all_indices),i=Date.now()-k,t=this.plot_view.canvas_view.ctx,t.save(),v=this.mget("data_source").get("selected"),v=v&&0!==v.length?v["0d"].flag?u:v["1d"].indices.length>0?v["1d"].indices:v["2d"].indices.length>0?v["2d"].indices:[]:[],g=this.plot_model.get("lod_threshold"),this.plot_view.interactive&&!o&&null!=g&&this.all_indices.length>g?(u=this.decimated,a=this.decimated_glyph,_=this.decimated_glyph,b=this.selection_glyph):(a=this.glyph,_=this.nonselection_glyph,b=this.selection_glyph),v.length&&this.have_selection_glyphs()){for(C=Date.now(),y={},c=0,d=v.length;d>c;c++)l=v[c],y[l]=!0;for(v=new Array,m=new Array,p=0,f=u.length;f>p;p++)l=u[p],null!=y[l]?v.push(l):m.push(l);r=Date.now()-C,M=Date.now(),_.render(t,m,this.glyph),b.render(t,v,this.glyph),n=Date.now()-M}else M=Date.now(),a.render(t,u,this.glyph),n=Date.now()-M;return this.last_dtrender=n,s=Date.now()-w,h.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): render finished in "+s+"ms"),h.trace(" - map_data finished in : "+e+"ms"),null!=i&&h.trace("
|
|||
|
h.push(t.stroke())):h.push(void 0));return h},e}(n.View),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.default_view=s,e.prototype.type="Triangle",e}(n.Model),e.exports={Model:r,View:s}},{"./marker":171,underscore:92}],176:[function(t,e,i){var n,r,s,o,a=function(t,e){function i(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},l={}.hasOwnProperty;o=t("underscore"),n=t("./marker"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype._render=function(t,e,i){var n,r,s,o,a,l,u,h,c;for(h=i.sx,c=i.sy,u=i.size,n=i.angle,l=[],s=0,o=e.length;o>s;s++)r=e[s],isNaN(h[r]+c[r]+u[r]+n[r])||(a=u[r]/2,t.beginPath(),t.translate(h[r],c[r]),n[r]&&t.rotate(n[r]),t.moveTo(-a,a),t.lineTo(a,-a),t.moveTo(-a,-a),t.lineTo(a,a),n[r]&&t.rotate(-n[r]),this.visuals.line.do_stroke&&(this.visuals.line.set_vectorize(t,r),t.stroke()),l.push(t.translate(-h[r],-c[r])));return l},e}(n.View),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.default_view=s,e.prototype.type="X",e.prototype.props=["line"],e}(n.Model),e.exports={Model:r,View:s}},{"./marker":171,underscore:92}],177:[function(t,e,i){var n,r,s,o,a,l=function(t,e){function i(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},u={}.hasOwnProperty;o=t("underscore"),a=t("rbush"),n=t("./glyph"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._index_data=function(){var t,e,i,n,r,s,l,u,h;for(e=a(),n=[],t=i=0,r=this.xs.length;r>=0?r>i:i>r;t=r>=0?++i:--i)l=function(){var e,i,n,r;for(n=this.xs[t],r=[],e=0,i=n.length;i>e;e++)s=n[e],o.isNaN(s)||r.push(s);return r}.call(this),h=function(){var e,i,n,r;for(n=this.ys[t],r=[],e=0,i=n.length;i>e;e++)u=n[e],o.isNaN(u)||r.push(u);return r}.call(this),0!==l.length&&n.push([o.min(l),o.min(h),o.max(l),o.max(h),{i:t}]);return e.load(n),e},e.prototype._render=function(t,e,i){var n,r,s,o,a,l,u,h,c,p,d,f;for(p=i.sxs,f=i.sys,h=[],s=0,a=e.length;a>s;s++){for(n=e[s],l=[p[n],f[n]],c=l[0],d=l[1],this.visuals.line.set_vectorize(t,n),r=o=0,u=c.length;u>=0?u>o:o>u;r=u>=0?++o:--o)0!==r?isNaN(c[r])||isNaN(d[r])?(t.stroke(),t.beginPath()):t.lineTo(c[r],d[r]):(t.beginPath(),t.moveTo(c[r],d[r]));h.push(t.stroke())}return h},e.prototype.draw_legend=function(t,e,i,n,r){return this._generic_line_legend(t,e,i,n,r)},e}(n.View),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=s,e.prototype.type="MultiLine",e.prototype.visuals=["line"],e.prototype.coords=[["xs","ys"]],e}(n.Model),e.exports={Model:r,View:s}},{"./glyph":158,rbush:89,underscore:92}],178:[function(t,e,i){var n,r,s,o,a=function(t,e){function i(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},l={}.hasOwnProperty;o=t("underscore"),n=t("./glyph"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype._set_data=function(){return this.max_w2=0,"data"===this.distances.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,"data"===this.distances.height.units?this.max_h2=this.max_height/2:void 0},e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){return"data"===this.distances.width.units?this.sw=this.sdist(this.renderer.xmapper,this.x,this.width,"center"):this.sw=this.width,"data"===this.distances.height.units?this.sh=this.sdist(this.renderer.ymapper,this.y,this.height,"center"):this.sh=this.height},e.prototype._render=function(t,e,i){var n,r,s,o,a,l,u,h;for(u=i.sx,h=i.sy,l=i.sw,a=i.sh,o=[],r=0,s=e.length;s>r;r++)n=e[r],isNaN(u[n]+h[n]+l[n]+a[n]+this.angle[n])||(t.translate(u[n],h[n]),t.rotate(this.angle[n]),t.beginPath(),t.moveTo(0,-a[n]/2),t.bezierCurveTo(l[n]/2,-a[n]/2,l[n]/2,a[n]/2,0,a[n]
|
|||
|
this.register_property("rule_coords",this._rule_coords,!1),this.add_dependencies("rule_coords",this,["computed_bounds","side"]),this.register_property("tick_coords",this._tick_coords,!1),this.add_dependencies("tick_coords",this,["computed_bounds","location"]),this.register_property("ranges",this._ranges,!0),this.register_property("normals",function(){return this._normals},!0),this.register_property("dimension",function(){return this._dim},!0),this.register_property("offsets",this._offsets,!0)},e.prototype.initialize_layout=function(t){var e,i;return e=new h.Model({solver:t}),this.panel=e,this._top=e._top,this._bottom=e._bottom,this._left=e._left,this._right=e._right,this._width=e._width,this._height=e._height,i=this.get("location"),"above"===i?(this._dim=0,this._normals=[0,-1],this._size=e._height,this._anchor=e._bottom):"below"===i?(this._dim=0,this._normals=[0,1],this._size=e._height,this._anchor=e._top):"left"===i?(this._dim=1,this._normals=[-1,0],this._size=e._width,this._anchor=e._right):"right"===i?(this._dim=1,this._normals=[1,0],this._size=e._width,this._anchor=e._left):x.error("unrecognized side: '"+i+"'")},e.prototype.update_layout=function(t,e){var i;return i=this.get("visible")?this._tick_extent(t)+this._tick_label_extent(t)+this._axis_label_extent(t):0,null==this._last_size&&(this._last_size=-1),i!==this._last_size?(this._last_size=i,null!=this._size_constraint&&e.remove_constraint(this._size_constraint),this._size_constraint=new w.Constraint(new w.Expression(this._size,-i),w.Operator.Eq),e.add_constraint(this._size_constraint)):void 0},e.prototype._offsets=function(){var t,e,i,n,r;return i=this.get("location"),e=[0,0],n=e[0],r=e[1],t=this.get("plot").get("frame"),"below"===i?r=Math.abs(this.panel.get("top")-t.get("bottom")):"above"===i?r=Math.abs(this.panel.get("bottom")-t.get("top")):"right"===i?n=Math.abs(this.panel.get("left")-t.get("right")):"left"===i&&(n=Math.abs(this.panel.get("right")-t.get("left"))),[n,r]},e.prototype._ranges=function(){var t,e,i,n;return e=this.get("dimension"),i=(e+1)%2,t=this.get("plot").get("frame"),n=[t.get("x_ranges")[this.get("x_range_name")],t.get("y_ranges")[this.get("y_range_name")]],[n[e],n[i]]},e.prototype._computed_bounds=function(){var t,e,i,n,r,s,o,a;return r=this.get("ranges"),i=r[0],t=r[1],a=null!=(s=this.get("bounds"))?s:"auto",n=[i.get("min"),i.get("max")],"auto"===a?n:f.isArray(a)?(Math.abs(a[0]-a[1])>Math.abs(n[0]-n[1])?(o=Math.max(Math.min(a[0],a[1]),n[0]),e=Math.min(Math.max(a[0],a[1]),n[1])):(o=Math.min(a[0],a[1]),e=Math.max(a[0],a[1])),[o,e]):(x.error("user bounds '"+a+"' not understood"),null)},e.prototype._rule_coords=function(){var t,e,i,n,r,s,o,a,l,u,h,c;return n=this.get("dimension"),r=(n+1)%2,a=this.get("ranges"),o=a[0],e=a[1],l=this.get("computed_bounds"),u=l[0],i=l[1],h=new Array(2),c=new Array(2),t=[h,c],s=this._get_loc(e),t[n][0]=Math.max(u,o.get("min")),t[n][1]=Math.min(i,o.get("max")),t[n][0]>t[n][1]&&(t[n][0]=t[n][1]=NaN),t[r][0]=s,t[r][1]=s,t},e.prototype._tick_coords=function(){var t,e,i,n,r,s,o,a,l,u,h,c,p,d,f,g,m,_,v,y,b,w,x,k,M,C,D,T;if(n=this.get("dimension"),s=(n+1)%2,v=this.get("ranges"),g=v[0],e=v[1],y=this.get("computed_bounds"),M=y[0],i=y[1],C=this.get("ticker").get_ticks(M,i,g,{}),h=C.major,f=C.minor,l=this._get_loc(e),D=[],T=[],t=[D,T],p=[],d=[],c=[p,d],"FactorRange"===g.type)for(r=o=0,b=h.length;b>=0?b>o:o>b;r=b>=0?++o:--o)t[n].push(h[r]),t[s].push(l);else{for(w=[g.get("min"),g.get("max")],_=w[0],m=w[1],r=a=0,x=h.length;x>=0?x>a:a>x;r=x>=0?++a:--a)h[r]<_||h[r]>m||(t[n].push(h[r]),t[s].push(l));for(r=u=0,k=f.length;k>=0?k>u:u>k;r=k>=0?++u:--u)f[r]<_||f[r]>m||(c[n].push(f[r]),c[s].push(l))}return{major:t,minor:c}},e.prototype._get_loc=function(t){var e,i,n,r;return i=t.get("start"),e=t.get("end"),r=this.get("location"),"left"===r||"below"===r?n="start":("right"===r||"above"===r)&&(n="end"),t.get(n)},e.prototype._tick_extent=function(t){return this.get("major_tick_out")},e.prototype._tick_label_extent=function(t){var e,i,n,r,s,o,a,l,u,h,c,p,d,g,m,_,y,b,w;for(o=0,s=this.get("dimension"),r=t.plot_view.canvas_view.ctx,n=this.ge
|
|||
|
t.__super__=e.prototype,t},p={}.hasOwnProperty;n=t("jquery"),l=t("underscore"),o=t("backbone"),u=t("../common/logging").logger,a=t("./remote_data_source"),r=function(t){function e(){return this.defaults=h(this.defaults,this),this.get_data=h(this.get_data,this),this.setup=h(this.setup,this),this.destroy=h(this.destroy,this),e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.type="AjaxDataSource",e.prototype.destroy=function(){return null!=this.interval?clearInterval(this.interval):void 0},e.prototype.setup=function(t,e){return this.pv=t,this.get_data(this.get("mode")),this.get("polling_interval")?this.interval=setInterval(this.get_data,this.get("polling_interval"),this.get("mode"),this.get("max_size"),this.get("if_modified")):void 0},e.prototype.get_data=function(t,e,i){return null==e&&(e=0),null==i&&(i=!1),n.ajax({dataType:"json",ifModified:i,url:this.get("data_url"),xhrField:{withCredentials:!0},method:this.get("method"),contentType:"application/json"}).done(function(i){return function(n){var r,s,o,a,l;if("replace"===t)i.set("data",n);else if("append"===t){for(a=i.get("data"),l=i.columns(),s=0,o=l.length;o>s;s++)r=l[s],n[r]=a[r].concat(n[r]).slice(-e);i.set("data",n)}else u.error("unsupported mode: "+t);return u.trace(n),null}}(this)).error(function(){return u.error(arguments)}),null},e.prototype.defaults=function(){return l.extend({},e.__super__.defaults.call(this),{mode:"replace"})},e}(a.RemoteDataSource),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.model=r,e.prototype.defaults={url:"",expr:null},e}(o.Collection),e.exports={Model:r,Collection:new s}},{"../common/logging":119,"./remote_data_source":205,backbone:2,jquery:18,underscore:92}],203:[function(t,e,i){var n,r,s,o,a,l,u,h=function(t,e){return function(){return t.apply(e,arguments)}},c=function(t,e){function i(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},p={}.hasOwnProperty;n=t("jquery"),l=t("underscore"),r=t("backbone"),u=t("../common/logging").logger,a=t("./remote_data_source"),s=function(t){function e(){return this.update=h(this.update,this),this.setup=h(this.setup,this),this.destroy=h(this.destroy,this),e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.type="BlazeDataSource",e.prototype.destroy=function(){return null!=this.interval?clearInterval(this.interval):void 0},e.prototype.setup=function(t,e){return this.pv=t,this.update(),this.get("polling_interval")?this.interval=setInterval(this.update,this.get("polling_interval")):void 0},e.prototype.update=function(){var t;return t=JSON.stringify({expr:this.get("expr"),namespace:this.get("namespace")}),n.ajax({dataType:"json",url:this.get("data_url"),data:t,xhrField:{withCredentials:!0},method:"POST",contentType:"application/json"}).done(function(t){return function(e){var i,n,r,s,o,a,u,h;for(n=l.zip.apply(l,e.data),r={},h=e.names,o=s=0,a=h.length;a>s;o=++s)i=h[o],r[i]=n[o];return u=l.clone(t.get("data")),l.extend(u,r),t.set("data",u),null}}(this))},e}(a.RemoteDataSource),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.model=s,e.prototype.defaults={url:"",expr:null},e}(r.Collection),e.exports={Model:s,Collection:new o}},{"../common/logging":119,"./remote_data_source":205,backbone:2,jquery:18,underscore:92}],204:[function(t,e,i){var n,r,s,o,a,l=function(t,e){return function(){return t.apply(e,arguments)}},u=function(t,e){function i(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},h={}.hasOwnProperty;o=t("underscore"),r=t("../common/has_properties"),s=t("../common/selection_manager"),a=t("../common/hittest"),n=function(t){function e(){return this.defaults=l(this.defaults,this),e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.type="ColumnDataSource",e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this,"chang
|
|||
|
return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.type="MonthsTicker",e.prototype.initialize=function(t,i){var n,s;return e.__super__.initialize.call(this,t,i),s=this.get("months"),n=s.length>1?(s[1]-s[0])*r:12*r,this.set("interval",n)},e.prototype.get_ticks_no_defaults=function(t,e,i){var n,r,s,u,h,c,p;return p=l(t,e),u=this.get("months"),h=function(t){return u.map(function(e){var i;return i=a(t),i.setUTCMonth(e),i})},s=o.flatten(function(){var t,e,i;for(i=[],t=0,e=p.length;e>t;t++)r=p[t],i.push(h(r));return i}()),n=o.invoke(s,"getTime"),c=o.filter(n,function(i){return i>=t&&e>=i}),{major:c,minor:[]}},e.prototype.defaults=function(){return o.extend({},e.__super__.defaults.call(this),{toString_properties:["months"]})},e}(s.Model),e.exports={Model:n}},{"./single_interval_ticker":223,"./util":224,underscore:92}],221:[function(t,e,i){var n,r,s,o,a=function(t,e){function i(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},l={}.hasOwnProperty;o=t("underscore"),r=t("../../vendor/numeral.js-1.5.3/numeral.js"),n=t("../common/has_properties"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="NumeralTickFormatter",e.prototype.format=function(t){var e,i,n,s,o;return e=this.get("format"),n=this.get("language"),s=function(){switch(this.get("rounding")){case"round":case"nearest":return Math.round;case"floor":case"rounddown":return Math.floor;case"ceil":case"roundup":return Math.ceil}}.call(this),i=function(){var i,a,l;for(l=[],i=0,a=t.length;a>i;i++)o=t[i],l.push(r.format(o,e,n,s));return l}()},e.prototype.defaults=function(){return o.extend({},e.__super__.defaults.call(this),{format:"0,0",language:"en",rounding:"round"})},e}(n),e.exports={Model:s}},{"../../vendor/numeral.js-1.5.3/numeral.js":304,"../common/has_properties":115,underscore:92}],222:[function(t,e,i){var n,r,s,o,a=function(t,e){function i(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},l={}.hasOwnProperty;o=t("underscore"),s=t("sprintf"),n=t("../common/has_properties"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="PrintfTickFormatter",e.prototype.format=function(t){var e,i,n;return e=this.get("format"),i=function(){var i,r,o;for(o=[],i=0,r=t.length;r>i;i++)n=t[i],o.push(s.sprintf(e,n));return o}()},e.prototype.defaults=function(){return o.extend({},e.__super__.defaults.call(this),{format:"%s"})},e}(n),e.exports={Model:r}},{"../common/has_properties":115,sprintf:90,underscore:92}],223:[function(t,e,i){var n,r,s,o=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},a={}.hasOwnProperty;s=t("underscore"),n=t("./abstract_ticker"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.type="SingleIntervalTicker",e.prototype.initialize=function(t,i){return e.__super__.initialize.call(this,t,i),this.register_property("min_interval",function(){return this.get("interval")},!0),this.add_dependencies("min_interval",this,["interval"]),this.register_property("max_interval",function(){return this.get("interval")},!0),this.add_dependencies("max_interval",this,["interval"])},e.prototype.get_interval=function(t,e,i){return this.get("interval")},e.prototype.defaults=function(){return s.extend({},e.__super__.defaults.call(this),{toString_properties:["interval"]})},e}(n.Model),e.exports={Model:r}},{"./abstract_ticker":207,underscore:92}],224:[function(t,e,i){var n,r,s,o,a,l,u,h,c,p,d,f;h=t("underscore"),s=1,l=1e3,o=60*l,r=60*o,n=24*r,a=30*n,u=365*n,c=function(t){var e;return e=h.min(h.range(t.length),function(e){return t[e]})},p=function(t){return new Date(t.getTime())},d=function(t){return t=p(t),t.setUTCDate(1),t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),t},f=fun
|
|||
|
n=t("./gesture_tool"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype._pan_start=function(t){var e,i,n,r,s,o;return this.last_dx=0,this.last_dy=0,e=this.plot_view.canvas,i=this.plot_view.frame,s=e.sx_to_vx(t.bokeh.sx),o=e.sy_to_vy(t.bokeh.sy),i.contains(s,o)||(n=i.get("h_range"),r=i.get("v_range"),(s<n.get("start")||s>n.get("end"))&&(this.v_axis_only=!0),(o<r.get("start")||o>r.get("end"))&&(this.h_axis_only=!0)),this.plot_view.interactive_timestamp=Date.now()},e.prototype._pan=function(t){return this._update(t.deltaX,-t.deltaY),this.plot_view.interactive_timestamp=Date.now()},e.prototype._pan_end=function(t){return this.h_axis_only=!1,this.v_axis_only=!1},e.prototype._update=function(t,e){var i,n,r,s,a,l,u,h,c,p,d,f,g,m,_,v,y,b,w,x,k,M,C,D,T,S,A;r=this.plot_view.frame,u=t-this.last_dx,h=e-this.last_dy,s=o.clone(r.get("h_range")),x=s.get("start")-u,w=s.get("end")-u,T=o.clone(r.get("v_range")),D=T.get("start")-h,C=T.get("end")-h,i=this.mget("dimensions"),i.indexOf("width")>-1&&!this.v_axis_only?(y=x,b=w,m=-u):(y=s.get("start"),b=s.get("end"),m=0),i.indexOf("height")>-1&&!this.h_axis_only?(k=D,M=C,_=h):(k=T.get("start"),M=T.get("end"),_=0),this.last_dx=t,this.last_dy=e,S={},p=r.get("x_mappers");for(l in p)a=p[l],d=a.v_map_from_target([y,b],!0),v=d[0],n=d[1],S[l]={start:v,end:n};A={},f=r.get("y_mappers");for(l in f)a=f[l],g=a.v_map_from_target([k,M],!0),v=g[0],n=g[1],A[l]={start:v,end:n};return c={xrs:S,yrs:A,sdx:m,sdy:_},this.plot_view.update_range(c),null},e}(n.View),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.default_view=s,e.prototype.type="PanTool",e.prototype.tool_name="Pan",e.prototype.icon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCRTI5MDhEODIwQjUxMUU0ODREQUYzNzM5QTM2MjBCRSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpCRTI5MDhEOTIwQjUxMUU0ODREQUYzNzM5QTM2MjBCRSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkJFMjkwOEQ2MjBCNTExRTQ4NERBRjM3MzlBMzYyMEJFIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkJFMjkwOEQ3MjBCNTExRTQ4NERBRjM3MzlBMzYyMEJFIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+OXzPwwAAAKNJREFUeNrsVsEKgCAM3cyj0f8fuwT9XdEHrLyVIOKYY4kPPDim0+fenF+3HZi4nhFec+Rs4oCPAALwjDVUsKMWA6DNAFX6YXcMYIERdRWIYBzAZbKYGsSKex6mVUAK8Za0TphgoFTbpSvlx3/I0EQOILO2i/ibegLk/mgVONM4JvuBVizgkGH3XTGrR/xlV0ycbO8qCeMN54wdtVQwSTFwCzAATqEZUn8W8W4AAAAASUVORK5CYII=",e.prototype.event_type="pan",e.prototype.default_order=10,e.prototype.initialize=function(t,i){return e.__super__.initialize.call(this,t,i),this.register_property("tooltip",function(){return this._get_dim_tooltip("Pan",this._check_dims(this.get("dimensions"),"pan tool"))},!1),this.add_dependencies("tooltip",this,["dimensions"])},e.prototype.defaults=function(){return o.extend({},e.__super__.defaults.call(this),{dimensions:["width","height"]})},e}(n.Model),e.exports={Model:r,View:s}},{"./gesture_tool":235,underscore:92}],238:[function(t,e,i){var n,r,s,o,a,l=function(t,e){function i(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},u={}.hasOwnProperty;a=t("underscore"),s=t("../../renderer/overlay/poly_selection"),o=t("./select_tool"),r=function(t){function e(){return e.__super__.constructor.ap
|
|||
|
u=[a.max([u[0],r.get("min")]),a.min([u[1],r.get("max")])]):u=[r.get("min"),r.get("max")],s=i.get("v_range"),n.indexOf("height")>=0?(p=[a.min([h,c]),a.max([h,c])],p=[a.max([p[0],s.get("min")]),a.min([p[1],s.get("max")])]):p=[s.get("min"),s.get("max")],[u,p]},e.prototype.defaults=function(){return a.extend({},e.__super__.defaults.call(this),{tool_name:this.tool_name,level:"overlay"})},e}(n),e.exports={Model:s,View:o}},{"../common/has_properties":115,"../common/logging":119,"../common/plot_widget":125,underscore:92}],248:[function(t,e,i){var n,r;r=function(t,e,i,n,r,s,o,a){var l,u,h,c,p,d,f,g,m,_,v,y;return l=a*r,u=-o*s,h=o*r,c=a*s,d=.5*(n-i),p=8/3*Math.sin(.5*d)*Math.sin(.5*d)/Math.sin(d),f=t+Math.cos(i)-p*Math.sin(i),_=e+Math.sin(i)+p*Math.cos(i),m=t+Math.cos(n),y=e+Math.sin(n),g=m+p*Math.sin(n),v=y-p*Math.cos(n),[l*f+u*_,h*f+c*_,l*g+u*v,h*g+c*v,l*m+u*y,h*m+c*y]},n=function(t,e,i,n,s,o,a,l,u){var h,c,p,d,f,g,m,_,v,y,b,w,x,k,M,C,D,T,S,A,P,E,I,N,R,z,j,O,F;return T=s*(Math.PI/180),D=Math.sin(T),f=Math.cos(T),w=Math.abs(i),x=Math.abs(n),v=f*(t-l)*.5+D*(e-u)*.5,y=f*(e-u)*.5-D*(t-l)*.5,_=v*v/(w*w)+y*y/(x*x),_>1&&(_=Math.sqrt(_),w*=_,x*=_),h=f/w,c=D/w,p=-D/x,d=f/x,N=h*t+c*e,j=p*t+d*e,R=h*l+c*u,O=p*l+d*u,g=(R-N)*(R-N)+(O-j)*(O-j),C=1/g-.25,0>C&&(C=0),M=Math.sqrt(C),a===o&&(M=-M),z=.5*(N+R)-M*(O-j),F=.5*(j+O)+M*(R-N),S=Math.atan2(j-F,N-z),A=Math.atan2(O-F,R-z),I=A-S,0>I&&1===a?I+=2*Math.PI:I>0&&0===a&&(I-=2*Math.PI),k=Math.ceil(Math.abs(I/(.5*Math.PI+.001))),b=function(){var t,e,i;for(i=[],m=t=0,e=k;e>=0?e>t:t>e;m=e>=0?++t:--t)P=S+m*I/k,E=S+(m+1)*I/k,i.push(r(z,F,P,E,w,x,D,f));return i}()},e.exports={arc_to_bezier:n,segment_to_bezier:r}},{}],249:[function(t,e,i){var n,r,s;r=t("underscore"),n=t("jquery"),s=function(t,e){var i,r;return i=function(i){return function(){return n.contains(document.documentElement,t)?(clearInterval(r),e()):void 0}}(this),r=setInterval(i,50)},e.exports={waitForElement:s}},{jquery:18,underscore:92}],250:[function(t,e,i){var n,r,s,o,a;s=t("underscore"),r=t("sprintf"),n=t("../../vendor/numeral.js-1.5.3/numeral.js"),o=function(t){var e;return s.isNumber(t)?(e=function(){switch(!1){case Math.floor(t)!==t:return"%d";case!(Math.abs(t)>.1&&Math.abs(t)<1e3):return"%0.3f";default:return"%0.3e"}}(),r.sprintf(e,t)):""+t},a=function(t,e,i,r){return null==r&&(r={}),t=t.replace(/(^|[^\$])\$(\w+)/g,function(t){return function(t,e,i){return e+"@$"+i}}(this)),t=t.replace(/(^|[^@])@(?:(\$?\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t){return function(t,a,l,u,h){var c,p,d;return l=null!=u?u:l,d="$"===l[0]?r[l.substring(1)]:null!=(c=e.get_column(l))?c[i]:void 0,p=null==d?"???":null!=h?n.format(d,h):o(d),""+a+s.escape(p)}}(this))},e.exports={replace_placeholders:a}},{"../../vendor/numeral.js-1.5.3/numeral.js":304,sprintf:90,underscore:92}],251:[function(t,e,i){(function(i){var n,r,s,o,a,l=function(t,e){function i(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},u={}.hasOwnProperty;a=t("underscore"),n=null!=i._bokehTest?void 0:t("jquery-ui/autocomplete"),o=t("./text_input"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.render=function(){var t;return e.__super__.render.call(this),t=this.$el.find("input"),t.autocomplete({source:this.mget("completions")}),t.autocomplete("widget").addClass("bk-autocomplete-input"),this},e}(o.View),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="AutocompleteInput",e.prototype.default_view=s,e.prototype.defaults=function(){return a.extend({},e.__super__.defaults.call(this),{completions:[]})},e}(o.Model),e.exports={View:s,Model:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./text_input":288,"jquery-ui/autocomplete":5,underscore:92}],252:[function(t,e,i){var n,r,s,o,a,l,u=function(t,e){function i(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super
|
|||
|
function e(){return e.__super__.constructor.apply(this,arguments)}return I(e,t),e}(o),l=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return I(e,t),e.prototype.default_view=u,e.prototype.defaults=function(){return M.extend({},e.__super__.defaults.call(this),{type:"ContinuousColumn",label:"Continuous",name:"",fields:["count","mean","std","min","max"],count:0,mean:0,std:0,min:0,max:0})},e}(b),D={DiscreteColumn:f,TimeColumn:x,ContinuousColumn:l},s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return I(e,t),e.prototype.model=function(t,e){return t.type in D?new D[t.type](t):(console.log("Unknown column type: '"+t.type+"'"),null)},e}(r),e.exports={Model:c,View:p,Collection:new d}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../common/build_views":101,"../common/close_wrapper":106,"../common/collection":107,"../common/continuum_view":109,"../common/has_parent":114,"../common/has_properties":115,"./crossfilter_column_template":258,"./crossfilter_facet_template":259,"./crossfilter_template":260,"jquery-ui/draggable":9,"jquery-ui/droppable":10,underscore:92}],258:[function(t,e,i){e.exports=function(t){t||(t={});var e,i=[],n=function(t){return t&&t.ecoSafe?t:"undefined"!=typeof t&&null!=t?s(t):""},r=t.safe,s=t.escape;return e=t.safe=function(t){if(t&&t.ecoSafe)return t;("undefined"==typeof t||null==t)&&(t="");var e=new String(t);return e.ecoSafe=!0,e},s||(s=t.escape=function(t){return(""+t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}),function(){(function(){var t,e,r,s;for("Continuous"===this.label?i.push('\n<div class="bk-bs-panel-heading bk-crossfilter-panel-heading bk-crossfilter-panel-continuous-heading">\n'):i.push('\n<div class="bk-bs-panel-heading bk-crossfilter-panel-heading bk-crossfilter-panel-factor-heading">\n'),i.push("\n "),i.push(n(this.name)),i.push(' <span style="font-size:x-small;">('),i.push(n(this.label)),i.push(')</span>\n</div>\n\n\n<div class="bk-bs-panel-body">\n\n <table class="bk-table">\n\n <tbody>\n\n '),s=this.fields,e=0,r=s.length;r>e;e++)t=s[e],i.push("\n <tr> <td> "),i.push(n(t)),i.push(" </td> <td> "),i.push(n(this[t])),i.push(" </td> </tr>\n ");i.push("\n\n </tbody>\n\n </table>\n\n</div>")}).call(this)}.call(t),t.safe=r,t.escape=s,i.join("")}},{}],259:[function(t,e,i){e.exports=function(t){t||(t={});var e,i=[],n=function(t){return t&&t.ecoSafe?t:"undefined"!=typeof t&&null!=t?s(t):""},r=t.safe,s=t.escape;return e=t.safe=function(t){if(t&&t.ecoSafe)return t;("undefined"==typeof t||null==t)&&(t="");var e=new String(t);return e.ecoSafe=!0,e},s||(s=t.escape=function(t){return(""+t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}),function(){(function(){i.push(n(this.name)),i.push(" [x]")}).call(this)}.call(t),t.safe=r,t.escape=s,i.join("")}},{}],260:[function(t,e,i){e.exports=function(t){t||(t={});var e,i=[],n=t.safe,r=t.escape;return e=t.safe=function(t){if(t&&t.ecoSafe)return t;("undefined"==typeof t||null==t)&&(t="");var e=new String(t);return e.ecoSafe=!0,e},r||(r=t.escape=function(t){return(""+t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}),function(){(function(){i.push('<div class="bk-crossfilter-container">\n\n <table>\n\n <tr>\n\n <td class="aligntable">\n\n <div class="bk-crossfilter-configuration bk-bs-container">\n\n <div class="bk-crossfilter-row">\n\n <div class="col-md-5 bk-column-list" />\n\n <div class="col-md-7 bk-filters-facets">\n\n <div class="bk-bs-panel bk-bs-panel-primary bk-filters">\n <div class="bk-bs-panel-heading bk-crossfilter-panel-heading"> Filter </div>\n <div class="bk-bs-panel-body bk-filters-selections" />\n </div>\n\n <div class="bk-bs-panel bk-bs-panel-primary bk-facet bk-facet-x">\n <div class="bk-bs-panel-heading bk-crossfilter-panel
|
|||
|
return t=function(){var t,n,r,s;for(r=this.$("input"),s=[],e=t=0,n=r.length;n>t;e=++t)i=r[e],i.checked&&s.push(e);return s}.call(this),this.mset("active",t[0]),this.model.save(),null!=(n=this.mget("callback"))?n.execute(this.model):void 0},e}(s),a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="RadioButtonGroup",e.prototype.default_view=l,e.prototype.defaults=function(){return u.extend({},e.__super__.defaults.call(this),{active:null,labels:[],type:"default",disabled:!1})},e}(o),e.exports={Model:a,View:l}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../common/continuum_view":109,"../common/has_parent":114,"bootstrap/button":293,jquery:18,underscore:92}],279:[function(t,e,i){var n,r,s,o,a,l,u=function(t,e){function i(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},h={}.hasOwnProperty;l=t("underscore"),n=t("jquery"),r=t("../common/continuum_view"),s=t("../common/has_parent"),a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.tagName="div",e.prototype.events={"change input":"change_input"},e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.render(),this.listenTo(this.model,"change",this.render)},e.prototype.render=function(){var t,e,i,r,s,o,a,u,h,c;for(this.$el.empty(),h=l.uniqueId("RadioGroup"),r=this.mget("active"),c=this.mget("labels"),s=o=0,u=c.length;u>o;s=++o)a=c[s],e=n('<input type="radio">').attr({name:h,value:""+s}),this.mget("disabled")&&e.prop("disabled",!0),s===r&&e.prop("checked",!0),i=n("<label></label>").text(a).prepend(e),this.mget("inline")?(i.addClass("bk-bs-radio-inline"),this.$el.append(i)):(t=n('<div class="bk-bs-radio"></div>').append(i),this.$el.append(t));return this},e.prototype.change_input=function(){var t,e,i;return t=function(){var t,n,r,s;for(r=this.$("input"),s=[],e=t=0,n=r.length;n>t;e=++t)i=r[e],i.checked&&s.push(e);return s}.call(this),this.mset("active",t[0]),this.model.save()},e}(r),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.type="RadioGroup",e.prototype.default_view=a,e.prototype.defaults=function(){return l.extend({},e.__super__.defaults.call(this),{active:null,labels:[],inline:!1,disabled:!1})},e}(s),e.exports={Model:o,View:a}},{"../common/continuum_view":109,"../common/has_parent":114,jquery:18,underscore:92}],280:[function(t,e,i){var n,r,s,o,a,l,u,h=function(t,e){function i(){this.constructor=t}for(var n in e)c.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},c={}.hasOwnProperty;a=t("underscore"),n=t("../common/continuum_view"),r=t("../common/has_parent"),l=t("../common/logging").logger,u=t("./selecttemplate"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.tagName="div",e.prototype.template=u,e.prototype.events={"change select":"change_input"},e.prototype.change_input=function(){var t,e;return e=this.$("select").val(),l.debug("selectbox: value = "+e),this.mset("value",e),this.model.save(),null!=(t=this.mget("callback"))?t.execute(this.model):void 0},e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.render(),this.listenTo(this.model,"change",this.render)},e.prototype.render=function(){var t;return this.$el.empty(),t=this.template(this.model.attributes),this.$el.html(t),this},e}(n),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="Select",e.prototype.default_view=o,e.prototype.defaults=function(){return a.extend({},e.__super__.defaults.call(this),{title:"",value:"",options:[]})},e}(r),e.exports={Model:s,View:o}},{"../common/continuum_view":109,"../common/has_parent":114,"../common/logging":119,"./selecttemplate":281,underscore:92}],281:[function(t,e,i){e.exports=function(t){t||(t={});var e,i=[],n=function(t){ret
|
|||
|
T=o(j,3*a/4-h-c),k=s(x,a),w=[],w.push("M",_[6].x,_[6].y),w.push("C",_[5].x,_[5].y,_[4].x,_[4].y,_[3].x,_[3].y,_[2].x,_[2].y,_[1].x,_[1].y,_[0].x,_[0].y),R>z&&w.push("L",M.x,M.y),w.push("A",z,z,0,0,0,C.x,C.y),R>z&&w.push("L",v[0].x,v[0].y),w.push("C",v[1].x,v[1].y,v[2].x,v[2].y,v[3].x,v[3].y,v[4].x,v[4].y,v[5].x,v[5].y,v[6].x,v[6].y),D.y<T.y&&(w.push("A",L,L,0,0,0,D.x,D.y),w.push("A",j,j,0,0,0,T.x,T.y)),w.push("A",L,L,0,0,0,k.x,k.y),w}}(),e.exports={create_gear_tooth:r,create_internal_gear_tooth:s}},{}],298:[function(t,e,i){!function(t,n){"function"==typeof define&&define.amd?define([],n):"undefined"!=typeof i?(e.exports=n(),"undefined"==typeof window&&(t.gloo2=e.exports)):t.gloo2=n()}(this,function(){var t,e,i,n,r,s,o;return o=function(t,e){var i,n,r,s,o,a,l,u;for(e=void 0===e?"periodic check":e,l=[];;){if(o=t.getError(),o==t.NO_ERROR||l&&o==l[l.length-1])break;(l.append||l.push).apply(l,[o])}if(l.length){for(u="",i=l,"object"!=typeof i||Array.isArray(i)||(i=Object.keys(i)),r=i.length,n=0;r>n;n+=1)s=i[n],u+=s;throw a=new Error("RuntimeError:"+("OpenGL got errors ("+e+"): "+u)),a.name="RuntimeError",a}},e=function(){this.__init__&&this.__init__.apply(this,arguments)},e.prototype._base_class=Object,e.prototype.__init__=function(t){if(this._gl=t,this._handle=null,this._create(),null===this._handle)throw"AssertionError: this._handle !== null"},e.prototype._create=function(){var t;throw t=new Error("NotImplementedError:"),t.name="NotImplementedError",t},n=function(){this.__init__&&this.__init__.apply(this,arguments)},n.prototype=Object.create(e.prototype),n.prototype._base_class=e.prototype,n.prototype.UTYPEMAP={"float":"uniform1fv",vec2:"uniform2fv",vec3:"uniform3fv",vec4:"uniform4fv","int":"uniform1iv",ivec2:"uniform2iv",ivec3:"uniform3iv",ivec4:"uniform4iv",bool:"uniform1iv",bvec2:"uniform2iv",bvec3:"uniform3iv",bvec4:"uniform4iv",mat2:"uniformMatrix2fv",mat3:"uniformMatrix3fv",mat4:"uniformMatrix4fv",sampler1D:"uniform1i",sampler2D:"uniform1i",sampler3D:"uniform1i"},n.prototype.ATYPEMAP={"float":"vertexAttrib1f",vec2:"vertexAttrib2f",vec3:"vertexAttrib3f",vec4:"vertexAttrib4f"},n.prototype.ATYPEINFO={"float":[1,5126],vec2:[2,5126],vec3:[3,5126],vec4:[4,5126]},n.prototype._create=function(){this._handle=this._gl.createProgram(),this._handles=[],this._unset_variables=[],this._validated=!1,this._samplers={},this._attributes={},this._known_invalid=[]},n.prototype["delete"]=function(){this._gl.deleteProgram(this._handle)},n.prototype.activate=function(){this._gl.useProgram(this._handle)},n.prototype.deactivate=function(){this._gl.useProgram(0)},n.prototype.set_shaders=function(t,e){var i,n,r,s,o,a,l,u,h,c,p,d,f;for(l=this._gl,this._linked=!1,f=l.createShader(l.VERTEX_SHADER),a=l.createShader(l.FRAGMENT_SHADER),p=[[t,f,"vertex"],[e,a,"fragment"]],h=0;2>h;h+=1)if(n=p[h],i=n[0],u=n[1],d=n[2],l.shaderSource(u,i),l.compileShader(u),c=l.getShaderParameter(u,l.COMPILE_STATUS),!c)throw o=l.getShaderInfoLog(u),s=new Error("RuntimeError:"+("errors in "+d+" shader:\n"+o)),s.name="RuntimeError",s;if(l.attachShader(this._handle,f),l.attachShader(this._handle,a),l.linkProgram(this._handle),!l.getProgramParameter(this._handle,l.LINK_STATUS))throw r=new Error("RuntimeError:Program link error:\n"+l.getProgramInfoLog(this._handle)),r.name="RuntimeError",r;l.detachShader(this._handle,f),l.detachShader(this._handle,a),l.deleteShader(f),l.deleteShader(a),this._unset_variables=this._get_active_attributes_and_uniforms(),this._handles={},this._known_invalid=[],this._linked=!0},n.prototype._get_active_attributes_and_uniforms=function(){var t,e,i,n,r,s,o,a,l,u,h,c,p,d,f,g,m,_,v,y,b,w,x,k,M;for(m=this._gl,w=new RegExp("(\\w+)\\s*(\\[(\\d+)\\])\\s*"),r=m.getProgramParameter(this._handle,m.ACTIVE_UNIFORMS),e=m.getProgramParameter(this._handle,m.ACTIVE_ATTRIBUTES),t=[],x=[],c=[[t,e,m.getActiveAttrib],[x,r,m.getActiveUniform]],"object"!=typeof c||Array.isArray(c)||(c=Object.keys(c)),d=c.length,p=0;d>p;p+=1)for(M=c[p],h=M,i=h[0],n=h[1],g=h[2],_=0;n>_;_+=1)if(v=g.call(m,this._handle,_),b=v.name,y=b.match(w))for(b=y.group(0),_=0;_<v.size;_+=1)(i.appen
|
|||
|
u.results=[],n(a||u[p]||i.droppable).each(function(s,a){return h.target=a,t.isPropagationStopped=function(){return!1},l=a?r.dispatch.call(a,t,h):null,l===!1?("drag"==p&&(u.cancelled=!0,i.propagates-=1),"drop"==e&&(u[p][s]=null)):"dropinit"==e&&u.droppable.push(o.element(l)||a),"dragstart"==e&&(u.proxy=n(o.element(l)||u.drag)[0]),u.results.push(l),delete t.result,"dropinit"!==e?l:void 0}),i.results[d]=o.flatten(u.results),"dropinit"==e&&(u.droppable=o.flatten(u.droppable)),"dragstart"!=e||u.cancelled||h.update()}while(++d<f);return t.type=c.type,t.originalEvent=c.event,o.flatten(i.results)}},properties:function(t,e,i){var n=i.callback;return n.drag=i.drag,n.proxy=i.proxy||i.drag,n.startX=e.pageX,n.startY=e.pageY,n.deltaX=t.pageX-e.pageX,n.deltaY=t.pageY-e.pageY,n.originalX=i.offset.left,n.originalY=i.offset.top,n.offsetX=n.originalX+n.deltaX,n.offsetY=n.originalY+n.deltaY,n.drop=o.flatten((i.drop||[]).slice()),n.available=o.flatten((i.droppable||[]).slice()),n},element:function(t){return t&&(t.jquery||1==t.nodeType)?t:void 0},flatten:function(t){return n.map(t,function(t){return t&&t.jquery?n.makeArray(t):t&&t.length?o.flatten(t):t})},textselect:function(t){n(document)[t?"unbind":"bind"]("selectstart",o.dontstart).css("MozUserSelect",t?"":"none"),document.unselectable=t?"off":"on"},dontstart:function(){return!1},callback:function(){}};o.callback.prototype={update:function(){s.drop&&this.available.length&&n.each(this.available,function(t){s.drop.locate(this,t)})}};var a=r.dispatch;r.dispatch=function(t){return n.data(this,"suppress."+t.type)-(new Date).getTime()>0?void n.removeData(this,"suppress."+t.type):a.apply(this,arguments)};var l=r.fixHooks.touchstart=r.fixHooks.touchmove=r.fixHooks.touchend=r.fixHooks.touchcancel={props:"clientX clientY pageX pageY screenX screenY".split(" "),filter:function(t,e){if(e){var i=e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0]||null;i&&n.each(l.props,function(e,n){t[n]=i[n]})}return t}};s.draginit=s.dragstart=s.dragend=o},{jquery:18}],302:[function(t,e,i){var n=t("jquery");t("jquery_event_drag");n.fn.drop=function(t,e,i){var r="string"==typeof t?t:"",s=n.isFunction(t)?t:n.isFunction(e)?e:null;return 0!==r.indexOf("drop")&&(r="drop"+r),i=(t==s?e:i)||{},s?this.bind(r,i,s):this.trigger(r)},n.drop=function(t){t=t||{},o.multi=t.multi===!0?1/0:t.multi===!1?1:isNaN(t.multi)?o.multi:t.multi,o.delay=t.delay||o.delay,o.tolerance=n.isFunction(t.tolerance)?t.tolerance:null===t.tolerance?null:o.tolerance,o.mode=t.mode||o.mode||"intersect"};var r=n.event,s=r.special,o=n.event.special.drop={multi:1,delay:20,mode:"overlap",targets:[],datakey:"dropdata",noBubble:!0,add:function(t){var e=n.data(this,o.datakey);e.related+=1},remove:function(){n.data(this,o.datakey).related-=1},setup:function(){if(!n.data(this,o.datakey)){var t={related:0,active:[],anyactive:0,winner:0,location:{}};n.data(this,o.datakey,t),o.targets.push(this)}},teardown:function(){var t=n.data(this,o.datakey)||{};if(!t.related){n.removeData(this,o.datakey);var e=this;o.targets=n.grep(o.targets,function(t){return t!==e})}},handler:function(t,e){var i;if(e)switch(t.type){case"mousedown":case"touchstart":i=n(o.targets),"string"==typeof e.drop&&(i=i.filter(e.drop)),i.each(function(){var t=n.data(this,o.datakey);t.active=[],t.anyactive=0,t.winner=0}),e.droppable=i,s.drag.hijack(t,"dropinit",e);break;case"mousemove":case"touchmove":o.event=t,o.timer||o.tolerate(e);break;case"mouseup":case"touchend":o.timer=clearTimeout(o.timer),e.propagates&&(s.drag.hijack(t,"drop",e),s.drag.hijack(t,"dropend",e))}},locate:function(t,e){var i=n.data(t,o.datakey),r=n(t),s=r.offset()||{},a=r.outerHeight(),l=r.outerWidth(),u={elem:t,width:l,height:a,top:s.top,left:s.left,right:s.left+l,bottom:s.top+a};return i&&(i.location=u,i.index=e,i.elem=t),u},contains:function(t,e){return(e[0]||e.left)>=t.left&&(e[0]||e.right)<=t.right&&(e[1]||e.top)>=t.top&&(e[1]||e.bottom)<=t.bottom},modes:{intersect:function(t,e,i){return this.contains(i,[t.pageX,t.pageY])?1e9:this.modes.overlap.apply(this,arguments)},overlap:function(t,e,i){return Math.max(0,Math.m
|
|||
|
m.setActiveCell(e.row,e.cell);else if(-1!==n&&(t.ctrlKey||t.metaKey))i=r.grep(i,function(t,i){return t!==e.row}),m.setActiveCell(e.row,e.cell);else if(i.length&&t.shiftKey){var s=i.pop(),l=Math.min(e.row,s),u=Math.max(e.row,s);i=[];for(var h=l;u>=h;h++)h!==s&&i.push(h);i.push(s),m.setActiveCell(e.row,e.cell)}return y=a(i),c(y),t.stopImmediatePropagation(),!0}var m,_,v,y=[],b=this,w=new s.EventHandler,x={selectActiveRow:!0};r.extend(this,{getSelectedRows:u,setSelectedRows:h,getSelectedRanges:p,setSelectedRanges:c,init:e,destroy:i,onSelectedRangesChanged:new s.Event})}var r=t("jquery"),s=t("../slick.core");e.exports=n},{"../slick.core":307,jquery:18}],307:[function(t,e,i){function n(){var t=!1,e=!1;this.stopPropagation=function(){t=!0},this.isPropagationStopped=function(){return t},this.stopImmediatePropagation=function(){e=!0},this.isImmediatePropagationStopped=function(){return e}}function r(){var t=[];this.subscribe=function(e){t.push(e)},this.unsubscribe=function(e){for(var i=t.length-1;i>=0;i--)t[i]===e&&t.splice(i,1)},this.notify=function(e,i,r){i=i||new n,r=r||this;for(var s,o=0;o<t.length&&!i.isPropagationStopped()&&!i.isImmediatePropagationStopped();o++)s=t[o].call(r,i,e);return s}}function s(){var t=[];this.subscribe=function(e,i){return t.push({event:e,handler:i}),e.subscribe(i),this},this.unsubscribe=function(e,i){for(var n=t.length;n--;)if(t[n].event===e&&t[n].handler===i)return t.splice(n,1),void e.unsubscribe(i);return this},this.unsubscribeAll=function(){for(var e=t.length;e--;)t[e].event.unsubscribe(t[e].handler);return t=[],this}}function o(t,e,i,n){void 0===i&&void 0===n&&(i=t,n=e),this.fromRow=Math.min(t,i),this.fromCell=Math.min(e,n),this.toRow=Math.max(t,i),this.toCell=Math.max(e,n),this.isSingleRow=function(){return this.fromRow==this.toRow},this.isSingleCell=function(){return this.fromRow==this.toRow&&this.fromCell==this.toCell},this.contains=function(t,e){return t>=this.fromRow&&t<=this.toRow&&e>=this.fromCell&&e<=this.toCell},this.toString=function(){return this.isSingleCell()?"("+this.fromRow+":"+this.fromCell+")":"("+this.fromRow+":"+this.fromCell+" - "+this.toRow+":"+this.toCell+")"}}function a(){this.__nonDataRow=!0}function l(){this.__group=!0,this.level=0,this.count=0,this.value=null,this.title=null,this.collapsed=!1,this.totals=null,this.rows=[],this.groups=null,this.groupingKey=null}function u(){this.__groupTotals=!0,this.group=null,this.initialized=!1}function h(){var t=null;this.isActive=function(e){return e?t===e:null!==t},this.activate=function(e){if(e!==t){if(null!==t)throw"SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController";if(!e.commitCurrentEdit)throw"SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()";if(!e.cancelCurrentEdit)throw"SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()";t=e}},this.deactivate=function(e){if(t!==e)throw"SlickGrid.EditorLock.deactivate: specified editController is not the currently active one";t=null},this.commitCurrentEdit=function(){return t?t.commitCurrentEdit():!0},this.cancelCurrentEdit=function(){return t?t.cancelCurrentEdit():!0}}var c=(t("jquery"),{Event:r,EventData:n,EventHandler:s,Range:o,NonDataRow:a,Group:l,GroupTotals:u,EditorLock:h,GlobalEditorLock:new h});l.prototype=new a,l.prototype.equals=function(t){return this.value===t.value&&this.count===t.count&&this.collapsed===t.collapsed&&this.title===t.title},u.prototype=new a,e.exports=c},{jquery:18}],308:[function(require,module,exports){function SlickGrid(container,data,columns,options){function init(){if($container=$(container),$container.length<1)throw new Error("SlickGrid requires a valid container, "+container+" does not exist in the DOM.");maxSupportedCssHeight=maxSupportedCssHeight||getMaxSupportedCssHeight(),scrollbarDimensions=scrollbarDimensions||measureScrollbar(),options=$.extend({},defaults,options),validateAndEnforceOptions(),columnDefaults.width=options.defaultColumnWidth,columnsById={};for(var t=0;t<columns.length;t++){var e=columns[t]=$.extend({},columnDe
|
|||
|
r&&(activeCellNode=getCellNode(activeRow,activeCell))}}function startPostProcessing(){options.enableAsyncPostRender&&(clearTimeout(h_postrender),h_postrender=setTimeout(asyncPostProcessRows,options.asyncPostRenderDelay))}function invalidatePostProcessingResults(t){delete postProcessedRows[t],postProcessFromRow=Math.min(postProcessFromRow,t),postProcessToRow=Math.max(postProcessToRow,t),startPostProcessing()}function updateRowPositions(){for(var t in rowsCache)rowsCache[t].rowNode.style.top=getRowTop(t)+"px"}function render(){if(initialized){var t=getVisibleRange(),e=getRenderedRange();cleanupRows(e),lastRenderedScrollLeft!=scrollLeft&&cleanUpAndRenderCells(e),renderRows(e),postProcessFromRow=t.top,postProcessToRow=Math.min(getDataLengthIncludingAddNew()-1,t.bottom),startPostProcessing(),lastRenderedScrollTop=scrollTop,lastRenderedScrollLeft=scrollLeft,h_render=null}}function handleHeaderRowScroll(){var t=$headerRowScroller[0].scrollLeft;t!=$viewport[0].scrollLeft&&($viewport[0].scrollLeft=t)}function handleScroll(){scrollTop=$viewport[0].scrollTop,scrollLeft=$viewport[0].scrollLeft;var t=Math.abs(scrollTop-prevScrollTop),e=Math.abs(scrollLeft-prevScrollLeft);if(e&&(prevScrollLeft=scrollLeft,$headerScroller[0].scrollLeft=scrollLeft,$topPanelScroller[0].scrollLeft=scrollLeft,$headerRowScroller[0].scrollLeft=scrollLeft),t)if(vScrollDir=scrollTop>prevScrollTop?1:-1,prevScrollTop=scrollTop,viewportH>t)scrollTo(scrollTop+offset);else{var i=offset;page=h==viewportH?0:Math.min(n-1,Math.floor(scrollTop*((th-viewportH)/(h-viewportH))*(1/ph))),offset=Math.round(page*cj),i!=offset&&invalidateAllRows()}(e||t)&&(h_render&&clearTimeout(h_render),(Math.abs(lastRenderedScrollTop-scrollTop)>20||Math.abs(lastRenderedScrollLeft-scrollLeft)>20)&&(options.forceSyncScrolling||Math.abs(lastRenderedScrollTop-scrollTop)<viewportH&&Math.abs(lastRenderedScrollLeft-scrollLeft)<viewportW?render():h_render=setTimeout(render,50),trigger(self.onViewportChanged,{}))),trigger(self.onScroll,{scrollLeft:scrollLeft,scrollTop:scrollTop})}function asyncPostProcessRows(){for(var t=getDataLength();postProcessToRow>=postProcessFromRow;){var e=vScrollDir>=0?postProcessFromRow++:postProcessToRow--,i=rowsCache[e];if(i&&!(e>=t)){postProcessedRows[e]||(postProcessedRows[e]={}),ensureCellNodesInRowsCache(e);for(var n in i.cellNodesByColumnIdx)if(i.cellNodesByColumnIdx.hasOwnProperty(n)){n=0|n;var r=columns[n];if(r.asyncPostRender&&!postProcessedRows[e][n]){var s=i.cellNodesByColumnIdx[n];s&&r.asyncPostRender(s,e,getDataItem(e),r),postProcessedRows[e][n]=!0}}return void(h_postrender=setTimeout(asyncPostProcessRows,options.asyncPostRenderDelay))}}}function updateCellCssStylesOnRenderedRows(t,e){var i,n,r,s;for(var o in rowsCache){if(s=e&&e[o],r=t&&t[o],s)for(n in s)r&&s[n]==r[n]||(i=getCellNode(o,getColumnIndex(n)),i&&$(i).removeClass(s[n]));if(r)for(n in r)s&&s[n]==r[n]||(i=getCellNode(o,getColumnIndex(n)),i&&$(i).addClass(r[n]))}}function addCellCssStyles(t,e){if(cellCssClasses[t])throw"addCellCssStyles: cell CSS hash with key '"+t+"' already exists.";cellCssClasses[t]=e,updateCellCssStylesOnRenderedRows(e,null),trigger(self.onCellCssStylesChanged,{key:t,hash:e})}function removeCellCssStyles(t){cellCssClasses[t]&&(updateCellCssStylesOnRenderedRows(null,cellCssClasses[t]),delete cellCssClasses[t],trigger(self.onCellCssStylesChanged,{key:t,hash:null}))}function setCellCssStyles(t,e){var i=cellCssClasses[t];cellCssClasses[t]=e,updateCellCssStylesOnRenderedRows(e,i),trigger(self.onCellCssStylesChanged,{key:t,hash:e})}function getCellCssStyles(t){return cellCssClasses[t]}function flashCell(t,e,i){function n(t){t&&setTimeout(function(){r.queue(function(){r.toggleClass(options.cellFlashingCssClass).dequeue(),n(t-1)})},i)}if(i=i||100,rowsCache[t]){var r=$(getCellNode(t,e));n(4)}}function handleMouseWheel(t){var e=$(t.target).closest(".bk-slick-row")[0];e!=rowNodeFromLastMouseWheelEvent&&(zombieRowNodeFromLastMouseWheelEvent&&zombieRowNodeFromLastMouseWheelEvent!=e&&($canvas[0].removeChild(zombieRowNodeFromLastMouseWheelEvent),zombieRowNodeFromLastMouseWheelEvent=null)
|
|||
|
//# sourceMappingURL=bokeh.min.js.map
|
|||
|
/* END C:\Users\Bradlee Speice\Anaconda3\lib\site-packages\bokeh\server\static\js/bokeh.min.js */
|
|||
|
</script>
|
|||
|
<script type="text/javascript">
|
|||
|
Bokeh.set_log_level("info");
|
|||
|
</script>
|
|||
|
|
|||
|
<style>
|
|||
|
/* BEGIN C:\Users\Bradlee Speice\Anaconda3\lib\site-packages\bokeh\server\static\css/bokeh.min.css */
|
|||
|
.bk-bs-container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media(min-width:768px){.bk-bs-container{width:750px}}@media(min-width:992px){.bk-bs-container{width:970px}}@media(min-width:1200px){.bk-bs-container{width:1170px}}.bk-bs-container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.bk-bs-row{margin-left:-15px;margin-right:-15px}.bk-bs-col-xs-1,.bk-bs-col-sm-1,.bk-bs-col-md-1,.bk-bs-col-lg-1,.bk-bs-col-xs-2,.bk-bs-col-sm-2,.bk-bs-col-md-2,.bk-bs-col-lg-2,.bk-bs-col-xs-3,.bk-bs-col-sm-3,.bk-bs-col-md-3,.bk-bs-col-lg-3,.bk-bs-col-xs-4,.bk-bs-col-sm-4,.bk-bs-col-md-4,.bk-bs-col-lg-4,.bk-bs-col-xs-5,.bk-bs-col-sm-5,.bk-bs-col-md-5,.bk-bs-col-lg-5,.bk-bs-col-xs-6,.bk-bs-col-sm-6,.bk-bs-col-md-6,.bk-bs-col-lg-6,.bk-bs-col-xs-7,.bk-bs-col-sm-7,.bk-bs-col-md-7,.bk-bs-col-lg-7,.bk-bs-col-xs-8,.bk-bs-col-sm-8,.bk-bs-col-md-8,.bk-bs-col-lg-8,.bk-bs-col-xs-9,.bk-bs-col-sm-9,.bk-bs-col-md-9,.bk-bs-col-lg-9,.bk-bs-col-xs-10,.bk-bs-col-sm-10,.bk-bs-col-md-10,.bk-bs-col-lg-10,.bk-bs-col-xs-11,.bk-bs-col-sm-11,.bk-bs-col-md-11,.bk-bs-col-lg-11,.bk-bs-col-xs-12,.bk-bs-col-sm-12,.bk-bs-col-md-12,.bk-bs-col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.bk-bs-col-xs-1,.bk-bs-col-xs-2,.bk-bs-col-xs-3,.bk-bs-col-xs-4,.bk-bs-col-xs-5,.bk-bs-col-xs-6,.bk-bs-col-xs-7,.bk-bs-col-xs-8,.bk-bs-col-xs-9,.bk-bs-col-xs-10,.bk-bs-col-xs-11,.bk-bs-col-xs-12{float:left}.bk-bs-col-xs-12{width:100%}.bk-bs-col-xs-11{width:91.66666667%}.bk-bs-col-xs-10{width:83.33333333%}.bk-bs-col-xs-9{width:75%}.bk-bs-col-xs-8{width:66.66666667%}.bk-bs-col-xs-7{width:58.33333333%}.bk-bs-col-xs-6{width:50%}.bk-bs-col-xs-5{width:41.66666667%}.bk-bs-col-xs-4{width:33.33333333%}.bk-bs-col-xs-3{width:25%}.bk-bs-col-xs-2{width:16.66666667%}.bk-bs-col-xs-1{width:8.33333333%}.bk-bs-col-xs-pull-12{right:100%}.bk-bs-col-xs-pull-11{right:91.66666667%}.bk-bs-col-xs-pull-10{right:83.33333333%}.bk-bs-col-xs-pull-9{right:75%}.bk-bs-col-xs-pull-8{right:66.66666667%}.bk-bs-col-xs-pull-7{right:58.33333333%}.bk-bs-col-xs-pull-6{right:50%}.bk-bs-col-xs-pull-5{right:41.66666667%}.bk-bs-col-xs-pull-4{right:33.33333333%}.bk-bs-col-xs-pull-3{right:25%}.bk-bs-col-xs-pull-2{right:16.66666667%}.bk-bs-col-xs-pull-1{right:8.33333333%}.bk-bs-col-xs-pull-0{right:0}.bk-bs-col-xs-push-12{left:100%}.bk-bs-col-xs-push-11{left:91.66666667%}.bk-bs-col-xs-push-10{left:83.33333333%}.bk-bs-col-xs-push-9{left:75%}.bk-bs-col-xs-push-8{left:66.66666667%}.bk-bs-col-xs-push-7{left:58.33333333%}.bk-bs-col-xs-push-6{left:50%}.bk-bs-col-xs-push-5{left:41.66666667%}.bk-bs-col-xs-push-4{left:33.33333333%}.bk-bs-col-xs-push-3{left:25%}.bk-bs-col-xs-push-2{left:16.66666667%}.bk-bs-col-xs-push-1{left:8.33333333%}.bk-bs-col-xs-push-0{left:0}.bk-bs-col-xs-offset-12{margin-left:100%}.bk-bs-col-xs-offset-11{margin-left:91.66666667%}.bk-bs-col-xs-offset-10{margin-left:83.33333333%}.bk-bs-col-xs-offset-9{margin-left:75%}.bk-bs-col-xs-offset-8{margin-left:66.66666667%}.bk-bs-col-xs-offset-7{margin-left:58.33333333%}.bk-bs-col-xs-offset-6{margin-left:50%}.bk-bs-col-xs-offset-5{margin-left:41.66666667%}.bk-bs-col-xs-offset-4{margin-left:33.33333333%}.bk-bs-col-xs-offset-3{margin-left:25%}.bk-bs-col-xs-offset-2{margin-left:16.66666667%}.bk-bs-col-xs-offset-1{margin-left:8.33333333%}.bk-bs-col-xs-offset-0{margin-left:0}@media(min-width:768px){.bk-bs-col-sm-1,.bk-bs-col-sm-2,.bk-bs-col-sm-3,.bk-bs-col-sm-4,.bk-bs-col-sm-5,.bk-bs-col-sm-6,.bk-bs-col-sm-7,.bk-bs-col-sm-8,.bk-bs-col-sm-9,.bk-bs-col-sm-10,.bk-bs-col-sm-11,.bk-bs-col-sm-12{float:left}.bk-bs-col-sm-12{width:100%}.bk-bs-col-sm-11{width:91.66666667%}.bk-bs-col-sm-10{width:83.33333333%}.bk-bs-col-sm-9{width:75%}.bk-bs-col-sm-8{width:66.66666667%}.bk-bs-col-sm-7{width:58.33333333%}.bk-bs-col-sm-6{width:50%}.bk-bs-col-sm-5{width:41.66666667%}.bk-bs-col-sm-4{width:33.33333333%}.bk-bs-col-sm-3{width:25%}.bk-bs-col-sm-2{width:16.66666667%}.bk-bs-col-sm-1{width:8.33333333%}.bk-bs-col-sm-pull-12{right:100%}.bk-bs-col-sm-pull-11{right:91.66666667%}.bk-bs-col-sm-pull-10{right:83.3333333
|
|||
|
* jQuery UI CSS Framework 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/category/theming/
|
|||
|
*/.bk-ui-helper-hidden{display:none}.bk-ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.bk-ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.bk-ui-helper-clearfix:before,.bk-ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.bk-ui-helper-clearfix:after{clear:both}.bk-ui-helper-clearfix{min-height:0}.bk-ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.bk-ui-front{z-index:100}.bk-ui-state-disabled{cursor:default !important}.bk-ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.bk-ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}/*!
|
|||
|
* jQuery UI Accordion 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/accordion/#theming
|
|||
|
*/.bk-ui-accordion .bk-ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.bk-ui-accordion .bk-ui-accordion-icons{padding-left:2.2em}.bk-ui-accordion .bk-ui-accordion-icons .bk-ui-accordion-icons{padding-left:2.2em}.bk-ui-accordion .bk-ui-accordion-header .bk-ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.bk-ui-accordion .bk-ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}/*!
|
|||
|
* jQuery UI Autocomplete 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/autocomplete/#theming
|
|||
|
*/.bk-ui-autocomplete{position:absolute;top:0;left:0;cursor:default}/*!
|
|||
|
* jQuery UI Button 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/button/#theming
|
|||
|
*/.bk-ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.bk-ui-button,.bk-ui-button:link,.bk-ui-button:visited,.bk-ui-button:hover,.bk-ui-button:active{text-decoration:none}.bk-ui-button-icon-only{width:2.2em}button.bk-ui-button-icon-only{width:2.4em}.bk-ui-button-icons-only{width:3.4em}button.bk-ui-button-icons-only{width:3.7em}.bk-ui-button .bk-ui-button-text{display:block;line-height:normal}.bk-ui-button-text-only .bk-ui-button-text{padding:.4em 1em}.bk-ui-button-icon-only .bk-ui-button-text,.bk-ui-button-icons-only .bk-ui-button-text{padding:.4em;text-indent:-9999999px}.bk-ui-button-text-icon-primary .bk-ui-button-text,.bk-ui-button-text-icons .bk-ui-button-text{padding:.4em 1em .4em 2.1em}.bk-ui-button-text-icon-secondary .bk-ui-button-text,.bk-ui-button-text-icons .bk-ui-button-text{padding:.4em 2.1em .4em 1em}.bk-ui-button-text-icons .bk-ui-button-text{padding-left:2.1em;padding-right:2.1em}input.bk-ui-button{padding:.4em 1em}.bk-ui-button-icon-only .bk-ui-icon,.bk-ui-button-text-icon-primary .bk-ui-icon,.bk-ui-button-text-icon-secondary .bk-ui-icon,.bk-ui-button-text-icons .bk-ui-icon,.bk-ui-button-icons-only .bk-ui-icon{position:absolute;top:50%;margin-top:-8px}.bk-ui-button-icon-only .bk-ui-icon{left:50%;margin-left:-8px}.bk-ui-button-text-icon-primary .bk-ui-button-icon-primary,.bk-ui-button-text-icons .bk-ui-button-icon-primary,.bk-ui-button-icons-only .bk-ui-button-icon-primary{left:.5em}.bk-ui-button-text-icon-secondary .bk-ui-button-icon-secondary,.bk-ui-button-text-icons .bk-ui-button-icon-secondary,.bk-ui-button-icons-only .bk-ui-button-icon-secondary{right:.5em}.bk-ui-buttonset{margin-right:7px}.bk-ui-buttonset .bk-ui-button{margin-left:0;margin-right:-.3em}input.bk-ui-button::-moz-focus-inner,button.bk-ui-button::-moz-focus-inner{border:0;padding:0}/*!
|
|||
|
* jQuery UI Datepicker 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/datepicker/#theming
|
|||
|
*/.bk-ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.bk-ui-datepicker .bk-ui-datepicker-header{position:relative;padding:.2em 0}.bk-ui-datepicker .bk-ui-datepicker-prev,.bk-ui-datepicker .bk-ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.bk-ui-datepicker .bk-ui-datepicker-prev-hover,.bk-ui-datepicker .bk-ui-datepicker-next-hover{top:1px}.bk-ui-datepicker .bk-ui-datepicker-prev{left:2px}.bk-ui-datepicker .bk-ui-datepicker-next{right:2px}.bk-ui-datepicker .bk-ui-datepicker-prev-hover{left:1px}.bk-ui-datepicker .bk-ui-datepicker-next-hover{right:1px}.bk-ui-datepicker .bk-ui-datepicker-prev span,.bk-ui-datepicker .bk-ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.bk-ui-datepicker .bk-ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.bk-ui-datepicker .bk-ui-datepicker-title select{font-size:1em;margin:1px 0}.bk-ui-datepicker select.bk-ui-datepicker-month,.bk-ui-datepicker select.bk-ui-datepicker-year{width:45%}.bk-ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.bk-ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.bk-ui-datepicker td{border:0;padding:1px}.bk-ui-datepicker td span,.bk-ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.bk-ui-datepicker .bk-ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.bk-ui-datepicker .bk-ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.bk-ui-datepicker .bk-ui-datepicker-buttonpane button.bk-ui-datepicker-current{float:left}.bk-ui-datepicker.bk-ui-datepicker-multi{width:auto}.bk-ui-datepicker-multi .bk-ui-datepicker-group{float:left}.bk-ui-datepicker-multi .bk-ui-datepicker-group table{width:95%;margin:0 auto .4em}.bk-ui-datepicker-multi-2 .bk-ui-datepicker-group{width:50%}.bk-ui-datepicker-multi-3 .bk-ui-datepicker-group{width:33.3%}.bk-ui-datepicker-multi-4 .bk-ui-datepicker-group{width:25%}.bk-ui-datepicker-multi .bk-ui-datepicker-group-last .bk-ui-datepicker-header,.bk-ui-datepicker-multi .bk-ui-datepicker-group-middle .bk-ui-datepicker-header{border-left-width:0}.bk-ui-datepicker-multi .bk-ui-datepicker-buttonpane{clear:left}.bk-ui-datepicker-row-break{clear:both;width:100%;font-size:0}.bk-ui-datepicker-rtl{direction:rtl}.bk-ui-datepicker-rtl .bk-ui-datepicker-prev{right:2px;left:auto}.bk-ui-datepicker-rtl .bk-ui-datepicker-next{left:2px;right:auto}.bk-ui-datepicker-rtl .bk-ui-datepicker-prev:hover{right:1px;left:auto}.bk-ui-datepicker-rtl .bk-ui-datepicker-next:hover{left:1px;right:auto}.bk-ui-datepicker-rtl .bk-ui-datepicker-buttonpane{clear:right}.bk-ui-datepicker-rtl .bk-ui-datepicker-buttonpane button{float:left}.bk-ui-datepicker-rtl .bk-ui-datepicker-buttonpane button.bk-ui-datepicker-current,.bk-ui-datepicker-rtl .bk-ui-datepicker-group{float:right}.bk-ui-datepicker-rtl .bk-ui-datepicker-group-last .bk-ui-datepicker-header,.bk-ui-datepicker-rtl .bk-ui-datepicker-group-middle .bk-ui-datepicker-header{border-right-width:0;border-left-width:1px}/*!
|
|||
|
* jQuery UI Dialog 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/dialog/#theming
|
|||
|
*/.bk-ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.bk-ui-dialog .bk-ui-dialog-titlebar{padding:.4em 1em;position:relative}.bk-ui-dialog .bk-ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.bk-ui-dialog .bk-ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.bk-ui-dialog .bk-ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.bk-ui-dialog .bk-ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.bk-ui-dialog .bk-ui-dialog-buttonpane .bk-ui-dialog-buttonset{float:right}.bk-ui-dialog .bk-ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.bk-ui-dialog .bk-ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.bk-ui-draggable .bk-ui-dialog-titlebar{cursor:move}/*!
|
|||
|
* jQuery UI Draggable 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*/.bk-ui-draggable-handle{-ms-touch-action:none;touch-action:none}/*!
|
|||
|
* jQuery UI Menu 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/menu/#theming
|
|||
|
*/.bk-ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.bk-ui-menu .bk-ui-menu{position:absolute}.bk-ui-menu .bk-ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.bk-ui-menu .bk-ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.bk-ui-menu .bk-ui-state-focus,.bk-ui-menu .bk-ui-state-active{margin:-1px}.bk-ui-menu-icons{position:relative}.bk-ui-menu-icons .bk-ui-menu-item{padding-left:2em}.bk-ui-menu .bk-ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.bk-ui-menu .bk-ui-menu-icon{left:auto;right:0}/*!
|
|||
|
* jQuery UI Progressbar 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/progressbar/#theming
|
|||
|
*/.bk-ui-progressbar{height:2em;text-align:left;overflow:hidden}.bk-ui-progressbar .bk-ui-progressbar-value{margin:-1px;height:100%}.bk-ui-progressbar .bk-ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:.25}.bk-ui-progressbar-indeterminate .bk-ui-progressbar-value{background-image:none}/*!
|
|||
|
* jQuery UI Resizable 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*/.bk-ui-resizable{position:relative}.bk-ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.bk-ui-resizable-disabled .bk-ui-resizable-handle,.bk-ui-resizable-autohide .bk-ui-resizable-handle{display:none}.bk-ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.bk-ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.bk-ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.bk-ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.bk-ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.bk-ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.bk-ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.bk-ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}/*!
|
|||
|
* jQuery UI Selectable 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*/.bk-ui-selectable{-ms-touch-action:none;touch-action:none}.bk-ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}/*!
|
|||
|
* jQuery UI Selectmenu 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/selectmenu/#theming
|
|||
|
*/.bk-ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.bk-ui-selectmenu-menu .bk-ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.bk-ui-selectmenu-menu .bk-ui-menu .bk-ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px .4em;margin:.5em 0 0 0;height:auto;border:0}.bk-ui-selectmenu-open{display:block}.bk-ui-selectmenu-button{display:inline-block;overflow:hidden;position:relative;text-decoration:none;cursor:pointer}.bk-ui-selectmenu-button span.bk-ui-icon{right:.5em;left:auto;margin-top:-8px;position:absolute;top:50%}.bk-ui-selectmenu-button span.bk-ui-selectmenu-text{text-align:left;padding:.4em 2.1em .4em 1em;display:block;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}/*!
|
|||
|
* jQuery UI Sortable 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*/.bk-ui-sortable-handle{-ms-touch-action:none;touch-action:none}/*!
|
|||
|
* jQuery UI Slider 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/slider/#theming
|
|||
|
*/.bk-ui-slider{position:relative;text-align:left}.bk-ui-slider .bk-ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.bk-ui-slider .bk-ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.bk-ui-slider.bk-ui-state-disabled .bk-ui-slider-handle,.bk-ui-slider.bk-ui-state-disabled .bk-ui-slider-range{filter:inherit}.bk-ui-slider-horizontal{height:.8em}.bk-ui-slider-horizontal .bk-ui-slider-handle{top:-.3em;margin-left:-.6em}.bk-ui-slider-horizontal .bk-ui-slider-range{top:0;height:100%}.bk-ui-slider-horizontal .bk-ui-slider-range-min{left:0}.bk-ui-slider-horizontal .bk-ui-slider-range-max{right:0}.bk-ui-slider-vertical{width:.8em;height:100px}.bk-ui-slider-vertical .bk-ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.bk-ui-slider-vertical .bk-ui-slider-range{left:0;width:100%}.bk-ui-slider-vertical .bk-ui-slider-range-min{bottom:0}.bk-ui-slider-vertical .bk-ui-slider-range-max{top:0}/*!
|
|||
|
* jQuery UI Spinner 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/spinner/#theming
|
|||
|
*/.bk-ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.bk-ui-spinner-input{border:0;background:0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.bk-ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.bk-ui-spinner a.bk-ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.bk-ui-spinner .bk-ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.bk-ui-spinner-up{top:0}.bk-ui-spinner-down{bottom:0}.bk-ui-spinner .bk-ui-icon-triangle-1-s{background-position:-65px -16px}/*!
|
|||
|
* jQuery UI Tabs 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/tabs/#theming
|
|||
|
*/.bk-ui-tabs{position:relative;padding:.2em}.bk-ui-tabs .bk-ui-tabs-nav{margin:0;padding:.2em .2em 0}.bk-ui-tabs .bk-ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.bk-ui-tabs .bk-ui-tabs-nav .bk-ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.bk-ui-tabs .bk-ui-tabs-nav li.bk-ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.bk-ui-tabs .bk-ui-tabs-nav li.bk-ui-tabs-active .bk-ui-tabs-anchor,.bk-ui-tabs .bk-ui-tabs-nav li.bk-ui-state-disabled .bk-ui-tabs-anchor,.bk-ui-tabs .bk-ui-tabs-nav li.bk-ui-tabs-loading .bk-ui-tabs-anchor{cursor:text}.bk-ui-tabs-collapsible .bk-ui-tabs-nav li.bk-ui-tabs-active .bk-ui-tabs-anchor{cursor:pointer}.bk-ui-tabs .bk-ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0}/*!
|
|||
|
* jQuery UI Tooltip 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/tooltip/#theming
|
|||
|
*/.bk-ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .bk-ui-tooltip{border-width:2px}/*!
|
|||
|
* jQuery UI CSS Framework 1.11.2
|
|||
|
* http://jqueryui.com
|
|||
|
*
|
|||
|
* Copyright 2014 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license.
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* http://api.jqueryui.com/category/theming/
|
|||
|
*
|
|||
|
* To view and modify this theme, visit http://jqueryui.com/themeroller/
|
|||
|
*/.bk-ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.bk-ui-widget .bk-ui-widget{font-size:1em}.bk-ui-widget input,.bk-ui-widget select,.bk-ui-widget textarea,.bk-ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.bk-ui-widget-content{border:1px solid #aaa;background:#fff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;color:#222}.bk-ui-widget-content a{color:#222}.bk-ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.bk-ui-widget-header a{color:#222}.bk-ui-state-default,.bk-ui-widget-content .bk-ui-state-default,.bk-ui-widget-header .bk-ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.bk-ui-state-default a,.bk-ui-state-default a:link,.bk-ui-state-default a:visited{color:#555;text-decoration:none}.bk-ui-state-hover,.bk-ui-widget-content .bk-ui-state-hover,.bk-ui-widget-header .bk-ui-state-hover,.bk-ui-state-focus,.bk-ui-widget-content .bk-ui-state-focus,.bk-ui-widget-header .bk-ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.bk-ui-state-hover a,.bk-ui-state-hover a:hover,.bk-ui-state-hover a:link,.bk-ui-state-hover a:visited,.bk-ui-state-focus a,.bk-ui-state-focus a:hover,.bk-ui-state-focus a:link,.bk-ui-state-focus a:visited{color:#212121;text-decoration:none}.bk-ui-state-active,.bk-ui-widget-content .bk-ui-state-active,.bk-ui-widget-header .bk-ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.bk-ui-state-active a,.bk-ui-state-active a:link,.bk-ui-state-active a:visited{color:#212121;text-decoration:none}.bk-ui-state-highlight,.bk-ui-widget-content .bk-ui-state-highlight,.bk-ui-widget-header .bk-ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.bk-ui-state-highlight a,.bk-ui-widget-content .bk-ui-state-highlight a,.bk-ui-widget-header .bk-ui-state-highlight a{color:#363636}.bk-ui-state-error,.bk-ui-widget-content .bk-ui-state-error,.bk-ui-widget-header .bk-ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.bk-ui-state-error a,.bk-ui-widget-content .bk-ui-state-error a,.bk-ui-widget-header .bk-ui-state-error a{color:#cd0a0a}.bk-ui-state-error-text,.bk-ui-widget-content .bk-ui-state-error-text,.bk-ui-widget-header .bk-ui-state-error-text{color:#cd0a0a}.bk-ui-priority-primary,.bk-ui-widget-content .bk-ui-priority-primary,.bk-ui-widget-header .bk-ui-priority-primary{font-weight:bold}.bk-ui-priority-secondary,.bk-ui-widget-content .bk-ui-priority-secondary,.bk-ui-widget-header .bk-ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.bk-ui-state-disabled,.bk-ui-widget-content .bk-ui-state-disabled,.bk-ui-widget-header .bk-ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.bk-ui-state-disabled .bk-ui-icon{filter:Alpha(Opacity=35)}.bk-ui-icon{width:16px;height:16px}.bk-ui-icon,.bk-ui-widget-content .bk-ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.bk-ui-widget-header .bk-ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.bk-ui-state-default .bk-ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.bk-ui-state-hover .bk-ui-icon,.bk-ui-state-focus .bk-ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.bk-ui-state-active .bk-ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.bk-ui-state-highlight .bk-ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.bk-ui-state-error .bk-ui-icon,.bk-ui-state-error-text .bk-ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.bk-ui-icon-blank{background-position:16px 16px}.bk-ui-icon-carat
|
|||
|
/*# sourceMappingURL=bokeh.min.css.map */
|
|||
|
/* END C:\Users\Bradlee Speice\Anaconda3\lib\site-packages\bokeh\server\static\css/bokeh.min.css */
|
|||
|
</style>
|
|||
|
<div>
|
|||
|
<a href="http://bokeh.pydata.org" target="_blank" class="bk-logo bk-logo-small bk-logo-notebook"></a>
|
|||
|
<span>BokehJS successfully loaded.</span>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
<div class="cell border-box-sizing text_cell rendered">
|
|||
|
<div class="prompt input_prompt">
|
|||
|
</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="text_cell_render border-box-sizing rendered_html">
|
|||
|
<p>I'm originally from North Carolina, and I've been hearing a lot of people talking about how often it's been raining recently. They're excited for any day that has sun.</p>
|
|||
|
<p>So I got a bit curious: Has North Carolina over the past few months actually had more cloudy and rainy days recently than in previous years? This shouldn't be a particularly challenging task, but I'm interested to know if people's perceptions actually reflect reality.</p>
|
|||
|
<p>The data we'll use comes from <a href="http://forecast.io/">forecast.io</a>, since they can give us a cloud cover percentage. I've gone ahead and retrieved the data to a pickle file, and included the <a href="#Generating-the-Forecast-file">code that was used to generate it</a>. First up: What was the average cloud cover in North Carolina during August - November, and how many days were cloudy? We're going to assume that a "cloudy" day is defined as any day in which the cloud cover is above 50%.</p>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="cell border-box-sizing code_cell rendered">
|
|||
|
<div class="input">
|
|||
|
<div class="prompt input_prompt">In [2]:</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="input_area">
|
|||
|
<div class=" highlight hl-ipython3"><pre><span class="n">city_forecasts</span> <span class="o">=</span> <span class="n">pickle</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="s1">'city_forecasts.p'</span><span class="p">,</span> <span class="s1">'rb'</span><span class="p">))</span>
|
|||
|
<span class="n">forecast_df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">city_forecasts</span><span class="p">)</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
<div class="cell border-box-sizing code_cell rendered">
|
|||
|
<div class="input">
|
|||
|
<div class="prompt input_prompt">In [3]:</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="input_area">
|
|||
|
<div class=" highlight hl-ipython3"><pre><span class="n">cary_forecast</span> <span class="o">=</span> <span class="n">forecast_df</span><span class="p">[</span><span class="s1">'cary'</span><span class="p">]</span>
|
|||
|
<span class="n">years</span> <span class="o">=</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1990</span><span class="p">,</span> <span class="mi">2016</span><span class="p">)</span>
|
|||
|
<span class="n">months</span> <span class="o">=</span> <span class="nb">range</span><span class="p">(</span><span class="mi">7</span><span class="p">,</span> <span class="mi">12</span><span class="p">)</span>
|
|||
|
<span class="n">months_str</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'July'</span><span class="p">,</span> <span class="s1">'August'</span><span class="p">,</span> <span class="s1">'September'</span><span class="p">,</span> <span class="s1">'October'</span><span class="p">,</span> <span class="s1">'November'</span><span class="p">]</span>
|
|||
|
|
|||
|
<span class="k">def</span> <span class="nf">safe_cover</span><span class="p">(</span><span class="n">frame</span><span class="p">):</span>
|
|||
|
<span class="k">if</span> <span class="n">frame</span> <span class="ow">and</span> <span class="s1">'cloudCover'</span> <span class="ow">in</span> <span class="n">frame</span><span class="p">:</span>
|
|||
|
<span class="k">return</span> <span class="n">frame</span><span class="p">[</span><span class="s1">'cloudCover'</span><span class="p">]</span>
|
|||
|
<span class="k">else</span><span class="p">:</span>
|
|||
|
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">NaN</span>
|
|||
|
|
|||
|
<span class="k">def</span> <span class="nf">monthly_avg_cloudcover</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span><span class="p">):</span>
|
|||
|
<span class="n">dates</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DatetimeIndex</span><span class="p">(</span><span class="n">start</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">12</span><span class="p">),</span>
|
|||
|
<span class="n">end</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">12</span><span class="p">),</span>
|
|||
|
<span class="n">freq</span><span class="o">=</span><span class="s1">'D'</span><span class="p">,</span> <span class="n">closed</span><span class="o">=</span><span class="s1">'left'</span><span class="p">)</span>
|
|||
|
<span class="n">cloud_cover_vals</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">safe_cover</span><span class="p">(</span><span class="n">cary_forecast</span><span class="p">[</span><span class="n">x</span><span class="p">][</span><span class="s1">'currently'</span><span class="p">]),</span> <span class="n">dates</span><span class="p">))</span>
|
|||
|
<span class="n">cloud_cover_samples</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="nb">filter</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">np</span><span class="o">.</span><span class="n">NaN</span><span class="p">,</span> <span class="n">cloud_cover_vals</span><span class="p">)))</span>
|
|||
|
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">nanmean</span><span class="p">(</span><span class="n">cloud_cover_vals</span><span class="p">),</span> <span class="n">cloud_cover_samples</span>
|
|||
|
|
|||
|
|
|||
|
<span class="n">monthly_cover_vals</span> <span class="o">=</span> <span class="p">[[</span><span class="n">monthly_avg_cloudcover</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">m</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span> <span class="k">for</span> <span class="n">y</span> <span class="ow">in</span> <span class="n">years</span><span class="p">]</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">months</span><span class="p">]</span>
|
|||
|
|
|||
|
<span class="n">f</span> <span class="o">=</span> <span class="n">figure</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="s1">'Monthly Average Cloud Cover'</span><span class="p">,</span>
|
|||
|
<span class="n">x_range</span><span class="o">=</span><span class="p">(</span><span class="mi">1990</span><span class="p">,</span> <span class="mi">2015</span><span class="p">),</span>
|
|||
|
<span class="n">x_axis_label</span><span class="o">=</span><span class="s1">'Year'</span><span class="p">)</span>
|
|||
|
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">months</span><span class="p">)):</span>
|
|||
|
<span class="n">f</span><span class="o">.</span><span class="n">line</span><span class="p">(</span><span class="n">years</span><span class="p">,</span> <span class="n">monthly_cover_vals</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">legend</span><span class="o">=</span><span class="n">months_str</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">color</span><span class="o">=</span><span class="n">Palette</span><span class="p">[</span><span class="n">x</span><span class="p">])</span>
|
|||
|
<span class="n">show</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="output_wrapper">
|
|||
|
<div class="output">
|
|||
|
|
|||
|
|
|||
|
<div class="output_area"><div class="prompt"></div>
|
|||
|
|
|||
|
<div class="output_html rendered_html output_subarea ">
|
|||
|
<script type="text/javascript">
|
|||
|
Bokeh.$(function() {
|
|||
|
var all_models = [{"id": "d6d1c76a-2c08-4837-a235-5d28812045b8", "attributes": {"plot": {"id": "2a4fdc48-79d5-4dae-ab6c-649854b2bfe9", "type": "Plot", "subtype": "Figure"}, "dimension": 0, "id": "d6d1c76a-2c08-4837-a235-5d28812045b8", "doc": null, "ticker": {"id": "04b264bc-ea65-496a-9d53-52ebd0924cf5", "type": "BasicTicker"}, "tags": []}, "type": "Grid"}, {"id": "db4c713a-944b-497a-a1a5-594d70d9919b", "attributes": {"line_color": {"value": "#1f77b4"}, "line_alpha": {"value": 0.1}, "y": {"field": "y"}, "doc": null, "id": "db4c713a-944b-497a-a1a5-594d70d9919b", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "aa63abd3-cfae-4d14-a3bf-1858f44da41e", "attributes": {"plot": {"id": "2a4fdc48-79d5-4dae-ab6c-649854b2bfe9", "type": "Plot", "subtype": "Figure"}, "legends": [["July", [{"id": "f61dd8ae-9fbe-4a4b-9e1c-cc2d8156059d", "type": "GlyphRenderer"}]], ["August", [{"id": "8e26ebbc-2da1-4be6-911e-8d19209b2e9c", "type": "GlyphRenderer"}]], ["September", [{"id": "21ee1fe1-d928-49f1-9237-0cac113a4975", "type": "GlyphRenderer"}]], ["October", [{"id": "901ba0fb-85e3-45a6-909e-5f3995dc7953", "type": "GlyphRenderer"}]], ["November", [{"id": "0f5331ba-05e0-440a-ac3f-a3b2415f0936", "type": "GlyphRenderer"}]]], "doc": null, "id": "aa63abd3-cfae-4d14-a3bf-1858f44da41e", "tags": []}, "type": "Legend"}, {"id": "ddd92e55-4f38-4207-a9d0-be051d83032f", "attributes": {"doc": null, "names": [], "callback": null, "renderers": [], "id": "ddd92e55-4f38-4207-a9d0-be051d83032f", "tags": []}, "type": "DataRange1d"}, {"id": "32db6117-a4c9-4522-9970-89e3aecb4c07", "attributes": {"end": 2015, "callback": null, "id": "32db6117-a4c9-4522-9970-89e3aecb4c07", "doc": null, "start": 1990, "tags": []}, "type": "Range1d"}, {"id": "d75fc1ac-60eb-415a-a1d7-2a9ac853fe9f", "attributes": {"plot": {"id": "2a4fdc48-79d5-4dae-ab6c-649854b2bfe9", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "d75fc1ac-60eb-415a-a1d7-2a9ac853fe9f", "tags": []}, "type": "HelpTool"}, {"id": "04b264bc-ea65-496a-9d53-52ebd0924cf5", "attributes": {"mantissas": [2, 5, 10], "num_minor_ticks": 5, "doc": null, "id": "04b264bc-ea65-496a-9d53-52ebd0924cf5", "tags": []}, "type": "BasicTicker"}, {"id": "4b4d1b3b-9fb2-44ff-aef2-1477ac788173", "attributes": {"axis_label": "Year", "plot": {"id": "2a4fdc48-79d5-4dae-ab6c-649854b2bfe9", "type": "Plot", "subtype": "Figure"}, "id": "4b4d1b3b-9fb2-44ff-aef2-1477ac788173", "doc": null, "ticker": {"id": "04b264bc-ea65-496a-9d53-52ebd0924cf5", "type": "BasicTicker"}, "tags": [], "formatter": {"id": "38693d6f-b22a-4a97-a51a-789e49c3123e", "type": "BasicTickFormatter"}}, "type": "LinearAxis"}, {"id": "83c110bc-2b50-49b9-b919-dc744f4ddf58", "attributes": {"plot": {"id": "2a4fdc48-79d5-4dae-ab6c-649854b2bfe9", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "83c110bc-2b50-49b9-b919-dc744f4ddf58", "tags": []}, "type": "ResetTool"}, {"id": "2a4fdc48-79d5-4dae-ab6c-649854b2bfe9", "attributes": {"tools": [{"id": "212828cc-c9e4-4e54-a207-c17dce71bb83", "type": "PanTool"}, {"id": "f8c53aaf-b69b-41e3-8f86-cadd16bd11ca", "type": "WheelZoomTool"}, {"id": "98c4047a-bde0-4918-ae33-bd559384e30b", "type": "BoxZoomTool"}, {"id": "3fb793c9-d15c-4b61-8583-25113661d6df", "type": "PreviewSaveTool"}, {"id": "d5588c29-3bcf-4965-a858-66778ae66fa0", "type": "ResizeTool"}, {"id": "83c110bc-2b50-49b9-b919-dc744f4ddf58", "type": "ResetTool"}, {"id": "d75fc1ac-60eb-415a-a1d7-2a9ac853fe9f", "type": "HelpTool"}], "x_range": {"id": "32db6117-a4c9-4522-9970-89e3aecb4c07", "type": "Range1d"}, "extra_y_ranges": {}, "doc": null, "title": "Monthly Average Cloud Cover", "extra_x_ranges": {}, "below": [{"id": "4b4d1b3b-9fb2-44ff-aef2-1477ac788173", "type": "LinearAxis"}], "right": [], "above": [], "y_range": {"id": "ddd92e55-4f38-4207-a9d0-be051d83032f", "type": "DataRange1d"}, "renderers": [{"id": "4b4d1b3b-9fb2-44ff-aef2-1477ac788173", "type": "LinearAxis"}, {"id": "d6d1c76a-2c08-4837-a235-5d28812045b8", "type": "Grid"}, {"id": "f4afd080-75c2-4fde-b2b4-00182d10988d", "type": "LinearAxis"}, {"id": "06109d80-3f5d-4dc9-a113-05e5030dd0de", "type": "Grid"}, {"id":
|
|||
|
Bokeh.load_models(all_models);
|
|||
|
var plots = [{'modelid': '2a4fdc48-79d5-4dae-ab6c-649854b2bfe9', 'elementid': 'c021877f-5cb6-4035-9044-c444f0727cdf', 'modeltype': 'Plot'}];
|
|||
|
for (idx in plots) {
|
|||
|
var plot = plots[idx];
|
|||
|
var model = Bokeh.Collections(plot.modeltype).get(plot.modelid);
|
|||
|
Bokeh.logger.info('Realizing plot:')
|
|||
|
Bokeh.logger.info(' - modeltype: ' + plot.modeltype);
|
|||
|
Bokeh.logger.info(' - modelid: ' + plot.modelid);
|
|||
|
Bokeh.logger.info(' - elementid: ' + plot.elementid);
|
|||
|
var view = new model.default_view({
|
|||
|
model: model,
|
|||
|
el: '#' + plot.elementid
|
|||
|
});
|
|||
|
Bokeh.index[plot.modelid] = view;
|
|||
|
}
|
|||
|
});
|
|||
|
</script>
|
|||
|
<div class="plotdiv" id="c021877f-5cb6-4035-9044-c444f0727cdf"></div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
<div class="cell border-box-sizing text_cell rendered">
|
|||
|
<div class="prompt input_prompt">
|
|||
|
</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="text_cell_render border-box-sizing rendered_html">
|
|||
|
<p>As we can see from the chart above, on the whole the monthly average cloud cover has been generally trending down over time. The average cloud cover is also lower than it was last year - it seems people are mostly just complaining. There are some data issues that start in 2012 that we need to be aware of - the cloud cover percentage doesn't exist for all days. Even so, the data that we have seems to reflect the wider trend, so we'll assume for now that the missing data doesn't skew our results.</p>
|
|||
|
<p>There's one more metric we want to check though - how many cloudy days were there? This is probably a better gauge of sentiment than the average monthly cover.</p>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="cell border-box-sizing code_cell rendered">
|
|||
|
<div class="input">
|
|||
|
<div class="prompt input_prompt">In [4]:</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="input_area">
|
|||
|
<div class=" highlight hl-ipython3"><pre><span class="k">def</span> <span class="nf">monthly_cloudy_days</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span><span class="p">):</span>
|
|||
|
<span class="n">dates</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DatetimeIndex</span><span class="p">(</span><span class="n">start</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">12</span><span class="p">),</span>
|
|||
|
<span class="n">end</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">12</span><span class="p">),</span>
|
|||
|
<span class="n">freq</span><span class="o">=</span><span class="s1">'D'</span><span class="p">,</span> <span class="n">closed</span><span class="o">=</span><span class="s1">'left'</span><span class="p">)</span>
|
|||
|
<span class="n">cloud_cover_vals</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">safe_cover</span><span class="p">(</span><span class="n">cary_forecast</span><span class="p">[</span><span class="n">x</span><span class="p">][</span><span class="s1">'currently'</span><span class="p">]),</span> <span class="n">dates</span><span class="p">))</span>
|
|||
|
<span class="n">cloud_cover_samples</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="nb">filter</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">np</span><span class="o">.</span><span class="n">NaN</span><span class="p">,</span> <span class="n">cloud_cover_vals</span><span class="p">)))</span>
|
|||
|
<span class="n">cloudy_days</span> <span class="o">=</span> <span class="p">[</span><span class="n">cover</span> <span class="o">></span> <span class="o">.</span><span class="mi">5</span> <span class="k">for</span> <span class="n">cover</span> <span class="ow">in</span> <span class="n">cloud_cover_vals</span><span class="p">]</span>
|
|||
|
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">count_nonzero</span><span class="p">(</span><span class="n">cloudy_days</span><span class="p">),</span> <span class="n">cloud_cover_samples</span>
|
|||
|
|
|||
|
<span class="n">monthly_days_vals</span> <span class="o">=</span> <span class="p">[[</span><span class="n">monthly_cloudy_days</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">m</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span> <span class="k">for</span> <span class="n">y</span> <span class="ow">in</span> <span class="n">years</span><span class="p">]</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">months</span><span class="p">]</span>
|
|||
|
<span class="n">monthly_cover_samples</span> <span class="o">=</span> <span class="p">[[</span><span class="n">monthly_cloudy_days</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">m</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span> <span class="k">for</span> <span class="n">y</span> <span class="ow">in</span> <span class="n">years</span><span class="p">]</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">months</span><span class="p">]</span>
|
|||
|
|
|||
|
<span class="n">f</span> <span class="o">=</span> <span class="n">figure</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="s1">'Monthly Cloudy Days'</span><span class="p">,</span>
|
|||
|
<span class="n">x_range</span><span class="o">=</span><span class="p">(</span><span class="mi">1990</span><span class="p">,</span> <span class="mi">2015</span><span class="p">),</span>
|
|||
|
<span class="n">x_axis_label</span><span class="o">=</span><span class="s1">'Year'</span><span class="p">)</span>
|
|||
|
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">months</span><span class="p">)):</span>
|
|||
|
<span class="n">f</span><span class="o">.</span><span class="n">line</span><span class="p">(</span><span class="n">years</span><span class="p">,</span> <span class="n">monthly_days_vals</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">legend</span><span class="o">=</span><span class="n">months_str</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">color</span><span class="o">=</span><span class="n">Palette</span><span class="p">[</span><span class="n">x</span><span class="p">])</span>
|
|||
|
<span class="n">show</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
|
|||
|
|
|||
|
<span class="n">f</span> <span class="o">=</span> <span class="n">figure</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="s1">'Monthly Cloud Cover Samples'</span><span class="p">,</span>
|
|||
|
<span class="n">x_range</span><span class="o">=</span><span class="p">(</span><span class="mi">1990</span><span class="p">,</span> <span class="mi">2015</span><span class="p">),</span>
|
|||
|
<span class="n">x_axis_label</span><span class="o">=</span><span class="s1">'Year'</span><span class="p">,</span>
|
|||
|
<span class="n">height</span><span class="o">=</span><span class="mi">300</span><span class="p">)</span>
|
|||
|
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">months</span><span class="p">)):</span>
|
|||
|
<span class="n">f</span><span class="o">.</span><span class="n">line</span><span class="p">(</span><span class="n">years</span><span class="p">,</span> <span class="n">monthly_cover_samples</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">legend</span><span class="o">=</span><span class="n">months_str</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">color</span><span class="o">=</span><span class="n">Palette</span><span class="p">[</span><span class="n">x</span><span class="p">])</span>
|
|||
|
<span class="n">show</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="output_wrapper">
|
|||
|
<div class="output">
|
|||
|
|
|||
|
|
|||
|
<div class="output_area"><div class="prompt"></div>
|
|||
|
|
|||
|
<div class="output_html rendered_html output_subarea ">
|
|||
|
<script type="text/javascript">
|
|||
|
Bokeh.$(function() {
|
|||
|
var all_models = [{"id": "5b478055-568d-4a61-a30f-bd63ee630ee2", "attributes": {"mantissas": [2, 5, 10], "num_minor_ticks": 5, "doc": null, "id": "5b478055-568d-4a61-a30f-bd63ee630ee2", "tags": []}, "type": "BasicTicker"}, {"id": "ac54db8c-1975-48b8-bb83-40dee95eb4c8", "attributes": {"line_color": {"value": "#1f77b4"}, "line_alpha": {"value": 0.1}, "y": {"field": "y"}, "doc": null, "id": "ac54db8c-1975-48b8-bb83-40dee95eb4c8", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "a086fe67-8527-4d41-9a4e-5b8b9d514fc2", "attributes": {"doc": null, "names": [], "callback": null, "renderers": [], "id": "a086fe67-8527-4d41-9a4e-5b8b9d514fc2", "tags": []}, "type": "DataRange1d"}, {"id": "f77df6d7-72a4-4ae8-a1e4-7d4b4becd4b4", "attributes": {"data_source": {"id": "488e712e-8084-45c9-9e54-c5a127297b72", "type": "ColumnDataSource"}, "nonselection_glyph": {"id": "ac54db8c-1975-48b8-bb83-40dee95eb4c8", "type": "Line"}, "glyph": {"id": "349147be-4a55-4549-85ec-d9f05d14d8af", "type": "Line"}, "doc": null, "selection_glyph": null, "id": "f77df6d7-72a4-4ae8-a1e4-7d4b4becd4b4", "tags": []}, "type": "GlyphRenderer"}, {"id": "d116f6bc-d89e-4be2-8af6-00add845b655", "attributes": {"dimensions": ["width", "height"], "plot": {"id": "68293e2e-cd0e-4773-95ed-c4c245cb8578", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "d116f6bc-d89e-4be2-8af6-00add845b655", "tags": []}, "type": "BoxZoomTool"}, {"id": "2fe28651-e40b-4fd6-9017-7d3cf80d331b", "attributes": {"doc": null, "id": "2fe28651-e40b-4fd6-9017-7d3cf80d331b", "tags": []}, "type": "BasicTickFormatter"}, {"id": "488e712e-8084-45c9-9e54-c5a127297b72", "attributes": {"data": {"x": [1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015], "y": [18, 15, 12, 11, 17, 12, 2, 15, 18, 19, 24, 21, 13, 17, 13, 12, 4, 7, 9, 14, 13, 7, 12, 19, 0, 0]}, "callback": null, "doc": null, "id": "488e712e-8084-45c9-9e54-c5a127297b72", "selected": {"0d": {"flag": false, "indices": []}, "1d": {"indices": []}, "2d": {"indices": []}}, "column_names": ["x", "y"], "tags": []}, "type": "ColumnDataSource"}, {"id": "bc7435fb-8c25-4bdf-b509-7360d23b3e15", "attributes": {"dimensions": ["width", "height"], "plot": {"id": "68293e2e-cd0e-4773-95ed-c4c245cb8578", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "bc7435fb-8c25-4bdf-b509-7360d23b3e15", "tags": []}, "type": "PanTool"}, {"id": "ea961122-d9c4-4795-9093-d4d736d615ec", "attributes": {"line_color": {"value": "#1f77b4"}, "line_alpha": {"value": 0.1}, "y": {"field": "y"}, "doc": null, "id": "ea961122-d9c4-4795-9093-d4d736d615ec", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "a92ff025-72ad-4739-98ac-7d0404235003", "attributes": {"data_source": {"id": "5e35841f-1ab5-4a8c-8bfe-0c362548607b", "type": "ColumnDataSource"}, "nonselection_glyph": {"id": "436b1c5d-2887-484a-9a85-96b800db05e3", "type": "Line"}, "glyph": {"id": "c16f342a-5128-4542-9d80-5c7e680e1a9e", "type": "Line"}, "doc": null, "selection_glyph": null, "id": "a92ff025-72ad-4739-98ac-7d0404235003", "tags": []}, "type": "GlyphRenderer"}, {"id": "e8851ddd-934f-40d8-b80a-1d935a2330bc", "attributes": {"data_source": {"id": "4595e065-33f8-4a01-9523-42e5ee97a0ed", "type": "ColumnDataSource"}, "nonselection_glyph": {"id": "ea961122-d9c4-4795-9093-d4d736d615ec", "type": "Line"}, "glyph": {"id": "9c4c6a38-5917-494b-a9e9-9e24a6473bce", "type": "Line"}, "doc": null, "selection_glyph": null, "id": "e8851ddd-934f-40d8-b80a-1d935a2330bc", "tags": []}, "type": "GlyphRenderer"}, {"id": "756ac16d-b924-422e-9fad-88a8142fae84", "attributes": {"line_color": {"value": "#67a9cf"}, "line_alpha": {"value": 1.0}, "y": {"field": "y"}, "doc": null, "id": "756ac16d-b924-422e-9fad-88a8142fae84", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "587eefca-cd67-4c4a-b774-e26186a3ab8b", "attributes": {"plot": {"id": "68293e2e-cd0e-4773-95ed-c4c245cb8578", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "587eefca-cd67-4c4a-b774-e26186a3ab8b", "tags": []}, "type": "ResetTool"}, {"id": "f3
|
|||
|
Bokeh.load_models(all_models);
|
|||
|
var plots = [{'modelid': '68293e2e-cd0e-4773-95ed-c4c245cb8578', 'elementid': '5b89dfb3-0bd0-482b-9e35-0acb63e01883', 'modeltype': 'Plot'}];
|
|||
|
for (idx in plots) {
|
|||
|
var plot = plots[idx];
|
|||
|
var model = Bokeh.Collections(plot.modeltype).get(plot.modelid);
|
|||
|
Bokeh.logger.info('Realizing plot:')
|
|||
|
Bokeh.logger.info(' - modeltype: ' + plot.modeltype);
|
|||
|
Bokeh.logger.info(' - modelid: ' + plot.modelid);
|
|||
|
Bokeh.logger.info(' - elementid: ' + plot.elementid);
|
|||
|
var view = new model.default_view({
|
|||
|
model: model,
|
|||
|
el: '#' + plot.elementid
|
|||
|
});
|
|||
|
Bokeh.index[plot.modelid] = view;
|
|||
|
}
|
|||
|
});
|
|||
|
</script>
|
|||
|
<div class="plotdiv" id="5b89dfb3-0bd0-482b-9e35-0acb63e01883"></div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="output_area"><div class="prompt"></div>
|
|||
|
|
|||
|
<div class="output_html rendered_html output_subarea ">
|
|||
|
<script type="text/javascript">
|
|||
|
Bokeh.$(function() {
|
|||
|
var all_models = [{"id": "ebc8a196-42cb-4c41-8f1d-6999d76eb0e0", "attributes": {"mantissas": [2, 5, 10], "num_minor_ticks": 5, "doc": null, "id": "ebc8a196-42cb-4c41-8f1d-6999d76eb0e0", "tags": []}, "type": "BasicTicker"}, {"id": "41e3fc70-b574-44d3-b0c6-13efa20ebf81", "attributes": {"data": {"x": [1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015], "y": [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 19, 18, 24]}, "callback": null, "doc": null, "id": "41e3fc70-b574-44d3-b0c6-13efa20ebf81", "selected": {"0d": {"flag": false, "indices": []}, "1d": {"indices": []}, "2d": {"indices": []}}, "column_names": ["x", "y"], "tags": []}, "type": "ColumnDataSource"}, {"id": "831f397d-2858-4caa-a0f1-d6d0287b829e", "attributes": {"data_source": {"id": "6ab0c722-302b-40f3-aa73-7ec54ba79b07", "type": "ColumnDataSource"}, "nonselection_glyph": {"id": "69a05944-0130-4882-a180-e3b20edb64e1", "type": "Line"}, "glyph": {"id": "0e10b42d-a0e9-40ba-a466-63312225186d", "type": "Line"}, "doc": null, "selection_glyph": null, "id": "831f397d-2858-4caa-a0f1-d6d0287b829e", "tags": []}, "type": "GlyphRenderer"}, {"id": "3232e79f-601a-451b-a99b-71cadc9d089a", "attributes": {"doc": null, "id": "3232e79f-601a-451b-a99b-71cadc9d089a", "tags": []}, "type": "BasicTickFormatter"}, {"id": "73870cbf-695f-4306-83e2-ffc256b017c2", "attributes": {"data_source": {"id": "cd57a879-069f-4174-b6ca-189a66843751", "type": "ColumnDataSource"}, "nonselection_glyph": {"id": "0e4186f8-866c-409d-b836-973e428378d9", "type": "Line"}, "glyph": {"id": "36b202f4-2918-4fdf-a317-d6f5aa51022d", "type": "Line"}, "doc": null, "selection_glyph": null, "id": "73870cbf-695f-4306-83e2-ffc256b017c2", "tags": []}, "type": "GlyphRenderer"}, {"id": "0ff6827e-1a73-4c09-876d-a4b3d8b578ac", "attributes": {"line_color": {"value": "#014636"}, "line_alpha": {"value": 1.0}, "y": {"field": "y"}, "doc": null, "id": "0ff6827e-1a73-4c09-876d-a4b3d8b578ac", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "03a89c0f-5abf-47ad-8a96-c51111459f7a", "attributes": {"line_color": {"value": "#3690c0"}, "line_alpha": {"value": 1.0}, "y": {"field": "y"}, "doc": null, "id": "03a89c0f-5abf-47ad-8a96-c51111459f7a", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "28dfa31e-aee0-4708-8bf6-6a4858309248", "attributes": {"data_source": {"id": "c2f0f87d-661e-4918-8906-0b82fb1cfba2", "type": "ColumnDataSource"}, "nonselection_glyph": {"id": "0b88bf72-f517-4223-bc96-5dd44c9f5576", "type": "Line"}, "glyph": {"id": "03a89c0f-5abf-47ad-8a96-c51111459f7a", "type": "Line"}, "doc": null, "selection_glyph": null, "id": "28dfa31e-aee0-4708-8bf6-6a4858309248", "tags": []}, "type": "GlyphRenderer"}, {"id": "cd57a879-069f-4174-b6ca-189a66843751", "attributes": {"data": {"x": [1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015], "y": [30, 30, 30, 30, 30, 30, 30, 30, 28, 30, 30, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 24, 24, 20]}, "callback": null, "doc": null, "id": "cd57a879-069f-4174-b6ca-189a66843751", "selected": {"0d": {"flag": false, "indices": []}, "1d": {"indices": []}, "2d": {"indices": []}}, "column_names": ["x", "y"], "tags": []}, "type": "ColumnDataSource"}, {"id": "c2f0f87d-661e-4918-8906-0b82fb1cfba2", "attributes": {"data": {"x": [1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015], "y": [31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 15, 29, 23]}, "callback": null, "doc": null, "id": "c2f0f87d-661e-4918-8906-0b82fb1cfba2", "selected": {"0d": {"flag": false, "indices": []}, "1d": {"indices": []}, "2d": {"indices": []}}, "column_names": ["x", "y"], "tags": []}, "type": "ColumnDataSource"}, {"id": "9d299f9a-c918-4c4f-8480-ff3330e3c202", "attributes": {"plot": {"id": "1e75e982-59a5-4e67-8947-1
|
|||
|
Bokeh.load_models(all_models);
|
|||
|
var plots = [{'modelid': '1e75e982-59a5-4e67-8947-1b11391c0f23', 'elementid': 'd2fca745-9f46-40b7-8e1d-76e542d1ef8d', 'modeltype': 'Plot'}];
|
|||
|
for (idx in plots) {
|
|||
|
var plot = plots[idx];
|
|||
|
var model = Bokeh.Collections(plot.modeltype).get(plot.modelid);
|
|||
|
Bokeh.logger.info('Realizing plot:')
|
|||
|
Bokeh.logger.info(' - modeltype: ' + plot.modeltype);
|
|||
|
Bokeh.logger.info(' - modelid: ' + plot.modelid);
|
|||
|
Bokeh.logger.info(' - elementid: ' + plot.elementid);
|
|||
|
var view = new model.default_view({
|
|||
|
model: model,
|
|||
|
el: '#' + plot.elementid
|
|||
|
});
|
|||
|
Bokeh.index[plot.modelid] = view;
|
|||
|
}
|
|||
|
});
|
|||
|
</script>
|
|||
|
<div class="plotdiv" id="d2fca745-9f46-40b7-8e1d-76e542d1ef8d"></div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
<div class="cell border-box-sizing text_cell rendered">
|
|||
|
<div class="prompt input_prompt">
|
|||
|
</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="text_cell_render border-box-sizing rendered_html">
|
|||
|
<p>On the whole, the number of cloudy days seems to reflect the trend with average cloud cover - it's actually becoming more sunny as time progresses. That said, we need to be careful in how we view this number - because there weren't as many samples in 2015 as previous years, the number of days can get thrown off. In context though, even if most days not recorded were in fact cloudy, the overall count for 2015 would still be lower than previous years.</p>
|
|||
|
<h1 id="Tracking-Precipitation-Chances">Tracking Precipitation Chances<a class="anchor-link" href="#Tracking-Precipitation-Chances">¶</a></h1><p>In addition to checking cloud cover, I wanted to check precipitation data as well - what is the average precipitation chance over a month, and how many days during a month is rain likely? The thinking is that days with a high-precipitation chance will also be days in which it is cloudy or depressing.</p>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="cell border-box-sizing code_cell rendered">
|
|||
|
<div class="input">
|
|||
|
<div class="prompt input_prompt">In [5]:</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="input_area">
|
|||
|
<div class=" highlight hl-ipython3"><pre><span class="k">def</span> <span class="nf">safe_precip</span><span class="p">(</span><span class="n">frame</span><span class="p">):</span>
|
|||
|
<span class="k">if</span> <span class="n">frame</span> <span class="ow">and</span> <span class="s1">'precipProbability'</span> <span class="ow">in</span> <span class="n">frame</span><span class="p">:</span>
|
|||
|
<span class="k">return</span> <span class="n">frame</span><span class="p">[</span><span class="s1">'precipProbability'</span><span class="p">]</span>
|
|||
|
<span class="k">else</span><span class="p">:</span>
|
|||
|
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">NaN</span>
|
|||
|
|
|||
|
<span class="k">def</span> <span class="nf">monthly_avg_precip</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span><span class="p">):</span>
|
|||
|
<span class="n">dates</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DatetimeIndex</span><span class="p">(</span><span class="n">start</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">12</span><span class="p">),</span>
|
|||
|
<span class="n">end</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">12</span><span class="p">),</span>
|
|||
|
<span class="n">freq</span><span class="o">=</span><span class="s1">'D'</span><span class="p">,</span> <span class="n">closed</span><span class="o">=</span><span class="s1">'left'</span><span class="p">)</span>
|
|||
|
<span class="n">precip_vals</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">safe_precip</span><span class="p">(</span><span class="n">cary_forecast</span><span class="p">[</span><span class="n">x</span><span class="p">][</span><span class="s1">'currently'</span><span class="p">]),</span> <span class="n">dates</span><span class="p">))</span>
|
|||
|
<span class="n">precip_samples</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="nb">filter</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">np</span><span class="o">.</span><span class="n">NaN</span><span class="p">,</span> <span class="n">precip_vals</span><span class="p">)))</span>
|
|||
|
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">nanmean</span><span class="p">(</span><span class="n">precip_vals</span><span class="p">),</span> <span class="n">precip_samples</span>
|
|||
|
|
|||
|
<span class="n">monthly_avg_precip_vals</span> <span class="o">=</span> <span class="p">[[</span><span class="n">monthly_avg_precip</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">m</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span> <span class="k">for</span> <span class="n">y</span> <span class="ow">in</span> <span class="n">years</span><span class="p">]</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">months</span><span class="p">]</span>
|
|||
|
|
|||
|
<span class="n">f</span> <span class="o">=</span> <span class="n">figure</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="s1">'Monthly Average Precipitation Chance'</span><span class="p">,</span>
|
|||
|
<span class="n">x_range</span><span class="o">=</span><span class="p">(</span><span class="mi">1990</span><span class="p">,</span> <span class="mi">2015</span><span class="p">),</span>
|
|||
|
<span class="n">x_axis_label</span><span class="o">=</span><span class="s1">'Year'</span><span class="p">)</span>
|
|||
|
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">months</span><span class="p">)):</span>
|
|||
|
<span class="n">f</span><span class="o">.</span><span class="n">line</span><span class="p">(</span><span class="n">years</span><span class="p">,</span> <span class="n">monthly_avg_precip_vals</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">legend</span><span class="o">=</span><span class="n">months_str</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">color</span><span class="o">=</span><span class="n">Palette</span><span class="p">[</span><span class="n">x</span><span class="p">])</span>
|
|||
|
<span class="n">show</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="output_wrapper">
|
|||
|
<div class="output">
|
|||
|
|
|||
|
|
|||
|
<div class="output_area"><div class="prompt"></div>
|
|||
|
|
|||
|
<div class="output_html rendered_html output_subarea ">
|
|||
|
<script type="text/javascript">
|
|||
|
Bokeh.$(function() {
|
|||
|
var all_models = [{"id": "40b83047-3e6f-459d-b005-988e7c72ffeb", "attributes": {"line_color": {"value": "#1f77b4"}, "line_alpha": {"value": 0.1}, "y": {"field": "y"}, "doc": null, "id": "40b83047-3e6f-459d-b005-988e7c72ffeb", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "f77ee919-b8d8-47f7-a503-8d146e85fe54", "attributes": {"line_color": {"value": "#3690c0"}, "line_alpha": {"value": 1.0}, "y": {"field": "y"}, "doc": null, "id": "f77ee919-b8d8-47f7-a503-8d146e85fe54", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "5ab374c6-7820-4435-bcfd-31d3e2ac3a7f", "attributes": {"dimensions": ["width", "height"], "plot": {"id": "f700bb3b-d41c-4877-9f5c-9c7737a13924", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "5ab374c6-7820-4435-bcfd-31d3e2ac3a7f", "tags": []}, "type": "PanTool"}, {"id": "9d902dfd-3f7c-4970-9161-cdb8fde2d815", "attributes": {"data": {"x": [1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015], "y": [0.023870967741935485, 0.0, 0.053548387096774196, 0.04387096774193548, 0.026451612903225806, 0.02903225806451613, 0.025161290322580646, 0.04483870967741936, 0.04096774193548387, 0.07419354838709677, 0.0, 0.004193548387096774, 0.08064516129032258, 0.06516129032258063, 0.02225806451612903, 0.051612903225806445, 0.08451612903225807, 0.09451612903225808, 0.023548387096774193, 0.024193548387096774, 0.04290322580645162, 0.03774193548387097, 0.053548387096774196, 0.03354838709677419, 0.06387096774193549, 0.09709677419354838]}, "callback": null, "doc": null, "id": "9d902dfd-3f7c-4970-9161-cdb8fde2d815", "selected": {"0d": {"flag": false, "indices": []}, "1d": {"indices": []}, "2d": {"indices": []}}, "column_names": ["x", "y"], "tags": []}, "type": "ColumnDataSource"}, {"id": "8c95b964-2a30-4a3b-baf2-8a82f67ab197", "attributes": {"line_color": {"value": "#02818a"}, "line_alpha": {"value": 1.0}, "y": {"field": "y"}, "doc": null, "id": "8c95b964-2a30-4a3b-baf2-8a82f67ab197", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "5edfc45e-4904-4866-a9d0-00c86b88a334", "attributes": {"doc": null, "names": [], "callback": null, "renderers": [], "id": "5edfc45e-4904-4866-a9d0-00c86b88a334", "tags": []}, "type": "DataRange1d"}, {"id": "f789b942-86b5-4a0c-b92e-da732ee401b6", "attributes": {"data_source": {"id": "0889d3f8-878a-4bfb-bd5d-f3d90d652993", "type": "ColumnDataSource"}, "nonselection_glyph": {"id": "34fe74a3-302c-42ef-8e64-c3a897607a31", "type": "Line"}, "glyph": {"id": "bb411c59-5525-4a1f-bf97-020cb2d0956f", "type": "Line"}, "doc": null, "selection_glyph": null, "id": "f789b942-86b5-4a0c-b92e-da732ee401b6", "tags": []}, "type": "GlyphRenderer"}, {"id": "8b1f4e78-4335-47da-9b93-7279d23e2190", "attributes": {"plot": {"id": "f700bb3b-d41c-4877-9f5c-9c7737a13924", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "8b1f4e78-4335-47da-9b93-7279d23e2190", "tags": []}, "type": "ResizeTool"}, {"id": "cfc78640-7a6c-4a95-8a87-c6e22739d822", "attributes": {"line_color": {"value": "#014636"}, "line_alpha": {"value": 1.0}, "y": {"field": "y"}, "doc": null, "id": "cfc78640-7a6c-4a95-8a87-c6e22739d822", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "2d70dbe8-3790-4bc4-8e6c-8c0ca118a691", "attributes": {"line_color": {"value": "#1f77b4"}, "line_alpha": {"value": 0.1}, "y": {"field": "y"}, "doc": null, "id": "2d70dbe8-3790-4bc4-8e6c-8c0ca118a691", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "a16eafea-6839-44a6-927b-535da6d3b12b", "attributes": {"dimensions": ["width", "height"], "plot": {"id": "f700bb3b-d41c-4877-9f5c-9c7737a13924", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "a16eafea-6839-44a6-927b-535da6d3b12b", "tags": []}, "type": "WheelZoomTool"}, {"id": "0889d3f8-878a-4bfb-bd5d-f3d90d652993", "attributes": {"data": {"x": [1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015], "y": [0.0, 0.0, 0.07200000000000001, 0.055, 0.046, 0.1036666666666666
|
|||
|
Bokeh.load_models(all_models);
|
|||
|
var plots = [{'modelid': 'f700bb3b-d41c-4877-9f5c-9c7737a13924', 'elementid': 'fe48a963-4ff4-44e1-8d01-b095adafd533', 'modeltype': 'Plot'}];
|
|||
|
for (idx in plots) {
|
|||
|
var plot = plots[idx];
|
|||
|
var model = Bokeh.Collections(plot.modeltype).get(plot.modelid);
|
|||
|
Bokeh.logger.info('Realizing plot:')
|
|||
|
Bokeh.logger.info(' - modeltype: ' + plot.modeltype);
|
|||
|
Bokeh.logger.info(' - modelid: ' + plot.modelid);
|
|||
|
Bokeh.logger.info(' - elementid: ' + plot.elementid);
|
|||
|
var view = new model.default_view({
|
|||
|
model: model,
|
|||
|
el: '#' + plot.elementid
|
|||
|
});
|
|||
|
Bokeh.index[plot.modelid] = view;
|
|||
|
}
|
|||
|
});
|
|||
|
</script>
|
|||
|
<div class="plotdiv" id="fe48a963-4ff4-44e1-8d01-b095adafd533"></div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
<div class="cell border-box-sizing text_cell rendered">
|
|||
|
<div class="prompt input_prompt">
|
|||
|
</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="text_cell_render border-box-sizing rendered_html">
|
|||
|
<p>As we can see from the chart, the average chance of precipitation over a month more or less stays within a band of 0 - .1 for all months over all years. This is further evidence that the past few months are no more cloudy or rainy than previous years. Like the cloud cover though, we still want to get a count of all the rainy days, in addition to the average chance. We'll define a "rainy day" as any day in which the chance of rain is greater than 25%.</p>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="cell border-box-sizing code_cell rendered">
|
|||
|
<div class="input">
|
|||
|
<div class="prompt input_prompt">In [6]:</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="input_area">
|
|||
|
<div class=" highlight hl-ipython3"><pre><span class="k">def</span> <span class="nf">monthly_rainy_days</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span><span class="p">):</span>
|
|||
|
<span class="n">dates</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DatetimeIndex</span><span class="p">(</span><span class="n">start</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">12</span><span class="p">),</span>
|
|||
|
<span class="n">end</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">12</span><span class="p">),</span>
|
|||
|
<span class="n">freq</span><span class="o">=</span><span class="s1">'D'</span><span class="p">,</span> <span class="n">closed</span><span class="o">=</span><span class="s1">'left'</span><span class="p">)</span>
|
|||
|
<span class="n">precip_prob_vals</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">safe_precip</span><span class="p">(</span><span class="n">cary_forecast</span><span class="p">[</span><span class="n">x</span><span class="p">][</span><span class="s1">'currently'</span><span class="p">]),</span> <span class="n">dates</span><span class="p">))</span>
|
|||
|
<span class="n">precip_prob_samples</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="nb">filter</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">np</span><span class="o">.</span><span class="n">NaN</span><span class="p">,</span> <span class="n">precip_prob_vals</span><span class="p">)))</span>
|
|||
|
<span class="n">precip_days</span> <span class="o">=</span> <span class="p">[</span><span class="n">prob</span> <span class="o">></span> <span class="o">.</span><span class="mi">25</span> <span class="k">for</span> <span class="n">prob</span> <span class="ow">in</span> <span class="n">precip_prob_vals</span><span class="p">]</span>
|
|||
|
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">count_nonzero</span><span class="p">(</span><span class="n">precip_days</span><span class="p">),</span> <span class="n">precip_prob_samples</span>
|
|||
|
|
|||
|
<span class="n">monthly_precip_days_vals</span> <span class="o">=</span> <span class="p">[[</span><span class="n">monthly_rainy_days</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">m</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span> <span class="k">for</span> <span class="n">y</span> <span class="ow">in</span> <span class="n">years</span><span class="p">]</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">months</span><span class="p">]</span>
|
|||
|
<span class="n">monthly_precip_samples</span> <span class="o">=</span> <span class="p">[[</span><span class="n">monthly_rainy_days</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">m</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span> <span class="k">for</span> <span class="n">y</span> <span class="ow">in</span> <span class="n">years</span><span class="p">]</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">months</span><span class="p">]</span>
|
|||
|
|
|||
|
<span class="n">f</span> <span class="o">=</span> <span class="n">figure</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="s1">'Monthly Rainy Days'</span><span class="p">,</span>
|
|||
|
<span class="n">x_range</span><span class="o">=</span><span class="p">(</span><span class="mi">1990</span><span class="p">,</span> <span class="mi">2015</span><span class="p">),</span>
|
|||
|
<span class="n">x_axis_label</span><span class="o">=</span><span class="s1">'Year'</span><span class="p">)</span>
|
|||
|
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">months</span><span class="p">)):</span>
|
|||
|
<span class="n">f</span><span class="o">.</span><span class="n">line</span><span class="p">(</span><span class="n">years</span><span class="p">,</span> <span class="n">monthly_precip_days_vals</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">legend</span><span class="o">=</span><span class="n">months_str</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">color</span><span class="o">=</span><span class="n">Palette</span><span class="p">[</span><span class="n">x</span><span class="p">])</span>
|
|||
|
<span class="n">show</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
|
|||
|
|
|||
|
<span class="n">f</span> <span class="o">=</span> <span class="n">figure</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="s1">'Monthly Rainy Days Samples'</span><span class="p">,</span>
|
|||
|
<span class="n">x_range</span><span class="o">=</span><span class="p">(</span><span class="mi">1990</span><span class="p">,</span> <span class="mi">2015</span><span class="p">),</span>
|
|||
|
<span class="n">x_axis_label</span><span class="o">=</span><span class="s1">'Year'</span><span class="p">,</span>
|
|||
|
<span class="n">height</span><span class="o">=</span><span class="mi">300</span><span class="p">)</span>
|
|||
|
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">months</span><span class="p">)):</span>
|
|||
|
<span class="n">f</span><span class="o">.</span><span class="n">line</span><span class="p">(</span><span class="n">years</span><span class="p">,</span> <span class="n">monthly_precip_samples</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">legend</span><span class="o">=</span><span class="n">months_str</span><span class="p">[</span><span class="n">x</span><span class="p">],</span> <span class="n">color</span><span class="o">=</span><span class="n">Palette</span><span class="p">[</span><span class="n">x</span><span class="p">])</span>
|
|||
|
<span class="n">show</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="output_wrapper">
|
|||
|
<div class="output">
|
|||
|
|
|||
|
|
|||
|
<div class="output_area"><div class="prompt"></div>
|
|||
|
|
|||
|
<div class="output_html rendered_html output_subarea ">
|
|||
|
<script type="text/javascript">
|
|||
|
Bokeh.$(function() {
|
|||
|
var all_models = [{"id": "796aa38f-3d60-4e2f-b935-9bb5eadd9c2d", "attributes": {"doc": null, "id": "796aa38f-3d60-4e2f-b935-9bb5eadd9c2d", "tags": []}, "type": "BasicTickFormatter"}, {"id": "6ec9712e-0074-415d-96bf-d3357cd09e8c", "attributes": {"line_color": {"value": "#1f77b4"}, "line_alpha": {"value": 0.1}, "y": {"field": "y"}, "doc": null, "id": "6ec9712e-0074-415d-96bf-d3357cd09e8c", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "dd882eaa-16df-4a51-9ef9-473dba442ac1", "attributes": {"end": 2015, "callback": null, "id": "dd882eaa-16df-4a51-9ef9-473dba442ac1", "doc": null, "start": 1990, "tags": []}, "type": "Range1d"}, {"id": "06bd0543-d74f-4e8e-8a7e-7ec0c9e24d29", "attributes": {"dimensions": ["width", "height"], "plot": {"id": "cf7920fd-e257-462f-ac47-e6e79f5ca051", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "06bd0543-d74f-4e8e-8a7e-7ec0c9e24d29", "tags": []}, "type": "PanTool"}, {"id": "479fee83-2daa-4ee9-91c2-41330bc3bfb6", "attributes": {"line_color": {"value": "#1f77b4"}, "line_alpha": {"value": 0.1}, "y": {"field": "y"}, "doc": null, "id": "479fee83-2daa-4ee9-91c2-41330bc3bfb6", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "82cf9c4f-73ca-4975-81d0-23e9f7708d38", "attributes": {"data": {"x": [1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015], "y": [0, 1, 0, 1, 1, 0, 1, 2, 0, 2, 4, 3, 2, 2, 0, 1, 1, 0, 1, 2, 2, 1, 0, 2, 2, 0]}, "callback": null, "doc": null, "id": "82cf9c4f-73ca-4975-81d0-23e9f7708d38", "selected": {"0d": {"flag": false, "indices": []}, "1d": {"indices": []}, "2d": {"indices": []}}, "column_names": ["x", "y"], "tags": []}, "type": "ColumnDataSource"}, {"id": "4088c32e-912e-45ca-a17e-fa318fe1014c", "attributes": {"plot": {"id": "cf7920fd-e257-462f-ac47-e6e79f5ca051", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "4088c32e-912e-45ca-a17e-fa318fe1014c", "tags": []}, "type": "HelpTool"}, {"id": "be836449-a914-4879-9d45-b58bf4ff1f59", "attributes": {"plot": {"id": "cf7920fd-e257-462f-ac47-e6e79f5ca051", "type": "Plot", "subtype": "Figure"}, "id": "be836449-a914-4879-9d45-b58bf4ff1f59", "doc": null, "ticker": {"id": "2923220b-a95b-427e-9c70-9bdf644b2414", "type": "BasicTicker"}, "tags": [], "formatter": {"id": "796aa38f-3d60-4e2f-b935-9bb5eadd9c2d", "type": "BasicTickFormatter"}}, "type": "LinearAxis"}, {"id": "5507332f-ad8e-4e23-b165-c0001537e56a", "attributes": {"line_color": {"value": "#1f77b4"}, "line_alpha": {"value": 0.1}, "y": {"field": "y"}, "doc": null, "id": "5507332f-ad8e-4e23-b165-c0001537e56a", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "43684d89-d93d-4ae8-b688-8e06aebf807e", "attributes": {"data": {"x": [1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015], "y": [1, 2, 2, 1, 1, 1, 1, 1, 0, 1, 3, 0, 3, 2, 3, 2, 2, 0, 1, 2, 0, 1, 1, 1, 3, 1]}, "callback": null, "doc": null, "id": "43684d89-d93d-4ae8-b688-8e06aebf807e", "selected": {"0d": {"flag": false, "indices": []}, "1d": {"indices": []}, "2d": {"indices": []}}, "column_names": ["x", "y"], "tags": []}, "type": "ColumnDataSource"}, {"id": "f90070db-b844-4992-bdcc-9b7bcae08930", "attributes": {"line_color": {"value": "#02818a"}, "line_alpha": {"value": 1.0}, "y": {"field": "y"}, "doc": null, "id": "f90070db-b844-4992-bdcc-9b7bcae08930", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "e6331979-30cf-474e-9999-43ad26edc912", "attributes": {"line_color": {"value": "#1f77b4"}, "line_alpha": {"value": 0.1}, "y": {"field": "y"}, "doc": null, "id": "e6331979-30cf-474e-9999-43ad26edc912", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "e5863a93-32f3-4401-8627-15bbc2c9c810", "attributes": {"dimensions": ["width", "height"], "plot": {"id": "cf7920fd-e257-462f-ac47-e6e79f5ca051", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "e5863a93-32f3-4401-8627-15bbc2c9c810", "tags": []}, "type": "WheelZoomTool"}, {"id": "f8797896-5a49-47d4-bc24-be35f39
|
|||
|
Bokeh.load_models(all_models);
|
|||
|
var plots = [{'modelid': 'cf7920fd-e257-462f-ac47-e6e79f5ca051', 'elementid': '81c95d50-a301-410f-bc4c-797abe6f67a5', 'modeltype': 'Plot'}];
|
|||
|
for (idx in plots) {
|
|||
|
var plot = plots[idx];
|
|||
|
var model = Bokeh.Collections(plot.modeltype).get(plot.modelid);
|
|||
|
Bokeh.logger.info('Realizing plot:')
|
|||
|
Bokeh.logger.info(' - modeltype: ' + plot.modeltype);
|
|||
|
Bokeh.logger.info(' - modelid: ' + plot.modelid);
|
|||
|
Bokeh.logger.info(' - elementid: ' + plot.elementid);
|
|||
|
var view = new model.default_view({
|
|||
|
model: model,
|
|||
|
el: '#' + plot.elementid
|
|||
|
});
|
|||
|
Bokeh.index[plot.modelid] = view;
|
|||
|
}
|
|||
|
});
|
|||
|
</script>
|
|||
|
<div class="plotdiv" id="81c95d50-a301-410f-bc4c-797abe6f67a5"></div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="output_area"><div class="prompt"></div>
|
|||
|
|
|||
|
<div class="output_html rendered_html output_subarea ">
|
|||
|
<script type="text/javascript">
|
|||
|
Bokeh.$(function() {
|
|||
|
var all_models = [{"id": "95612edb-f8f2-4f17-b216-2f36178794d4", "attributes": {"mantissas": [2, 5, 10], "num_minor_ticks": 5, "doc": null, "id": "95612edb-f8f2-4f17-b216-2f36178794d4", "tags": []}, "type": "BasicTicker"}, {"id": "e9818ec1-73ca-4ccb-8e3c-a813a139dc1b", "attributes": {"data": {"x": [1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015], "y": [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]}, "callback": null, "doc": null, "id": "e9818ec1-73ca-4ccb-8e3c-a813a139dc1b", "selected": {"0d": {"flag": false, "indices": []}, "1d": {"indices": []}, "2d": {"indices": []}}, "column_names": ["x", "y"], "tags": []}, "type": "ColumnDataSource"}, {"id": "0367f78c-edcb-4549-8a51-3c8b74969c07", "attributes": {"line_color": {"value": "#3690c0"}, "line_alpha": {"value": 1.0}, "y": {"field": "y"}, "doc": null, "id": "0367f78c-edcb-4549-8a51-3c8b74969c07", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "dd56772f-e47f-4b8d-9960-d8114239447a", "attributes": {"doc": null, "id": "dd56772f-e47f-4b8d-9960-d8114239447a", "tags": []}, "type": "BasicTickFormatter"}, {"id": "be6e22c5-9d57-4c4a-80ba-9d9b553ef019", "attributes": {"plot": {"id": "4bcda4ae-5267-4de8-b4ce-9c01c6da20d2", "type": "Plot", "subtype": "Figure"}, "legends": [["July", [{"id": "e84ae364-5b3c-4828-8996-98e44725e77e", "type": "GlyphRenderer"}]], ["August", [{"id": "a63c17e9-d92b-427c-9011-c09ba6ab82c1", "type": "GlyphRenderer"}]], ["September", [{"id": "4467c69e-a996-4556-af6b-bf5930177a38", "type": "GlyphRenderer"}]], ["October", [{"id": "cac0185b-6937-4cb0-8c37-b03bbc8de1c0", "type": "GlyphRenderer"}]], ["November", [{"id": "482d65c9-8f4b-429e-8a4f-2012223b32c5", "type": "GlyphRenderer"}]]], "doc": null, "id": "be6e22c5-9d57-4c4a-80ba-9d9b553ef019", "tags": []}, "type": "Legend"}, {"id": "d1a04e80-220b-4d77-8a0e-4e80e3fa6cc4", "attributes": {"dimensions": ["width", "height"], "plot": {"id": "4bcda4ae-5267-4de8-b4ce-9c01c6da20d2", "type": "Plot", "subtype": "Figure"}, "doc": null, "id": "d1a04e80-220b-4d77-8a0e-4e80e3fa6cc4", "tags": []}, "type": "BoxZoomTool"}, {"id": "e84ae364-5b3c-4828-8996-98e44725e77e", "attributes": {"data_source": {"id": "2ead803f-4454-4169-b5d5-a167c322d83e", "type": "ColumnDataSource"}, "nonselection_glyph": {"id": "bdfb89bb-deff-4d31-84b5-b485878f6f9a", "type": "Line"}, "glyph": {"id": "70ea7777-8ded-4914-befb-445d740ab417", "type": "Line"}, "doc": null, "selection_glyph": null, "id": "e84ae364-5b3c-4828-8996-98e44725e77e", "tags": []}, "type": "GlyphRenderer"}, {"id": "70ea7777-8ded-4914-befb-445d740ab417", "attributes": {"line_color": {"value": "#014636"}, "line_alpha": {"value": 1.0}, "y": {"field": "y"}, "doc": null, "id": "70ea7777-8ded-4914-befb-445d740ab417", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "84f866c1-7183-4138-9e7a-6fe8804e3eae", "attributes": {"line_color": {"value": "#1f77b4"}, "line_alpha": {"value": 0.1}, "y": {"field": "y"}, "doc": null, "id": "84f866c1-7183-4138-9e7a-6fe8804e3eae", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "bdfb89bb-deff-4d31-84b5-b485878f6f9a", "attributes": {"line_color": {"value": "#1f77b4"}, "line_alpha": {"value": 0.1}, "y": {"field": "y"}, "doc": null, "id": "bdfb89bb-deff-4d31-84b5-b485878f6f9a", "x": {"field": "x"}, "tags": []}, "type": "Line"}, {"id": "d2f1813c-6f54-44a1-aa8f-3bc7259a4524", "attributes": {"plot": {"id": "4bcda4ae-5267-4de8-b4ce-9c01c6da20d2", "type": "Plot", "subtype": "Figure"}, "dimension": 1, "id": "d2f1813c-6f54-44a1-aa8f-3bc7259a4524", "doc": null, "ticker": {"id": "95612edb-f8f2-4f17-b216-2f36178794d4", "type": "BasicTicker"}, "tags": []}, "type": "Grid"}, {"id": "4467c69e-a996-4556-af6b-bf5930177a38", "attributes": {"data_source": {"id": "44451684-6155-4535-8f19-3dc3b01df557", "type": "ColumnDataSource"}, "nonselection_glyph": {"id": "00b775f6-1605-4ed7-8ab1-fbc970e8d47a", "type": "Line"}, "glyph": {"id": "9f7dd85f-e1e3-45b6-bba0-264dac900cf3", "type": "Line"},
|
|||
|
Bokeh.load_models(all_models);
|
|||
|
var plots = [{'modelid': '4bcda4ae-5267-4de8-b4ce-9c01c6da20d2', 'elementid': 'e0f55f0d-f1ae-4a3c-a517-63a15a51bd88', 'modeltype': 'Plot'}];
|
|||
|
for (idx in plots) {
|
|||
|
var plot = plots[idx];
|
|||
|
var model = Bokeh.Collections(plot.modeltype).get(plot.modelid);
|
|||
|
Bokeh.logger.info('Realizing plot:')
|
|||
|
Bokeh.logger.info(' - modeltype: ' + plot.modeltype);
|
|||
|
Bokeh.logger.info(' - modelid: ' + plot.modelid);
|
|||
|
Bokeh.logger.info(' - elementid: ' + plot.elementid);
|
|||
|
var view = new model.default_view({
|
|||
|
model: model,
|
|||
|
el: '#' + plot.elementid
|
|||
|
});
|
|||
|
Bokeh.index[plot.modelid] = view;
|
|||
|
}
|
|||
|
});
|
|||
|
</script>
|
|||
|
<div class="plotdiv" id="e0f55f0d-f1ae-4a3c-a517-63a15a51bd88"></div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
<div class="cell border-box-sizing text_cell rendered">
|
|||
|
<div class="prompt input_prompt">
|
|||
|
</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="text_cell_render border-box-sizing rendered_html">
|
|||
|
<p>After trying to find the number of days that are rainy, we can see that November hit its max value for rainy days in 2015. However, that value is 6, as compared to a previous maximum of 5. While it is a new record, the value isn't actually all that different. And for other months, the values are mostly in-line with the averages.</p>
|
|||
|
<h1 id="Summary-and-Conclusions">Summary and Conclusions<a class="anchor-link" href="#Summary-and-Conclusions">¶</a></h1><p>After having looked at forecast data for Cary, it appears that the months of July - November this year in terms of weather were at worst on par with prior years, if not slightly more sunny. This seems to be a case of confirmation bias: someone complains about a string of cloudy or rainy days, and suddenly you start noticing them more.</p>
|
|||
|
<p>While this analysis doesn't take into account other areas of North Carolina, my initial guess would be to assume that other areas also will show similar results: nothing interesting is happening. Maybe that will be for another blog post later!</p>
|
|||
|
<p>Coming soon: I'll compare rain/cloud conditions in North Carolina to some other places in the U.S.!</p>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="cell border-box-sizing text_cell rendered">
|
|||
|
<div class="prompt input_prompt">
|
|||
|
</div>
|
|||
|
<div class="inner_cell">
|
|||
|
<div class="text_cell_render border-box-sizing rendered_html">
|
|||
|
<h1 id="Generating-the-Forecast-file">Generating the Forecast file<a class="anchor-link" href="#Generating-the-Forecast-file">¶</a></h1><p>The following code was generates the file that was used throughout the blog post. Please note that I'm retrieving data for other cities to use in a future blog post, only Cary data was used for this post.</p>
|
|||
|
<div class="highlight"><pre><span class="kn">import</span> <span class="nn">pandas</span> <span class="kn">as</span> <span class="nn">pd</span>
|
|||
|
<span class="kn">from</span> <span class="nn">functools</span> <span class="kn">import</span> <span class="nb">reduce</span>
|
|||
|
<span class="kn">import</span> <span class="nn">requests</span>
|
|||
|
<span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span>
|
|||
|
|
|||
|
<span class="c1"># Coordinate data from http://itouchmap.com/latlong.html</span>
|
|||
|
<span class="n">cary_loc</span> <span class="o">=</span> <span class="p">(</span><span class="mf">35.79154</span><span class="p">,</span><span class="o">-</span><span class="mf">78.781117</span><span class="p">)</span>
|
|||
|
<span class="n">nyc_loc</span> <span class="o">=</span> <span class="p">(</span><span class="mf">40.78306</span><span class="p">,</span><span class="o">-</span><span class="mf">73.971249</span><span class="p">)</span>
|
|||
|
<span class="n">seattle_loc</span> <span class="o">=</span> <span class="p">(</span><span class="mf">47.60621</span><span class="p">,</span><span class="o">-</span><span class="mf">122.332071</span><span class="p">)</span>
|
|||
|
<span class="n">binghamton_loc</span> <span class="o">=</span> <span class="p">(</span><span class="mf">42.098687</span><span class="p">,</span><span class="o">-</span><span class="mf">75.917974</span><span class="p">)</span>
|
|||
|
<span class="n">cities</span> <span class="o">=</span> <span class="p">{</span>
|
|||
|
<span class="s1">'cary'</span><span class="p">:</span> <span class="n">cary_loc</span><span class="p">,</span>
|
|||
|
<span class="s1">'nyc'</span><span class="p">:</span> <span class="n">nyc_loc</span><span class="p">,</span>
|
|||
|
<span class="s1">'seattle'</span><span class="p">:</span> <span class="n">seattle_loc</span><span class="p">,</span>
|
|||
|
<span class="s1">'binghamton'</span><span class="p">:</span> <span class="n">binghamton_loc</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="n">apikey</span> <span class="o">=</span> <span class="s1">''</span> <span class="c1"># My super-secret API Key</span>
|
|||
|
|
|||
|
<span class="k">def</span> <span class="nf">get_forecast</span><span class="p">(</span><span class="n">lat</span><span class="p">,</span> <span class="nb">long</span><span class="p">,</span> <span class="n">date</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
|
|||
|
<span class="n">forecast_base</span> <span class="o">=</span> <span class="s2">"https://api.forecast.io/forecast/"</span>
|
|||
|
<span class="k">if</span> <span class="n">date</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
|
|||
|
<span class="n">url</span> <span class="o">=</span> <span class="n">forecast_base</span> <span class="o">+</span> <span class="n">apikey</span> <span class="o">+</span> <span class="s1">'/{},{}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">lat</span><span class="p">,</span> <span class="nb">long</span><span class="p">)</span>
|
|||
|
<span class="k">else</span><span class="p">:</span>
|
|||
|
<span class="n">epoch</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">date</span><span class="o">.</span><span class="n">timestamp</span><span class="p">())</span>
|
|||
|
<span class="n">url</span> <span class="o">=</span> <span class="n">forecast_base</span> <span class="o">+</span> <span class="n">apikey</span> <span class="o">+</span> <span class="s1">'/{},{},{}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">lat</span><span class="p">,</span> <span class="nb">long</span><span class="p">,</span> <span class="n">epoch</span><span class="p">)</span>
|
|||
|
|
|||
|
<span class="k">return</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">url</span><span class="p">)</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
|
|||
|
|
|||
|
<span class="n">years</span> <span class="o">=</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1990</span><span class="p">,</span><span class="mi">2016</span><span class="p">)</span>
|
|||
|
<span class="c1"># For datetimes, the 12 is for getting the weather at noon.</span>
|
|||
|
<span class="c1"># We're doing this over midnight because we're more concerned</span>
|
|||
|
<span class="c1"># with what people see, and people don't typically see the weather</span>
|
|||
|
<span class="c1"># at midnight.</span>
|
|||
|
<span class="n">dt_indices</span> <span class="o">=</span> <span class="p">[</span><span class="n">pd</span><span class="o">.</span><span class="n">date_range</span><span class="p">(</span><span class="n">start</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">12</span><span class="p">),</span>
|
|||
|
<span class="n">end</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mi">12</span><span class="p">))</span>
|
|||
|
<span class="k">for</span> <span class="n">year</span> <span class="ow">in</span> <span class="n">years</span><span class="p">]</span>
|
|||
|
<span class="n">dt_merge</span> <span class="o">=</span> <span class="nb">reduce</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">:</span> <span class="n">x</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">y</span><span class="p">),</span> <span class="n">dt_indices</span><span class="p">)</span>
|
|||
|
|
|||
|
<span class="c1"># Because we have to pay a little bit to use the API, we use for loops here</span>
|
|||
|
<span class="c1"># instead of a comprehension - if something breaks, we want to preserve the</span>
|
|||
|
<span class="c1"># data already retrieved</span>
|
|||
|
<span class="n">city_forecasts</span> <span class="o">=</span> <span class="p">{}</span>
|
|||
|
<span class="k">for</span> <span class="n">city</span><span class="p">,</span> <span class="n">loc</span> <span class="ow">in</span> <span class="n">cities</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
|
|||
|
<span class="k">print</span><span class="p">(</span><span class="s2">"Retrieving data for {} starting at {}"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">city</span><span class="p">,</span>
|
|||
|
<span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%I:%M:%S %p"</span><span class="p">)))</span>
|
|||
|
<span class="k">for</span> <span class="n">dt</span> <span class="ow">in</span> <span class="n">dt_merge</span><span class="p">:</span>
|
|||
|
<span class="k">try</span><span class="p">:</span>
|
|||
|
<span class="n">city_forecasts</span><span class="p">[(</span><span class="n">city</span><span class="p">,</span> <span class="n">dt</span><span class="p">)]</span> <span class="o">=</span> <span class="n">get_forecast</span><span class="p">(</span><span class="o">*</span><span class="n">loc</span><span class="p">,</span> <span class="n">dt</span><span class="p">)</span>
|
|||
|
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
|||
|
<span class="k">print</span><span class="p">(</span><span class="n">e</span><span class="p">)</span>
|
|||
|
<span class="n">city_forecasts</span><span class="p">[(</span><span class="n">city</span><span class="p">,</span> <span class="n">dt</span><span class="p">)]</span> <span class="o">=</span> <span class="bp">None</span>
|
|||
|
<span class="k">print</span><span class="p">(</span><span class="s2">"End forecast retrieval: {}"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%I:%M:%S %p"</span><span class="p">)))</span>
|
|||
|
|
|||
|
<span class="kn">import</span> <span class="nn">pickle</span>
|
|||
|
<span class="n">pickle</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="n">city_forecasts</span><span class="p">,</span> <span class="nb">open</span><span class="p">(</span><span class="s1">'city_forecasts.p'</span><span class="p">,</span> <span class="s1">'wb'</span><span class="p">))</span>
|
|||
|
|
|||
|
<span class="c1">### Output:</span>
|
|||
|
<span class="c1"># Retrieving data for binghamton starting at 05:13:42 PM</span>
|
|||
|
<span class="c1"># Retrieving data for seattle starting at 05:30:51 PM</span>
|
|||
|
<span class="c1"># Retrieving data for nyc starting at 05:48:30 PM</span>
|
|||
|
<span class="c1"># Retrieving data for cary starting at 06:08:32 PM</span>
|
|||
|
<span class="c1"># End forecast retrieval: 06:25:21 PM</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div></p>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
<!-- /Content -->
|
|||
|
|
|||
|
<!-- Footer -->
|
|||
|
<div class="footer gradient-2">
|
|||
|
<div class="container footer-container ">
|
|||
|
<div class="row">
|
|||
|
<div class="col-xs-4 col-sm-3 col-md-3 col-lg-3">
|
|||
|
<div class="footer-title"></div>
|
|||
|
<ul class="list-unstyled">
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<div class="col-xs-4 col-sm-3 col-md-3 col-lg-3">
|
|||
|
<div class="footer-title"></div>
|
|||
|
<ul class="list-unstyled">
|
|||
|
<li><a href="https://github.com/bspeice" target="_blank">Github</a></li>
|
|||
|
<li><a href="https://www.linkedin.com/in/bradleespeice" target="_blank">LinkedIn</a></li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<div class="col-xs-4 col-sm-3 col-md-3 col-lg-3">
|
|||
|
</div>
|
|||
|
<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
|
|||
|
<p class="pull-right text-right">
|
|||
|
<small><em>Proudly powered by <a href="http://docs.getpelican.com/" target="_blank">pelican</a></em></small><br/>
|
|||
|
<small><em>Theme and code by <a href="https://github.com/molivier" target="_blank">molivier</a></em></small><br/>
|
|||
|
<small></small>
|
|||
|
</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<!-- /Footer -->
|
|||
|
</body>
|
|||
|
</html>
|