{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "The data:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "periods = [0.241, 0.615, 1.0, 1.88, 11.86, 29.50, 84.0, 165, 248]\n", "a = [0.387 , 0.723 , 1.0 , 1.523 , 5.202 , 9.539 , 19.18 , 30.06 , 39.44]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's plot this:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function(global) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n", " window._bokeh_onload_callbacks = [];\n", " window._bokeh_is_loading = undefined;\n", " }\n", "\n", "\n", " \n", " if (typeof (window._bokeh_timeout) === \"undefined\" || force === true) {\n", " window._bokeh_timeout = Date.now() + 5000;\n", " window._bokeh_failed_load = false;\n", " }\n", "\n", " var NB_LOAD_WARNING = {'data': {'text/html':\n", " \"
\\n\"+\n", " \"

\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"

\\n\"+\n", " \"\\n\"+\n", " \"\\n\"+\n", " \"from bokeh.resources import INLINE\\n\"+\n", " \"output_notebook(resources=INLINE)\\n\"+\n", " \"\\n\"+\n", " \"
\"}};\n", "\n", " function display_loaded() {\n", " if (window.Bokeh !== undefined) {\n", " document.getElementById(\"\").textContent = \"BokehJS successfully loaded.\";\n", " } else if (Date.now() < window._bokeh_timeout) {\n", " setTimeout(display_loaded, 100)\n", " }\n", " }\n", "\n", " function run_callbacks() {\n", " window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n", " delete window._bokeh_onload_callbacks\n", " console.info(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(js_urls, callback) {\n", " window._bokeh_onload_callbacks.push(callback);\n", " if (window._bokeh_is_loading > 0) {\n", " console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n", " return null;\n", " }\n", " if (js_urls == null || js_urls.length === 0) {\n", " run_callbacks();\n", " return null;\n", " }\n", " console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", " window._bokeh_is_loading = js_urls.length;\n", " for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " var s = document.createElement('script');\n", " s.src = url;\n", " s.async = false;\n", " s.onreadystatechange = s.onload = function() {\n", " window._bokeh_is_loading--;\n", " if (window._bokeh_is_loading === 0) {\n", " console.log(\"Bokeh: all BokehJS libraries loaded\");\n", " run_callbacks()\n", " }\n", " };\n", " s.onerror = function() {\n", " console.warn(\"failed to load library \" + url);\n", " };\n", " console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " }\n", " };\n", "\n", " var js_urls = [];\n", "\n", " var inline_js = [\n", " function(Bokeh) {\n", " /* BEGIN bokeh.min.js */\n", " window.Bokeh=Bokeh=function(){var t=void 0;return function e(t,r,n){function o(i){if(!r[i]){if(!t[i]){var s=new Error(\"Cannot find module '\"+i+\"'\");throw s.code=\"MODULE_NOT_FOUND\",s}var a=r[i]={exports:{}},l=function(e){var r=t[i][1][e];return o(r?r:e)};l.modules=o.modules,t[i][0].call(a.exports,l,a,a.exports,e,t,r,n)}return r[i].exports}o.modules=t;var i=o(n[0]);return i.require=o,i}({base:[function(t,e,r){\"use strict\";var n,o={}.hasOwnProperty,i=t(\"underscore\"),s=t(\"./models/index\");r.overrides={},n=i.extend({},s),r.Models=function(t){var e,o;if(e=null!=(o=r.overrides[t])?o:n[t],null==e)throw new Error(\"Model `\"+t+\"' does not exist. This could be due to a widget or a custom model not being registered before first usage.\");return e},r.Models.register=function(t,e){return r.overrides[t]=e},r.Models.unregister=function(t){return delete r.overrides[t]},r.Models.register_models=function(t,e,r){var i,s,a;if(null==e&&(e=!1),null==r&&(r=null),null!=t){a=[];for(s in t)o.call(t,s)&&(i=t[s],e||!n.hasOwnProperty(s)?a.push(n[s]=i):a.push(\"function\"==typeof r?r(s):void 0));return a}},r.Models.registered_names=function(){return Object.keys(n)},r.index={}},{\"./models/index\":\"models/index\",underscore:\"underscore\"}],client:[function(t,e,r){\"use strict\";var n,o,i,s,a=t(\"underscore\"),l=t(\"es6-promise\"),u=t(\"./core/logging\"),c=t(\"./document\");r.DEFAULT_SERVER_WEBSOCKET_URL=\"ws://localhost:5006/ws\",r.DEFAULT_SESSION_ID=\"default\",i=function(){function t(t,e,r){this.header=t,this.metadata=e,this.content=r,this.buffers=[]}return t.assemble=function(e,r,n){var o,i,s,a;try{return s=JSON.parse(e),a=JSON.parse(r),o=JSON.parse(n),new t(s,a,o)}catch(l){throw i=l,u.logger.error(\"Failure parsing json \"+i+\" \"+e+\" \"+r+\" \"+n,i),i}},t.create_header=function(t,e){var r;return r={msgid:a.uniqueId(),msgtype:t},a.extend(r,e)},t.create=function(e,r,n){var o;return null==n&&(n={}),o=t.create_header(e,r),new t(o,{},n)},t.prototype.send=function(t){var e,r,n,o;try{return n=JSON.stringify(this.header),o=JSON.stringify(this.metadata),e=JSON.stringify(this.content),t.send(n),t.send(o),t.send(e)}catch(i){throw r=i,u.logger.error(\"Error sending \",this,r),r}},t.prototype.complete=function(){return null!=this.header&&null!=this.metadata&&null!=this.content&&(!(\"num_buffers\"in this.header)||this.buffers.length===this.header.num_buffers)},t.prototype.add_buffer=function(t){return this.buffers.push(t)},t.prototype._header_field=function(t){return t in this.header?this.header[t]:null},t.prototype.msgid=function(){return this._header_field(\"msgid\")},t.prototype.msgtype=function(){return this._header_field(\"msgtype\")},t.prototype.sessid=function(){return this._header_field(\"sessid\")},t.prototype.reqid=function(){return this._header_field(\"reqid\")},t.prototype.problem=function(){return\"msgid\"in this.header?\"msgtype\"in this.header?null:\"No msgtype in header\":\"No msgid in header\"},t}(),s={\"PATCH-DOC\":function(t,e){return t._for_session(function(t){return t._handle_patch(e)})},OK:function(t,e){return u.logger.debug(\"Unhandled OK reply to \"+e.reqid())},ERROR:function(t,e){return u.logger.error(\"Unhandled ERROR reply to \"+e.reqid()+\": \"+e.content.text)}},n=function(){function t(e,n,o,i){this.url=e,this.id=n,this._on_have_session_hook=o,this._on_closed_permanently_hook=i,this._number=t._connection_count,t._connection_count=this._number+1,null==this.url&&(this.url=r.DEFAULT_SERVER_WEBSOCKET_URL),null==this.id&&(this.id=r.DEFAULT_SESSION_ID),u.logger.debug(\"Creating websocket \"+this._number+\" to '\"+this.url+\"' session '\"+this.id+\"'\"),this.socket=null,this.closed_permanently=!1,this._fragments=[],this._partial=null,this._current_handler=null,this._pending_ack=null,this._pending_replies={},this.session=null}return t._connection_count=0,t.prototype._for_session=function(t){if(null!==this.session)return t(this.session)},t.prototype.connect=function(){var t,e;if(this.closed_permanently)return l.Promise.reject(new Error(\"Cannot connect() a closed ClientConnection\"));if(null!=this.socket)return l.Promise.reject(new Error(\"Already connected\"));this._fragments=[],this._partial=null,this._pending_replies={},this._current_handler=null;try{return e=this.url+\"?bokeh-protocol-version=1.0&bokeh-session-id=\"+this.id,null!=window.MozWebSocket?this.socket=new MozWebSocket(e):this.socket=new WebSocket(e),new l.Promise(function(t){return function(e,r){return t.socket.binarytype=\"arraybuffer\",t.socket.onopen=function(){return t._on_open(e,r)},t.socket.onmessage=function(e){return t._on_message(e)},t.socket.onclose=function(e){return t._on_close(e)},t.socket.onerror=function(){return t._on_error(r)}}}(this))}catch(r){return t=r,u.logger.error(\"websocket creation failed to url: \"+this.url),u.logger.error(\" - \"+t),l.Promise.reject(t)}},t.prototype.close=function(){if(!this.closed_permanently&&(u.logger.debug(\"Permanently closing websocket connection \"+this._number),this.closed_permanently=!0,null!=this.socket&&this.socket.close(1e3,\"close method called on ClientConnection \"+this._number),this._for_session(function(t){return t._connection_closed()}),null!=this._on_closed_permanently_hook))return this._on_closed_permanently_hook(),this._on_closed_permanently_hook=null},t.prototype._schedule_reconnect=function(t){var e;return e=function(t){return function(){t.closed_permanently||u.logger.info(\"Websocket connection \"+t._number+\" disconnected, will not attempt to reconnect\")}}(this),setTimeout(e,t)},t.prototype.send=function(t){var e;try{if(null===this.socket)throw new Error(\"not connected so cannot send \"+t);return t.send(this.socket)}catch(r){return e=r,u.logger.error(\"Error sending message \",e,t)}},t.prototype.send_with_reply=function(t){var e;return e=new l.Promise(function(e){return function(r,n){return e._pending_replies[t.msgid()]=[r,n],e.send(t)}}(this)),e.then(function(t){if(\"ERROR\"===t.msgtype())throw new Error(\"Error reply \"+t.content.text);return t},function(t){throw t})},t.prototype._pull_doc_json=function(){var t,e;return t=i.create(\"PULL-DOC-REQ\",{}),e=this.send_with_reply(t),e.then(function(t){if(!(\"doc\"in t.content))throw new Error(\"No 'doc' field in PULL-DOC-REPLY\");return t.content.doc},function(t){throw t})},t.prototype._repull_session_doc=function(){return null===this.session?u.logger.debug(\"Pulling session for first time\"):u.logger.debug(\"Repulling session\"),this._pull_doc_json().then(function(t){return function(e){var r,n,s;return null!==t.session?(t.session.document.replace_with_json(e),u.logger.debug(\"Updated existing session with new pulled doc\")):t.closed_permanently?u.logger.debug(\"Got new document after connection was already closed\"):(r=c.Document.from_json(e),n=c.Document._compute_patch_since_json(e,r),n.events.length>0&&(u.logger.debug(\"Sending \"+n.events.length+\" changes from model construction back to server\"),s=i.create(\"PATCH-DOC\",{},n),t.send(s)),t.session=new o(t,r,t.id),u.logger.debug(\"Created a new session from new pulled doc\"),null!=t._on_have_session_hook?(t._on_have_session_hook(t.session),t._on_have_session_hook=null):void 0)}}(this),function(t){throw t})[\"catch\"](function(t){return null!=console.trace&&console.trace(t),u.logger.error(\"Failed to repull session \"+t)})},t.prototype._on_open=function(t,e){return u.logger.info(\"Websocket connection \"+this._number+\" is now open\"),this._pending_ack=[t,e],this._current_handler=function(t){return function(e){return t._awaiting_ack_handler(e)}}(this)},t.prototype._on_message=function(t){var e;try{return this._on_message_unchecked(t)}catch(r){return e=r,u.logger.error(\"Error handling message: \"+e+\", \"+t)}},t.prototype._on_message_unchecked=function(t){var e,r;if(null==this._current_handler&&u.logger.error(\"got a message but haven't set _current_handler\"),t.data instanceof ArrayBuffer?null==this._partial||this._partial.complete()?this._close_bad_protocol(\"Got binary from websocket but we were expecting text\"):this._partial.add_buffer(t.data):null!=this._partial?this._close_bad_protocol(\"Got text from websocket but we were expecting binary\"):(this._fragments.push(t.data),3===this._fragments.length&&(this._partial=i.assemble(this._fragments[0],this._fragments[1],this._fragments[2]),this._fragments=[],r=this._partial.problem(),null!==r&&this._close_bad_protocol(r))),null!=this._partial&&this._partial.complete())return e=this._partial,this._partial=null,this._current_handler(e)},t.prototype._on_close=function(t){var e,r;for(u.logger.info(\"Lost websocket \"+this._number+\" connection, \"+t.code+\" (\"+t.reason+\")\"),this.socket=null,null!=this._pending_ack&&(this._pending_ack[1](new Error(\"Lost websocket connection, \"+t.code+\" (\"+t.reason+\")\")),this._pending_ack=null),e=function(t){return function(){var e,r,n;r=t._pending_replies;for(n in r)return e=r[n],delete t._pending_replies[n],e;return null}}(this),r=e();null!==r;)r[1](\"Disconnected\"),r=e();if(!this.closed_permanently)return this._schedule_reconnect(2e3)},t.prototype._on_error=function(t){return u.logger.debug(\"Websocket error on socket \"+this._number),t(new Error(\"Could not open websocket\"))},t.prototype._close_bad_protocol=function(t){if(u.logger.error(\"Closing connection: \"+t),null!=this.socket)return this.socket.close(1002,t)},t.prototype._awaiting_ack_handler=function(t){return\"ACK\"!==t.msgtype()?this._close_bad_protocol(\"First message was not an ACK\"):(this._current_handler=function(t){return function(e){return t._steady_state_handler(e)}}(this),this._repull_session_doc(),null!=this._pending_ack?(this._pending_ack[0](this),this._pending_ack=null):void 0)},t.prototype._steady_state_handler=function(t){var e;return t.reqid()in this._pending_replies?(e=this._pending_replies[t.reqid()],delete this._pending_replies[t.reqid()],e[0](t)):t.msgtype()in s?s[t.msgtype()](this,t):u.logger.debug(\"Doing nothing with message \"+t.msgtype())},t}(),o=function(){function t(t,e,r){this._connection=t,this.document=e,this.id=r,this.document_listener=function(t){return function(e){return t._document_changed(e)}}(this),this.document.on_change(this.document_listener)}return t.prototype.close=function(){return this._connection.close()},t.prototype._connection_closed=function(){return this.document.remove_on_change(this.document_listener)},t.prototype.request_server_info=function(){var t,e;return t=i.create(\"SERVER-INFO-REQ\",{}),e=this._connection.send_with_reply(t),e.then(function(t){return t.content})},t.prototype.force_roundtrip=function(){return this.request_server_info().then(function(t){})},t.prototype._document_changed=function(t){var e;if(t.setter_id!==this.id&&(!(t instanceof c.ModelChangedEvent)||t.attr in t.model.serializable_attributes()))return e=i.create(\"PATCH-DOC\",{},this.document.create_json_patch([t])),this._connection.send(e)},t.prototype._handle_patch=function(t){return this.document.apply_json_patch(t.content,this.id)},t}(),r.pull_session=function(t,e){var r,o,i;return i=null,r=null,o=new l.Promise(function(o,i){return r=new n(t,e,function(t){var e;try{return o(t)}catch(r){throw e=r,u.logger.error(\"Promise handler threw an error, closing session \"+error),t.close(),e}},function(){return i(new Error(\"Connection was closed before we successfully pulled a session\"))}),r.connect().then(function(t){},function(t){throw u.logger.error(\"Failed to connect to Bokeh server \"+t),t})}),o.close=function(){return r.close()},o}},{\"./core/logging\":\"core/logging\",\"./document\":\"document\",\"es6-promise\":\"es6-promise\",underscore:\"underscore\"}],\"core/backbone\":[function(t,e,r){\"use strict\";\n", " // (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n", " // Backbone may be freely distributed under the MIT license.\n", " var n=t(\"underscore\"),o=t(\"jquery\"),i=t(\"./events\");r.Model=function(t,e){var r=t||{};e||(e={}),this.attributes={},this.setv(r,e),this.changed={},this.initialize.apply(this,arguments)},n.extend(r.Model.prototype,i.Events,{changed:null,initialize:function(){},getv:function(t){return this.attributes[t]},setv:function(t,e,r){if(null==t)return this;var o;\"object\"==typeof t?(o=t,r=e):(o={})[t]=e,r||(r={});var i=r.silent,s=[],a=this._changing;this._changing=!0,a||(this._previousAttributes=n.clone(this.attributes),this.changed={});var l=this.attributes,u=this.changed,c=this._previousAttributes;for(var p in o)e=o[p],n.isEqual(l[p],e)||s.push(p),n.isEqual(c[p],e)?delete u[p]:u[p]=e,l[p]=e;if(!i){s.length&&(this._pending=!0);for(var h=0;ha;o=0<=a?++s:--s)u=r[o],p=n[o],ci&&(r=[i,o],o=r[0],i=r[1]),s>a&&(n=[a,s],s=n[0],a=n[1]),{minX:o,minY:s,maxX:i,maxY:a}},i=function(t){return t*t},r.dist_2_pts=function(t,e,r,n){return i(t-r)+i(e-n)},n=function(t,e,n){var o,i;return o=r.dist_2_pts(e.x,e.y,n.x,n.y),0===o?r.dist_2_pts(t.x,t.y,e.x,e.y):(i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/o,i<0?r.dist_2_pts(t.x,t.y,e.x,e.y):i>1?r.dist_2_pts(t.x,t.y,n.x,n.y):r.dist_2_pts(t.x,t.y,e.x+i*(n.x-e.x),e.y+i*(n.y-e.y)))},r.dist_to_segment=function(t,e,r){return Math.sqrt(n(t,e,r))},r.check_2_segments_intersect=function(t,e,r,n,o,i,s,a){var l,u,c,p,h,_,d;return c=(a-i)*(r-t)-(s-o)*(n-e),0===c?{hit:!1,x:null,y:null}:(l=e-i,u=t-o,p=(s-o)*l-(a-i)*u,h=(r-t)*l-(n-e)*u,l=p/c,u=h/c,_=t+l*(r-t),d=e+l*(n-e),{hit:l>0&&l<1&&u>0&&u<1,x:_,y:d})}},{}],\"core/layout/layout_canvas\":[function(t,e,r){\"use strict\";var n=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,i=t(\"./solver\"),s=t(\"../../model\"),a=t(\"../properties\");r.LayoutCanvas=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type=\"LayoutCanvas\",e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._top=new i.Variable(\"top \"+this.id),this._left=new i.Variable(\"left \"+this.id),this._width=new i.Variable(\"width \"+this.id),this._height=new i.Variable(\"height \"+this.id),this._right=new i.Variable(\"right \"+this.id),this._bottom=new i.Variable(\"bottom \"+this.id)},e.getters({height:function(){return this._height.value()},width:function(){return this._width.value()},right:function(){return this._right.value()},left:function(){return this._left.value()},top:function(){return this._top.value()},bottom:function(){return this._bottom.value()}}),e.internal({layout_location:[a.Any]}),e.prototype.get_edit_variables=function(){var t;return t=[],t.push({edit_variable:this._top,strength:i.Strength.strong}),t.push({edit_variable:this._left,strength:i.Strength.strong}),t.push({edit_variable:this._width,strength:i.Strength.strong}),t.push({edit_variable:this._height,strength:i.Strength.strong}),t},e.prototype.get_constraints=function(){return[]},e}(s.Model)},{\"../../model\":\"model\",\"../properties\":\"core/properties\",\"./solver\":\"core/layout/solver\"}],\"core/layout/side_panel\":[function(t,e,r){\"use strict\";var n,o,i,s,a,l,u,c,p,h,_,d,f,m,g=function(t,e){function r(){this.constructor=t}for(var n in e)y.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},y={}.hasOwnProperty,v=t(\"underscore\"),b=t(\"./solver\"),x=t(\"./layout_canvas\"),w=t(\"../../core/properties\"),k=t(\"../../core/logging\");m=Math.PI/2,n=\"alphabetic\",c=\"top\",o=\"bottom\",l=\"middle\",s=\"hanging\",a=\"left\",u=\"right\",i=\"center\",d={above:{parallel:0,normal:-m,horizontal:0,vertical:-m},below:{parallel:0,normal:m,horizontal:0,vertical:m},left:{parallel:-m,normal:0,horizontal:0,vertical:-m},right:{parallel:m,normal:0,horizontal:0,vertical:m}},f={above:{justified:c,parallel:n,normal:l,horizontal:n,vertical:l},below:{justified:o,parallel:s,normal:l,horizontal:s,vertical:l},left:{justified:c,parallel:n,normal:l,horizontal:l,vertical:n},right:{justified:c,parallel:n,normal:l,horizontal:l,vertical:n}},p={above:{justified:i,parallel:i,normal:a,horizontal:i,vertical:a},below:{justified:i,parallel:i,normal:a,horizontal:i,vertical:u},left:{justified:i,parallel:i,normal:u,horizontal:u,vertical:i},right:{justified:i,parallel:i,normal:a,horizontal:a,vertical:i}},h={above:u,below:a,left:u,right:a},_={above:a,below:u,left:u,right:a},r.update_constraints=function(t){var e,r,n,o;if(o=t,(null==o.model.props.visible||o.model.visible!==!1)&&(n=o._get_size(),null==o._last_size&&(o._last_size=-1),n!==o._last_size))return e=o.model.document.solver(),o._last_size=n,null!=o._size_constraint&&e.remove_constraint(o._size_constraint),o._size_constraint=b.GE(o.model.panel._size,-n),e.add_constraint(o._size_constraint),null==o._full_set&&(o._full_set=!1),o._full_set?void 0:(r=o.model.panel.side,\"above\"!==r&&\"below\"!==r||e.add_constraint(b.EQ(o.model.panel._width,[-1,o.plot_model.canvas._width])),\"left\"!==r&&\"right\"!==r||e.add_constraint(b.EQ(o.model.panel._height,[-1,o.plot_model.canvas._height])),o._full_set=!0)},r.SidePanel=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return g(e,t),e.internal({side:[w.String],plot:[w.Instance]}),e.prototype.initialize=function(t,r){switch(e.__super__.initialize.call(this,t,r),this.side){case\"above\":return this._dim=0,this._normals=[0,-1],this._size=this._height,this._anchor=this._bottom;case\"below\":return this._dim=0,this._normals=[0,1],this._size=this._height,this._anchor=this._top;case\"left\":return this._dim=1,this._normals=[-1,0],this._size=this._width,this._anchor=this._right;case\"right\":return this._dim=1,this._normals=[1,0],this._size=this._width,this._anchor=this._left;default:return k.logger.error(\"unrecognized side: '\"+this.side+\"'\")}},e.prototype.get_constraints=function(){var t;return t=[],t.push(b.GE(this._top)),t.push(b.GE(this._bottom)),t.push(b.GE(this._left)),t.push(b.GE(this._right)),t.push(b.GE(this._width)),t.push(b.GE(this._height)),t.push(b.EQ(this._left,this._width,[-1,this._right])),t.push(b.EQ(this._bottom,this._height,[-1,this._top])),t},e.prototype.apply_label_text_heuristics=function(t,e){var r,n,o;return o=this.side,v.isString(e)?(n=f[o][e],r=p[o][e]):0===e?(n=f[o][e],r=p[o][e]):e<0?(n=\"middle\",r=h[o]):e>0&&(n=\"middle\",r=_[o]),t.textBaseline=n,t.textAlign=r,t},e.prototype.get_label_angle_heuristic=function(t){var e;return e=this.side,d[e][t]},e}(x.LayoutCanvas)},{\"../../core/logging\":\"core/logging\",\"../../core/properties\":\"core/properties\",\"./layout_canvas\":\"core/layout/layout_canvas\",\"./solver\":\"core/layout/solver\",underscore:\"underscore\"}],\"core/layout/solver\":[function(t,e,r){\"use strict\";var n,o,i=t(\"underscore\"),s=t(\"kiwi\");r.Variable=s.Variable,r.Expression=s.Expression,r.Constraint=s.Constraint,r.Operator=s.Operator,r.Strength=s.Strength;var a=t(\"../events\");n=function(t){return function(e){return function(){var e;return e=Object.create(s.Expression.prototype),s.Expression.apply(e,arguments),new s.Constraint(e,t)}}(this)},o=function(t){return function(){var e,r,n,o;for(r=[null],n=0,o=arguments.length;n0)return n=o[e],null==n&&(n=o[e]=new t(e,r)),n;throw new TypeError(\"Logger.get() expects a string name and an optional log-level\")},Object.defineProperty(t.prototype,\"level\",{get:function(){return this.get_level()}}),t.prototype.get_level=function(){return this._log_level},t.prototype.set_level=function(e){var r,o,a,u,c;if(e instanceof n)this._log_level=e;else{if(!l.isString(e)||null==t.log_levels[e])throw new Error(\"Logger.set_level() expects a log-level object or a string name of a log-level\");this._log_level=t.log_levels[e]}o=\"[\"+this._name+\"]\",u=t.log_levels,c=[];for(r in u){if(e=u[r],e===t.OFF)break;a=e.name,e.levele;r=0<=e?++t:--t)o.push(i);return o}();return null!=this.spec.transform&&(o=this.spec.transform.v_compute(o)),o},t.prototype._init=function(t){var e,r,n,o;if(null==t&&(t=!0),o=this.obj,null==o)throw new Error(\"missing property object\");if(null==o.properties)throw new Error(\"property object must be a HasProps\");if(e=this.attr,null==e)throw new Error(\"missing property attr\");if(r=o.getv(e),s.isUndefined(r)&&(n=this.default_value,r=function(){switch(!1){case!s.isUndefined(n):return null;case!s.isArray(n):return s.clone(n);case!s.isFunction(n):return n(o);default:return n}}(),o.setv(e,r,{silent:!0,defaults:!0})),s.isArray(r)?this.spec={value:r}:s.isObject(r)&&1===s.size(s.pick.apply(null,[r].concat(this.specifiers)))?this.spec=r:this.spec={value:r},null!=this.spec.field&&!s.isString(this.spec.field))throw new Error(\"field value for property '\"+e+\"' is not a string\");if(null!=this.spec.value&&this.validate(this.spec.value),this.init(),t)return this.trigger(\"change\")},t}(),r.simple_prop=function(t,e){var o;return o=function(r){function o(){return o.__super__.constructor.apply(this,arguments)}return n(o,r),o.prototype.toString=function(){return t+\"(obj: \"+this.obj.id+\", spec: \"+JSON.stringify(this.spec)+\")\"},o.prototype.validate=function(r){if(!e(r))throw new Error(t+\" property '\"+this.attr+\"' given invalid value: \"+r)},o}(r.Property)},r.Any=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.simple_prop(\"Any\",function(t){return!0})),r.Array=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.simple_prop(\"Array\",function(t){return s.isArray(t)||t instanceof Float64Array})),r.Bool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.simple_prop(\"Bool\",s.isBoolean)),r.Boolean=r.Bool,r.Color=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.simple_prop(\"Color\",function(t){return null!=u[t.toLowerCase()]||\"#\"===t.substring(0,1)||c.valid_rgb(t)})),r.Instance=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.simple_prop(\"Instance\",function(t){return null!=t.properties})),r.Number=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.simple_prop(\"Number\",function(t){return s.isNumber(t)||s.isBoolean(t)})),r.Int=r.Number,r.Percent=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.simple_prop(\"Number\",function(t){return(s.isNumber(t)||s.isBoolean(t))&&0<=t&&t<=1})),r.String=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.simple_prop(\"String\",s.isString)),r.Font=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.String),r.enum_prop=function(t,e){var o;return o=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return n(r,e),r.prototype.toString=function(){return t+\"(obj: \"+this.obj.id+\", spec: \"+JSON.stringify(this.spec)+\")\"},r}(r.simple_prop(t,function(t){return i.call(e,t)>=0}))},r.Anchor=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"Anchor\",l.LegendLocation)),r.AngleUnits=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"AngleUnits\",l.AngleUnits)),r.Direction=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.transform=function(t){var e,r,n,o;for(o=new Uint8Array(t.length),e=r=0,n=t.length;0<=n?rn;e=0<=n?++r:--r)switch(t[e]){case\"clock\":o[e]=!1;break;case\"anticlock\":o[e]=!0}return o},e}(r.enum_prop(\"Direction\",l.Direction)),r.Dimension=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"Dimension\",l.Dimension)),r.Dimensions=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"Dimensions\",l.Dimensions)),r.FontStyle=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"FontStyle\",l.FontStyle)),r.LineCap=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"LineCap\",l.LineCap)),r.LineJoin=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"LineJoin\",l.LineJoin)),r.LegendLocation=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"LegendLocation\",l.LegendLocation)),r.Location=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"Location\",l.Location)),r.Orientation=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"Orientation\",l.Orientation)),r.TextAlign=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"TextAlign\",l.TextAlign)),r.TextBaseline=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"TextBaseline\",l.TextBaseline)),r.RenderLevel=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"RenderLevel\",l.RenderLevel)),r.RenderMode=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"RenderMode\",l.RenderMode)),r.SizingMode=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"SizingMode\",l.SizingMode)),r.SpatialUnits=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"SpatialUnits\",l.SpatialUnits)),r.Distribution=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"Distribution\",l.DistributionTypes)),r.TransformStepMode=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(r.enum_prop(\"TransformStepMode\",l.TransformStepModes)),r.units_prop=function(t,e,o){var s;return s=function(r){function s(){return s.__super__.constructor.apply(this,arguments)}return n(s,r),s.prototype.toString=function(){return t+\"(obj: \"+this.obj.id+\", spec: \"+JSON.stringify(this.spec)+\")\"},s.prototype.init=function(){var r;if(null==this.spec.units&&(this.spec.units=o),this.units=this.spec.units,r=this.spec.units,i.call(e,r)<0)throw new Error(t+\" units must be one of \"+e+\", given invalid value: \"+r)},s}(r.Number)},r.Angle=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.transform=function(t){var r;return\"deg\"===this.spec.units&&(t=function(){var e,n,o;for(o=[],e=0,n=t.length;e0)&&\"pinch\"===e?(l.logger.debug(\"Registering scroll on touch screen\"),t.listenTo(this,\"scroll:\"+r,t._scroll)):void 0)},t.prototype._trigger=function(t,e){var r,n,o;if(n=t.split(\":\")[0],(\"ontouchstart\"in window||navigator.maxTouchPoints>0)&&\"scroll\"===t&&(n=\"pinch\"),o=this.toolbar.gestures,r=o[n].active,null!=r)return this._trigger_event(t,r,e)},t.prototype._trigger_event=function(t,e,r){if(e.active===!0)return\"scroll\"===t&&(r.preventDefault(),r.stopPropagation()),this.trigger(t+\":\"+e.id,r)},t.prototype._bokify_hammer=function(t){var e,r,n,i,s,a,l;return\"mouse\"===t.pointerType?(a=t.srcEvent.pageX,l=t.srcEvent.pageY):(a=t.pointers[0].pageX,l=t.pointers[0].pageY),r=o(t.target).offset(),e=null!=(n=r.left)?n:0,s=null!=(i=r.top)?i:0,t.bokeh={sx:a-e,sy:l-s}},t.prototype._bokify_jq=function(t){var e,r,n,i,s;return r=o(t.currentTarget).offset(),e=null!=(n=r.left)?n:0,s=null!=(i=r.top)?i:0,t.bokeh={sx:t.pageX-e,sy:t.pageY-s}},t.prototype._tap=function(t){return this._bokify_hammer(t),this._trigger(\"tap\",t)},t.prototype._doubletap=function(t){return this._bokify_hammer(t),this.trigger(\"doubletap\",t)},t.prototype._press=function(t){return this._bokify_hammer(t),this._trigger(\"press\",t)},t.prototype._pan_start=function(t){return this._bokify_hammer(t),t.bokeh.sx-=t.deltaX,t.bokeh.sy-=t.deltaY,this._trigger(\"pan:start\",t)},t.prototype._pan=function(t){return this._bokify_hammer(t),this._trigger(\"pan\",t)},t.prototype._pan_end=function(t){return this._bokify_hammer(t),this._trigger(\"pan:end\",t)},t.prototype._pinch_start=function(t){return this._bokify_hammer(t),this._trigger(\"pinch:start\",t)},t.prototype._pinch=function(t){return this._bokify_hammer(t),this._trigger(\"pinch\",t)},t.prototype._pinch_end=function(t){return this._bokify_hammer(t),this._trigger(\"pinch:end\",t)},t.prototype._rotate_start=function(t){return this._bokify_hammer(t),this._trigger(\"rotate:start\",t)},t.prototype._rotate=function(t){return this._bokify_hammer(t),this._trigger(\"rotate\",t)},t.prototype._rotate_end=function(t){return this._bokify_hammer(t),this._trigger(\"rotate:end\",t)},t.prototype._mouse_enter=function(t){return this._bokify_jq(t),this.trigger(\"move:enter\",t)},t.prototype._mouse_move=function(t){return this._bokify_jq(t),this.trigger(\"move\",t)},t.prototype._mouse_exit=function(t){return this._bokify_jq(t),this.trigger(\"move:exit\",t)},t.prototype._mouse_wheel=function(t,e){return this._bokify_jq(t),t.bokeh.delta=e,this._trigger(\"scroll\",t)},t.prototype._key_down=function(t){return this.trigger(\"keydown\",t)},t.prototype._key_up=function(t){return this.trigger(\"keyup\",t)},t}()},{\"./events\":\"core/events\",\"./logging\":\"core/logging\",hammerjs:\"hammerjs\",jquery:\"jquery\",\"jquery-mousewheel\":\"jquery-mousewheel\",underscore:\"underscore\"}],\"core/util/bbox\":[function(t,e,r){\"use strict\";r.empty=function(){return{minX:Infinity,minY:Infinity,maxX:-Infinity,maxY:-Infinity}},r.positive_x=function(){return{minX:Number.MIN_VALUE,minY:-Infinity,maxX:Infinity,maxY:Infinity}},r.positive_y=function(){return{minX:-Infinity,minY:Number.MIN_VALUE,maxX:Infinity,maxY:Infinity}},r.union=function(t,e){var r;return r={},r.minX=Math.min(t.minX,e.minX),r.maxX=Math.max(t.maxX,e.maxX),r.minY=Math.min(t.minY,e.minY),r.maxY=Math.max(t.maxY,e.maxY),r}},{}],\"core/util/canvas\":[function(t,e,r){\"use strict\";r.fixup_line_dash=function(t){if(t.setLineDash||(t.setLineDash=function(e){return t.mozDash=e,t.webkitLineDash=e}),!t.getLineDash)return t.getLineDash=function(){return t.mozDash}},r.fixup_line_dash_offset=function(t){return t.setLineDashOffset=function(e){return t.lineDashOffset=e,t.mozDashOffset=e,t.webkitLineDashOffset=e},t.getLineDashOffset=function(){return t.mozDashOffset}},r.fixup_image_smoothing=function(t){return t.setImageSmoothingEnabled=function(e){return t.imageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.oImageSmoothingEnabled=e,t.webkitImageSmoothingEnabled=e},t.getImageSmoothingEnabled=function(){var e;return null==(e=t.imageSmoothingEnabled)||e}},r.fixup_measure_text=function(t){if(t.measureText&&null==t.html5MeasureText)return t.html5MeasureText=t.measureText,t.measureText=function(e){var r;return r=t.html5MeasureText(e),r.ascent=1.6*t.html5MeasureText(\"m\").width,r}},r.get_scale_ratio=function(t,e){var r,n;return e?(n=window.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1,n/r):1},r.fixup_ellipse=function(t){var e;if(e=function(e,r,n,o,i,s,a,l){var u,c,p;null==l&&(l=!1),u=.551784,t.translate(e,r),t.rotate(i),c=n,p=o,l&&(c=-n,p=-o),t.moveTo(-c,0),t.bezierCurveTo(-c,p*u,-c*u,p,0,p),t.bezierCurveTo(c*u,p,c,p*u,c,0),t.bezierCurveTo(c,-p*u,c*u,-p,0,-p),t.bezierCurveTo(-c*u,-p,-c,-p*u,-c,0),t.rotate(-i),t.translate(-e,-r)},!t.ellipse)return t.ellipse=e}},{}],\"core/util/color\":[function(t,e,r){\"use strict\";var n,o=[].indexOf||function(t){for(var e=0,r=this.length;e=0)throw new Error(\"color expects rgb to have value between 0 and 255\");return!0}},{\"./svg_colors\":\"core/util/svg_colors\"}],\"core/util/data_structures\":[function(t,e,r){\"use strict\";var n=t(\"underscore\");r.MultiDict=function(){function t(){this._dict={}}return t.prototype._existing=function(t){return t in this._dict?this._dict[t]:null},t.prototype.add_value=function(t,e){var r;if(null===e)throw new Error(\"Can't put null in this dict\");if(n.isArray(e))throw new Error(\"Can't put arrays in this dict\");return r=this._existing(t),null===r?this._dict[t]=e:n.isArray(r)?r.push(e):this._dict[t]=[r,e]},t.prototype.remove_value=function(t,e){var r,o;return r=this._existing(t),n.isArray(r)?(o=n.without(r,e),o.length>0?this._dict[t]=o:delete this._dict[t]):n.isEqual(r,e)?delete this._dict[t]:void 0},t.prototype.get_one=function(t,e){var r;if(r=this._existing(t),n.isArray(r)){if(1===r.length)return r[0];throw new Error(e)}return r},t}(),r.Set=function(){function t(e){if(e){if(e.constructor===t)return new t(e.values);e.constructor===Array?this.values=t.compact(e):this.values=[e]}else this.values=[]}return t.compact=function(t){var e,r,n,o;for(o=[],r=0,n=t.length;rr&&(r=n);return r},r.angle_norm=function(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t},r.angle_dist=function(t,e){return Math.abs(r.angle_norm(t-e))},r.angle_between=function(t,e,n,o){var i;return t=r.angle_norm(t),i=r.angle_dist(e,n),\"anticlock\"===o?r.angle_dist(e,t)<=i&&r.angle_dist(t,n)<=i:!(r.angle_dist(e,t)<=i&&r.angle_dist(t,n)<=i)},r.random=function(){return Math.random()},r.atan2=function(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])},r.rnorm=function(t,e){var n,o,i;for(n=null,o=null;;)if(n=r.random(),o=r.random(),o=(2*o-1)*Math.sqrt(2*(1/Math.E)),-4*n*n*Math.log(n)>=o*o)break;return i=o/n,i=t+e*i},r.clamp=function(t,e,r){return t>r?r:tu;r=0<=u?++o:--o)c=n.proj4(n.mercator,[t[r],e[r]]),i=c[0],a=c[1],s[r]=i,l[r]=a;return[s,l]},r.project_xsys=function(t,e){var n,o,i,s,a,l,u,c;for(s=[],l=[],n=o=0,u=t.length;0<=u?ou;n=0<=u?++o:--o)c=r.project_xy(t[n],e[n]),i=c[0],a=c[1],s[n]=i,l[n]=a;return[s,l]}},{\"../../core/util/proj4\":\"core/util/proj4\"}],\"core/util/refs\":[function(t,e,r){\"use strict\";var n=t(\"underscore\"),o=t(\"../has_props\");r.create_ref=function(t){var e;if(!(t instanceof o.HasProps))throw new Error(\"can only create refs for HasProps subclasses\");return e={type:t.type,id:t.id},null!=t._subtype&&(e.subtype=t._subtype),e},r.is_ref=function(t){var e;if(n.isObject(t)){if(e=n.keys(t).sort(),2===e.length)return\"id\"===e[0]&&\"type\"===e[1];if(3===e.length)return\"id\"===e[0]&&\"subtype\"===e[1]&&\"type\"===e[2]}return!1},r.convert_to_ref=function(t){return n.isArray(t)?t.map(r.convert_to_ref):t instanceof o.HasProps?t.ref():void 0}},{\"../has_props\":\"core/has_props\",underscore:\"underscore\"}],\"core/util/selection\":[function(t,e,r){\"use strict\";r.get_indices=function(t){var e;return e=t.selected,e[\"0d\"].glyph?e[\"0d\"].indices:e[\"1d\"].indices.length>0?e[\"1d\"].indices:e[\"2d\"].indices.length>0?e[\"2d\"].indices:[]}},{}],\"core/util/serialization\":[function(t,e,r){\"use strict\";var n,o,i,s,a,l,u=t(\"underscore\");n={float32:Float32Array,float64:Float64Array,uint8:Uint8Array,int8:Int8Array,uint16:Uint16Array,int16:Int16Array,uint32:Uint32Array,int32:Int32Array},o={};for(a in n)l=n[a],o[l.name]=a;i=function(t){var e,r,n;return n=new Uint8Array(t),r=function(){var t,r,o;for(o=[],t=0,r=n.length;ts;n=0<=s?++o:--o)r[n]=e.charCodeAt(n);return r.buffer},r.decode_base64=function(t){var e,r,o,i;return r=s(t.__ndarray__),o=t.dtype,o in n&&(e=new n[o](r)),i=t.shape,[e,i]},r.encode_base64=function(t,e){var r,n,s;return r=i(t.buffer),s=o[t.constructor.name],n={__ndarray__:r,shape:e,dtype:s}},r.decode_column_data=function(t){var e,n,o,i,s,c,p,h,_,d;c={},o={};for(a in t)if(l=t[a],u.isArray(l)){for(n=[],d=[],i=0,s=l.length;i0?(c[a]=n,o[a]=d):c[a]=l}else u.isObject(l)&&\"__ndarray__\"in l?(h=r.decode_base64(l),e=h[0],_=h[1],c[a]=e,o[a]=_):(c[a]=l,o[a]=[]);return[c,o]},r.encode_column_data=function(t,e){var n,o,i,s,c,p,h;s={};for(a in t){if(l=t[a],(null!=l?l.buffer:void 0)instanceof ArrayBuffer)l=r.encode_base64(l,null!=e?e[a]:void 0);else if(u.isArray(l)){for(i=[],n=o=0,c=l.length;0<=c?oc;n=0<=c?++o:--o)(null!=(p=l[n])?p.buffer:void 0)instanceof ArrayBuffer?i.push(r.encode_base64(l[n],null!=e&&null!=(h=e[a])?h[n]:void 0)):i.push(l[n]);l=i}s[a]=l}return s}},{underscore:\"underscore\"}],\"core/util/svg_colors\":[function(t,e,r){\"use strict\";r.indianred=\"#CD5C5C\",r.lightcoral=\"#F08080\",r.salmon=\"#FA8072\",r.darksalmon=\"#E9967A\",r.lightsalmon=\"#FFA07A\",r.crimson=\"#DC143C\",r.red=\"#FF0000\",r.firebrick=\"#B22222\",r.darkred=\"#8B0000\",r.pink=\"#FFC0CB\",r.lightpink=\"#FFB6C1\",r.hotpink=\"#FF69B4\",r.deeppink=\"#FF1493\",r.mediumvioletred=\"#C71585\",r.palevioletred=\"#DB7093\",r.coral=\"#FF7F50\",r.tomato=\"#FF6347\",r.orangered=\"#FF4500\",r.darkorange=\"#FF8C00\",r.orange=\"#FFA500\",r.gold=\"#FFD700\",r.yellow=\"#FFFF00\",r.lightyellow=\"#FFFFE0\",r.lemonchiffon=\"#FFFACD\",r.lightgoldenrodyellow=\"#FAFAD2\",r.papayawhip=\"#FFEFD5\",r.moccasin=\"#FFE4B5\",r.peachpuff=\"#FFDAB9\",r.palegoldenrod=\"#EEE8AA\",r.khaki=\"#F0E68C\",r.darkkhaki=\"#BDB76B\",r.lavender=\"#E6E6FA\",r.thistle=\"#D8BFD8\",r.plum=\"#DDA0DD\",r.violet=\"#EE82EE\",r.orchid=\"#DA70D6\",r.fuchsia=\"#FF00FF\",r.magenta=\"#FF00FF\",r.mediumorchid=\"#BA55D3\",r.mediumpurple=\"#9370DB\",r.blueviolet=\"#8A2BE2\",r.darkviolet=\"#9400D3\",r.darkorchid=\"#9932CC\",r.darkmagenta=\"#8B008B\",r.purple=\"#800080\",r.indigo=\"#4B0082\",r.slateblue=\"#6A5ACD\",r.darkslateblue=\"#483D8B\",r.mediumslateblue=\"#7B68EE\",r.greenyellow=\"#ADFF2F\",r.chartreuse=\"#7FFF00\",r.lawngreen=\"#7CFC00\",r.lime=\"#00FF00\",r.limegreen=\"#32CD32\",r.palegreen=\"#98FB98\",r.lightgreen=\"#90EE90\",r.mediumspringgreen=\"#00FA9A\",r.springgreen=\"#00FF7F\",r.mediumseagreen=\"#3CB371\",r.seagreen=\"#2E8B57\",r.forestgreen=\"#228B22\",r.green=\"#008000\",r.darkgreen=\"#006400\",r.yellowgreen=\"#9ACD32\",r.olivedrab=\"#6B8E23\",r.olive=\"#808000\",r.darkolivegreen=\"#556B2F\",r.mediumaquamarine=\"#66CDAA\",r.darkseagreen=\"#8FBC8F\",r.lightseagreen=\"#20B2AA\",r.darkcyan=\"#008B8B\",r.teal=\"#008080\",r.aqua=\"#00FFFF\",r.cyan=\"#00FFFF\",r.lightcyan=\"#E0FFFF\",r.paleturquoise=\"#AFEEEE\",r.aquamarine=\"#7FFFD4\",r.turquoise=\"#40E0D0\",r.mediumturquoise=\"#48D1CC\",r.darkturquoise=\"#00CED1\",r.cadetblue=\"#5F9EA0\",r.steelblue=\"#4682B4\",r.lightsteelblue=\"#B0C4DE\",r.powderblue=\"#B0E0E6\",r.lightblue=\"#ADD8E6\",r.skyblue=\"#87CEEB\",r.lightskyblue=\"#87CEFA\",r.deepskyblue=\"#00BFFF\",r.dodgerblue=\"#1E90FF\",r.cornflowerblue=\"#6495ED\",r.royalblue=\"#4169E1\",r.blue=\"#0000FF\",r.mediumblue=\"#0000CD\",r.darkblue=\"#00008B\",r.navy=\"#000080\",r.midnightblue=\"#191970\",r.cornsilk=\"#FFF8DC\",r.blanchedalmond=\"#FFEBCD\",r.bisque=\"#FFE4C4\",r.navajowhite=\"#FFDEAD\",r.wheat=\"#F5DEB3\",r.burlywood=\"#DEB887\",r.tan=\"#D2B48C\",r.rosybrown=\"#BC8F8F\",r.sandybrown=\"#F4A460\",r.goldenrod=\"#DAA520\",r.darkgoldenrod=\"#B8860B\",r.peru=\"#CD853F\",r.chocolate=\"#D2691E\",r.saddlebrown=\"#8B4513\",r.sienna=\"#A0522D\",r.brown=\"#A52A2A\",r.maroon=\"#800000\",r.white=\"#FFFFFF\",r.snow=\"#FFFAFA\",r.honeydew=\"#F0FFF0\",r.mintcream=\"#F5FFFA\",r.azure=\"#F0FFFF\",r.aliceblue=\"#F0F8FF\",r.ghostwhite=\"#F8F8FF\",r.whitesmoke=\"#F5F5F5\",r.seashell=\"#FFF5EE\",r.beige=\"#F5F5DC\",r.oldlace=\"#FDF5E6\",r.floralwhite=\"#FFFAF0\",r.ivory=\"#FFFFF0\",r.antiquewhite=\"#FAEBD7\",r.linen=\"#FAF0E6\",r.lavenderblush=\"#FFF0F5\",r.mistyrose=\"#FFE4E1\",r.gainsboro=\"#DCDCDC\",r.lightgray=\"#D3D3D3\",r.lightgrey=\"#D3D3D3\",r.silver=\"#C0C0C0\",r.darkgray=\"#A9A9A9\",r.darkgrey=\"#A9A9A9\",r.gray=\"#808080\",r.grey=\"#808080\",r.dimgray=\"#696969\",r.dimgrey=\"#696969\",r.lightslategray=\"#778899\",r.lightslategrey=\"#778899\",r.slategray=\"#708090\",r.slategrey=\"#708090\",r.darkslategray=\"#2F4F4F\",r.darkslategrey=\"#2F4F4F\",r.black=\"#000000\"},{}],\"core/util/templating\":[function(t,e,r){\"use strict\";var n,o=t(\"underscore\"),i=t(\"sprintf\"),s=t(\"numbro\");n=function(t){var e;return o.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\"}}(),i.sprintf(e,t)):\"\"+t},r.replace_placeholders=function(t,e,r,i){return null==i&&(i={}),t=t.replace(/(^|[^\\$])\\$(\\w+)/g,function(t){return function(t,e,r){return e+\"@$\"+r}}(this)),t=t.replace(/(^|[^@])@(?:(\\$?\\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t){return function(t,a,l,u,c){var p,h,_;if(l=null!=u?u:l,_=\"$\"===l[0]?i[l.substring(1)]:null!=(p=e.get_column(l))?p[r]:void 0,h=null,null==_)h=\"???\";else{if(\"safe\"===c)return\"#{prefix}#{value}\";h=null!=c?s.format(_,c):n(_)}return h=\"\"+a+o.escape(h)}}(this))}},{numbro:\"numbro\",sprintf:\"sprintf\",underscore:\"underscore\"}],\"core/util/text\":[function(t,e,r){\"use strict\";var n,o=t(\"jquery\");n={},r.get_text_height=function(t){var e,r,i,s,a;if(null!=n[t])return n[t];a=o(\"Hg\").css({font:t}),e=o('
'),i=o(\"
\"),i.append(a,e),r=o(\"body\"),r.append(i);try{s={},e.css({verticalAlign:\"baseline\"}),s.ascent=e.offset().top-a.offset().top,e.css({verticalAlign:\"bottom\"}),s.height=e.offset().top-a.offset().top,s.descent=s.height-s.ascent}finally{i.remove()}return n[t]=s,s}},{jquery:\"jquery\"}],\"core/util/throttle\":[function(t,e,r){\"use strict\";var n,o;n=function(t){return t()},o=(\"undefined\"!=typeof window&&null!==window?window.requestAnimationFrame:void 0)||(\"undefined\"!=typeof window&&null!==window?window.mozRequestAnimationFrame:void 0)||(\"undefined\"!=typeof window&&null!==window?window.webkitRequestAnimationFrame:void 0)||(\"undefined\"!=typeof window&&null!==window?window.msRequestAnimationFrame:void 0)||n,r.throttle=function(t,e){var r,n,i,s,a,l,u,c;return l=[null,null,null,null],n=l[0],r=l[1],c=l[2],u=l[3],a=0,s=!1,i=function(){return a=new Date,c=null,s=!1,u=t.apply(n,r)},function(){var t,l;return t=new Date,l=e-(t-a),n=this,r=arguments,l<=0&&!s?(clearTimeout(c),s=!0,o(i)):c||s||(c=setTimeout(function(){return o(i)},l)),u}}},{}],\"core/util/underscore\":[function(t,e,r){\"use strict\";var n=t(\"underscore\");n.uniqueId=function(t){var e,r,n,o,i;for(o=[],e=\"0123456789ABCDEF\",r=n=0;n<=31;r=++n)o[r]=e.substr(Math.floor(16*Math.random()),1);return o[12]=\"4\",o[16]=e.substr(3&o[16]|8,1),i=o.join(\"\"),t?t+\"-\"+i:i},n.setdefault=function(t,e,r){return n.has(t,e)?t[e]:(t[e]=r,r)}},{underscore:\"underscore\"}],\"core/util/zoom\":[function(t,e,r){\"use strict\";var n=t(\"./math\");r.scale_highlow=function(t,e,r){var n,o,i,s,a,l;return null==r&&(r=null),i=[t.start,t.end],o=i[0],n=i[1],s=null!=r?r:(n+o)/2,a=o-(o-s)*e,l=n-(n-s)*e,[a,l]},r.get_info=function(t,e){var r,n,o,i,s,a,l,u;l=e[0],u=e[1],n={};for(i in t)o=t[i],s=o.v_map_from_target([l,u],!0),a=s[0],r=s[1],n[i]={start:a,end:r};return n},r.scale_range=function(t,e,o,i,s){var a,l,u,c,p,h,_,d,f,m;return null==o&&(o=!0),null==i&&(i=!0),null==s&&(s=null),e=n.clamp(e,-.9,.9),a=o?e:0,l=r.scale_highlow(t.h_range,a,null!=s?s.x:void 0),p=l[0],h=l[1],f=r.get_info(t.x_mappers,[p,h]),c=i?e:0,u=r.scale_highlow(t.v_range,c,null!=s?s.y:void 0),_=u[0],d=u[1],m=r.get_info(t.y_mappers,[_,d]),{xrs:f,yrs:m,factor:e}}},{\"./math\":\"core/util/math\"}],\"core/visuals\":[function(t,e,r){\"use strict\";var n,o=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,s=t(\"underscore\"),a=t(\"./property_mixins\"),l=t(\"./util/color\");n=function(){function t(t,e){var r,n,o,i,a;for(null==e&&(e=\"\"),this.obj=t,this.prefix=e,this.cache={},n=t.properties[e+this.do_attr].spec,this.doit=!s.isNull(n.value),a=this.attrs,o=0,i=a.length;o0;)t.push(this.remove_root(this._roots[0]));return t}finally{this._pop_all_models_freeze()}},t.prototype.destructively_move=function(t){var e,r,n,o,i,a,l,u,c;if(t===this)throw new Error(\"Attempted to overwrite a document with itself\");for(t.clear(),c=[],u=this._roots,e=0,n=u.length;e=0)){this._push_all_models_freeze();try{this._roots.push(t),t._is_root=!0}finally{this._pop_all_models_freeze()}return this._init_solver(),this._trigger_on_change(new r.RootAddedEvent(this,t,e))}},t.prototype.remove_root=function(t,e){var n;if(n=this._roots.indexOf(t),!(n<0)){this._push_all_models_freeze();try{this._roots.splice(n,1),t._is_root=!1}finally{this._pop_all_models_freeze()}return this._init_solver(),this._trigger_on_change(new r.RootRemovedEvent(this,t,e))}},t.prototype.title=function(){return this._title},t.prototype.set_title=function(t,e){if(t!==this._title)return this._title=t,this._trigger_on_change(new r.TitleChangedEvent(this,t,e))},t.prototype.get_model_by_id=function(t){return t in this._all_models?this._all_models[t]:null},t.prototype.get_model_by_name=function(t){return this._all_models_by_name.get_one(t,\"Multiple models are named '\"+t+\"'\")},t.prototype.on_change=function(t){if(!(i.call(this._callbacks,t)>=0))return this._callbacks.push(t)},t.prototype.remove_on_change=function(t){var e;if(e=this._callbacks.indexOf(t),e>=0)return this._callbacks.splice(e,1)},t.prototype._trigger_on_change=function(t){var e,r,n,o,i;for(o=this._callbacks,i=[],r=0,n=o.length;r0||s.difference(w,i).length>0)throw new Error(\"Not implemented: computing add/remove of document roots\");E={},n=[],y=r._all_models;for(l in y)d=y[l],l in o&&(T=t._events_to_sync_objects(o[l],x[l],r,E),n=n.concat(T));return{events:n,references:t._references_json(s.values(E),u=!1)}},t.prototype.to_json_string=function(t){return null==t&&(t=!0),JSON.stringify(this.to_json(t))},t.prototype.to_json=function(e){var r,n,o,i,a,l;for(null==e&&(e=!0),a=[],i=this._roots,r=0,n=i.length;r\"),d(\"body\").append(e)},r.inject_raw_css=function(t){var e;return e=d(\"\").appendTo(r)),s.opacity&&(this.helper.css(\"opacity\")&&(this._storedOpacity=this.helper.css(\"opacity\")),this.helper.css(\"opacity\",s.opacity)),s.zIndex&&(this.helper.css(\"zIndex\")&&(this._storedZIndex=this.helper.css(\"zIndex\")),this.helper.css(\"zIndex\",s.zIndex)),this.scrollParent[0]!==document&&\"HTML\"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger(\"start\",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger(\"activate\",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass(\"ui-sortable-helper\"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,n,o,r,s=this.options,a=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo(\"absolute\"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&\"HTML\"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;i--)if(n=this.items[i],o=n.item[0],r=this._intersectsWithPointer(n),r&&n.instance===this.currentContainer&&!(o===this.currentItem[0]||this.placeholder[1===r?\"next\":\"prev\"]()[0]===o||t.contains(this.placeholder[0],o)||\"semi-dynamic\"===this.options.type&&t.contains(this.element[0],o))){if(this.direction=1===r?\"down\":\"up\",\"pointer\"!==this.options.tolerance&&!this._intersectsWithSides(n))break;this._rearrange(e,n),this._trigger(\"change\",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger(\"sort\",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var n=this,o=this.placeholder.offset(),r=this.options.axis,s={};r&&\"x\"!==r||(s.left=o.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),r&&\"y\"!==r||(s.top=o.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(s,parseInt(this.options.revert,10)||500,function(){n._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),\"original\"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger(\"deactivate\",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger(\"out\",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),\"original\"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||\"id\")||\"\").match(e.expression||/(.+)[\\-=_](.+)/);i&&n.push((e.key||i[1]+\"[]\")+\"=\"+(e.key&&e.expression?i[1]:i[2]))}),!n.length&&e.key&&n.push(e.key+\"=\"),n.join(\"&\")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},i.each(function(){n.push(t(e.item||this).attr(e.attribute||\"id\")||\"\")}),n},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,n=this.positionAbs.top,o=n+this.helperProportions.height,r=t.left,s=r+t.width,a=t.top,l=a+t.height,u=this.offset.click.top,c=this.offset.click.left,d=\"x\"===this.options.axis||n+u>a&&n+ur&&e+ct[this.floating?\"width\":\"height\"]?p:r0?\"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){function i(){a.push(this)}var n,o,r,s,a=[],l=[],u=this._connectWith();if(u&&e)for(n=u.length-1;n>=0;n--)for(r=t(u[n]),o=r.length-1;o>=0;o--)s=t.data(r[o],this.widgetFullName),s&&s!==this&&!s.options.disabled&&l.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(l.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]),n=l.length-1;n>=0;n--)l[n][0].each(i);return t(a)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(\":data(\"+this.widgetName+\"-item)\");this.items=t.grep(this.items,function(t){for(var i=0;i=0;i--)for(o=t(h[i]),n=o.length-1;n>=0;n--)r=t.data(o[n],this.widgetFullName),r&&r!==this&&!r.options.disabled&&(d.push([t.isFunction(r.options.items)?r.options.items.call(r.element[0],e,{item:this.currentItem}):t(r.options.items,r.element),r]),this.containers.push(r));for(i=d.length-1;i>=0;i--)for(s=d[i][1],a=d[i][0],n=0,u=a.length;n=0;i--)n=this.items[i],n.instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]||(o=this.options.toleranceElement?t(this.options.toleranceElement,n.item):n.item,e||(n.width=o.outerWidth(),n.height=o.outerHeight()),r=o.offset(),n.left=r.left,n.top=r.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--)r=this.containers[i].element.offset(),this.containers[i].containerCache.left=r.left,this.containers[i].containerCache.top=r.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;var i,n=e.options;n.placeholder&&n.placeholder.constructor!==String||(i=n.placeholder,n.placeholder={element:function(){var n=e.currentItem[0].nodeName.toLowerCase(),o=t(\"<\"+n+\">\",e.document[0]).addClass(i||e.currentItem[0].className+\" ui-sortable-placeholder\").removeClass(\"ui-sortable-helper\");return\"tr\"===n?e.currentItem.children().each(function(){t(\" \",e.document[0]).attr(\"colspan\",t(this).attr(\"colspan\")||1).appendTo(o)}):\"img\"===n&&o.attr(\"src\",e.currentItem.attr(\"src\")),i||o.css(\"visibility\",\"hidden\"),o},update:function(t,o){i&&!n.forcePlaceholderSize||(o.height()||o.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css(\"paddingTop\")||0,10)-parseInt(e.currentItem.css(\"paddingBottom\")||0,10)),o.width()||o.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css(\"paddingLeft\")||0,10)-parseInt(e.currentItem.css(\"paddingRight\")||0,10)))}}),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 o,r,s,a,l,u,c,d,h,p,f=null,m=null;for(o=this.containers.length-1;o>=0;o--)if(!t.contains(this.currentItem[0],this.containers[o].element[0]))if(this._intersectsWith(this.containers[o].containerCache)){if(f&&t.contains(this.containers[o].element[0],f.element[0]))continue;f=this.containers[o],m=o}else this.containers[o].containerCache.over&&(this.containers[o]._trigger(\"out\",e,this._uiHash(this)),this.containers[o].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger(\"over\",e,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(s=1e4,a=null,p=f.floating||n(this.currentItem),l=p?\"left\":\"top\",u=p?\"width\":\"height\",c=this.positionAbs[l]+this.offset.click[l],r=this.items.length-1;r>=0;r--)t.contains(this.containers[m].element[0],this.items[r].item[0])&&this.items[r].item[0]!==this.currentItem[0]&&(p&&!i(this.positionAbs.top+this.offset.click.top,this.items[r].top,this.items[r].height)||(d=this.items[r].item.offset()[l],h=!1,Math.abs(d-c)>Math.abs(d+this.items[r][u]-c)&&(h=!0,d+=this.items[r][u]),Math.abs(d-c)this.containment[2]&&(r=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),o.grid&&(i=this.originalPageY+Math.round((s-this.originalPageY)/o.grid[1])*o.grid[1],s=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-o.grid[1]:i+o.grid[1]:i,n=this.originalPageX+Math.round((r-this.originalPageX)/o.grid[0])*o.grid[0],r=this.containment?n-this.offset.click.left>=this.containment[0]&&n-this.offset.click.left<=this.containment[2]?n:n-this.offset.click.left>=this.containment[0]?n-o.grid[0]:n+o.grid[0]:n)),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(\"fixed\"===this.cssPosition?-this.scrollParent.scrollTop():l?0:a.scrollTop()),left:r-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(\"fixed\"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:a.scrollLeft())}},_rearrange:function(t,e,i,n){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],\"down\"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!n)})},_clear:function(t,e){function i(t,e,i){return function(n){i._trigger(t,n,e._uiHash(e))}}this.reverting=!1;var n,o=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)\"auto\"!==this._storedCSS[n]&&\"static\"!==this._storedCSS[n]||(this._storedCSS[n]=\"\");this.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\")}else this.currentItem.show();for(this.fromOutside&&!e&&o.push(function(t){this._trigger(\"receive\",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(\".ui-sortable-helper\")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||o.push(function(t){this._trigger(\"update\",t,this._uiHash())}),this!==this.currentContainer&&(e||(o.push(function(t){this._trigger(\"remove\",t,this._uiHash())}),o.push(function(t){return function(e){t._trigger(\"receive\",e,this._uiHash(this))}}.call(this,this.currentContainer)),o.push(function(t){return function(e){t._trigger(\"update\",e,this._uiHash(this))}}.call(this,this.currentContainer)))),n=this.containers.length-1;n>=0;n--)e||o.push(i(\"deactivate\",this,this.containers[n])),this.containers[n].containerCache.over&&(o.push(i(\"out\",this,this.containers[n])),this.containers[n].containerCache.over=0);if(this.storedCursor&&(this.document.find(\"body\").css(\"cursor\",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css(\"opacity\",this._storedOpacity),this._storedZIndex&&this.helper.css(\"zIndex\",\"auto\"===this._storedZIndex?\"\":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger(\"beforeStop\",t,this._uiHash()),n=0;n\",widgetEventPrefix:\"spin\",options:{culture:null,icons:{down:\"ui-icon-triangle-1-s\",up:\"ui-icon-triangle-1-n\"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption(\"max\",this.options.max),this._setOption(\"min\",this.options.min),this._setOption(\"step\",this.options.step),\"\"!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr(\"autocomplete\")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each([\"min\",\"max\",\"step\"],function(t,n){var o=i.attr(n);void 0!==o&&o.length&&(e[n]=o)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:\"_stop\",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?void delete this.cancelBlur:(this._stop(),this._refresh(),void(this.previous!==this.element.val()&&this._trigger(\"change\",t)))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},\"mousedown .ui-spinner-button\":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass(\"ui-spinner-up\")?1:-1,e)},\"mouseup .ui-spinner-button\":\"_stop\",\"mouseenter .ui-spinner-button\":function(e){if(t(e.currentTarget).hasClass(\"ui-state-active\"))return this._start(e)!==!1&&void this._repeat(null,t(e.currentTarget).hasClass(\"ui-spinner-up\")?1:-1,e)},\"mouseleave .ui-spinner-button\":\"_stop\"},_draw:function(){var t=this.uiSpinner=this.element.addClass(\"ui-spinner-input\").attr(\"autocomplete\",\"off\").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr(\"role\",\"spinbutton\"),this.buttons=t.find(\".ui-spinner-button\").attr(\"tabIndex\",-1).button().removeClass(\"ui-corner-all\"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,n=t.ui.keyCode;switch(e.keyCode){case n.UP:return this._repeat(null,1,e),!0;case n.DOWN:return this._repeat(null,-1,e),!0;case n.PAGE_UP:return this._repeat(null,i.page,e),!0;case n.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return\"\"},_buttonHtml:function(){return\"\"},_start:function(t){return!(!this.spinning&&this._trigger(\"start\",t)===!1)&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger(\"spin\",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),i=e.indexOf(\".\");return i===-1?0:e.length-i-1},_adjustValue:function(t){var e,i,n=this.options;return e=null!==n.min?n.min:0,i=t-e,i=Math.round(i/n.step)*n.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==n.max&&t>n.max?n.max:null!==n.min&&t\",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(),this.focusable=t(),n!==this&&(t.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===n&&this.destroy()}}),this.document=t(n.style?n.ownerDocument:n.document||n),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger(\"create\",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr(\"aria-disabled\").removeClass(this.widgetFullName+\"-disabled ui-state-disabled\"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\")},_destroy:t.noop,widget:function(){return this.element},option:function(i,n){var o,r,s,a=i;if(0===arguments.length)return t.widget.extend({},this.options);if(\"string\"==typeof i)if(a={},o=i.split(\".\"),i=o.shift(),o.length){for(r=a[i]=t.widget.extend({},this.options[i]),s=0;s').insertAfter(r(this)).on(\"click\",n);var a={relatedTarget:this};if(i.trigger(t=r.Event(\"show.bk-bs.dropdown\",a)),t.isDefaultPrevented())return;i.toggleClass(\"bk-bs-open\").trigger(\"shown.bk-bs.dropdown\",a),e.focus()}return!1}},l.prototype.keydown=function(t){if(/(38|40|27)/.test(t.keyCode)){var e=r(this);if(t.preventDefault(),t.stopPropagation(),!e.is(\".bk-bs-disabled, :disabled\")){var i=o(e),n=i.hasClass(\"bk-bs-open\");if(!n||n&&27==t.keyCode)return 27==t.which&&i.find(a).focus(),e.click();var s=\" li:not(.bk-bs-divider):visible a\",l=i.find(\"[role=menu]\"+s+\", [role=listbox]\"+s);if(l.length){var u=l.index(l.filter(\":focus\"));38==t.keyCode&&u>0&&u--,40==t.keyCode&&u .bk-bs-dropdown-menu > .bk-bs-active\").removeClass(\"bk-bs-active\"),t.addClass(\"bk-bs-active\"),s?(t[0].offsetWidth,t.addClass(\"bk-bs-in\")):t.removeClass(\"bk-bs-fade\"),t.parent(\".bk-bs-dropdown-menu\")&&t.closest(\"li.bk-bs-dropdown\").addClass(\"bk-bs-active\"),i&&i()}var r=e.find(\"> .bk-bs-active\"),s=i&&n.support.transition&&r.hasClass(\"bk-bs-fade\");s?r.one(n.support.transition.end,o).emulateTransitionEnd(150):o(),r.removeClass(\"bk-bs-in\")};var r=n.fn.tab;n.fn.tab=function(t){return this.each(function(){var e=n(this),i=e.data(\"bk-bs.tab\");i||e.data(\"bk-bs.tab\",i=new o(this)),\"string\"==typeof t&&i[t]()})},n.fn.tab.Constructor=o,n.fn.tab.noConflict=function(){return n.fn.tab=r,this},n(document).on(\"click.bk-bs.tab.data-api\",'[data-bk-bs-toggle=\"tab\"], [data-bk-bs-toggle=\"pill\"]',function(t){t.preventDefault(),n(this).tab(\"show\")})},{jquery:\"jquery\"}],\"jqrangeslider/jQDateRangeSlider\":[function(t,e,i){/**\n", " * jQRangeSlider\n", " * A javascript slider selector that supports dates\n", " *\n", " * Copyright (C) Guillaume Gautreau 2012\n", " * Dual licensed under the MIT or GPL Version 2 licenses.\n", " *\n", " */\n", " var n=t(\"jquery\");t(\"./jQRangeSlider\"),e.exports=n.widget(\"ui.dateRangeSlider\",n.ui.rangeSlider,{options:{bounds:{min:new Date(2010,0,1).valueOf(),max:new Date(2012,0,1).valueOf()},defaultValues:{min:new Date(2010,1,11).valueOf(),max:new Date(2011,1,11).valueOf()}},_create:function(){n.ui.rangeSlider.prototype._create.apply(this),this.element.addClass(\"bk-ui-dateRangeSlider\")},destroy:function(){this.element.removeClass(\"bk-ui-dateRangeSlider\"),n.ui.rangeSlider.prototype.destroy.apply(this)},_setDefaultValues:function(){this._values={min:this.options.defaultValues.min.valueOf(),max:this.options.defaultValues.max.valueOf()}},_setRulerParameters:function(){this.ruler.ruler({min:new Date(this.options.bounds.min),max:new Date(this.options.bounds.max),scales:this.options.scales})},_setOption:function(t,e){(\"defaultValues\"===t||\"bounds\"===t)&&\"undefined\"!=typeof e&&null!==e&&this._isValidDate(e.min)&&this._isValidDate(e.max)?n.ui.rangeSlider.prototype._setOption.apply(this,[t,{min:e.min.valueOf(),max:e.max.valueOf()}]):n.ui.rangeSlider.prototype._setOption.apply(this,this._toArray(arguments))},_handleType:function(){return\"dateRangeSliderHandle\"},option:function(t){if(\"bounds\"===t||\"defaultValues\"===t){var e=n.ui.rangeSlider.prototype.option.apply(this,arguments);return{min:new Date(e.min),max:new Date(e.max)}}return n.ui.rangeSlider.prototype.option.apply(this,this._toArray(arguments))},_defaultFormatter:function(t){var e=t.getMonth()+1,i=t.getDate();return\"\"+t.getFullYear()+\"-\"+(e<10?\"0\"+e:e)+\"-\"+(i<10?\"0\"+i:i)},_getFormatter:function(){var t=this.options.formatter;return this.options.formatter!==!1&&null!==this.options.formatter||(t=this._defaultFormatter),function(t){return function(e){return t(new Date(e))}}(t)},values:function(t,e){var i=null;return i=this._isValidDate(t)&&this._isValidDate(e)?n.ui.rangeSlider.prototype.values.apply(this,[t.valueOf(),e.valueOf()]):n.ui.rangeSlider.prototype.values.apply(this,this._toArray(arguments)),{min:new Date(i.min),max:new Date(i.max)}},min:function(t){return this._isValidDate(t)?new Date(n.ui.rangeSlider.prototype.min.apply(this,[t.valueOf()])):new Date(n.ui.rangeSlider.prototype.min.apply(this))},max:function(t){return this._isValidDate(t)?new Date(n.ui.rangeSlider.prototype.max.apply(this,[t.valueOf()])):new Date(n.ui.rangeSlider.prototype.max.apply(this))},bounds:function(t,e){var i;return i=this._isValidDate(t)&&this._isValidDate(e)?n.ui.rangeSlider.prototype.bounds.apply(this,[t.valueOf(),e.valueOf()]):n.ui.rangeSlider.prototype.bounds.apply(this,this._toArray(arguments)),{min:new Date(i.min),max:new Date(i.max)}},_isValidDate:function(t){return\"undefined\"!=typeof t&&t instanceof Date},_toArray:function(t){return Array.prototype.slice.call(t)}})},{\"./jQRangeSlider\":\"jqrangeslider/jQRangeSlider\",jquery:\"jquery\"}],\"jqrangeslider/jQRangeSlider\":[function(t,e,i){/**\n", " * jQRangeSlider\n", " * A javascript slider selector that supports dates\n", " *\n", " * Copyright (C) Guillaume Gautreau 2012\n", " * Dual licensed under the MIT or GPL Version 2 licenses.\n", " *\n", " */\n", " var n=t(\"jquery\");t(\"jquery-ui/core\"),t(\"jquery-ui/widget\"),t(\"jquery-ui/mouse\"),t(\"jquery-mousewheel\"),e.exports=n.widget(\"ui.rangeSlider\",{options:{bounds:{min:0,max:100},defaultValues:{min:20,max:50},wheelMode:null,wheelSpeed:4,arrows:!0,valueLabels:\"show\",formatter:null,durationIn:0,durationOut:400,delayOut:200,range:{min:!1,max:!1},step:!1,scales:!1,enabled:!0,symmetricPositionning:!1},_values:null,_valuesChanged:!1,_initialized:!1,bar:null,leftHandle:null,rightHandle:null,innerBar:null,container:null,arrows:null,labels:null,changing:{min:!1,max:!1},changed:{min:!1,max:!1},ruler:null,_create:function(){this._setDefaultValues(),this.labels={left:null,right:null,leftDisplayed:!0,rightDisplayed:!0},this.arrows={left:null,right:null},this.changing={min:!1,max:!1},this.changed={min:!1,max:!1},this._createElements(),this._bindResize(),setTimeout(n.proxy(this.resize,this),1),setTimeout(n.proxy(this._initValues,this),1)},_setDefaultValues:function(){this._values={min:this.options.defaultValues.min,max:this.options.defaultValues.max}},_bindResize:function(){var t=this;this._resizeProxy=function(e){t.resize(e)},n(window).resize(this._resizeProxy)},_initWidth:function(){this.container.css(\"width\",this.element.width()-this.container.outerWidth(!0)+this.container.width()),this.innerBar.css(\"width\",this.container.width()-this.innerBar.outerWidth(!0)+this.innerBar.width())},_initValues:function(){this._initialized=!0,this.values(this._values.min,this._values.max)},_setOption:function(t,e){this._setWheelOption(t,e),this._setArrowsOption(t,e),this._setLabelsOption(t,e),this._setLabelsDurations(t,e),this._setFormatterOption(t,e),this._setBoundsOption(t,e),this._setRangeOption(t,e),this._setStepOption(t,e),this._setScalesOption(t,e),this._setEnabledOption(t,e),this._setPositionningOption(t,e)},_validProperty:function(t,e,i){return null===t||\"undefined\"==typeof t[e]?i:t[e]},_setStepOption:function(t,e){\"step\"===t&&(this.options.step=e,this._leftHandle(\"option\",\"step\",e),this._rightHandle(\"option\",\"step\",e),this._changed(!0))},_setScalesOption:function(t,e){\"scales\"===t&&(e===!1||null===e?(this.options.scales=!1,this._destroyRuler()):e instanceof Array&&(this.options.scales=e,this._updateRuler()))},_setRangeOption:function(t,e){\"range\"===t&&(this._bar(\"option\",\"range\",e),this.options.range=this._bar(\"option\",\"range\"),this._changed(!0))},_setBoundsOption:function(t,e){\"bounds\"===t&&\"undefined\"!=typeof e.min&&\"undefined\"!=typeof e.max&&this.bounds(e.min,e.max)},_setWheelOption:function(t,e){\"wheelMode\"!==t&&\"wheelSpeed\"!==t||(this._bar(\"option\",t,e),this.options[t]=this._bar(\"option\",t))},_setLabelsOption:function(t,e){if(\"valueLabels\"===t){if(\"hide\"!==e&&\"show\"!==e&&\"change\"!==e)return;this.options.valueLabels=e,\"hide\"!==e?(this._createLabels(),this._leftLabel(\"update\"),this._rightLabel(\"update\")):this._destroyLabels()}},_setFormatterOption:function(t,e){\"formatter\"===t&&null!==e&&\"function\"==typeof e&&\"hide\"!==this.options.valueLabels&&(this._leftLabel(\"option\",\"formatter\",e),this.options.formatter=this._rightLabel(\"option\",\"formatter\",e))},_setArrowsOption:function(t,e){\"arrows\"!==t||e!==!0&&e!==!1||e===this.options.arrows||(e===!0?(this.element.removeClass(\"bk-ui-rangeSlider-noArrow\").addClass(\"bk-ui-rangeSlider-withArrows\"),this.arrows.left.css(\"display\",\"block\"),this.arrows.right.css(\"display\",\"block\"),this.options.arrows=!0):e===!1&&(this.element.addClass(\"bk-ui-rangeSlider-noArrow\").removeClass(\"bk-ui-rangeSlider-withArrows\"),this.arrows.left.css(\"display\",\"none\"),this.arrows.right.css(\"display\",\"none\"),this.options.arrows=!1),this._initWidth())},_setLabelsDurations:function(t,e){if(\"durationIn\"===t||\"durationOut\"===t||\"delayOut\"===t){if(parseInt(e,10)!==e)return;null!==this.labels.left&&this._leftLabel(\"option\",t,e),null!==this.labels.right&&this._rightLabel(\"option\",t,e),this.options[t]=e}},_setEnabledOption:function(t,e){\"enabled\"===t&&this.toggle(e)},_setPositionningOption:function(t,e){\"symmetricPositionning\"===t&&(this._rightHandle(\"option\",t,e),this.options[t]=this._leftHandle(\"option\",t,e))},_createElements:function(){\"absolute\"!==this.element.css(\"position\")&&this.element.css(\"position\",\"relative\"),this.element.addClass(\"bk-ui-rangeSlider\"),this.container=n(\"
\").css(\"position\",\"absolute\").appendTo(this.element),this.innerBar=n(\"
\").css(\"position\",\"absolute\").css(\"top\",0).css(\"left\",0),this._createHandles(),this._createBar(),this.container.prepend(this.innerBar),this._createArrows(),\"hide\"!==this.options.valueLabels?this._createLabels():this._destroyLabels(),this._updateRuler(),this.options.enabled||this._toggle(this.options.enabled)},_createHandle:function(t){return n(\"
\")[this._handleType()](t).bind(\"sliderDrag\",n.proxy(this._changing,this)).bind(\"stop\",n.proxy(this._changed,this))},_createHandles:function(){this.leftHandle=this._createHandle({isLeft:!0,bounds:this.options.bounds,value:this._values.min,step:this.options.step,symmetricPositionning:this.options.symmetricPositionning}).appendTo(this.container),this.rightHandle=this._createHandle({isLeft:!1,bounds:this.options.bounds,value:this._values.max,step:this.options.step,symmetricPositionning:this.options.symmetricPositionning}).appendTo(this.container)},_createBar:function(){this.bar=n(\"
\").prependTo(this.container).bind(\"sliderDrag scroll zoom\",n.proxy(this._changing,this)).bind(\"stop\",n.proxy(this._changed,this)),this._bar({leftHandle:this.leftHandle,rightHandle:this.rightHandle,values:{min:this._values.min,max:this._values.max},type:this._handleType(),range:this.options.range,wheelMode:this.options.wheelMode,wheelSpeed:this.options.wheelSpeed}),this.options.range=this._bar(\"option\",\"range\"),this.options.wheelMode=this._bar(\"option\",\"wheelMode\"),this.options.wheelSpeed=this._bar(\"option\",\"wheelSpeed\")},_createArrows:function(){this.arrows.left=this._createArrow(\"left\"),this.arrows.right=this._createArrow(\"right\"),this.options.arrows?this.element.addClass(\"bk-ui-rangeSlider-withArrows\"):(this.arrows.left.css(\"display\",\"none\"),this.arrows.right.css(\"display\",\"none\"),this.element.addClass(\"bk-ui-rangeSlider-noArrow\"))},_createArrow:function(t){var e,i=n(\"
\").append(\"
\").addClass(\"bk-ui-rangeSlider-\"+t+\"Arrow\").css(\"position\",\"absolute\").css(t,0).appendTo(this.element);return e=\"right\"===t?n.proxy(this._scrollRightClick,this):n.proxy(this._scrollLeftClick,this),i.bind(\"mousedown touchstart\",e),i},_proxy:function(t,e,i){var n=Array.prototype.slice.call(i);return t&&t[e]?t[e].apply(t,n):null},_handleType:function(){return\"rangeSliderHandle\"},_barType:function(){return\"rangeSliderBar\"},_bar:function(){return this._proxy(this.bar,this._barType(),arguments)},_labelType:function(){return\"rangeSliderLabel\"},_leftLabel:function(){return this._proxy(this.labels.left,this._labelType(),arguments)},_rightLabel:function(){return this._proxy(this.labels.right,this._labelType(),arguments)},_leftHandle:function(){return this._proxy(this.leftHandle,this._handleType(),arguments)},_rightHandle:function(){return this._proxy(this.rightHandle,this._handleType(),arguments)},_getValue:function(t,e){return e===this.rightHandle&&(t-=e.outerWidth()),t*(this.options.bounds.max-this.options.bounds.min)/(this.container.innerWidth()-e.outerWidth(!0))+this.options.bounds.min},_trigger:function(t){var e=this;setTimeout(function(){e.element.trigger(t,{label:e.element,values:e.values()})},1)},_changing:function(){this._updateValues()&&(this._trigger(\"valuesChanging\"),this._valuesChanged=!0)},_deactivateLabels:function(){\"change\"===this.options.valueLabels&&(this._leftLabel(\"option\",\"show\",\"hide\"),this._rightLabel(\"option\",\"show\",\"hide\"))},_reactivateLabels:function(){\"change\"===this.options.valueLabels&&(this._leftLabel(\"option\",\"show\",\"change\"),this._rightLabel(\"option\",\"show\",\"change\"))},_changed:function(t){t===!0&&this._deactivateLabels(),(this._updateValues()||this._valuesChanged)&&(this._trigger(\"valuesChanged\"),t!==!0&&this._trigger(\"userValuesChanged\"),this._valuesChanged=!1),t===!0&&this._reactivateLabels()},_updateValues:function(){var t=this._leftHandle(\"value\"),e=this._rightHandle(\"value\"),i=this._min(t,e),n=this._max(t,e),o=i!==this._values.min||n!==this._values.max;return this._values.min=this._min(t,e),this._values.max=this._max(t,e),o},_min:function(t,e){return Math.min(t,e)},_max:function(t,e){return Math.max(t,e)},_createLabel:function(t,e){var i;return null===t?(i=this._getLabelConstructorParameters(t,e),t=n(\"
\").appendTo(this.element)[this._labelType()](i)):(i=this._getLabelRefreshParameters(t,e),t[this._labelType()](i)),t},_getLabelConstructorParameters:function(t,e){return{handle:e,handleType:this._handleType(),formatter:this._getFormatter(),show:this.options.valueLabels,durationIn:this.options.durationIn,durationOut:this.options.durationOut,delayOut:this.options.delayOut}},_getLabelRefreshParameters:function(){return{formatter:this._getFormatter(),show:this.options.valueLabels,durationIn:this.options.durationIn,durationOut:this.options.durationOut,delayOut:this.options.delayOut}},_getFormatter:function(){return this.options.formatter===!1||null===this.options.formatter?this._defaultFormatter:this.options.formatter},_defaultFormatter:function(t){return Math.round(t)},_destroyLabel:function(t){return null!==t&&(t[this._labelType()](\"destroy\"),t.remove(),t=null),t},_createLabels:function(){this.labels.left=this._createLabel(this.labels.left,this.leftHandle),this.labels.right=this._createLabel(this.labels.right,this.rightHandle),this._leftLabel(\"pair\",this.labels.right)},_destroyLabels:function(){this.labels.left=this._destroyLabel(this.labels.left),this.labels.right=this._destroyLabel(this.labels.right)},_stepRatio:function(){return this._leftHandle(\"stepRatio\")},_scrollRightClick:function(t){return!!this.options.enabled&&(t.preventDefault(),this._bar(\"startScroll\"),this._bindStopScroll(),void this._continueScrolling(\"scrollRight\",4*this._stepRatio(),1))},_continueScrolling:function(t,e,i,n){if(!this.options.enabled)return!1;this._bar(t,i),n=n||5,n--;var o=this,r=16,s=Math.max(1,4/this._stepRatio());this._scrollTimeout=setTimeout(function(){0===n&&(e>r?e=Math.max(r,e/1.5):i=Math.min(s,2*i),n=5),o._continueScrolling(t,e,i,n)},e)},_scrollLeftClick:function(t){return!!this.options.enabled&&(t.preventDefault(),this._bar(\"startScroll\"),this._bindStopScroll(),void this._continueScrolling(\"scrollLeft\",4*this._stepRatio(),1))},_bindStopScroll:function(){var t=this;this._stopScrollHandle=function(e){e.preventDefault(),t._stopScroll()},n(document).bind(\"mouseup touchend\",this._stopScrollHandle)},_stopScroll:function(){n(document).unbind(\"mouseup touchend\",this._stopScrollHandle),this._stopScrollHandle=null,this._bar(\"stopScroll\"),clearTimeout(this._scrollTimeout)},_createRuler:function(){this.ruler=n(\"
\").appendTo(this.innerBar)},_setRulerParameters:function(){this.ruler.ruler({min:this.options.bounds.min,max:this.options.bounds.max,scales:this.options.scales})},_destroyRuler:function(){null!==this.ruler&&n.fn.ruler&&(this.ruler.ruler(\"destroy\"),this.ruler.remove(),this.ruler=null)},_updateRuler:function(){this._destroyRuler(),this.options.scales!==!1&&n.fn.ruler&&(this._createRuler(),this._setRulerParameters())},values:function(t,e){var i;if(\"undefined\"!=typeof t&&\"undefined\"!=typeof e){if(!this._initialized)return this._values.min=t,this._values.max=e,this._values;this._deactivateLabels(),i=this._bar(\"values\",t,e),this._changed(!0),this._reactivateLabels()}else i=this._bar(\"values\",t,e);return i},min:function(t){return this._values.min=this.values(t,this._values.max).min,this._values.min},max:function(t){return this._values.max=this.values(this._values.min,t).max,this._values.max},bounds:function(t,e){return this._isValidValue(t)&&this._isValidValue(e)&&t0&&t.which!=i.which)&&!n(t.target).is(i.not)&&(!i.handle||n(t.target).closest(i.handle,t.currentTarget).length)&&(s.touched=\"touchstart\"==t.type?this:null,i.propagates=1,i.mousedown=this,i.interactions=[s.interaction(this,i)],i.target=t.target,i.pageX=t.pageX,i.pageY=t.pageY,i.dragging=null,e=s.hijack(t,\"draginit\",i),i.propagates))return e=s.flatten(e),e&&e.length&&(i.interactions=[],n.each(e,function(){i.interactions.push(s.interaction(this,i))})),i.propagates=i.interactions.length,i.drop!==!1&&r.drop&&r.drop.handler(t,i),s.textselect(!1),s.touched?o.add(s.touched,\"touchmove touchend\",s.handler,i):o.add(document,\"mousemove mouseup\",s.handler,i),!(!s.touched||i.live)&&void 0}},interaction:function(t,e){var i=n(t)[e.relative?\"position\":\"offset\"]()||{top:0,left:0};return{drag:t,callback:new s.callback,droppable:[],offset:i}},handler:function(t){var e=t.data;switch(t.type){case!e.dragging&&\"touchmove\":t.preventDefault();case!e.dragging&&\"mousemove\":if(Math.pow(t.pageX-e.pageX,2)+Math.pow(t.pageY-e.pageY,2)0?void n.removeData(this,\"suppress.\"+t.type):a.apply(this,arguments)};var l=o.fixHooks.touchstart=o.fixHooks.touchmove=o.fixHooks.touchend=o.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}};r.draginit=r.dragstart=r.dragend=s},{jquery:\"jquery\"}],jquery_event_drop:[function(t,e,i){/*!\n", " * jquery.event.drop - v 2.2\n", " * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com\n", " * Open Source MIT License - http://threedubmedia.com/code/license\n", " */\n", " var n=t(\"jquery\");t(\"jquery_event_drag\");n.fn.drop=function(t,e,i){var o=\"string\"==typeof t?t:\"\",r=n.isFunction(t)?t:n.isFunction(e)?e:null;return 0!==o.indexOf(\"drop\")&&(o=\"drop\"+o),i=(t==r?e:i)||{},r?this.bind(o,i,r):this.trigger(o)},n.drop=function(t){t=t||{},s.multi=t.multi===!0?1/0:t.multi===!1?1:isNaN(t.multi)?s.multi:t.multi,s.delay=t.delay||s.delay,s.tolerance=n.isFunction(t.tolerance)?t.tolerance:null===t.tolerance?null:s.tolerance,s.mode=t.mode||s.mode||\"intersect\"};var o=n.event,r=o.special,s=n.event.special.drop={multi:1,delay:20,mode:\"overlap\",targets:[],datakey:\"dropdata\",noBubble:!0,add:function(t){var e=n.data(this,s.datakey);e.related+=1},remove:function(){n.data(this,s.datakey).related-=1},setup:function(){if(!n.data(this,s.datakey)){var t={related:0,active:[],anyactive:0,winner:0,location:{}};n.data(this,s.datakey,t),s.targets.push(this)}},teardown:function(){var t=n.data(this,s.datakey)||{};if(!t.related){n.removeData(this,s.datakey);var e=this;s.targets=n.grep(s.targets,function(t){return t!==e})}},handler:function(t,e){var i;if(e)switch(t.type){case\"mousedown\":case\"touchstart\":i=n(s.targets),\"string\"==typeof e.drop&&(i=i.filter(e.drop)),i.each(function(){var t=n.data(this,s.datakey);t.active=[],t.anyactive=0,t.winner=0}),e.droppable=i,r.drag.hijack(t,\"dropinit\",e);break;case\"mousemove\":case\"touchmove\":s.event=t,s.timer||s.tolerate(e);break;case\"mouseup\":case\"touchend\":s.timer=clearTimeout(s.timer),e.propagates&&(r.drag.hijack(t,\"drop\",e),r.drag.hijack(t,\"dropend\",e))}},locate:function(t,e){var i=n.data(t,s.datakey),o=n(t),r=o.offset()||{},a=o.outerHeight(),l=o.outerWidth(),u={elem:t,width:l,height:a,top:r.top,left:r.left,right:r.left+l,bottom:r.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.min(i.bottom,e.bottom)-Math.max(i.top,e.top))*Math.max(0,Math.min(i.right,e.right)-Math.max(i.left,e.left))},fit:function(t,e,i){return this.contains(i,e)?1:0},middle:function(t,e,i){return this.contains(i,[e.left+.5*e.width,e.top+.5*e.height])?1:0}},sort:function(t,e){return e.winner-t.winner||t.index-e.index},tolerate:function(t){var e,i,o,a,l,u,c,d,h=0,p=t.interactions.length,f=[s.event.pageX,s.event.pageY],m=s.tolerance||s.modes[s.mode];do if(d=t.interactions[h]){if(!d)return;d.drop=[],l=[],u=d.droppable.length,m&&(o=s.locate(d.proxy)),e=0;do if(c=d.droppable[e]){if(a=n.data(c,s.datakey),i=a.location,!i)continue;a.winner=m?m.call(s,s.event,o,i):s.contains(i,f)?1:0,l.push(a)}while(++e\",g.toolTip):h.updateColumnHeader(g.columnId,\"\",g.toolTip)}function s(t,e){32==t.which&&h.getColumns()[e.cell].id===g.columnId&&(h.getEditorLock().isActive()&&!h.getEditorLock().commitCurrentEdit()||l(e.row),t.preventDefault(),t.stopImmediatePropagation())}function a(t,e){if(h.getColumns()[e.cell].id===g.columnId&&o(t.target).is(\":checkbox\")){if(h.getEditorLock().isActive()&&!h.getEditorLock().commitCurrentEdit())return t.preventDefault(),void t.stopImmediatePropagation();l(e.row),t.stopPropagation(),t.stopImmediatePropagation()}}function l(t){f[t]?h.setSelectedRows(o.grep(h.getSelectedRows(),function(e){return e!=t})):h.setSelectedRows(h.getSelectedRows().concat(t))}function u(t,e){if(e.column.id==g.columnId&&o(t.target).is(\":checkbox\")){if(h.getEditorLock().isActive()&&!h.getEditorLock().commitCurrentEdit())return t.preventDefault(),void t.stopImmediatePropagation();if(o(t.target).is(\":checked\")){for(var i=[],n=0;n\",toolTip:g.toolTip,field:\"sel\",width:g.width,resizable:!1,sortable:!1,cssClass:g.cssClass,formatter:d}}function d(t,e,i,n,o){return o?f[t]?\"\":\"\":null}var h,p=new r.EventHandler,f={},m={columnId:\"_checkbox_selector\",cssClass:null,toolTip:\"Select/Deselect All\",width:30},g=o.extend(!0,{},m,t);o.extend(this,{init:e,destroy:i,getColumnDefinition:c})}var o=t(\"jquery\"),r=t(\"../slick.core\");e.exports=n},{\"../slick.core\":\"slick_grid/slick.core\",jquery:\"jquery\"}],\"slick_grid/plugins/slick.rowselectionmodel\":[function(t,e,i){function n(t){function e(e){_=o.extend(!0,{},C,t),g=e,w.subscribe(g.onActiveCellChanged,n(p)),w.subscribe(g.onKeyDown,n(f)),w.subscribe(g.onClick,n(m))}function i(){w.unsubscribeAll()}function n(t){return function(){v||(v=!0,t.apply(this,arguments),v=!1)}}function s(t){for(var e=[],i=0;i=0&&n=0;i--)t[i]===e&&t.splice(i,1)},this.notify=function(e,i,o){i=i||new n,o=o||this;for(var r,s=0;s=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 c(){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()},this.cancelCurrentEdit=function(){return!t||t.cancelCurrentEdit()}}var d=(t(\"jquery\"),{Event:o,EventData:n,EventHandler:r,Range:s,NonDataRow:a,Group:l,GroupTotals:u,EditorLock:c,GlobalEditorLock:new c});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=d},{jquery:\"jquery\"}],\"slick_grid/slick.grid\":[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;te.maxWidth&&(e.width=e.maxWidth)}if(options.enableColumnReorder&&!$.fn.sortable)throw new Error(\"SlickGrid's 'enableColumnReorder = true' option requires jquery-ui.sortable module to be loaded\");editController={commitCurrentEdit:commitCurrentEdit,cancelCurrentEdit:cancelCurrentEdit},$container.empty().css(\"overflow\",\"hidden\").css(\"outline\",0).addClass(uid).addClass(\"bk-ui-widget\"),/relative|absolute|fixed/.test($container.css(\"position\"))||$container.css(\"position\",\"relative\"),$focusSink=$(\"
\").appendTo($container),$headerScroller=$(\"
\").appendTo($container),$headers=$(\"
\").appendTo($headerScroller),$headers.width(getHeadersWidth()),$headerRowScroller=$(\"
\").appendTo($container),$headerRow=$(\"
\").appendTo($headerRowScroller),$headerRowSpacer=$(\"
\").css(\"width\",getCanvasWidth()+scrollbarDimensions.width+\"px\").appendTo($headerRowScroller),$topPanelScroller=$(\"
\").appendTo($container),$topPanel=$(\"
\").appendTo($topPanelScroller),options.showTopPanel||$topPanelScroller.hide(),options.showHeaderRow||$headerRowScroller.hide(),$viewport=$(\"
\").appendTo($container),$viewport.css(\"overflow-y\",options.autoHeight?\"hidden\":\"auto\"),$canvas=$(\"
\").appendTo($viewport),$focusSink2=$focusSink.clone().appendTo($container),options.explicitInitialization||finishInitialization()}function finishInitialization(){initialized||(initialized=!0,viewportW=parseFloat($.css($container[0],\"width\",!0)),measureCellPaddingAndBorder(),disableSelection($headers),options.enableTextSelectionOnCells||$viewport.bind(\"selectstart.ui\",function(t){return $(t.target).is(\"input,textarea\")}),updateColumnCaches(),createColumnHeaders(),setupColumnSort(),createCssRules(),resizeCanvas(),bindAncestorScrollEvents(),$container.bind(\"resize.bk-slickgrid\",resizeCanvas),$viewport.bind(\"scroll\",handleScroll),$headerScroller.bind(\"contextmenu\",handleHeaderContextMenu).bind(\"click\",handleHeaderClick).delegate(\".bk-slick-header-column\",\"mouseenter\",handleHeaderMouseEnter).delegate(\".bk-slick-header-column\",\"mouseleave\",handleHeaderMouseLeave),$headerRowScroller.bind(\"scroll\",handleHeaderRowScroll),$focusSink.add($focusSink2).bind(\"keydown\",handleKeyDown),$canvas.bind(\"keydown\",handleKeyDown).bind(\"click\",handleClick).bind(\"dblclick\",handleDblClick).bind(\"contextmenu\",handleContextMenu).bind(\"draginit\",handleDragInit).bind(\"dragstart\",{distance:3},handleDragStart).bind(\"drag\",handleDrag).bind(\"dragend\",handleDragEnd).delegate(\".bk-slick-cell\",\"mouseenter\",handleMouseEnter).delegate(\".bk-slick-cell\",\"mouseleave\",handleMouseLeave),navigator.userAgent.toLowerCase().match(/webkit/)&&navigator.userAgent.toLowerCase().match(/macintosh/)&&$canvas.bind(\"mousewheel\",handleMouseWheel))}function registerPlugin(t){plugins.unshift(t),t.init(self)}function unregisterPlugin(t){for(var e=plugins.length;e>=0;e--)if(plugins[e]===t){plugins[e].destroy&&plugins[e].destroy(),plugins.splice(e,1);break}}function setSelectionModel(t){selectionModel&&(selectionModel.onSelectedRangesChanged.unsubscribe(handleSelectedRangesChanged),selectionModel.destroy&&selectionModel.destroy()),selectionModel=t,selectionModel&&(selectionModel.init(self),selectionModel.onSelectedRangesChanged.subscribe(handleSelectedRangesChanged))}function getSelectionModel(){return selectionModel}function getCanvasNode(){return $canvas[0]}function measureScrollbar(){var t=$(\"
\").appendTo(\"body\"),e={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),e}function getHeadersWidth(){for(var t=0,e=0,i=columns.length;eviewportW-scrollbarDimensions.width),$headerRowSpacer.width(canvasWidth+(viewportHasVScroll?scrollbarDimensions.width:0)),(canvasWidth!=e||t)&&applyColumnWidths()}function disableSelection(t){t&&t.jquery&&t.attr(\"unselectable\",\"on\").css(\"MozUserSelect\",\"none\").bind(\"selectstart.ui\",function(){return!1})}function getMaxSupportedCssHeight(){for(var t=1e6,e=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=$(\"
\").appendTo(document.body);;){var n=2*t;if(i.css(\"height\",n),n>e||i.height()!==n)break;t=n}return i.remove(),t}function bindAncestorScrollEvents(){for(var t=$canvas[0];(t=t.parentNode)!=document.body&&null!=t;)if(t==$viewport[0]||t.scrollWidth!=t.clientWidth||t.scrollHeight!=t.clientHeight){var e=$(t);$boundAncestors=$boundAncestors?$boundAncestors.add(e):e,e.bind(\"scroll.\"+uid,handleActiveCellPositionChange)}}function unbindAncestorScrollEvents(){$boundAncestors&&($boundAncestors.unbind(\"scroll.\"+uid),$boundAncestors=null)}function updateColumnHeader(t,e,i){if(initialized){var n=getColumnIndex(t);if(null!=n){var o=columns[n],r=$headers.children().eq(n);r&&(void 0!==e&&(columns[n].name=e),void 0!==i&&(columns[n].toolTip=i),trigger(self.onBeforeHeaderCellDestroy,{node:r[0],column:o}),r.attr(\"title\",i||\"\").children().eq(0).html(e),trigger(self.onHeaderCellRendered,{node:r[0],column:o}))}}}function getHeaderRow(){return $headerRow[0]}function getHeaderRowColumn(t){var e=getColumnIndex(t),i=$headerRow.children().eq(e);return i&&i[0]}function createColumnHeaders(){function t(){$(this).addClass(\"bk-ui-state-hover\")}function e(){$(this).removeClass(\"bk-ui-state-hover\")}$headers.find(\".bk-slick-header-column\").each(function(){var t=$(this).data(\"column\");t&&trigger(self.onBeforeHeaderCellDestroy,{node:this,column:t})}),$headers.empty(),$headers.width(getHeadersWidth()),$headerRow.find(\".bk-slick-headerrow-column\").each(function(){var t=$(this).data(\"column\");t&&trigger(self.onBeforeHeaderRowCellDestroy,{node:this,column:t})}),$headerRow.empty();for(var i=0;i\").html(\"\"+n.name+\"\").width(n.width-headerColumnWidthDiff).attr(\"id\",\"\"+uid+n.id).attr(\"title\",n.toolTip||\"\").data(\"column\",n).addClass(n.headerCssClass||\"\").appendTo($headers);if((options.enableColumnReorder||n.sortable)&&o.on(\"mouseenter\",t).on(\"mouseleave\",e),n.sortable&&(o.addClass(\"bk-slick-header-sortable\"),o.append(\"\")),trigger(self.onHeaderCellRendered,{node:o[0],column:n}),options.showHeaderRow){var r=$(\"
\").data(\"column\",n).appendTo($headerRow);trigger(self.onHeaderRowCellRendered,{node:r[0],column:n})}}setSortColumns(sortColumns),setupColumnResize(),options.enableColumnReorder&&setupColumnReorder()}function setupColumnSort(){$headers.click(function(t){if(t.metaKey=t.metaKey||t.ctrlKey,!$(t.target).hasClass(\"bk-slick-resizable-handle\")){var e=$(t.target).closest(\".bk-slick-header-column\");if(e.length){var i=e.data(\"column\");if(i.sortable){if(!getEditorLock().commitCurrentEdit())return;for(var n=null,o=0;o=l||(t=$(c),$(\"
\").appendTo(c).bind(\"dragstart\",function(t,a){if(!getEditorLock().commitCurrentEdit())return!1;n=t.pageX,$(this).parent().addClass(\"bk-slick-header-column-active\");var l=null,c=null;if(o.each(function(t,e){columns[t].previousWidth=$(e).outerWidth()}),options.forceFitColumns)for(l=0,c=0,e=u+1;e=0;e--)i=columns[e],i.resizable&&(l=Math.max(i.minWidth||0,absoluteColumnMinWidth),c&&i.previousWidth+c=0;e--)i=columns[e],i.resizable&&(c&&i.maxWidth&&i.maxWidth-i.previousWidth
\").appendTo($headers),headerColumnWidthDiff=headerColumnHeightDiff=0,\"border-box\"!=t.css(\"box-sizing\")&&\"border-box\"!=t.css(\"-moz-box-sizing\")&&\"border-box\"!=t.css(\"-webkit-box-sizing\")&&($.each(e,function(e,i){headerColumnWidthDiff+=parseFloat(t.css(i))||0}),$.each(i,function(e,i){headerColumnHeightDiff+=parseFloat(t.css(i))||0})),t.remove();var n=$(\"
\").appendTo($canvas);t=$(\"\").appendTo(n),cellWidthDiff=cellHeightDiff=0,\"border-box\"!=t.css(\"box-sizing\")&&\"border-box\"!=t.css(\"-moz-box-sizing\")&&\"border-box\"!=t.css(\"-webkit-box-sizing\")&&($.each(e,function(e,i){cellWidthDiff+=parseFloat(t.css(i))||0}),$.each(i,function(e,i){cellHeightDiff+=parseFloat(t.css(i))||0})),n.remove(),absoluteColumnMinWidth=Math.max(headerColumnWidthDiff,cellWidthDiff)}function createCssRules(){$style=$(\"\n", "\n", "\n", "
\n", "
\n", "\n", "\n", "
\n", "\n", "
\n", " \n", " \n", "
\n", "\n", "\n", "
\n", "\n", "\n", "
\n", "\n", "\n", "
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import holoviews as hv\n", "hv.extension('bokeh')" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "
\n", "
\n", "
\n", "
" ], "text/plain": [ ":Curve [period] (axis)" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hv.Curve((periods, a), kdims=['period'], vdims=['axis'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's plot the log of $a$ instead:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "
\n", "
\n", "
\n", "
" ], "text/plain": [ ":Curve [period] (axis)" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hv.Curve((periods, np.log(a)), kdims=['period'], vdims=['axis'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Or both as logs." ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "
\n", "
\n", "
\n", "
" ], "text/plain": [ ":Curve [period] (axis)" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hv.Curve((np.log(periods), np.log(a)), kdims=['period'], vdims=['axis'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This seems to work better. Let's find the slope that works best using curve-fit." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "from scipy.optimize import curve_fit" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(array([ 6.66618093e-01, -2.65258044e-04]),\n", " array([[ 3.54437825e-09, -7.73068688e-09],\n", " [-7.73068688e-09, 3.79355644e-08]]))" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "curve_fit(lambda x, a, b: a*x + b, np.log(periods), np.log(a))" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "loglog = hv.Points((np.log(periods), np.log(a)), label='measurements') \n", "loglogfit = hv.Curve((np.log(periods), .66*np.log(periods) -2.65e-4), kdims=['period'], vdims=['axis'], label='model') " ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "
\n", "
\n", "
\n", "
" ], "text/plain": [ ":Overlay\n", " .Curve.Model :Curve [period] (axis)\n", " .Points.Measurements :Points [x,y]" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "loglogfit * loglog" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" }, "toc": { "colors": { "hover_highlight": "#DAA520", "navigate_num": "#000000", "navigate_text": "#333333", "running_highlight": "#FF0000", "selected_highlight": "#FFD700", "sidebar_border": "#EEEEEE", "wrapper_background": "#FFFFFF" }, "moveMenuLeft": true, "nav_menu": { "height": "12px", "width": "252px" }, "navigate_menu": true, "number_sections": true, "sideBar": true, "threshold": 4, "toc_cell": false, "toc_section_display": "block", "toc_window_display": false, "widenNotebook": false } }, "nbformat": 4, "nbformat_minor": 2 }