(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("8d97aaed-54b8-4378-866a-9ff2d40dfcee");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid '8d97aaed-54b8-4378-866a-9ff2d40dfcee' but no matching script tag was found. ")
        return false;
      }
    
      var js_urls = ["https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js", "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(root, factory) {
          //  if(typeof exports === 'object' && typeof module === 'object')
          //    factory(require("Bokeh"));
          //  else if(typeof define === 'function' && define.amd)
          //    define(["Bokeh"], factory);
          //  else if(typeof exports === 'object')
          //    factory(require("Bokeh"));
          //  else
              factory(root["Bokeh"]);
          })(this, function(Bokeh) {
            var define;
            return (function outer(modules, entry) {
            if (Bokeh != null) {
              return Bokeh.register_plugin(modules, {}, entry);
            } else {
              throw new Error("Cannot find Bokeh. You have to load it prior to loading plugins.");
            }
          })
          ({
            "custom/main": function(require, module, exports) {
              var models = {
                "MyFormatter": require("custom/bk_script_19e8333060364f84afa0c1ffb433f451.my_formatter").MyFormatter,
          "LatexLabel": require("custom/bk_script_3ae07ca84853402c8d2505982164ff11.latex_label").LatexLabel
              };
              require("base").register_models(models);
              module.exports = models;
            },
            "custom/bk_script_19e8333060364f84afa0c1ffb433f451.my_formatter": function(require, module, exports) {
          "use strict";
          Object.defineProperty(exports, "__esModule", { value: true });
          var extend = function (child, parent) { for (var key in parent) {
              if (hasProp.call(parent, key))
                  child[key] = parent[key];
          } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty;
          var tick_formatter_1 = require("models/formatters/tick_formatter");
          exports.MyFormatter = (function (superClass) {
              extend(MyFormatter, superClass);
              function MyFormatter() {
                  return MyFormatter.__super__.constructor.apply(this, arguments);
              }
              MyFormatter.prototype.type = "MyFormatter";
              MyFormatter.prototype.doFormat = function (ticks) {
                  var formatted, i, j, ref;
                  formatted = ["" + ticks[0]];
                  for (i = j = 1, ref = ticks.length; 1 <= ref ? j < ref : j > ref; i = 1 <= ref ? ++j : --j) {
                      formatted.push("+" + ((ticks[i] - ticks[0]).toPrecision(2)));
                  }
                  return formatted;
              };
              return MyFormatter;
          })(tick_formatter_1.TickFormatter);
          
          },
          "custom/bk_script_3ae07ca84853402c8d2505982164ff11.latex_label": function(require, module, exports) {
          "use strict";
          Object.defineProperty(exports, "__esModule", { value: true });
          var extend = function (child, parent) { for (var key in parent) {
              if (hasProp.call(parent, key))
                  child[key] = parent[key];
          } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty;
          var label_1 = require("models/annotations/label");
          exports.LatexLabelView = (function (superClass) {
              extend(LatexLabelView, superClass);
              function LatexLabelView() {
                  return LatexLabelView.__super__.constructor.apply(this, arguments);
              }
              LatexLabelView.prototype.render = function () {
                  var angle, ctx, panel_offset, sx, sy, vx, vy;
                  ctx = this.plot_view.canvas_view.ctx;
                  switch (this.model.angle_units) {
                      case "rad":
                          angle = -1 * this.model.angle;
                          break;
                      case "deg":
                          angle = -1 * this.model.angle * Math.PI / 180.0;
                  }
                  if (this.model.x_units === "data") {
                      vx = this.xscale.compute(this.model.x);
                  }
                  else {
                      vx = this.model.x;
                  }
                  sx = this.canvas.vx_to_sx(vx);
                  if (this.model.y_units === "data") {
                      vy = this.yscale.compute(this.model.y);
                  }
                  else {
                      vy = this.model.y;
                  }
                  sy = this.canvas.vy_to_sy(vy);
                  if (this.model.panel != null) {
                      panel_offset = this._get_panel_offset();
                      sx += panel_offset.x;
                      sy += panel_offset.y;
                  }
                  this._css_text(ctx, "", sx + this.model.x_offset, sy - this.model.y_offset, angle);
                  return katex.render(this.model.text, this.el, {
                      displayMode: true
                  });
              };
              return LatexLabelView;
          })(label_1.LabelView);
          exports.LatexLabel = (function (superClass) {
              extend(LatexLabel, superClass);
              function LatexLabel() {
                  return LatexLabel.__super__.constructor.apply(this, arguments);
              }
              LatexLabel.prototype.type = 'LatexLabel';
              LatexLabel.prototype.default_view = exports.LatexLabelView;
              return LatexLabel;
          })(label_1.Label);
          
          }
          }, "custom/main");
          ;
          });
        },
        
        function(Bokeh) {
          (function() {
            var fn = function() {
              Bokeh.safely(function() {
                (function(root) {
                  function embed_document(root) {
                    var docs_json = {"9c3ff17a-2e1e-4620-b7d6-64afa639aede":{"roots":{"references":[{"attributes":{"fill_color":{"value":"#1f77b4"},"line_color":{"value":"#1f77b4"},"x":{"field":"x"},"y":{"field":"y"}},"id":"f957facb-cd19-4989-b7f7-bcb3739c4b93","type":"Circle"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"0b511595-a4f3-451c-9edc-1890e47dfc70","type":"PanTool"},{"id":"ae12c0d7-f64f-4a6e-9546-297757807406","type":"WheelZoomTool"},{"id":"467a2ad7-0f39-490e-a8c1-0d5d7a4e5b71","type":"BoxZoomTool"},{"id":"066335a7-6c15-4c25-875b-bd4c685b46a5","type":"SaveTool"},{"id":"7caec7bf-6a87-4774-81b2-8c0a1fbb3d2c","type":"ResetTool"},{"id":"5ab8f805-16a6-4df6-a126-52adc53bb615","type":"HelpTool"}]},"id":"2ee3e220-8c38-4b84-921e-2d869fcad260","type":"Toolbar"},{"attributes":{"formatter":{"id":"581b90e4-8e32-4b5b-9d0d-f0cb36b2859d","type":"BasicTickFormatter"},"plot":{"id":"5ca08ba3-2263-41c5-8b64-8d1b385edd79","subtype":"Figure","type":"Plot"},"ticker":{"id":"3c9032bf-9665-4eb4-a786-8fa07c86b6a2","type":"BasicTicker"}},"id":"e2e001c7-5f8b-4558-b576-1bacc6190045","type":"LinearAxis"},{"attributes":{"callback":null,"column_names":["y","x"],"data":{"x":[1,2,3,4,6],"y":[5,7,3,2,4]}},"id":"8eb97e19-f1d7-4f2d-8a4c-06cdd4f4da59","type":"ColumnDataSource"},{"attributes":{"overlay":{"id":"b373b948-fea5-456c-a2fa-992a72e47b75","type":"BoxAnnotation"}},"id":"467a2ad7-0f39-490e-a8c1-0d5d7a4e5b71","type":"BoxZoomTool"},{"attributes":{},"id":"3c9032bf-9665-4eb4-a786-8fa07c86b6a2","type":"BasicTicker"},{"attributes":{"plot":{"id":"5ca08ba3-2263-41c5-8b64-8d1b385edd79","subtype":"Figure","type":"Plot"},"ticker":{"id":"b88a6473-c0b0-4348-b9b8-81adcb167f77","type":"BasicTicker"}},"id":"f78b2873-e9ad-4a48-98e5-422757e54d15","type":"Grid"},{"attributes":{},"id":"ae12c0d7-f64f-4a6e-9546-297757807406","type":"WheelZoomTool"},{"attributes":{},"id":"581b90e4-8e32-4b5b-9d0d-f0cb36b2859d","type":"BasicTickFormatter"},{"attributes":{"formatter":{"id":"65ec9928-2a61-4196-acff-220245972ca2","type":"MyFormatter"},"plot":{"id":"5ca08ba3-2263-41c5-8b64-8d1b385edd79","subtype":"Figure","type":"Plot"},"ticker":{"id":"b88a6473-c0b0-4348-b9b8-81adcb167f77","type":"BasicTicker"}},"id":"d62fd3af-f996-4740-9ce6-eaf1876e56b5","type":"LinearAxis"},{"attributes":{},"id":"f258b0d1-c64b-49a1-8780-56393b49ae56","type":"LinearScale"},{"attributes":{},"id":"b88a6473-c0b0-4348-b9b8-81adcb167f77","type":"BasicTicker"},{"attributes":{},"id":"7caec7bf-6a87-4774-81b2-8c0a1fbb3d2c","type":"ResetTool"},{"attributes":{"dimension":1,"plot":{"id":"5ca08ba3-2263-41c5-8b64-8d1b385edd79","subtype":"Figure","type":"Plot"},"ticker":{"id":"3c9032bf-9665-4eb4-a786-8fa07c86b6a2","type":"BasicTicker"}},"id":"afef992f-1531-4819-a9b6-d9f938ef83ea","type":"Grid"},{"attributes":{},"id":"65ec9928-2a61-4196-acff-220245972ca2","type":"MyFormatter"},{"attributes":{"below":[{"id":"d62fd3af-f996-4740-9ce6-eaf1876e56b5","type":"LinearAxis"}],"left":[{"id":"e2e001c7-5f8b-4558-b576-1bacc6190045","type":"LinearAxis"}],"renderers":[{"id":"d62fd3af-f996-4740-9ce6-eaf1876e56b5","type":"LinearAxis"},{"id":"f78b2873-e9ad-4a48-98e5-422757e54d15","type":"Grid"},{"id":"e2e001c7-5f8b-4558-b576-1bacc6190045","type":"LinearAxis"},{"id":"afef992f-1531-4819-a9b6-d9f938ef83ea","type":"Grid"},{"id":"b373b948-fea5-456c-a2fa-992a72e47b75","type":"BoxAnnotation"},{"id":"8cdea070-a935-4020-96f4-2568d28dc39c","type":"GlyphRenderer"}],"title":{"id":"f5c6ade7-aa45-4dd2-92a1-d86a85b55b9f","type":"Title"},"toolbar":{"id":"2ee3e220-8c38-4b84-921e-2d869fcad260","type":"Toolbar"},"x_range":{"id":"7b9ea910-bec9-4d44-8b58-db64281037a9","type":"DataRange1d"},"x_scale":{"id":"60572dfc-2420-4cab-8970-2630076c0b41","type":"LinearScale"},"y_range":{"id":"ccded5e8-223d-4c41-9899-cc1554e34ae6","type":"DataRange1d"},"y_scale":{"id":"f258b0d1-c64b-49a1-8780-56393b49ae56","type":"LinearScale"}},"id":"5ca08ba3-2263-41c5-8b64-8d1b385edd79","subtype":"Figure","type":"Plot"},{"attributes":{},"id":"066335a7-6c15-4c25-875b-bd4c685b46a5","type":"SaveTool"},{"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":"b373b948-fea5-456c-a2fa-992a72e47b75","type":"BoxAnnotation"},{"attributes":{"fill_alpha":{"value":0.1},"fill_color":{"value":"#1f77b4"},"line_alpha":{"value":0.1},"line_color":{"value":"#1f77b4"},"x":{"field":"x"},"y":{"field":"y"}},"id":"ee8b6e97-df27-4cb4-a800-4de7401e5d76","type":"Circle"},{"attributes":{},"id":"0b511595-a4f3-451c-9edc-1890e47dfc70","type":"PanTool"},{"attributes":{"plot":null,"text":""},"id":"f5c6ade7-aa45-4dd2-92a1-d86a85b55b9f","type":"Title"},{"attributes":{},"id":"5ab8f805-16a6-4df6-a126-52adc53bb615","type":"HelpTool"},{"attributes":{"callback":null},"id":"7b9ea910-bec9-4d44-8b58-db64281037a9","type":"DataRange1d"},{"attributes":{},"id":"60572dfc-2420-4cab-8970-2630076c0b41","type":"LinearScale"},{"attributes":{"callback":null},"id":"ccded5e8-223d-4c41-9899-cc1554e34ae6","type":"DataRange1d"},{"attributes":{"data_source":{"id":"8eb97e19-f1d7-4f2d-8a4c-06cdd4f4da59","type":"ColumnDataSource"},"glyph":{"id":"f957facb-cd19-4989-b7f7-bcb3739c4b93","type":"Circle"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"ee8b6e97-df27-4cb4-a800-4de7401e5d76","type":"Circle"},"selection_glyph":null,"view":{"id":"c2b237f9-26b7-4693-9836-02d816a636d4","type":"CDSView"}},"id":"8cdea070-a935-4020-96f4-2568d28dc39c","type":"GlyphRenderer"},{"attributes":{"source":{"id":"8eb97e19-f1d7-4f2d-8a4c-06cdd4f4da59","type":"ColumnDataSource"}},"id":"c2b237f9-26b7-4693-9836-02d816a636d4","type":"CDSView"}],"root_ids":["5ca08ba3-2263-41c5-8b64-8d1b385edd79"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"9c3ff17a-2e1e-4620-b7d6-64afa639aede","elementid":"8d97aaed-54b8-4378-866a-9ff2d40dfcee","modelid":"5ca08ba3-2263-41c5-8b64-8d1b385edd79"}];
                
                    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://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css");
          Bokeh.embed.inject_css("https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css");
          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);
})();
