(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("426faf9b-b9cc-4fe9-b026-05fd73cae0a0");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid '426faf9b-b9cc-4fe9-b026-05fd73cae0a0' 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 = {"735bc1a9-8cbf-4a8c-b380-3b970998c5a7":{"roots":{"references":[{"attributes":{"callback":null},"id":"c9fb871e-0d34-4463-b85f-75f24dace4f4","type":"Range1d"},{"attributes":{"args":{"source":{"id":"478ad844-1594-4745-8a04-d6077a092f4c","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":"c62cccd4-1c6f-41d1-9d68-0f0aec7409e3","type":"CustomJS"},{"attributes":{"callback":{"id":"c62cccd4-1c6f-41d1-9d68-0f0aec7409e3","type":"CustomJS"},"overlay":{"id":"2b5ccd96-2c26-4189-b61a-f0f08308fe78","type":"BoxAnnotation"}},"id":"cd0bb138-6e89-4815-80fd-aa5f3a720af3","type":"BoxSelectTool"},{"attributes":{},"id":"b56824b5-88be-4f44-b510-e45eb54fa606","type":"LinearScale"},{"attributes":{"dimension":1,"plot":{"id":"8e301156-96f7-4b6a-89ec-50284d2dc3df","subtype":"Figure","type":"Plot"},"ticker":{"id":"98fe4585-f842-40d4-9acd-e81721d6eb30","type":"BasicTicker"}},"id":"0ae088e3-ae2a-4fda-ab45-9a567b045644","type":"Grid"},{"attributes":{"source":{"id":"478ad844-1594-4745-8a04-d6077a092f4c","type":"ColumnDataSource"}},"id":"c16a0685-ae99-4276-9e1f-5496fa8e90fe","type":"CDSView"},{"attributes":{"formatter":{"id":"ed3db16c-1348-4bac-bf96-8bfc6845c6c5","type":"BasicTickFormatter"},"plot":{"id":"8e301156-96f7-4b6a-89ec-50284d2dc3df","subtype":"Figure","type":"Plot"},"ticker":{"id":"d245a01f-f19a-44dd-a24d-7bfcb8310253","type":"BasicTicker"}},"id":"9a64ced6-6ff0-4cd6-a076-331cecc4eacb","type":"LinearAxis"},{"attributes":{},"id":"98fe4585-f842-40d4-9acd-e81721d6eb30","type":"BasicTicker"},{"attributes":{},"id":"d245a01f-f19a-44dd-a24d-7bfcb8310253","type":"BasicTicker"},{"attributes":{"plot":{"id":"8e301156-96f7-4b6a-89ec-50284d2dc3df","subtype":"Figure","type":"Plot"},"ticker":{"id":"d245a01f-f19a-44dd-a24d-7bfcb8310253","type":"BasicTicker"}},"id":"1b432894-7e5e-440d-820d-6dfef5347d2a","type":"Grid"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"cd0bb138-6e89-4815-80fd-aa5f3a720af3","type":"BoxSelectTool"}]},"id":"212d6b15-f1f5-4ca6-97fd-945e8dc2fe7a","type":"Toolbar"},{"attributes":{"callback":null,"column_names":["y","width","height","x"],"data":{"height":[],"width":[],"x":[],"y":[]}},"id":"478ad844-1594-4745-8a04-d6077a092f4c","type":"ColumnDataSource"},{"attributes":{},"id":"60cb4190-35b9-48c2-959c-5511bc9f490e","type":"LinearScale"},{"attributes":{"data_source":{"id":"478ad844-1594-4745-8a04-d6077a092f4c","type":"ColumnDataSource"},"glyph":{"id":"fd6a2f58-dccd-4242-a14f-1402641b1e38","type":"Rect"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"fd6a2f58-dccd-4242-a14f-1402641b1e38","type":"Rect"},"selection_glyph":{"id":"fd6a2f58-dccd-4242-a14f-1402641b1e38","type":"Rect"},"view":{"id":"c16a0685-ae99-4276-9e1f-5496fa8e90fe","type":"CDSView"}},"id":"24559215-a1fe-4974-b950-c8904f4eb595","type":"GlyphRenderer"},{"attributes":{"plot":null,"text":"Select Below"},"id":"d466fc71-ceee-4446-9942-3281b81221cf","type":"Title"},{"attributes":{},"id":"ed3db16c-1348-4bac-bf96-8bfc6845c6c5","type":"BasicTickFormatter"},{"attributes":{"below":[{"id":"9a64ced6-6ff0-4cd6-a076-331cecc4eacb","type":"LinearAxis"}],"left":[{"id":"b80c1c5d-0a32-4396-8c4a-21bd08d4e740","type":"LinearAxis"}],"plot_height":400,"plot_width":400,"renderers":[{"id":"9a64ced6-6ff0-4cd6-a076-331cecc4eacb","type":"LinearAxis"},{"id":"1b432894-7e5e-440d-820d-6dfef5347d2a","type":"Grid"},{"id":"b80c1c5d-0a32-4396-8c4a-21bd08d4e740","type":"LinearAxis"},{"id":"0ae088e3-ae2a-4fda-ab45-9a567b045644","type":"Grid"},{"id":"2b5ccd96-2c26-4189-b61a-f0f08308fe78","type":"BoxAnnotation"},{"id":"24559215-a1fe-4974-b950-c8904f4eb595","type":"GlyphRenderer"}],"title":{"id":"d466fc71-ceee-4446-9942-3281b81221cf","type":"Title"},"toolbar":{"id":"212d6b15-f1f5-4ca6-97fd-945e8dc2fe7a","type":"Toolbar"},"x_range":{"id":"12a77a1e-c37f-447b-aaec-d1099e72b15b","type":"Range1d"},"x_scale":{"id":"b56824b5-88be-4f44-b510-e45eb54fa606","type":"LinearScale"},"y_range":{"id":"c9fb871e-0d34-4463-b85f-75f24dace4f4","type":"Range1d"},"y_scale":{"id":"60cb4190-35b9-48c2-959c-5511bc9f490e","type":"LinearScale"}},"id":"8e301156-96f7-4b6a-89ec-50284d2dc3df","subtype":"Figure","type":"Plot"},{"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":"fd6a2f58-dccd-4242-a14f-1402641b1e38","type":"Rect"},{"attributes":{"callback":null},"id":"12a77a1e-c37f-447b-aaec-d1099e72b15b","type":"Range1d"},{"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":"2b5ccd96-2c26-4189-b61a-f0f08308fe78","type":"BoxAnnotation"},{"attributes":{"formatter":{"id":"cd0531a6-340e-4e13-b253-bfac6edaa258","type":"BasicTickFormatter"},"plot":{"id":"8e301156-96f7-4b6a-89ec-50284d2dc3df","subtype":"Figure","type":"Plot"},"ticker":{"id":"98fe4585-f842-40d4-9acd-e81721d6eb30","type":"BasicTicker"}},"id":"b80c1c5d-0a32-4396-8c4a-21bd08d4e740","type":"LinearAxis"},{"attributes":{},"id":"cd0531a6-340e-4e13-b253-bfac6edaa258","type":"BasicTickFormatter"}],"root_ids":["8e301156-96f7-4b6a-89ec-50284d2dc3df"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"735bc1a9-8cbf-4a8c-b380-3b970998c5a7","elementid":"426faf9b-b9cc-4fe9-b026-05fd73cae0a0","modelid":"8e301156-96f7-4b6a-89ec-50284d2dc3df"}];
                
                    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);
})();
