title: Precompute Jupyter widget results and embed in HTML
body: <p>I'm currently working on a Jupyter notebook that creates an energy level diagram using matplotlib. One parameter of the underlaying spectrum computation can be varied using an interact statement. Now I want to export this notebook to HTML while the widget functionality should stay intact. Is it possible to precompute all possible outcomes and include them into the HTML version? Users should be able to use the interact feature without having to connect to a kernel.</p>
  
  <p>Thanks for advice.</p>
  
  <p>Peter</p>
  
  <p><strong>EDIT</strong>: I hope to clarify my question with the following sample code:</p>
  
  <pre class="lang-python prettyprint-override"><code>from ipywidgets import interact
  import matplotlib.pyplot as plt
  import numpy as np
  
  def f(a):
      x = np.linspace(0,2,100)
      plt.plot(x,a*x**2)
      plt.ylim([0,20])
      plt.show()
      return None
  
  interact(f, a=(1,5,1))
  </code></pre>
  
  <p>In the final HTML file all possible images (in this case all parabolas with a=1...5) should be included (in this sense pre-computed) and then displayed when the user selects the appropiate value with the slider. </p>