(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("3dffbfa5-915b-4f5b-b831-95bb8398a7f8");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid '3dffbfa5-915b-4f5b-b831-95bb8398a7f8' 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 = {
                "LatexLabel": require("custom/bk_script_bfb9623b3cb142b39dad9fa1403dc95a.latex_label").LatexLabel,
          "MyFormatter": require("custom/bk_script_de11d510a75f413fb86b6e84959f4258.my_formatter").MyFormatter
              };
              require("base").register_models(models);
              module.exports = models;
            },
            "custom/bk_script_bfb9623b3cb142b39dad9fa1403dc95a.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/bk_script_de11d510a75f413fb86b6e84959f4258.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/main");
          ;
          });
        },
        
        function(Bokeh) {
          (function() {
            var fn = function() {
              Bokeh.safely(function() {
                (function(root) {
                  function embed_document(root) {
                    var docs_json = {"d44217ae-0ea7-4bd7-95b9-167ca6ff2c91":{"roots":{"references":[{"attributes":{},"id":"4db86704-e499-4652-9722-013560d561e0","type":"LinearScale"},{"attributes":{"overlay":{"id":"c3b36c3c-ca8e-4b77-9ba4-cc7b35465bb4","type":"BoxAnnotation"}},"id":"02c68c82-dcee-4641-8543-f1dfc578a38a","type":"BoxZoomTool"},{"attributes":{},"id":"6536b3f6-38ca-41a5-870d-d25d1f620bdb","type":"WheelZoomTool"},{"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":"c3b36c3c-ca8e-4b77-9ba4-cc7b35465bb4","type":"BoxAnnotation"},{"attributes":{},"id":"967cdcae-6b61-4f57-b01d-19a1114db68e","type":"BasicTicker"},{"attributes":{},"id":"dd5cc614-c919-4c9d-a04a-c3893acbc111","type":"BasicTicker"},{"attributes":{},"id":"b791ef50-358e-4f85-9fcf-f66bce48e4d3","type":"LinearScale"},{"attributes":{"callback":null,"column_names":["y","x"],"data":{"x":[1,2,3,4,6],"y":[5,7,3,2,4]}},"id":"f80ea72d-1bf3-48af-baa2-f46e0e20e31e","type":"ColumnDataSource"},{"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":"11b01a5f-c063-4abc-88d6-6374b799a10e","type":"Circle"},{"attributes":{"plot":{"id":"2e2bad3b-f0e5-4c34-82a6-bef824810cf4","subtype":"Figure","type":"Plot"},"ticker":{"id":"967cdcae-6b61-4f57-b01d-19a1114db68e","type":"BasicTicker"}},"id":"cb128ec6-2d28-4c30-a6ef-a6670d1c6206","type":"Grid"},{"attributes":{"source":{"id":"f80ea72d-1bf3-48af-baa2-f46e0e20e31e","type":"ColumnDataSource"}},"id":"6555f989-0100-4a68-8d18-041f07e66ad4","type":"CDSView"},{"attributes":{"below":[{"id":"34487519-d3fa-4586-9772-ded8c18a0d45","type":"LinearAxis"}],"left":[{"id":"0968fb44-a6a3-47e7-a31e-f7be2f5584ba","type":"LinearAxis"}],"renderers":[{"id":"34487519-d3fa-4586-9772-ded8c18a0d45","type":"LinearAxis"},{"id":"cb128ec6-2d28-4c30-a6ef-a6670d1c6206","type":"Grid"},{"id":"0968fb44-a6a3-47e7-a31e-f7be2f5584ba","type":"LinearAxis"},{"id":"e868cb9f-e5a3-419c-8ac4-ea979870c84d","type":"Grid"},{"id":"c3b36c3c-ca8e-4b77-9ba4-cc7b35465bb4","type":"BoxAnnotation"},{"id":"39b82515-f807-433c-b8a4-3f9b06f64761","type":"GlyphRenderer"}],"title":{"id":"210f48a6-373e-430b-89a9-36c0008a48ab","type":"Title"},"toolbar":{"id":"60f1d593-80ed-4861-a9c8-c73875557477","type":"Toolbar"},"x_range":{"id":"f26c9064-ff6c-4076-9698-78917a61a02b","type":"DataRange1d"},"x_scale":{"id":"b791ef50-358e-4f85-9fcf-f66bce48e4d3","type":"LinearScale"},"y_range":{"id":"28442725-9f49-4753-aed4-ac5bc44d0d47","type":"DataRange1d"},"y_scale":{"id":"4db86704-e499-4652-9722-013560d561e0","type":"LinearScale"}},"id":"2e2bad3b-f0e5-4c34-82a6-bef824810cf4","subtype":"Figure","type":"Plot"},{"attributes":{"data_source":{"id":"f80ea72d-1bf3-48af-baa2-f46e0e20e31e","type":"ColumnDataSource"},"glyph":{"id":"c07498e0-5286-465b-b50b-be4c76065a10","type":"Circle"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"11b01a5f-c063-4abc-88d6-6374b799a10e","type":"Circle"},"selection_glyph":null,"view":{"id":"6555f989-0100-4a68-8d18-041f07e66ad4","type":"CDSView"}},"id":"39b82515-f807-433c-b8a4-3f9b06f64761","type":"GlyphRenderer"},{"attributes":{},"id":"6ec44b7a-dc2b-405e-b72d-ba8d2fbbda1e","type":"PanTool"},{"attributes":{},"id":"90fdce65-79e3-47f7-988a-ec9ef213648a","type":"MyFormatter"},{"attributes":{"formatter":{"id":"90fdce65-79e3-47f7-988a-ec9ef213648a","type":"MyFormatter"},"plot":{"id":"2e2bad3b-f0e5-4c34-82a6-bef824810cf4","subtype":"Figure","type":"Plot"},"ticker":{"id":"967cdcae-6b61-4f57-b01d-19a1114db68e","type":"BasicTicker"}},"id":"34487519-d3fa-4586-9772-ded8c18a0d45","type":"LinearAxis"},{"attributes":{"dimension":1,"plot":{"id":"2e2bad3b-f0e5-4c34-82a6-bef824810cf4","subtype":"Figure","type":"Plot"},"ticker":{"id":"dd5cc614-c919-4c9d-a04a-c3893acbc111","type":"BasicTicker"}},"id":"e868cb9f-e5a3-419c-8ac4-ea979870c84d","type":"Grid"},{"attributes":{},"id":"94c6571b-4e56-4b72-8213-135c0481d0d7","type":"HelpTool"},{"attributes":{},"id":"8d0250a0-3963-4074-8efc-7249ff61abda","type":"BasicTickFormatter"},{"attributes":{},"id":"f0153a68-1464-460b-848a-460585eaebeb","type":"SaveTool"},{"attributes":{"callback":null},"id":"28442725-9f49-4753-aed4-ac5bc44d0d47","type":"DataRange1d"},{"attributes":{"formatter":{"id":"8d0250a0-3963-4074-8efc-7249ff61abda","type":"BasicTickFormatter"},"plot":{"id":"2e2bad3b-f0e5-4c34-82a6-bef824810cf4","subtype":"Figure","type":"Plot"},"ticker":{"id":"dd5cc614-c919-4c9d-a04a-c3893acbc111","type":"BasicTicker"}},"id":"0968fb44-a6a3-47e7-a31e-f7be2f5584ba","type":"LinearAxis"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"6ec44b7a-dc2b-405e-b72d-ba8d2fbbda1e","type":"PanTool"},{"id":"6536b3f6-38ca-41a5-870d-d25d1f620bdb","type":"WheelZoomTool"},{"id":"02c68c82-dcee-4641-8543-f1dfc578a38a","type":"BoxZoomTool"},{"id":"f0153a68-1464-460b-848a-460585eaebeb","type":"SaveTool"},{"id":"3f0e0c90-a86a-4fc2-98ba-c49b110cacbb","type":"ResetTool"},{"id":"94c6571b-4e56-4b72-8213-135c0481d0d7","type":"HelpTool"}]},"id":"60f1d593-80ed-4861-a9c8-c73875557477","type":"Toolbar"},{"attributes":{"fill_color":{"value":"#1f77b4"},"line_color":{"value":"#1f77b4"},"x":{"field":"x"},"y":{"field":"y"}},"id":"c07498e0-5286-465b-b50b-be4c76065a10","type":"Circle"},{"attributes":{},"id":"3f0e0c90-a86a-4fc2-98ba-c49b110cacbb","type":"ResetTool"},{"attributes":{"plot":null,"text":""},"id":"210f48a6-373e-430b-89a9-36c0008a48ab","type":"Title"},{"attributes":{"callback":null},"id":"f26c9064-ff6c-4076-9698-78917a61a02b","type":"DataRange1d"}],"root_ids":["2e2bad3b-f0e5-4c34-82a6-bef824810cf4"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"d44217ae-0ea7-4bd7-95b9-167ca6ff2c91","elementid":"3dffbfa5-915b-4f5b-b831-95bb8398a7f8","modelid":"2e2bad3b-f0e5-4c34-82a6-bef824810cf4"}];
                
                    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);
})();
