(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("fb01e615-c056-476a-8aef-95263b93881a");
      if (element == null) {
        console.log("Bokeh: ERROR: autoload.js configured with elementid 'fb01e615-c056-476a-8aef-95263b93881a' 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 = {"ab2bdbf1-a59d-40a0-9782-8a53b981159f":{"roots":{"references":[{"attributes":{"callback":null,"end":10,"start":-10},"id":"6f3d73eb-30a9-4655-bbac-550d1817b639","type":"Range1d"},{"attributes":{"line_alpha":{"value":0.1},"line_color":{"value":"#1f77b4"},"line_width":{"value":3},"x":{"field":"x"},"y":{"field":"y"}},"id":"b2096a93-7853-41a7-930c-5f599272d864","type":"Line"},{"attributes":{},"id":"5e0c4b48-5fd3-4c78-8cb6-0c3ca5e12748","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":"c6cbd0cd-fdf5-4c29-b386-cb32c08c9a80","type":"BoxAnnotation"},{"attributes":{},"id":"f2fd47a0-00a1-4ec5-9850-65368eab097e","type":"BasicTicker"},{"attributes":{"callback":{"id":"ccc160da-6d26-4e69-acc1-6db21ffecd00","type":"CustomJS"},"end":6.4,"start":0,"step":0.1,"title":"Phase","value":0},"id":"ba03a8a8-db6d-4410-bb5c-4d76748edf9a","type":"Slider"},{"attributes":{"callback":{"id":"ccc160da-6d26-4e69-acc1-6db21ffecd00","type":"CustomJS"},"end":10,"start":0.1,"step":0.1,"title":"Frequency","value":1},"id":"a0734c7d-0171-4565-baba-99c1d7da09a3","type":"Slider"},{"attributes":{},"id":"1b3a5f7a-369d-4039-b597-9e19be779d6f","type":"HelpTool"},{"attributes":{"plot":{"id":"9ea91369-2d56-432b-aea5-5fb89984c7de","subtype":"Figure","type":"Plot"},"ticker":{"id":"f2fd47a0-00a1-4ec5-9850-65368eab097e","type":"BasicTicker"}},"id":"fe6cf6e7-d8fe-460f-b68a-8665fa87c8e1","type":"Grid"},{"attributes":{"plot":null,"text":""},"id":"dc27f7d8-eba3-4078-8b3d-9d7df25cc06e","type":"Title"},{"attributes":{"args":{"amp":{"id":"c033a15d-ad5b-40ad-bbad-73e0296f5b04","type":"Slider"},"freq":{"id":"a0734c7d-0171-4565-baba-99c1d7da09a3","type":"Slider"},"offset":{"id":"91864a0d-dc5f-4bb2-8ca2-db8135e72223","type":"Slider"},"phase":{"id":"ba03a8a8-db6d-4410-bb5c-4d76748edf9a","type":"Slider"},"source":{"id":"cb45230f-e81f-4e98-abb2-64995176852a","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":"ccc160da-6d26-4e69-acc1-6db21ffecd00","type":"CustomJS"},{"attributes":{},"id":"d20588de-485b-462a-884a-f661f3b5cfd8","type":"BasicTicker"},{"attributes":{"data_source":{"id":"cb45230f-e81f-4e98-abb2-64995176852a","type":"ColumnDataSource"},"glyph":{"id":"24e8e7a7-74a6-4e57-bcc2-7ab95bd0ecbe","type":"Line"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"b2096a93-7853-41a7-930c-5f599272d864","type":"Line"},"selection_glyph":null,"view":{"id":"05612e53-53ab-4086-b2d7-fa3d9fb42138","type":"CDSView"}},"id":"d5777f46-5090-42b3-9ba9-fdd6cd121bb5","type":"GlyphRenderer"},{"attributes":{},"id":"53071f03-63af-4728-9ff4-184a08784dcf","type":"LinearScale"},{"attributes":{"children":[{"id":"c033a15d-ad5b-40ad-bbad-73e0296f5b04","type":"Slider"},{"id":"a0734c7d-0171-4565-baba-99c1d7da09a3","type":"Slider"},{"id":"ba03a8a8-db6d-4410-bb5c-4d76748edf9a","type":"Slider"},{"id":"91864a0d-dc5f-4bb2-8ca2-db8135e72223","type":"Slider"}]},"id":"d8a3c7e8-0a26-49a8-beb8-d5d3fc4a644c","type":"WidgetBox"},{"attributes":{"children":[{"id":"9ea91369-2d56-432b-aea5-5fb89984c7de","subtype":"Figure","type":"Plot"},{"id":"d8a3c7e8-0a26-49a8-beb8-d5d3fc4a644c","type":"WidgetBox"}]},"id":"e17d46a8-5493-4496-a594-769e2b787a2c","type":"Row"},{"attributes":{},"id":"4c866bec-d1a2-4c99-8358-d0a768b212b7","type":"BasicTickFormatter"},{"attributes":{},"id":"d15fc3de-93d7-444a-bb3e-4466dee639dc","type":"LinearScale"},{"attributes":{"callback":{"id":"ccc160da-6d26-4e69-acc1-6db21ffecd00","type":"CustomJS"},"end":5,"start":-5,"step":0.1,"title":"Offset","value":0},"id":"91864a0d-dc5f-4bb2-8ca2-db8135e72223","type":"Slider"},{"attributes":{"formatter":{"id":"4c866bec-d1a2-4c99-8358-d0a768b212b7","type":"BasicTickFormatter"},"plot":{"id":"9ea91369-2d56-432b-aea5-5fb89984c7de","subtype":"Figure","type":"Plot"},"ticker":{"id":"d20588de-485b-462a-884a-f661f3b5cfd8","type":"BasicTicker"}},"id":"64818644-63c1-4077-90d6-f804b8f25781","type":"LinearAxis"},{"attributes":{"callback":null},"id":"fc6d195a-87ab-4bb3-8e81-991c52c2fcbf","type":"DataRange1d"},{"attributes":{},"id":"42b4e2a3-fb84-4541-9055-1e082a9af8a8","type":"BasicTickFormatter"},{"attributes":{"callback":null,"column_names":["y","x"],"data":{"x":{"__ndarray__":" ","dtype":"float64","shape":[500]},"y":{"__ndarray__":" ","dtype":"float64","shape":[500]}}},"id":"cb45230f-e81f-4e98-abb2-64995176852a","type":"ColumnDataSource"},{"attributes":{"overlay":{"id":"c6cbd0cd-fdf5-4c29-b386-cb32c08c9a80","type":"BoxAnnotation"}},"id":"0ae44602-4a1c-4c96-9970-180c8f8af0a7","type":"BoxZoomTool"},{"attributes":{},"id":"07f2fa47-b043-41a2-9556-b54c79c0e063","type":"SaveTool"},{"attributes":{},"id":"22c88210-5c51-4f5d-86a4-5a5d7e417eda","type":"ResetTool"},{"attributes":{},"id":"bd605f9b-cbe8-407f-bf4b-c631ca0cfe27","type":"PanTool"},{"attributes":{"source":{"id":"cb45230f-e81f-4e98-abb2-64995176852a","type":"ColumnDataSource"}},"id":"05612e53-53ab-4086-b2d7-fa3d9fb42138","type":"CDSView"},{"attributes":{"dimension":1,"plot":{"id":"9ea91369-2d56-432b-aea5-5fb89984c7de","subtype":"Figure","type":"Plot"},"ticker":{"id":"d20588de-485b-462a-884a-f661f3b5cfd8","type":"BasicTicker"}},"id":"7188fa92-e93f-4413-81ad-b8dd85252241","type":"Grid"},{"attributes":{"line_alpha":{"value":0.6},"line_color":{"value":"#1f77b4"},"line_width":{"value":3},"x":{"field":"x"},"y":{"field":"y"}},"id":"24e8e7a7-74a6-4e57-bcc2-7ab95bd0ecbe","type":"Line"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"bd605f9b-cbe8-407f-bf4b-c631ca0cfe27","type":"PanTool"},{"id":"5e0c4b48-5fd3-4c78-8cb6-0c3ca5e12748","type":"WheelZoomTool"},{"id":"0ae44602-4a1c-4c96-9970-180c8f8af0a7","type":"BoxZoomTool"},{"id":"07f2fa47-b043-41a2-9556-b54c79c0e063","type":"SaveTool"},{"id":"22c88210-5c51-4f5d-86a4-5a5d7e417eda","type":"ResetTool"},{"id":"1b3a5f7a-369d-4039-b597-9e19be779d6f","type":"HelpTool"}]},"id":"5ad7d11f-1cb3-4b54-aee8-dac9990e7fc6","type":"Toolbar"},{"attributes":{"callback":{"id":"ccc160da-6d26-4e69-acc1-6db21ffecd00","type":"CustomJS"},"end":10,"start":0.1,"step":0.1,"title":"Amplitude","value":1},"id":"c033a15d-ad5b-40ad-bbad-73e0296f5b04","type":"Slider"},{"attributes":{"below":[{"id":"a176cc7c-d535-405e-80b1-8258daf28e18","type":"LinearAxis"}],"left":[{"id":"64818644-63c1-4077-90d6-f804b8f25781","type":"LinearAxis"}],"plot_height":400,"plot_width":400,"renderers":[{"id":"a176cc7c-d535-405e-80b1-8258daf28e18","type":"LinearAxis"},{"id":"fe6cf6e7-d8fe-460f-b68a-8665fa87c8e1","type":"Grid"},{"id":"64818644-63c1-4077-90d6-f804b8f25781","type":"LinearAxis"},{"id":"7188fa92-e93f-4413-81ad-b8dd85252241","type":"Grid"},{"id":"c6cbd0cd-fdf5-4c29-b386-cb32c08c9a80","type":"BoxAnnotation"},{"id":"d5777f46-5090-42b3-9ba9-fdd6cd121bb5","type":"GlyphRenderer"}],"title":{"id":"dc27f7d8-eba3-4078-8b3d-9d7df25cc06e","type":"Title"},"toolbar":{"id":"5ad7d11f-1cb3-4b54-aee8-dac9990e7fc6","type":"Toolbar"},"x_range":{"id":"fc6d195a-87ab-4bb3-8e81-991c52c2fcbf","type":"DataRange1d"},"x_scale":{"id":"53071f03-63af-4728-9ff4-184a08784dcf","type":"LinearScale"},"y_range":{"id":"6f3d73eb-30a9-4655-bbac-550d1817b639","type":"Range1d"},"y_scale":{"id":"d15fc3de-93d7-444a-bb3e-4466dee639dc","type":"LinearScale"}},"id":"9ea91369-2d56-432b-aea5-5fb89984c7de","subtype":"Figure","type":"Plot"},{"attributes":{"formatter":{"id":"42b4e2a3-fb84-4541-9055-1e082a9af8a8","type":"BasicTickFormatter"},"plot":{"id":"9ea91369-2d56-432b-aea5-5fb89984c7de","subtype":"Figure","type":"Plot"},"ticker":{"id":"f2fd47a0-00a1-4ec5-9850-65368eab097e","type":"BasicTicker"}},"id":"a176cc7c-d535-405e-80b1-8258daf28e18","type":"LinearAxis"}],"root_ids":["e17d46a8-5493-4496-a594-769e2b787a2c"]},"title":"Bokeh Application","version":"0.12.9"}};
                    var render_items = [{"docid":"ab2bdbf1-a59d-40a0-9782-8a53b981159f","elementid":"fb01e615-c056-476a-8aef-95263b93881a","modelid":"e17d46a8-5493-4496-a594-769e2b787a2c"}];
                
                    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);
})();
