(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("bdf7628e-484e-4b92-98a0-d444649297df");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid 'bdf7628e-484e-4b92-98a0-d444649297df' 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 = {"6251fb19-4cad-4e92-8004-dda109e98189":{"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":"ae6a8a15-b0d3-46b7-9998-dbb74899764c","type":"BoxAnnotation"},{"attributes":{"formatter":{"id":"45d8af64-67bc-4930-86d4-f729dc4fea56","type":"BasicTickFormatter"},"plot":{"id":"0cef3522-222f-476d-ae6c-0e974f3f306d","subtype":"Figure","type":"Plot"},"ticker":{"id":"15c572d3-00a2-4075-9908-787791801550","type":"BasicTicker"}},"id":"e7c3ca23-42dd-4936-acae-3cf01e6cfccb","type":"LinearAxis"},{"attributes":{},"id":"fc18f431-442b-4c61-a9b5-14b7f2b6db80","type":"LinearScale"},{"attributes":{"below":[{"id":"e7c3ca23-42dd-4936-acae-3cf01e6cfccb","type":"LinearAxis"}],"left":[{"id":"c95fe396-b0d1-47ad-9811-00b2bf7e3301","type":"LinearAxis"}],"plot_height":400,"plot_width":400,"renderers":[{"id":"e7c3ca23-42dd-4936-acae-3cf01e6cfccb","type":"LinearAxis"},{"id":"96f94907-bf92-4cea-ad30-626029cccf31","type":"Grid"},{"id":"c95fe396-b0d1-47ad-9811-00b2bf7e3301","type":"LinearAxis"},{"id":"3321c00c-1a4d-4e00-b9b3-3c32c8160399","type":"Grid"},{"id":"ae6a8a15-b0d3-46b7-9998-dbb74899764c","type":"BoxAnnotation"},{"id":"0046beca-2677-4022-a5c6-a434f5582cd8","type":"GlyphRenderer"}],"title":{"id":"1497819f-fdc1-4583-bf00-63a92189e019","type":"Title"},"toolbar":{"id":"0dd592cd-7db3-4d40-8043-e797610ba56e","type":"Toolbar"},"x_range":{"id":"a3440050-0741-464f-a81d-93130907f313","type":"Range1d"},"x_scale":{"id":"d819f84e-a042-4a45-a9cb-0f23c2dc3812","type":"LinearScale"},"y_range":{"id":"2e007ea1-d30a-4980-9d13-d3d7ec1b7702","type":"Range1d"},"y_scale":{"id":"fc18f431-442b-4c61-a9b5-14b7f2b6db80","type":"LinearScale"}},"id":"0cef3522-222f-476d-ae6c-0e974f3f306d","subtype":"Figure","type":"Plot"},{"attributes":{"args":{"source":{"id":"6119da66-27bb-4cc3-9a7d-c126d532194b","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":"d5562d18-5fc1-48ce-a365-cf6b64b7f9f3","type":"CustomJS"},{"attributes":{"plot":null,"text":"Select Below"},"id":"1497819f-fdc1-4583-bf00-63a92189e019","type":"Title"},{"attributes":{},"id":"15c572d3-00a2-4075-9908-787791801550","type":"BasicTicker"},{"attributes":{"source":{"id":"6119da66-27bb-4cc3-9a7d-c126d532194b","type":"ColumnDataSource"}},"id":"d14ae8c5-64d6-4f67-91d2-d9f389184cc8","type":"CDSView"},{"attributes":{"callback":null,"column_names":["y","width","height","x"],"data":{"height":[],"width":[],"x":[],"y":[]}},"id":"6119da66-27bb-4cc3-9a7d-c126d532194b","type":"ColumnDataSource"},{"attributes":{"formatter":{"id":"0e48043e-4658-45d8-ae42-a9e795bf54f8","type":"BasicTickFormatter"},"plot":{"id":"0cef3522-222f-476d-ae6c-0e974f3f306d","subtype":"Figure","type":"Plot"},"ticker":{"id":"b9b4cf1f-98e9-4fa8-8b12-eac0438232e9","type":"BasicTicker"}},"id":"c95fe396-b0d1-47ad-9811-00b2bf7e3301","type":"LinearAxis"},{"attributes":{},"id":"0e48043e-4658-45d8-ae42-a9e795bf54f8","type":"BasicTickFormatter"},{"attributes":{"plot":{"id":"0cef3522-222f-476d-ae6c-0e974f3f306d","subtype":"Figure","type":"Plot"},"ticker":{"id":"15c572d3-00a2-4075-9908-787791801550","type":"BasicTicker"}},"id":"96f94907-bf92-4cea-ad30-626029cccf31","type":"Grid"},{"attributes":{"callback":{"id":"d5562d18-5fc1-48ce-a365-cf6b64b7f9f3","type":"CustomJS"},"overlay":{"id":"ae6a8a15-b0d3-46b7-9998-dbb74899764c","type":"BoxAnnotation"}},"id":"2a9d5851-c0d7-4d1a-ab02-992a356ab0c7","type":"BoxSelectTool"},{"attributes":{"dimension":1,"plot":{"id":"0cef3522-222f-476d-ae6c-0e974f3f306d","subtype":"Figure","type":"Plot"},"ticker":{"id":"b9b4cf1f-98e9-4fa8-8b12-eac0438232e9","type":"BasicTicker"}},"id":"3321c00c-1a4d-4e00-b9b3-3c32c8160399","type":"Grid"},{"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":"918fb204-fc62-4a00-9aa5-f9ec57884e69","type":"Rect"},{"attributes":{},"id":"b9b4cf1f-98e9-4fa8-8b12-eac0438232e9","type":"BasicTicker"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"2a9d5851-c0d7-4d1a-ab02-992a356ab0c7","type":"BoxSelectTool"}]},"id":"0dd592cd-7db3-4d40-8043-e797610ba56e","type":"Toolbar"},{"attributes":{"callback":null},"id":"2e007ea1-d30a-4980-9d13-d3d7ec1b7702","type":"Range1d"},{"attributes":{"data_source":{"id":"6119da66-27bb-4cc3-9a7d-c126d532194b","type":"ColumnDataSource"},"glyph":{"id":"918fb204-fc62-4a00-9aa5-f9ec57884e69","type":"Rect"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"918fb204-fc62-4a00-9aa5-f9ec57884e69","type":"Rect"},"selection_glyph":{"id":"918fb204-fc62-4a00-9aa5-f9ec57884e69","type":"Rect"},"view":{"id":"d14ae8c5-64d6-4f67-91d2-d9f389184cc8","type":"CDSView"}},"id":"0046beca-2677-4022-a5c6-a434f5582cd8","type":"GlyphRenderer"},{"attributes":{},"id":"d819f84e-a042-4a45-a9cb-0f23c2dc3812","type":"LinearScale"},{"attributes":{},"id":"45d8af64-67bc-4930-86d4-f729dc4fea56","type":"BasicTickFormatter"},{"attributes":{"callback":null},"id":"a3440050-0741-464f-a81d-93130907f313","type":"Range1d"}],"root_ids":["0cef3522-222f-476d-ae6c-0e974f3f306d"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"6251fb19-4cad-4e92-8004-dda109e98189","elementid":"bdf7628e-484e-4b92-98a0-d444649297df","modelid":"0cef3522-222f-476d-ae6c-0e974f3f306d"}];
                
                    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);
})();
