(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("8e8cf73c-0df6-4742-b376-e30c22953fa5");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid '8e8cf73c-0df6-4742-b376-e30c22953fa5' 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_48bd9f2dd7f04922bb4b6673607e3f1c.my_formatter").MyFormatter,
          "LatexLabel": require("custom/bk_script_66a16298a37e4ee1b0ce5d15ea1f8e3e.latex_label").LatexLabel
              };
              require("base").register_models(models);
              module.exports = models;
            },
            "custom/bk_script_48bd9f2dd7f04922bb4b6673607e3f1c.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_66a16298a37e4ee1b0ce5d15ea1f8e3e.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 = {"6195dae3-6931-4d52-a3f4-66920a640cca":{"roots":{"references":[{"attributes":{},"id":"e215f583-2f0e-4ae5-972d-83cf3fc2afb9","type":"SaveTool"},{"attributes":{"data_source":{"id":"cea5a84b-34d7-4cfd-921c-a819306a3291","type":"ColumnDataSource"},"glyph":{"id":"c10e283e-d1b1-49c5-a885-9febe237bde6","type":"Circle"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"eb3465e2-a02e-49b3-a599-7139fc76e791","type":"Circle"},"selection_glyph":null,"view":{"id":"ef6e2066-f628-47a0-8351-2c4abead9856","type":"CDSView"}},"id":"c8592589-7508-40ed-9c6c-d13ff84b5deb","type":"GlyphRenderer"},{"attributes":{"formatter":{"id":"72328d02-7cba-4afe-9d73-db6222cec52a","type":"MyFormatter"},"plot":{"id":"530792e4-4972-4b61-8a93-88c404599b3d","subtype":"Figure","type":"Plot"},"ticker":{"id":"71875e1e-42e5-4e60-8c02-6c7ba3fa13e3","type":"BasicTicker"}},"id":"0d7c7738-e2eb-45e7-9acd-8b714e0a6245","type":"LinearAxis"},{"attributes":{"formatter":{"id":"e9442e83-37e2-464c-b0d3-085032046bdf","type":"BasicTickFormatter"},"plot":{"id":"530792e4-4972-4b61-8a93-88c404599b3d","subtype":"Figure","type":"Plot"},"ticker":{"id":"79093e0d-f2ef-4395-b3c5-cf34c7d201f3","type":"BasicTicker"}},"id":"3eccd55a-45f4-421c-bea1-bf82eb499b44","type":"LinearAxis"},{"attributes":{},"id":"a5ac2df0-c2f7-40a7-8889-ad470f8eddca","type":"PanTool"},{"attributes":{},"id":"e9442e83-37e2-464c-b0d3-085032046bdf","type":"BasicTickFormatter"},{"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":"eb3465e2-a02e-49b3-a599-7139fc76e791","type":"Circle"},{"attributes":{"callback":null,"column_names":["y","x"],"data":{"x":[1,2,3,4,6],"y":[5,7,3,2,4]}},"id":"cea5a84b-34d7-4cfd-921c-a819306a3291","type":"ColumnDataSource"},{"attributes":{"callback":null},"id":"cf29dbfc-f3bb-4d7f-a19e-81092e60bffa","type":"DataRange1d"},{"attributes":{},"id":"d14c27a2-7d5a-4825-9a49-909e39bccf56","type":"LinearScale"},{"attributes":{"fill_color":{"value":"#1f77b4"},"line_color":{"value":"#1f77b4"},"x":{"field":"x"},"y":{"field":"y"}},"id":"c10e283e-d1b1-49c5-a885-9febe237bde6","type":"Circle"},{"attributes":{"source":{"id":"cea5a84b-34d7-4cfd-921c-a819306a3291","type":"ColumnDataSource"}},"id":"ef6e2066-f628-47a0-8351-2c4abead9856","type":"CDSView"},{"attributes":{"dimension":1,"plot":{"id":"530792e4-4972-4b61-8a93-88c404599b3d","subtype":"Figure","type":"Plot"},"ticker":{"id":"79093e0d-f2ef-4395-b3c5-cf34c7d201f3","type":"BasicTicker"}},"id":"429bf557-cc33-4b87-a2df-f487abe7169a","type":"Grid"},{"attributes":{"below":[{"id":"0d7c7738-e2eb-45e7-9acd-8b714e0a6245","type":"LinearAxis"}],"left":[{"id":"3eccd55a-45f4-421c-bea1-bf82eb499b44","type":"LinearAxis"}],"renderers":[{"id":"0d7c7738-e2eb-45e7-9acd-8b714e0a6245","type":"LinearAxis"},{"id":"cb9ad41b-5cde-4058-92ad-70c7c865e754","type":"Grid"},{"id":"3eccd55a-45f4-421c-bea1-bf82eb499b44","type":"LinearAxis"},{"id":"429bf557-cc33-4b87-a2df-f487abe7169a","type":"Grid"},{"id":"9c771a9d-288d-4741-a587-5b473f7fe263","type":"BoxAnnotation"},{"id":"c8592589-7508-40ed-9c6c-d13ff84b5deb","type":"GlyphRenderer"}],"title":{"id":"c7deb2ed-cef6-4559-95b7-479e055acfbd","type":"Title"},"toolbar":{"id":"6f548e33-f9f2-4457-a687-498f226d38da","type":"Toolbar"},"x_range":{"id":"a0e71996-df6e-4f44-b43f-d88df267fa1d","type":"DataRange1d"},"x_scale":{"id":"f2d148a3-996d-454e-858c-4c4cad6ab85e","type":"LinearScale"},"y_range":{"id":"cf29dbfc-f3bb-4d7f-a19e-81092e60bffa","type":"DataRange1d"},"y_scale":{"id":"d14c27a2-7d5a-4825-9a49-909e39bccf56","type":"LinearScale"}},"id":"530792e4-4972-4b61-8a93-88c404599b3d","subtype":"Figure","type":"Plot"},{"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":"9c771a9d-288d-4741-a587-5b473f7fe263","type":"BoxAnnotation"},{"attributes":{},"id":"70c54aca-5a59-4240-b971-3eec2632bb5e","type":"ResetTool"},{"attributes":{},"id":"71875e1e-42e5-4e60-8c02-6c7ba3fa13e3","type":"BasicTicker"},{"attributes":{},"id":"72328d02-7cba-4afe-9d73-db6222cec52a","type":"MyFormatter"},{"attributes":{"plot":null,"text":""},"id":"c7deb2ed-cef6-4559-95b7-479e055acfbd","type":"Title"},{"attributes":{},"id":"9d6b3a8d-cb7b-481d-b432-21c43b88651e","type":"HelpTool"},{"attributes":{"callback":null},"id":"a0e71996-df6e-4f44-b43f-d88df267fa1d","type":"DataRange1d"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"a5ac2df0-c2f7-40a7-8889-ad470f8eddca","type":"PanTool"},{"id":"ffb7f82a-ad3c-4e6e-a969-b9fdb5eda910","type":"WheelZoomTool"},{"id":"1c9ba4ee-e595-4743-a759-f7ad05d9cdfe","type":"BoxZoomTool"},{"id":"e215f583-2f0e-4ae5-972d-83cf3fc2afb9","type":"SaveTool"},{"id":"70c54aca-5a59-4240-b971-3eec2632bb5e","type":"ResetTool"},{"id":"9d6b3a8d-cb7b-481d-b432-21c43b88651e","type":"HelpTool"}]},"id":"6f548e33-f9f2-4457-a687-498f226d38da","type":"Toolbar"},{"attributes":{},"id":"ffb7f82a-ad3c-4e6e-a969-b9fdb5eda910","type":"WheelZoomTool"},{"attributes":{"plot":{"id":"530792e4-4972-4b61-8a93-88c404599b3d","subtype":"Figure","type":"Plot"},"ticker":{"id":"71875e1e-42e5-4e60-8c02-6c7ba3fa13e3","type":"BasicTicker"}},"id":"cb9ad41b-5cde-4058-92ad-70c7c865e754","type":"Grid"},{"attributes":{"overlay":{"id":"9c771a9d-288d-4741-a587-5b473f7fe263","type":"BoxAnnotation"}},"id":"1c9ba4ee-e595-4743-a759-f7ad05d9cdfe","type":"BoxZoomTool"},{"attributes":{},"id":"f2d148a3-996d-454e-858c-4c4cad6ab85e","type":"LinearScale"},{"attributes":{},"id":"79093e0d-f2ef-4395-b3c5-cf34c7d201f3","type":"BasicTicker"}],"root_ids":["530792e4-4972-4b61-8a93-88c404599b3d"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"6195dae3-6931-4d52-a3f4-66920a640cca","elementid":"8e8cf73c-0df6-4742-b376-e30c22953fa5","modelid":"530792e4-4972-4b61-8a93-88c404599b3d"}];
                
                    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);
})();
