(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("4491a149-ae26-4d1f-9c96-1c9d41cb58b0");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid '4491a149-ae26-4d1f-9c96-1c9d41cb58b0' 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 = {"f3896403-1902-49a5-8b45-2262c03d6e37":{"roots":{"references":[{"attributes":{"callback":null},"id":"b5ae5188-cca8-4e9a-a3a3-10d9ae410ef3","type":"Range1d"},{"attributes":{"callback":{"id":"6443f07c-eaaf-474f-8930-005ada2637f4","type":"CustomJS"},"overlay":{"id":"f27ccfe4-c70d-4b07-a2ac-a979f810caac","type":"BoxAnnotation"}},"id":"bbf126aa-46ed-483b-9bc5-10d37779a467","type":"BoxSelectTool"},{"attributes":{"formatter":{"id":"addb5ab7-1eca-4cd4-95a3-0b2fff00b809","type":"BasicTickFormatter"},"plot":{"id":"4329422f-8161-491b-b1e9-2715a8855b69","subtype":"Figure","type":"Plot"},"ticker":{"id":"ff6970cb-f233-4c0a-b508-6216622ee0f3","type":"BasicTicker"}},"id":"ede830a9-aab9-4af5-a8bb-3bd457ddebe6","type":"LinearAxis"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"bbf126aa-46ed-483b-9bc5-10d37779a467","type":"BoxSelectTool"}]},"id":"cd345788-46a7-4406-b551-24b83f2ca40c","type":"Toolbar"},{"attributes":{},"id":"efc1480c-3389-49c6-ab49-c075a50a1d80","type":"LinearScale"},{"attributes":{"args":{"source":{"id":"954fa987-1f93-476d-b6e1-380db02dc0f4","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":"6443f07c-eaaf-474f-8930-005ada2637f4","type":"CustomJS"},{"attributes":{"callback":null,"column_names":["y","width","height","x"],"data":{"height":[],"width":[],"x":[],"y":[]}},"id":"954fa987-1f93-476d-b6e1-380db02dc0f4","type":"ColumnDataSource"},{"attributes":{},"id":"27957af4-42e6-42d1-8ace-6eed5856bb75","type":"BasicTicker"},{"attributes":{"plot":{"id":"4329422f-8161-491b-b1e9-2715a8855b69","subtype":"Figure","type":"Plot"},"ticker":{"id":"ff6970cb-f233-4c0a-b508-6216622ee0f3","type":"BasicTicker"}},"id":"80d88ff1-eabc-43be-a605-839092a3c381","type":"Grid"},{"attributes":{"callback":null},"id":"31ccea7d-efda-4cc1-989b-397ed2ecb812","type":"Range1d"},{"attributes":{"source":{"id":"954fa987-1f93-476d-b6e1-380db02dc0f4","type":"ColumnDataSource"}},"id":"631cfce0-083c-407e-b4ca-35b69f555a73","type":"CDSView"},{"attributes":{},"id":"addb5ab7-1eca-4cd4-95a3-0b2fff00b809","type":"BasicTickFormatter"},{"attributes":{},"id":"cc6b6e9f-236d-475d-8284-0b56175cdc58","type":"LinearScale"},{"attributes":{"dimension":1,"plot":{"id":"4329422f-8161-491b-b1e9-2715a8855b69","subtype":"Figure","type":"Plot"},"ticker":{"id":"27957af4-42e6-42d1-8ace-6eed5856bb75","type":"BasicTicker"}},"id":"d116f611-4b9d-4c3a-a1d9-c90e0e1fd48d","type":"Grid"},{"attributes":{"data_source":{"id":"954fa987-1f93-476d-b6e1-380db02dc0f4","type":"ColumnDataSource"},"glyph":{"id":"551f49fd-3b40-4ed9-bec1-23a342a1acc4","type":"Rect"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"551f49fd-3b40-4ed9-bec1-23a342a1acc4","type":"Rect"},"selection_glyph":{"id":"551f49fd-3b40-4ed9-bec1-23a342a1acc4","type":"Rect"},"view":{"id":"631cfce0-083c-407e-b4ca-35b69f555a73","type":"CDSView"}},"id":"9041cc8f-46ca-46b4-ba11-60cd6193472f","type":"GlyphRenderer"},{"attributes":{},"id":"245a2e84-49c0-4801-a1c9-b119e44e18e5","type":"BasicTickFormatter"},{"attributes":{"below":[{"id":"ede830a9-aab9-4af5-a8bb-3bd457ddebe6","type":"LinearAxis"}],"left":[{"id":"85155679-d4d7-4367-bec5-628c552805c3","type":"LinearAxis"}],"plot_height":400,"plot_width":400,"renderers":[{"id":"ede830a9-aab9-4af5-a8bb-3bd457ddebe6","type":"LinearAxis"},{"id":"80d88ff1-eabc-43be-a605-839092a3c381","type":"Grid"},{"id":"85155679-d4d7-4367-bec5-628c552805c3","type":"LinearAxis"},{"id":"d116f611-4b9d-4c3a-a1d9-c90e0e1fd48d","type":"Grid"},{"id":"f27ccfe4-c70d-4b07-a2ac-a979f810caac","type":"BoxAnnotation"},{"id":"9041cc8f-46ca-46b4-ba11-60cd6193472f","type":"GlyphRenderer"}],"title":{"id":"a327ccc3-3c34-4d47-a389-649ff81d9894","type":"Title"},"toolbar":{"id":"cd345788-46a7-4406-b551-24b83f2ca40c","type":"Toolbar"},"x_range":{"id":"31ccea7d-efda-4cc1-989b-397ed2ecb812","type":"Range1d"},"x_scale":{"id":"efc1480c-3389-49c6-ab49-c075a50a1d80","type":"LinearScale"},"y_range":{"id":"b5ae5188-cca8-4e9a-a3a3-10d9ae410ef3","type":"Range1d"},"y_scale":{"id":"cc6b6e9f-236d-475d-8284-0b56175cdc58","type":"LinearScale"}},"id":"4329422f-8161-491b-b1e9-2715a8855b69","subtype":"Figure","type":"Plot"},{"attributes":{"plot":null,"text":"Select Below"},"id":"a327ccc3-3c34-4d47-a389-649ff81d9894","type":"Title"},{"attributes":{},"id":"ff6970cb-f233-4c0a-b508-6216622ee0f3","type":"BasicTicker"},{"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":"551f49fd-3b40-4ed9-bec1-23a342a1acc4","type":"Rect"},{"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":"f27ccfe4-c70d-4b07-a2ac-a979f810caac","type":"BoxAnnotation"},{"attributes":{"formatter":{"id":"245a2e84-49c0-4801-a1c9-b119e44e18e5","type":"BasicTickFormatter"},"plot":{"id":"4329422f-8161-491b-b1e9-2715a8855b69","subtype":"Figure","type":"Plot"},"ticker":{"id":"27957af4-42e6-42d1-8ace-6eed5856bb75","type":"BasicTicker"}},"id":"85155679-d4d7-4367-bec5-628c552805c3","type":"LinearAxis"}],"root_ids":["4329422f-8161-491b-b1e9-2715a8855b69"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"f3896403-1902-49a5-8b45-2262c03d6e37","elementid":"4491a149-ae26-4d1f-9c96-1c9d41cb58b0","modelid":"4329422f-8161-491b-b1e9-2715a8855b69"}];
                
                    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);
})();
