(function() {
  var fn = function() {
    
    (function(root) {
      function now() {
        return new Date();
      }
    
      var force = false;
    
      if (typeof (root._bokeh_onload_callbacks) === "undefined" || force === true) {
        root._bokeh_onload_callbacks = [];
        root._bokeh_is_loading = undefined;
      }
    
      
      
    
      
      
    
      function run_callbacks() {
        try {
          root._bokeh_onload_callbacks.forEach(function(callback) { callback() });
        }
        finally {
          delete root._bokeh_onload_callbacks
        }
        console.info("Bokeh: all callbacks have finished");
      }
    
      function load_libs(js_urls, callback) {
        root._bokeh_onload_callbacks.push(callback);
        if (root._bokeh_is_loading > 0) {
          console.log("Bokeh: BokehJS is being loaded, scheduling callback at", now());
          return null;
        }
        if (js_urls == null || js_urls.length === 0) {
          run_callbacks();
          return null;
        }
        console.log("Bokeh: BokehJS not loaded, scheduling load and callback at", now());
        root._bokeh_is_loading = js_urls.length;
        for (var i = 0; i < js_urls.length; i++) {
          var url = js_urls[i];
          var s = document.createElement('script');
          s.src = url;
          s.async = false;
          s.onreadystatechange = s.onload = function() {
            root._bokeh_is_loading--;
            if (root._bokeh_is_loading === 0) {
              console.log("Bokeh: all BokehJS libraries loaded");
              run_callbacks()
            }
          };
          s.onerror = function() {
            console.warn("failed to load library " + url);
          };
          console.log("Bokeh: injecting script tag for BokehJS library: ", url);
          document.getElementsByTagName("head")[0].appendChild(s);
        }
      };var element = document.getElementById("856eeeb3-8dc5-407c-9b40-0e1fd27c0002");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid '856eeeb3-8dc5-407c-9b40-0e1fd27c0002' but no matching script tag was found. ")
        return false;
      }
    
      var js_urls = ["https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.js", "https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.js", "https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.js", "https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.9.min.js"];
    
      var inline_js = [
        function(Bokeh) {
          Bokeh.set_log_level("info");
        },
        
        function(Bokeh) {
          
        },
        
        function(Bokeh) {
          (function() {
            var fn = function() {
              Bokeh.safely(function() {
                (function(root) {
                  function embed_document(root) {
                    var docs_json = {"fb5e5a8e-82c4-453b-9d5e-90dc2a6cd8c9":{"roots":{"references":[{"attributes":{"bottom_units":"screen","fill_alpha":{"value":0.5},"fill_color":{"value":"lightgrey"},"left_units":"screen","level":"overlay","line_alpha":{"value":1.0},"line_color":{"value":"black"},"line_dash":[4,4],"line_width":{"value":2},"plot":null,"render_mode":"css","right_units":"screen","top_units":"screen"},"id":"bc303fd1-35a2-4a61-aea5-12438e47ba46","type":"BoxAnnotation"},{"attributes":{"dimension":1,"plot":{"id":"29bf0a93-dcdd-42fb-b253-ca679c626302","subtype":"Figure","type":"Plot"},"ticker":{"id":"70c55965-b0f2-485d-8f75-901f67359e43","type":"BasicTicker"}},"id":"36fa655d-fa09-4c14-a206-56e337d2dd17","type":"Grid"},{"attributes":{"args":{"source":{"id":"af411b81-5d5a-4cbb-b677-693aa56d0e45","type":"ColumnDataSource"}},"code":"\n        // get data source from Callback args\n        var data = source.data;\n\n        /// get BoxSelectTool dimensions from cb_data parameter of Callback\n        var geometry = cb_data['geometry'];\n\n        /// calculate Rect attributes\n        var width = geometry['x1'] - geometry['x0'];\n        var height = geometry['y1'] - geometry['y0'];\n        var x = geometry['x0'] + width/2;\n        var y = geometry['y0'] + height/2;\n\n        /// update data source with new Rect attributes\n        data['x'].push(x);\n        data['y'].push(y);\n        data['width'].push(width);\n        data['height'].push(height);\n\n        // emit update of data source\n        source.change.emit();\n    "},"id":"b7065f41-190b-46fc-a64a-17be2dad6cd5","type":"CustomJS"},{"attributes":{},"id":"2c96ee49-e639-4b98-90bf-498c855990e2","type":"BasicTicker"},{"attributes":{},"id":"9ac0aaa4-0bc9-4478-80f3-6e771c9fd657","type":"BasicTickFormatter"},{"attributes":{},"id":"43bd80f9-8eae-4a29-822f-8a1131cffcba","type":"BasicTickFormatter"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"62750972-04a3-4e6d-9b70-bb635553ade0","type":"BoxSelectTool"}]},"id":"b0c423a5-b9eb-415c-b659-377976690246","type":"Toolbar"},{"attributes":{"callback":{"id":"b7065f41-190b-46fc-a64a-17be2dad6cd5","type":"CustomJS"},"overlay":{"id":"bc303fd1-35a2-4a61-aea5-12438e47ba46","type":"BoxAnnotation"}},"id":"62750972-04a3-4e6d-9b70-bb635553ade0","type":"BoxSelectTool"},{"attributes":{"data_source":{"id":"af411b81-5d5a-4cbb-b677-693aa56d0e45","type":"ColumnDataSource"},"glyph":{"id":"f4c97709-f1a6-41ed-a0e6-770ad36dba82","type":"Rect"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"f4c97709-f1a6-41ed-a0e6-770ad36dba82","type":"Rect"},"selection_glyph":{"id":"f4c97709-f1a6-41ed-a0e6-770ad36dba82","type":"Rect"},"view":{"id":"fe5dc57e-98b7-4f3f-bf71-212fd39730dc","type":"CDSView"}},"id":"b069625a-c827-405d-9608-1876962c3028","type":"GlyphRenderer"},{"attributes":{"source":{"id":"af411b81-5d5a-4cbb-b677-693aa56d0e45","type":"ColumnDataSource"}},"id":"fe5dc57e-98b7-4f3f-bf71-212fd39730dc","type":"CDSView"},{"attributes":{"callback":null},"id":"1ead77e9-4fc7-42fe-b7e0-5afcb22e25cb","type":"Range1d"},{"attributes":{"callback":null},"id":"73ba6c5f-5da2-4d48-a4f8-906b442f73fe","type":"Range1d"},{"attributes":{"below":[{"id":"4212b669-7906-476c-9687-86b6ec41ceba","type":"LinearAxis"}],"left":[{"id":"8fc78519-1bca-4a7c-9458-96fe62b725cc","type":"LinearAxis"}],"plot_height":400,"plot_width":400,"renderers":[{"id":"4212b669-7906-476c-9687-86b6ec41ceba","type":"LinearAxis"},{"id":"5c0f4932-0468-437f-bc4b-04e94cfe72ee","type":"Grid"},{"id":"8fc78519-1bca-4a7c-9458-96fe62b725cc","type":"LinearAxis"},{"id":"36fa655d-fa09-4c14-a206-56e337d2dd17","type":"Grid"},{"id":"bc303fd1-35a2-4a61-aea5-12438e47ba46","type":"BoxAnnotation"},{"id":"b069625a-c827-405d-9608-1876962c3028","type":"GlyphRenderer"}],"title":{"id":"f3ba84ea-2b74-4f1e-be57-2f64cd85f9b1","type":"Title"},"toolbar":{"id":"b0c423a5-b9eb-415c-b659-377976690246","type":"Toolbar"},"x_range":{"id":"1ead77e9-4fc7-42fe-b7e0-5afcb22e25cb","type":"Range1d"},"x_scale":{"id":"338c42c6-023b-42e0-926e-e74abbe4351c","type":"LinearScale"},"y_range":{"id":"73ba6c5f-5da2-4d48-a4f8-906b442f73fe","type":"Range1d"},"y_scale":{"id":"e8eadc7a-4386-46ae-a21e-c8905e0ea042","type":"LinearScale"}},"id":"29bf0a93-dcdd-42fb-b253-ca679c626302","subtype":"Figure","type":"Plot"},{"attributes":{"formatter":{"id":"9ac0aaa4-0bc9-4478-80f3-6e771c9fd657","type":"BasicTickFormatter"},"plot":{"id":"29bf0a93-dcdd-42fb-b253-ca679c626302","subtype":"Figure","type":"Plot"},"ticker":{"id":"70c55965-b0f2-485d-8f75-901f67359e43","type":"BasicTicker"}},"id":"8fc78519-1bca-4a7c-9458-96fe62b725cc","type":"LinearAxis"},{"attributes":{"fill_alpha":{"value":0.3},"fill_color":{"value":"#009933"},"height":{"field":"height","units":"data"},"width":{"field":"width","units":"data"},"x":{"field":"x"},"y":{"field":"y"}},"id":"f4c97709-f1a6-41ed-a0e6-770ad36dba82","type":"Rect"},{"attributes":{},"id":"70c55965-b0f2-485d-8f75-901f67359e43","type":"BasicTicker"},{"attributes":{"plot":null,"text":"Select Below"},"id":"f3ba84ea-2b74-4f1e-be57-2f64cd85f9b1","type":"Title"},{"attributes":{"callback":null,"column_names":["y","width","height","x"],"data":{"height":[],"width":[],"x":[],"y":[]}},"id":"af411b81-5d5a-4cbb-b677-693aa56d0e45","type":"ColumnDataSource"},{"attributes":{"plot":{"id":"29bf0a93-dcdd-42fb-b253-ca679c626302","subtype":"Figure","type":"Plot"},"ticker":{"id":"2c96ee49-e639-4b98-90bf-498c855990e2","type":"BasicTicker"}},"id":"5c0f4932-0468-437f-bc4b-04e94cfe72ee","type":"Grid"},{"attributes":{"formatter":{"id":"43bd80f9-8eae-4a29-822f-8a1131cffcba","type":"BasicTickFormatter"},"plot":{"id":"29bf0a93-dcdd-42fb-b253-ca679c626302","subtype":"Figure","type":"Plot"},"ticker":{"id":"2c96ee49-e639-4b98-90bf-498c855990e2","type":"BasicTicker"}},"id":"4212b669-7906-476c-9687-86b6ec41ceba","type":"LinearAxis"},{"attributes":{},"id":"338c42c6-023b-42e0-926e-e74abbe4351c","type":"LinearScale"},{"attributes":{},"id":"e8eadc7a-4386-46ae-a21e-c8905e0ea042","type":"LinearScale"}],"root_ids":["29bf0a93-dcdd-42fb-b253-ca679c626302"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"fb5e5a8e-82c4-453b-9d5e-90dc2a6cd8c9","elementid":"856eeeb3-8dc5-407c-9b40-0e1fd27c0002","modelid":"29bf0a93-dcdd-42fb-b253-ca679c626302"}];
                
                    root.Bokeh.embed.embed_items(docs_json, render_items);
                  }
                
                  if (root.Bokeh !== undefined) {
                    embed_document(root);
                  } else {
                    var attempts = 0;
                    var timer = setInterval(function(root) {
                      if (root.Bokeh !== undefined) {
                        embed_document(root);
                        clearInterval(timer);
                      }
                      attempts++;
                      if (attempts > 100) {
                        console.log("Bokeh: ERROR: Unable to embed document because BokehJS library is missing")
                        clearInterval(timer);
                      }
                    }, 10, root)
                  }
                })(window);
              });
            };
            if (document.readyState != "loading") fn();
            else document.addEventListener("DOMContentLoaded", fn);
          })();
        },
        function(Bokeh) {
          console.log("Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.css");
          Bokeh.embed.inject_css("https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.css");
          console.log("Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.css");
          Bokeh.embed.inject_css("https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.css");
          console.log("Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.css");
          Bokeh.embed.inject_css("https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.css");
        }
      ];
    
      function run_inline_js() {
        
        for (var i = 0; i < inline_js.length; i++) {
          inline_js[i].call(root, root.Bokeh);
        }
        
      }
    
      if (root._bokeh_is_loading === 0) {
        console.log("Bokeh: BokehJS loaded, going straight to plotting");
        run_inline_js();
      } else {
        load_libs(js_urls, function() {
          console.log("Bokeh: BokehJS plotting callback run at", now());
          run_inline_js();
        });
      }
    }(window));
  };
  if (document.readyState != "loading") fn();
  else document.addEventListener("DOMContentLoaded", fn);
})();
