(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("45c0cbd1-a422-4641-a968-1344f50030cb");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid '45c0cbd1-a422-4641-a968-1344f50030cb' but no matching script tag was found. ")
        return false;
      }
    
      var js_urls = ["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(Bokeh) {
          (function() {
            var fn = function() {
              Bokeh.safely(function() {
                (function(root) {
                  function embed_document(root) {
                    var docs_json = {"53204d0c-044f-4fce-882e-11eee6b3ee6d":{"roots":{"references":[{"attributes":{"callback":{"id":"82dcb1ef-5af3-438c-8b05-e64f361244bd","type":"CustomJS"},"end":10,"start":0.1,"step":0.1,"title":"Frequency","value":1},"id":"25d118dd-3db0-43a3-95c4-8a17e10bb5af","type":"Slider"},{"attributes":{},"id":"07e36571-f772-47af-a10a-7b1cff67f1bb","type":"HelpTool"},{"attributes":{},"id":"82006ed7-ae02-4516-8f87-71eb99530e5b","type":"BasicTicker"},{"attributes":{"args":{"amp":{"id":"99c43d83-ec1f-4b0e-a22e-0e680699b83e","type":"Slider"},"freq":{"id":"25d118dd-3db0-43a3-95c4-8a17e10bb5af","type":"Slider"},"offset":{"id":"fdbfe283-7350-4251-a2ce-25af2cd600e9","type":"Slider"},"phase":{"id":"de4c7abf-db68-4364-a8b7-2e0230a96b60","type":"Slider"},"source":{"id":"a7f97869-166b-4b1b-b0db-28bbfc1913e8","type":"ColumnDataSource"}},"code":"\n    var data = source.data;\n    var A = amp.value;\n    var k = freq.value;\n    var phi = phase.value;\n    var B = offset.value;\n    x = data['x']\n    y = data['y']\n    for (i = 0; i < x.length; i++) {\n        y[i] = B + A*Math.sin(k*x[i]+phi);\n    }\n    source.change.emit();\n"},"id":"82dcb1ef-5af3-438c-8b05-e64f361244bd","type":"CustomJS"},{"attributes":{"callback":null,"column_names":["y","x"],"data":{"x":{"__ndarray__":"[encoded data, 5336 characters]","dtype":"float64","shape":[500]},"y":{"__ndarray__":"[encoded data, 5336 characters]","dtype":"float64","shape":[500]}}},"id":"a7f97869-166b-4b1b-b0db-28bbfc1913e8","type":"ColumnDataSource"},{"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":"b8bb6593-aeb7-4959-90e0-6a1c07edfaf4","type":"BoxAnnotation"},{"attributes":{"callback":null},"id":"fb7dab16-2c8a-495f-bdd1-3de3acb580dd","type":"DataRange1d"},{"attributes":{"plot":{"id":"c6387721-204a-463f-aa69-5ff337b3502b","subtype":"Figure","type":"Plot"},"ticker":{"id":"82006ed7-ae02-4516-8f87-71eb99530e5b","type":"BasicTicker"}},"id":"7b18150d-c36b-46d6-8d2b-0f6d3d5275f2","type":"Grid"},{"attributes":{"line_alpha":{"value":0.1},"line_color":{"value":"#1f77b4"},"line_width":{"value":3},"x":{"field":"x"},"y":{"field":"y"}},"id":"2ca82da1-abc7-4e32-b68f-d9764e25ff02","type":"Line"},{"attributes":{"callback":null,"end":10,"start":-10},"id":"e9f85e82-64bb-46d4-a08d-d4bf4c6073d0","type":"Range1d"},{"attributes":{},"id":"d47da4e2-436d-4455-9ce0-5832062f77dc","type":"SaveTool"},{"attributes":{"below":[{"id":"da3a2493-3106-4feb-bde3-3f353289c571","type":"LinearAxis"}],"left":[{"id":"4dd34051-bc00-4780-baa6-df79574f38aa","type":"LinearAxis"}],"plot_height":400,"plot_width":400,"renderers":[{"id":"da3a2493-3106-4feb-bde3-3f353289c571","type":"LinearAxis"},{"id":"7b18150d-c36b-46d6-8d2b-0f6d3d5275f2","type":"Grid"},{"id":"4dd34051-bc00-4780-baa6-df79574f38aa","type":"LinearAxis"},{"id":"f2753367-bcfd-40bf-b615-5615af38cb16","type":"Grid"},{"id":"b8bb6593-aeb7-4959-90e0-6a1c07edfaf4","type":"BoxAnnotation"},{"id":"bd0b763f-7c07-4739-84ea-72213181bf3f","type":"GlyphRenderer"}],"title":{"id":"77fd762a-872e-402a-a17a-eb5f3bdd1123","type":"Title"},"toolbar":{"id":"9d0269dc-8760-4111-91dd-1581dbf9d367","type":"Toolbar"},"x_range":{"id":"fb7dab16-2c8a-495f-bdd1-3de3acb580dd","type":"DataRange1d"},"x_scale":{"id":"219cbf3e-b946-4401-9cc7-bd4848001eea","type":"LinearScale"},"y_range":{"id":"e9f85e82-64bb-46d4-a08d-d4bf4c6073d0","type":"Range1d"},"y_scale":{"id":"1bbe0327-02d5-4afd-92b4-ef371aa81c75","type":"LinearScale"}},"id":"c6387721-204a-463f-aa69-5ff337b3502b","subtype":"Figure","type":"Plot"},{"attributes":{"plot":null,"text":""},"id":"77fd762a-872e-402a-a17a-eb5f3bdd1123","type":"Title"},{"attributes":{"callback":{"id":"82dcb1ef-5af3-438c-8b05-e64f361244bd","type":"CustomJS"},"end":10,"start":0.1,"step":0.1,"title":"Amplitude","value":1},"id":"99c43d83-ec1f-4b0e-a22e-0e680699b83e","type":"Slider"},{"attributes":{"callback":{"id":"82dcb1ef-5af3-438c-8b05-e64f361244bd","type":"CustomJS"},"end":6.4,"start":0,"step":0.1,"title":"Phase","value":0},"id":"de4c7abf-db68-4364-a8b7-2e0230a96b60","type":"Slider"},{"attributes":{},"id":"d3450429-be01-4a00-b7b2-5df3c552dcd0","type":"WheelZoomTool"},{"attributes":{"children":[{"id":"99c43d83-ec1f-4b0e-a22e-0e680699b83e","type":"Slider"},{"id":"25d118dd-3db0-43a3-95c4-8a17e10bb5af","type":"Slider"},{"id":"de4c7abf-db68-4364-a8b7-2e0230a96b60","type":"Slider"},{"id":"fdbfe283-7350-4251-a2ce-25af2cd600e9","type":"Slider"}]},"id":"a1198bd0-076a-4544-b185-56e6b83d4526","type":"WidgetBox"},{"attributes":{},"id":"e3e56a4c-669f-4a0e-9d4e-a100b84cd017","type":"BasicTickFormatter"},{"attributes":{"formatter":{"id":"dbaf12c0-7ce5-465c-bd2a-7170bc72692e","type":"BasicTickFormatter"},"plot":{"id":"c6387721-204a-463f-aa69-5ff337b3502b","subtype":"Figure","type":"Plot"},"ticker":{"id":"82006ed7-ae02-4516-8f87-71eb99530e5b","type":"BasicTicker"}},"id":"da3a2493-3106-4feb-bde3-3f353289c571","type":"LinearAxis"},{"attributes":{},"id":"bdc22a96-8303-48b6-8967-cb17184036c6","type":"PanTool"},{"attributes":{},"id":"819dc95d-3b34-44b0-864b-eb211e03a39d","type":"BasicTicker"},{"attributes":{"data_source":{"id":"a7f97869-166b-4b1b-b0db-28bbfc1913e8","type":"ColumnDataSource"},"glyph":{"id":"6d80e798-6713-4963-bf5e-209f97cce9e1","type":"Line"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"2ca82da1-abc7-4e32-b68f-d9764e25ff02","type":"Line"},"selection_glyph":null,"view":{"id":"9bcec673-7955-43db-acc1-bb6330ae9b92","type":"CDSView"}},"id":"bd0b763f-7c07-4739-84ea-72213181bf3f","type":"GlyphRenderer"},{"attributes":{},"id":"219cbf3e-b946-4401-9cc7-bd4848001eea","type":"LinearScale"},{"attributes":{"children":[{"id":"c6387721-204a-463f-aa69-5ff337b3502b","subtype":"Figure","type":"Plot"},{"id":"a1198bd0-076a-4544-b185-56e6b83d4526","type":"WidgetBox"}]},"id":"322bfbdf-8a96-4215-b849-03fabddd8135","type":"Row"},{"attributes":{"line_alpha":{"value":0.6},"line_color":{"value":"#1f77b4"},"line_width":{"value":3},"x":{"field":"x"},"y":{"field":"y"}},"id":"6d80e798-6713-4963-bf5e-209f97cce9e1","type":"Line"},{"attributes":{"overlay":{"id":"b8bb6593-aeb7-4959-90e0-6a1c07edfaf4","type":"BoxAnnotation"}},"id":"c2c4a01a-12d5-416a-abbc-379d8fd32912","type":"BoxZoomTool"},{"attributes":{},"id":"dbaf12c0-7ce5-465c-bd2a-7170bc72692e","type":"BasicTickFormatter"},{"attributes":{"source":{"id":"a7f97869-166b-4b1b-b0db-28bbfc1913e8","type":"ColumnDataSource"}},"id":"9bcec673-7955-43db-acc1-bb6330ae9b92","type":"CDSView"},{"attributes":{"formatter":{"id":"e3e56a4c-669f-4a0e-9d4e-a100b84cd017","type":"BasicTickFormatter"},"plot":{"id":"c6387721-204a-463f-aa69-5ff337b3502b","subtype":"Figure","type":"Plot"},"ticker":{"id":"819dc95d-3b34-44b0-864b-eb211e03a39d","type":"BasicTicker"}},"id":"4dd34051-bc00-4780-baa6-df79574f38aa","type":"LinearAxis"},{"attributes":{"callback":{"id":"82dcb1ef-5af3-438c-8b05-e64f361244bd","type":"CustomJS"},"end":5,"start":-5,"step":0.1,"title":"Offset","value":0},"id":"fdbfe283-7350-4251-a2ce-25af2cd600e9","type":"Slider"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"bdc22a96-8303-48b6-8967-cb17184036c6","type":"PanTool"},{"id":"d3450429-be01-4a00-b7b2-5df3c552dcd0","type":"WheelZoomTool"},{"id":"c2c4a01a-12d5-416a-abbc-379d8fd32912","type":"BoxZoomTool"},{"id":"d47da4e2-436d-4455-9ce0-5832062f77dc","type":"SaveTool"},{"id":"4767f717-1a2b-402d-9bd9-d255b4a0b77e","type":"ResetTool"},{"id":"07e36571-f772-47af-a10a-7b1cff67f1bb","type":"HelpTool"}]},"id":"9d0269dc-8760-4111-91dd-1581dbf9d367","type":"Toolbar"},{"attributes":{},"id":"4767f717-1a2b-402d-9bd9-d255b4a0b77e","type":"ResetTool"},{"attributes":{"dimension":1,"plot":{"id":"c6387721-204a-463f-aa69-5ff337b3502b","subtype":"Figure","type":"Plot"},"ticker":{"id":"819dc95d-3b34-44b0-864b-eb211e03a39d","type":"BasicTicker"}},"id":"f2753367-bcfd-40bf-b615-5615af38cb16","type":"Grid"},{"attributes":{},"id":"1bbe0327-02d5-4afd-92b4-ef371aa81c75","type":"LinearScale"}],"root_ids":["322bfbdf-8a96-4215-b849-03fabddd8135"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"53204d0c-044f-4fce-882e-11eee6b3ee6d","elementid":"45c0cbd1-a422-4641-a968-1344f50030cb","modelid":"322bfbdf-8a96-4215-b849-03fabddd8135"}];
                
                    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://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);
})();
