(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("6e342a18-3a8b-48c0-935f-e4943bd6486a");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid '6e342a18-3a8b-48c0-935f-e4943bd6486a' 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_66a16298a37e4ee1b0ce5d15ea1f8e3e.latex_label").LatexLabel
              };
              require("base").register_models(models);
              module.exports = models;
            },
            "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 = {"d0ba57fc-0841-4bab-9339-9ef1184ec862":{"roots":{"references":[{"attributes":{},"id":"3370491f-2431-44f0-b438-c56c32f793b2","type":"PanTool"},{"attributes":{"plot":{"id":"5bf4a01b-0ae6-4c72-80b4-3db1fcf4f1b0","subtype":"Figure","type":"Plot"},"ticker":{"id":"0bfa51d0-0ccb-480b-b2f6-1e3fc87e0be7","type":"BasicTicker"}},"id":"7e1d14bf-ebf7-43a8-b33d-61c686b82df8","type":"Grid"},{"attributes":{"data_source":{"id":"61796a31-8031-4372-b597-2e865b0e6316","type":"ColumnDataSource"},"glyph":{"id":"310c6343-2a0b-4d75-b756-3b1f67911ed0","type":"Line"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"e7958300-05ba-4fc1-af54-8dfc1d68e6c3","type":"Line"},"selection_glyph":null,"view":{"id":"e109c4e8-f052-46f0-afc9-0d7ee2ecc03e","type":"CDSView"}},"id":"3461cb10-1c79-4941-8adf-fc88caec8dbd","type":"GlyphRenderer"},{"attributes":{"callback":null},"id":"5b549136-ecab-40b4-b957-2d527b6fc61f","type":"DataRange1d"},{"attributes":{},"id":"ec414474-ed38-44a1-ac75-52213cebbbdb","type":"BasicTickFormatter"},{"attributes":{"source":{"id":"61796a31-8031-4372-b597-2e865b0e6316","type":"ColumnDataSource"}},"id":"e109c4e8-f052-46f0-afc9-0d7ee2ecc03e","type":"CDSView"},{"attributes":{"callback":null},"id":"3c48dab2-d8ca-492e-8356-c47aeee802b2","type":"DataRange1d"},{"attributes":{},"id":"a7928ac1-1637-40c3-89b6-64027c5e246c","type":"HelpTool"},{"attributes":{},"id":"916c4e88-9624-42db-805a-bd0e660ecf81","type":"BasicTickFormatter"},{"attributes":{"overlay":{"id":"d9fdc463-9ee9-4e57-89cd-dcf485a06491","type":"BoxAnnotation"}},"id":"6989a903-e599-4a65-9dc5-897411cc8f06","type":"BoxZoomTool"},{"attributes":{"callback":null,"column_names":["y","x"],"data":{"x":{"__ndarray__":"AAAAAAAAAAB7FK5H4XqEP3sUrkfhepQ/uB6F61G4nj97FK5H4XqkP5qZmZmZmak/uB6F61G4rj/sUbgeheuxP3sUrkfherQ/CtejcD0Ktz+amZmZmZm5Pylcj8L1KLw/uB6F61G4vj+kcD0K16PAP+xRuB6F68E/MzMzMzMzwz97FK5H4XrEP8P1KFyPwsU/CtejcD0Kxz9SuB6F61HIP5qZmZmZmck/4XoUrkfhyj8pXI/C9SjMP3E9CtejcM0/uB6F61G4zj8AAAAAAADQP6RwPQrXo9A/SOF6FK5H0T/sUbgehevRP4/C9Shcj9I/MzMzMzMz0z/Xo3A9CtfTP3sUrkfhetQ/H4XrUbge1T/D9Shcj8LVP2dmZmZmZtY/CtejcD0K1z+uR+F6FK7XP1K4HoXrUdg/9ihcj8L12D+amZmZmZnZPz4K16NwPdo/4XoUrkfh2j+F61G4HoXbPylcj8L1KNw/zczMzMzM3D9xPQrXo3DdPxWuR+F6FN4/uB6F61G43j9cj8L1KFzfPwAAAAAAAOA/UrgehetR4D+kcD0K16PgP/YoXI/C9eA/SOF6FK5H4T+amZmZmZnhP+xRuB6F6+E/PgrX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gE60CB0Ap/eXm3XgGQASu9IDt1AVAb0Ctv3EZBUDWCgaPX0kEQDSwJPn+ZwNAK/3l5t14AkCoN1DGwX8BQJwE31CYgABAy/ZBXs/+/j+vkF9zfAD9P64FNDJEDvs/lp+2DQIw+T9Y6vPhQG33Px5/pYAczfU/9KMW/iRW9D+tBTQyRA7zP9Yfv9il+vE/jlIIsaIf8T+Q8HfxroDwP36Tv1VMIPA/AAAAAAAA8D9+k79VTCDwP5Dwd/GugPA/jFIIsaIf8T/UH7/YpfrxP6sFNDJEDvM/+KMW/iRW9D8if6WAHM31P1zq8+FAbfc/k5+2DQIw+T+qBTQyRA77P6yQX3N8AP0/yPZBXs/+/j+aBN9QmIAAQKg3UMbBfwFAKf3l5t14AkA1sCT5/mcDQNQKBo9fSQRAcECtv3EZBUAGrvSA7dQFQCr95ebdeAZAFXCgE60CB0C51nunLnAHQLgHRIeovwdAQTYg1dnvB0AAAAAAAAAIQA==","dtype":"float64","shape":[101]}}},"id":"61796a31-8031-4372-b597-2e865b0e6316","type":"ColumnDataSource"},{"attributes":{},"id":"c374fe31-385f-4b57-af62-9993f9a3a880","type":"LinearScale"},{"attributes":{},"id":"02eee7c1-5bf0-4e46-8acb-849c425a82df","type":"BasicTicker"},{"attributes":{},"id":"0c49a1e7-9824-47e7-8f24-1996f4d02121","type":"SaveTool"},{"attributes":{"line_alpha":{"value":0.1},"line_color":{"value":"#1f77b4"},"x":{"field":"x"},"y":{"field":"y"}},"id":"e7958300-05ba-4fc1-af54-8dfc1d68e6c3","type":"Line"},{"attributes":{"formatter":{"id":"916c4e88-9624-42db-805a-bd0e660ecf81","type":"BasicTickFormatter"},"plot":{"id":"5bf4a01b-0ae6-4c72-80b4-3db1fcf4f1b0","subtype":"Figure","type":"Plot"},"ticker":{"id":"0bfa51d0-0ccb-480b-b2f6-1e3fc87e0be7","type":"BasicTicker"}},"id":"c6ff3b52-36b9-4595-9576-cf9b145c2eef","type":"LinearAxis"},{"attributes":{},"id":"5ad0ba44-af11-4b96-b6cd-fb93e8a90ef6","type":"LinearScale"},{"attributes":{},"id":"796f2609-2045-493e-88d4-c83f7bbdb8f6","type":"WheelZoomTool"},{"attributes":{},"id":"0bfa51d0-0ccb-480b-b2f6-1e3fc87e0be7","type":"BasicTicker"},{"attributes":{"plot":null,"text":"LaTex Demonstration"},"id":"54d716e7-714f-40ae-9c17-c6fa0f6d49fe","type":"Title"},{"attributes":{},"id":"931e2ab4-3589-4002-9150-453ee33f218a","type":"ResetTool"},{"attributes":{"below":[{"id":"c6ff3b52-36b9-4595-9576-cf9b145c2eef","type":"LinearAxis"}],"left":[{"id":"3f1160b4-f85b-4107-b51e-bd6106c3cebb","type":"LinearAxis"}],"plot_height":500,"plot_width":500,"renderers":[{"id":"c6ff3b52-36b9-4595-9576-cf9b145c2eef","type":"LinearAxis"},{"id":"7e1d14bf-ebf7-43a8-b33d-61c686b82df8","type":"Grid"},{"id":"3f1160b4-f85b-4107-b51e-bd6106c3cebb","type":"LinearAxis"},{"id":"ed9dc73a-a366-455c-b822-bbed0ff88be0","type":"Grid"},{"id":"d9fdc463-9ee9-4e57-89cd-dcf485a06491","type":"BoxAnnotation"},{"id":"3461cb10-1c79-4941-8adf-fc88caec8dbd","type":"GlyphRenderer"},{"id":"c2645416-1b8c-4169-a382-a8d004a8deba","type":"LatexLabel"}],"title":{"id":"54d716e7-714f-40ae-9c17-c6fa0f6d49fe","type":"Title"},"toolbar":{"id":"a6c253e1-dad1-4813-9ccc-056402f92c6d","type":"Toolbar"},"x_range":{"id":"5b549136-ecab-40b4-b957-2d527b6fc61f","type":"DataRange1d"},"x_scale":{"id":"c374fe31-385f-4b57-af62-9993f9a3a880","type":"LinearScale"},"y_range":{"id":"3c48dab2-d8ca-492e-8356-c47aeee802b2","type":"DataRange1d"},"y_scale":{"id":"5ad0ba44-af11-4b96-b6cd-fb93e8a90ef6","type":"LinearScale"}},"id":"5bf4a01b-0ae6-4c72-80b4-3db1fcf4f1b0","subtype":"Figure","type":"Plot"},{"attributes":{"line_color":{"value":"#1f77b4"},"x":{"field":"x"},"y":{"field":"y"}},"id":"310c6343-2a0b-4d75-b756-3b1f67911ed0","type":"Line"},{"attributes":{"dimension":1,"plot":{"id":"5bf4a01b-0ae6-4c72-80b4-3db1fcf4f1b0","subtype":"Figure","type":"Plot"},"ticker":{"id":"02eee7c1-5bf0-4e46-8acb-849c425a82df","type":"BasicTicker"}},"id":"ed9dc73a-a366-455c-b822-bbed0ff88be0","type":"Grid"},{"attributes":{"formatter":{"id":"ec414474-ed38-44a1-ac75-52213cebbbdb","type":"BasicTickFormatter"},"plot":{"id":"5bf4a01b-0ae6-4c72-80b4-3db1fcf4f1b0","subtype":"Figure","type":"Plot"},"ticker":{"id":"02eee7c1-5bf0-4e46-8acb-849c425a82df","type":"BasicTicker"}},"id":"3f1160b4-f85b-4107-b51e-bd6106c3cebb","type":"LinearAxis"},{"attributes":{"background_fill_color":{"value":"#ffffff"},"plot":{"id":"5bf4a01b-0ae6-4c72-80b4-3db1fcf4f1b0","subtype":"Figure","type":"Plot"},"render_mode":"css","text":"f = \\sum_{n=1}^\\infty\\frac{-e^{i\\pi}}{2^n}!","text_font_size":{"value":"16pt"},"x":35,"x_units":"screen","y":445,"y_units":"screen"},"id":"c2645416-1b8c-4169-a382-a8d004a8deba","type":"LatexLabel"},{"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":"d9fdc463-9ee9-4e57-89cd-dcf485a06491","type":"BoxAnnotation"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"3370491f-2431-44f0-b438-c56c32f793b2","type":"PanTool"},{"id":"796f2609-2045-493e-88d4-c83f7bbdb8f6","type":"WheelZoomTool"},{"id":"6989a903-e599-4a65-9dc5-897411cc8f06","type":"BoxZoomTool"},{"id":"0c49a1e7-9824-47e7-8f24-1996f4d02121","type":"SaveTool"},{"id":"931e2ab4-3589-4002-9150-453ee33f218a","type":"ResetTool"},{"id":"a7928ac1-1637-40c3-89b6-64027c5e246c","type":"HelpTool"}]},"id":"a6c253e1-dad1-4813-9ccc-056402f92c6d","type":"Toolbar"}],"root_ids":["5bf4a01b-0ae6-4c72-80b4-3db1fcf4f1b0"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"d0ba57fc-0841-4bab-9339-9ef1184ec862","elementid":"6e342a18-3a8b-48c0-935f-e4943bd6486a","modelid":"5bf4a01b-0ae6-4c72-80b4-3db1fcf4f1b0"}];
                
                    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);
})();
