(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("f6297603-fa32-46f7-9b30-b8816f37920d");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid 'f6297603-fa32-46f7-9b30-b8816f37920d' 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
              };
              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/main");
          ;
          });
        },
        
        function(Bokeh) {
          (function() {
            var fn = function() {
              Bokeh.safely(function() {
                (function(root) {
                  function embed_document(root) {
                    var docs_json = {"8d662aca-a49f-424d-bc12-913cfbb55f2e":{"roots":{"references":[{"attributes":{"plot":{"id":"21a11d5d-26c5-4105-b262-d0d879097c33","subtype":"Figure","type":"Plot"},"ticker":{"id":"5575201a-ff94-45ce-95cc-07a4a048f105","type":"BasicTicker"}},"id":"f38ac486-a0b2-4f30-b0f2-7197f4efa136","type":"Grid"},{"attributes":{},"id":"e13227bd-cb1d-4c1e-b47b-4731bc562d89","type":"BasicTicker"},{"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":"78020af8-d6f5-4b25-8f22-afb01fa61cdd","type":"BoxAnnotation"},{"attributes":{},"id":"914b3f6e-fb3c-4e05-9dc6-1e355a6e58e8","type":"HelpTool"},{"attributes":{},"id":"98767e04-9b7c-4049-9cca-17180cc88e94","type":"BasicTickFormatter"},{"attributes":{"dimension":1,"plot":{"id":"21a11d5d-26c5-4105-b262-d0d879097c33","subtype":"Figure","type":"Plot"},"ticker":{"id":"e13227bd-cb1d-4c1e-b47b-4731bc562d89","type":"BasicTicker"}},"id":"3debf817-aa01-49d0-9cae-0e425228b196","type":"Grid"},{"attributes":{"formatter":{"id":"98767e04-9b7c-4049-9cca-17180cc88e94","type":"BasicTickFormatter"},"plot":{"id":"21a11d5d-26c5-4105-b262-d0d879097c33","subtype":"Figure","type":"Plot"},"ticker":{"id":"5575201a-ff94-45ce-95cc-07a4a048f105","type":"BasicTicker"}},"id":"bea196c5-6db0-4d69-abca-7759b7c89e9e","type":"LinearAxis"},{"attributes":{"plot":null,"text":"LaTex Demonstration"},"id":"121a1383-5b0f-4573-94aa-1e6600925c97","type":"Title"},{"attributes":{},"id":"6a3e7f58-cca4-48b6-b3e4-7a43da95c776","type":"BasicTickFormatter"},{"attributes":{},"id":"b78539c3-fb06-4d73-9f67-ceb86c4442aa","type":"LinearScale"},{"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/uB6F61G43j9cj8L1KFzfPwAAAAAA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AdAuAdEh6i/B0BANiDV2e8HQAAAAAAAAAhAQTYg1dnvB0C4B0SHqL8HQLnWe6cucAdAFnCgE60CB0Ap/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":"3a75a180-d7bf-4f0e-bc43-aa68c12c66c9","type":"ColumnDataSource"},{"attributes":{"below":[{"id":"bea196c5-6db0-4d69-abca-7759b7c89e9e","type":"LinearAxis"}],"left":[{"id":"b3286739-1147-4387-a512-ac6752553044","type":"LinearAxis"}],"plot_height":500,"plot_width":500,"renderers":[{"id":"bea196c5-6db0-4d69-abca-7759b7c89e9e","type":"LinearAxis"},{"id":"f38ac486-a0b2-4f30-b0f2-7197f4efa136","type":"Grid"},{"id":"b3286739-1147-4387-a512-ac6752553044","type":"LinearAxis"},{"id":"3debf817-aa01-49d0-9cae-0e425228b196","type":"Grid"},{"id":"78020af8-d6f5-4b25-8f22-afb01fa61cdd","type":"BoxAnnotation"},{"id":"ab12fbb2-a94c-4e54-b8c8-f528fc7aef7c","type":"GlyphRenderer"},{"id":"ceee5991-e8f6-4707-add6-1b83d8d90ba7","type":"LatexLabel"}],"title":{"id":"121a1383-5b0f-4573-94aa-1e6600925c97","type":"Title"},"toolbar":{"id":"4536cede-ea46-4172-bacf-631c73de7b42","type":"Toolbar"},"x_range":{"id":"19811be1-9870-4549-9115-9c16fae85379","type":"DataRange1d"},"x_scale":{"id":"b78539c3-fb06-4d73-9f67-ceb86c4442aa","type":"LinearScale"},"y_range":{"id":"0b9815df-1a96-43ea-b86e-086433db0a8d","type":"DataRange1d"},"y_scale":{"id":"58f055e1-4c22-4be5-aa88-35d83480b0af","type":"LinearScale"}},"id":"21a11d5d-26c5-4105-b262-d0d879097c33","subtype":"Figure","type":"Plot"},{"attributes":{},"id":"58f055e1-4c22-4be5-aa88-35d83480b0af","type":"LinearScale"},{"attributes":{"background_fill_color":{"value":"#ffffff"},"plot":{"id":"21a11d5d-26c5-4105-b262-d0d879097c33","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":"ceee5991-e8f6-4707-add6-1b83d8d90ba7","type":"LatexLabel"},{"attributes":{},"id":"bb88a7b4-de7e-46bc-bad1-969372baf17e","type":"PanTool"},{"attributes":{"data_source":{"id":"3a75a180-d7bf-4f0e-bc43-aa68c12c66c9","type":"ColumnDataSource"},"glyph":{"id":"068da205-2c00-45f5-9b6b-b0daddfa370f","type":"Line"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"4c0f1900-1f91-441b-8ab0-7f302dce1ebd","type":"Line"},"selection_glyph":null,"view":{"id":"9daf03c5-49ba-4aee-a944-6789f2488349","type":"CDSView"}},"id":"ab12fbb2-a94c-4e54-b8c8-f528fc7aef7c","type":"GlyphRenderer"},{"attributes":{"line_alpha":{"value":0.1},"line_color":{"value":"#1f77b4"},"x":{"field":"x"},"y":{"field":"y"}},"id":"4c0f1900-1f91-441b-8ab0-7f302dce1ebd","type":"Line"},{"attributes":{"overlay":{"id":"78020af8-d6f5-4b25-8f22-afb01fa61cdd","type":"BoxAnnotation"}},"id":"3db8ced7-fa6f-4afe-9835-a3d1b87b85eb","type":"BoxZoomTool"},{"attributes":{},"id":"5575201a-ff94-45ce-95cc-07a4a048f105","type":"BasicTicker"},{"attributes":{},"id":"d18925e6-c219-44c2-aa79-086c3d87abd4","type":"ResetTool"},{"attributes":{"formatter":{"id":"6a3e7f58-cca4-48b6-b3e4-7a43da95c776","type":"BasicTickFormatter"},"plot":{"id":"21a11d5d-26c5-4105-b262-d0d879097c33","subtype":"Figure","type":"Plot"},"ticker":{"id":"e13227bd-cb1d-4c1e-b47b-4731bc562d89","type":"BasicTicker"}},"id":"b3286739-1147-4387-a512-ac6752553044","type":"LinearAxis"},{"attributes":{"line_color":{"value":"#1f77b4"},"x":{"field":"x"},"y":{"field":"y"}},"id":"068da205-2c00-45f5-9b6b-b0daddfa370f","type":"Line"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"bb88a7b4-de7e-46bc-bad1-969372baf17e","type":"PanTool"},{"id":"6bab751c-ccdb-45d8-aca7-c25ec6a855f5","type":"WheelZoomTool"},{"id":"3db8ced7-fa6f-4afe-9835-a3d1b87b85eb","type":"BoxZoomTool"},{"id":"92b219e7-1032-4ba4-bf68-b186ab9069ad","type":"SaveTool"},{"id":"d18925e6-c219-44c2-aa79-086c3d87abd4","type":"ResetTool"},{"id":"914b3f6e-fb3c-4e05-9dc6-1e355a6e58e8","type":"HelpTool"}]},"id":"4536cede-ea46-4172-bacf-631c73de7b42","type":"Toolbar"},{"attributes":{"callback":null},"id":"0b9815df-1a96-43ea-b86e-086433db0a8d","type":"DataRange1d"},{"attributes":{"source":{"id":"3a75a180-d7bf-4f0e-bc43-aa68c12c66c9","type":"ColumnDataSource"}},"id":"9daf03c5-49ba-4aee-a944-6789f2488349","type":"CDSView"},{"attributes":{},"id":"6bab751c-ccdb-45d8-aca7-c25ec6a855f5","type":"WheelZoomTool"},{"attributes":{},"id":"92b219e7-1032-4ba4-bf68-b186ab9069ad","type":"SaveTool"},{"attributes":{"callback":null},"id":"19811be1-9870-4549-9115-9c16fae85379","type":"DataRange1d"}],"root_ids":["21a11d5d-26c5-4105-b262-d0d879097c33"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"8d662aca-a49f-424d-bc12-913cfbb55f2e","elementid":"f6297603-fa32-46f7-9b30-b8816f37920d","modelid":"21a11d5d-26c5-4105-b262-d0d879097c33"}];
                
                    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);
})();
