(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("6010a2ad-7ff7-4c26-87f9-bcf40ed73a63");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid '6010a2ad-7ff7-4c26-87f9-bcf40ed73a63' 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_3ae07ca84853402c8d2505982164ff11.latex_label").LatexLabel
              };
              require("base").register_models(models);
              module.exports = models;
            },
            "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 = {"e325951e-a741-4e21-9901-116206c28cc6":{"roots":{"references":[{"attributes":{"data_source":{"id":"4aafa547-e334-4b97-b5a9-b3bc7ed09158","type":"ColumnDataSource"},"glyph":{"id":"a06c73c5-4ac2-4770-9d57-5f4a3610ec4c","type":"Line"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"42557c0b-ce41-4880-b994-3e69dfe64725","type":"Line"},"selection_glyph":null,"view":{"id":"7d3dab62-6401-430d-9142-b110408d8cb2","type":"CDSView"}},"id":"2be068b8-568d-44ce-8a16-6338dd2be029","type":"GlyphRenderer"},{"attributes":{},"id":"508db5ab-9f9c-4de3-8f17-bc1f0060fbea","type":"SaveTool"},{"attributes":{},"id":"e60cb873-ea06-4cfe-9316-7330b7011a07","type":"WheelZoomTool"},{"attributes":{"plot":{"id":"19b7d2eb-f9ca-4228-b3cf-ad546db558e7","subtype":"Figure","type":"Plot"},"ticker":{"id":"bb83ddc4-7c6f-441a-95c2-05921c522be8","type":"BasicTicker"}},"id":"c4c08bec-4ca2-4ca7-8297-c31d179e844f","type":"Grid"},{"attributes":{"background_fill_color":{"value":"#ffffff"},"plot":{"id":"19b7d2eb-f9ca-4228-b3cf-ad546db558e7","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":"43b1da6e-cbe4-4d61-98d9-4f7e745a90d4","type":"LatexLabel"},{"attributes":{"dimension":1,"plot":{"id":"19b7d2eb-f9ca-4228-b3cf-ad546db558e7","subtype":"Figure","type":"Plot"},"ticker":{"id":"3dbd9ff4-06e6-436e-89d7-62f9a8dbbc2e","type":"BasicTicker"}},"id":"abcfc45d-9b67-4683-a35d-d5f36add86a0","type":"Grid"},{"attributes":{"source":{"id":"4aafa547-e334-4b97-b5a9-b3bc7ed09158","type":"ColumnDataSource"}},"id":"7d3dab62-6401-430d-9142-b110408d8cb2","type":"CDSView"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"1c40d4c5-7181-4489-97b1-7fdefa7355da","type":"PanTool"},{"id":"e60cb873-ea06-4cfe-9316-7330b7011a07","type":"WheelZoomTool"},{"id":"d2fc52d7-afed-4a8d-a54a-cb7edf52beeb","type":"BoxZoomTool"},{"id":"508db5ab-9f9c-4de3-8f17-bc1f0060fbea","type":"SaveTool"},{"id":"4f947eb6-90d1-47ab-8fd6-d38697b93b53","type":"ResetTool"},{"id":"645e4699-320a-450d-b15d-e40686e977ce","type":"HelpTool"}]},"id":"fd13716e-c3bf-46c7-828d-75a70e3c792a","type":"Toolbar"},{"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":"44ba137f-d0c8-4bc4-8390-3703f1e01e04","type":"BoxAnnotation"},{"attributes":{"callback":null},"id":"6bc1d969-09d3-4a28-86b1-e0f3159bcb89","type":"DataRange1d"},{"attributes":{"line_color":{"value":"#1f77b4"},"x":{"field":"x"},"y":{"field":"y"}},"id":"a06c73c5-4ac2-4770-9d57-5f4a3610ec4c","type":"Line"},{"attributes":{},"id":"bb83ddc4-7c6f-441a-95c2-05921c522be8","type":"BasicTicker"},{"attributes":{"plot":null,"text":"LaTex Demonstration"},"id":"1153263b-eadb-4429-bf89-5010e1b45830","type":"Title"},{"attributes":{},"id":"4f947eb6-90d1-47ab-8fd6-d38697b93b53","type":"ResetTool"},{"attributes":{"overlay":{"id":"44ba137f-d0c8-4bc4-8390-3703f1e01e04","type":"BoxAnnotation"}},"id":"d2fc52d7-afed-4a8d-a54a-cb7edf52beeb","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/PgrXo3A94j+Pwv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/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":"4aafa547-e334-4b97-b5a9-b3bc7ed09158","type":"ColumnDataSource"},{"attributes":{"below":[{"id":"c8f85e00-bfcc-4e22-9bc3-389d0b1d128e","type":"LinearAxis"}],"left":[{"id":"4d8bc9cc-85c1-46ca-b32f-e4c44e65b15c","type":"LinearAxis"}],"plot_height":500,"plot_width":500,"renderers":[{"id":"c8f85e00-bfcc-4e22-9bc3-389d0b1d128e","type":"LinearAxis"},{"id":"c4c08bec-4ca2-4ca7-8297-c31d179e844f","type":"Grid"},{"id":"4d8bc9cc-85c1-46ca-b32f-e4c44e65b15c","type":"LinearAxis"},{"id":"abcfc45d-9b67-4683-a35d-d5f36add86a0","type":"Grid"},{"id":"44ba137f-d0c8-4bc4-8390-3703f1e01e04","type":"BoxAnnotation"},{"id":"2be068b8-568d-44ce-8a16-6338dd2be029","type":"GlyphRenderer"},{"id":"43b1da6e-cbe4-4d61-98d9-4f7e745a90d4","type":"LatexLabel"}],"title":{"id":"1153263b-eadb-4429-bf89-5010e1b45830","type":"Title"},"toolbar":{"id":"fd13716e-c3bf-46c7-828d-75a70e3c792a","type":"Toolbar"},"x_range":{"id":"bdf5c9e2-f321-48f9-93df-45ba093ee2af","type":"DataRange1d"},"x_scale":{"id":"bf392337-7a66-4fe4-8f6f-0d0c30d58721","type":"LinearScale"},"y_range":{"id":"6bc1d969-09d3-4a28-86b1-e0f3159bcb89","type":"DataRange1d"},"y_scale":{"id":"b71b3c09-7625-4e52-8701-752de98d6ce7","type":"LinearScale"}},"id":"19b7d2eb-f9ca-4228-b3cf-ad546db558e7","subtype":"Figure","type":"Plot"},{"attributes":{"formatter":{"id":"136f1dd8-c78d-4664-8103-117b0d170cdd","type":"BasicTickFormatter"},"plot":{"id":"19b7d2eb-f9ca-4228-b3cf-ad546db558e7","subtype":"Figure","type":"Plot"},"ticker":{"id":"3dbd9ff4-06e6-436e-89d7-62f9a8dbbc2e","type":"BasicTicker"}},"id":"4d8bc9cc-85c1-46ca-b32f-e4c44e65b15c","type":"LinearAxis"},{"attributes":{},"id":"9d69be00-d842-4d2a-9514-1b2a04e7bb1c","type":"BasicTickFormatter"},{"attributes":{"callback":null},"id":"bdf5c9e2-f321-48f9-93df-45ba093ee2af","type":"DataRange1d"},{"attributes":{},"id":"1c40d4c5-7181-4489-97b1-7fdefa7355da","type":"PanTool"},{"attributes":{},"id":"b71b3c09-7625-4e52-8701-752de98d6ce7","type":"LinearScale"},{"attributes":{},"id":"136f1dd8-c78d-4664-8103-117b0d170cdd","type":"BasicTickFormatter"},{"attributes":{},"id":"bf392337-7a66-4fe4-8f6f-0d0c30d58721","type":"LinearScale"},{"attributes":{"formatter":{"id":"9d69be00-d842-4d2a-9514-1b2a04e7bb1c","type":"BasicTickFormatter"},"plot":{"id":"19b7d2eb-f9ca-4228-b3cf-ad546db558e7","subtype":"Figure","type":"Plot"},"ticker":{"id":"bb83ddc4-7c6f-441a-95c2-05921c522be8","type":"BasicTicker"}},"id":"c8f85e00-bfcc-4e22-9bc3-389d0b1d128e","type":"LinearAxis"},{"attributes":{"line_alpha":{"value":0.1},"line_color":{"value":"#1f77b4"},"x":{"field":"x"},"y":{"field":"y"}},"id":"42557c0b-ce41-4880-b994-3e69dfe64725","type":"Line"},{"attributes":{},"id":"645e4699-320a-450d-b15d-e40686e977ce","type":"HelpTool"},{"attributes":{},"id":"3dbd9ff4-06e6-436e-89d7-62f9a8dbbc2e","type":"BasicTicker"}],"root_ids":["19b7d2eb-f9ca-4228-b3cf-ad546db558e7"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"e325951e-a741-4e21-9901-116206c28cc6","elementid":"6010a2ad-7ff7-4c26-87f9-bcf40ed73a63","modelid":"19b7d2eb-f9ca-4228-b3cf-ad546db558e7"}];
                
                    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);
})();
