(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("388f23a6-6915-4f9b-9162-43aa0c1be74b");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid '388f23a6-6915-4f9b-9162-43aa0c1be74b' 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 = {"3ccb9920-69b1-4da7-ad5c-9f9628706cdf":{"roots":{"references":[{"attributes":{"plot":null,"text":"Select Below"},"id":"4c9ab7b1-27c1-4c88-85dd-16ff640dc92a","type":"Title"},{"attributes":{},"id":"93388a0b-8815-4c59-88b8-baf0d2eb1775","type":"BasicTickFormatter"},{"attributes":{},"id":"dfe94549-0c6a-473a-8110-936717080db4","type":"BasicTicker"},{"attributes":{},"id":"51453890-e627-44b9-abb3-eac5e9c23844","type":"LinearScale"},{"attributes":{"callback":null},"id":"c09c48ea-a82f-4c57-9158-af1e379e359c","type":"Range1d"},{"attributes":{"dimension":1,"plot":{"id":"6e127e22-07a3-45c8-b581-9230aa3354ca","subtype":"Figure","type":"Plot"},"ticker":{"id":"dfe94549-0c6a-473a-8110-936717080db4","type":"BasicTicker"}},"id":"7291f4a4-48aa-4070-bf68-a5c32595f7b0","type":"Grid"},{"attributes":{"formatter":{"id":"2d14508e-59e7-44eb-9c6d-5e8d4e1b10fd","type":"BasicTickFormatter"},"plot":{"id":"6e127e22-07a3-45c8-b581-9230aa3354ca","subtype":"Figure","type":"Plot"},"ticker":{"id":"dfe94549-0c6a-473a-8110-936717080db4","type":"BasicTicker"}},"id":"a502f87a-d6a9-4f82-a692-26e94cbb38b2","type":"LinearAxis"},{"attributes":{},"id":"a1354da2-fdd3-44ab-ad9e-30ec2918f752","type":"LinearScale"},{"attributes":{"args":{"source":{"id":"194211e4-2c74-43d7-8491-f85067daf017","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":"420cf387-fcf3-4861-a312-7ca80fae33bb","type":"CustomJS"},{"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":"128b4337-966c-47af-a061-147b814bed0c","type":"Rect"},{"attributes":{"callback":{"id":"420cf387-fcf3-4861-a312-7ca80fae33bb","type":"CustomJS"},"overlay":{"id":"4ee0f41c-11a3-4438-adee-22b3a7b5b15e","type":"BoxAnnotation"}},"id":"164c18b3-7415-47a4-b75b-b5851fd9976f","type":"BoxSelectTool"},{"attributes":{},"id":"54b97898-dadd-4cd8-8bfe-9c98689fd528","type":"BasicTicker"},{"attributes":{"callback":null,"column_names":["y","width","height","x"],"data":{"height":[],"width":[],"x":[],"y":[]}},"id":"194211e4-2c74-43d7-8491-f85067daf017","type":"ColumnDataSource"},{"attributes":{"below":[{"id":"f1606e87-ecbd-4df6-bd5e-92a3ca517300","type":"LinearAxis"}],"left":[{"id":"a502f87a-d6a9-4f82-a692-26e94cbb38b2","type":"LinearAxis"}],"plot_height":400,"plot_width":400,"renderers":[{"id":"f1606e87-ecbd-4df6-bd5e-92a3ca517300","type":"LinearAxis"},{"id":"624d6c2d-3b02-4dd5-ba3a-4715077c96ea","type":"Grid"},{"id":"a502f87a-d6a9-4f82-a692-26e94cbb38b2","type":"LinearAxis"},{"id":"7291f4a4-48aa-4070-bf68-a5c32595f7b0","type":"Grid"},{"id":"4ee0f41c-11a3-4438-adee-22b3a7b5b15e","type":"BoxAnnotation"},{"id":"f726b486-0325-459b-b000-7f1ee504f020","type":"GlyphRenderer"}],"title":{"id":"4c9ab7b1-27c1-4c88-85dd-16ff640dc92a","type":"Title"},"toolbar":{"id":"592dec77-e5e3-4638-b7c2-fa5181f5fb46","type":"Toolbar"},"x_range":{"id":"86d10b7d-9f07-4ed5-aaf7-c990821e642d","type":"Range1d"},"x_scale":{"id":"51453890-e627-44b9-abb3-eac5e9c23844","type":"LinearScale"},"y_range":{"id":"c09c48ea-a82f-4c57-9158-af1e379e359c","type":"Range1d"},"y_scale":{"id":"a1354da2-fdd3-44ab-ad9e-30ec2918f752","type":"LinearScale"}},"id":"6e127e22-07a3-45c8-b581-9230aa3354ca","subtype":"Figure","type":"Plot"},{"attributes":{"source":{"id":"194211e4-2c74-43d7-8491-f85067daf017","type":"ColumnDataSource"}},"id":"628a04e6-ecce-4cac-adf2-e65657d1d05c","type":"CDSView"},{"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":"4ee0f41c-11a3-4438-adee-22b3a7b5b15e","type":"BoxAnnotation"},{"attributes":{"data_source":{"id":"194211e4-2c74-43d7-8491-f85067daf017","type":"ColumnDataSource"},"glyph":{"id":"128b4337-966c-47af-a061-147b814bed0c","type":"Rect"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"128b4337-966c-47af-a061-147b814bed0c","type":"Rect"},"selection_glyph":{"id":"128b4337-966c-47af-a061-147b814bed0c","type":"Rect"},"view":{"id":"628a04e6-ecce-4cac-adf2-e65657d1d05c","type":"CDSView"}},"id":"f726b486-0325-459b-b000-7f1ee504f020","type":"GlyphRenderer"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"164c18b3-7415-47a4-b75b-b5851fd9976f","type":"BoxSelectTool"}]},"id":"592dec77-e5e3-4638-b7c2-fa5181f5fb46","type":"Toolbar"},{"attributes":{},"id":"2d14508e-59e7-44eb-9c6d-5e8d4e1b10fd","type":"BasicTickFormatter"},{"attributes":{"plot":{"id":"6e127e22-07a3-45c8-b581-9230aa3354ca","subtype":"Figure","type":"Plot"},"ticker":{"id":"54b97898-dadd-4cd8-8bfe-9c98689fd528","type":"BasicTicker"}},"id":"624d6c2d-3b02-4dd5-ba3a-4715077c96ea","type":"Grid"},{"attributes":{"formatter":{"id":"93388a0b-8815-4c59-88b8-baf0d2eb1775","type":"BasicTickFormatter"},"plot":{"id":"6e127e22-07a3-45c8-b581-9230aa3354ca","subtype":"Figure","type":"Plot"},"ticker":{"id":"54b97898-dadd-4cd8-8bfe-9c98689fd528","type":"BasicTicker"}},"id":"f1606e87-ecbd-4df6-bd5e-92a3ca517300","type":"LinearAxis"},{"attributes":{"callback":null},"id":"86d10b7d-9f07-4ed5-aaf7-c990821e642d","type":"Range1d"}],"root_ids":["6e127e22-07a3-45c8-b581-9230aa3354ca"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"3ccb9920-69b1-4da7-ad5c-9f9628706cdf","elementid":"388f23a6-6915-4f9b-9162-43aa0c1be74b","modelid":"6e127e22-07a3-45c8-b581-9230aa3354ca"}];
                
                    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);
})();
