============== User Interface ============== Thebe includes support for some built-in user interface elements. The aim is to provide simple elements that can be added to a page and styled accordingly by the consumer without needing to [re]write code. Using these UI elements in the way shown here, assumes that you already have Thebe statically loaded on page. Built in UI elements are: - Activate Button - Kernel Status Widget Activate Button =============== When this button is pressed, it will run the `thebelab.bootstrap` function on the page. Configure this UI element as follows. Add a ``div`` element to the page in the desired location. .. code-block:: html
Then set the following option to :code:`mountActivateWidget:true` in the Thebe config object Status Widget ============= This element will display the status of the kernel, it will update when the kernel sends new messages or when code is executed. Configure this UI element as follows. Add a :code:`div` element to the page in the desired location. .. code-block:: html
Then set the following option to :code:`mountStatusWidget:true` in the Thebe config object Example ======= Adding the following to a page will render both Activate and Status widgets. .. code-block:: html
Pressing activate will convert the following code into an activate cell, and the kernel status widget will show status of the kernel launch. .. raw:: html
.. raw:: html
   %matplotlib inline
   import numpy as np
   import matplotlib.pyplot as plt
   x = np.linspace(0,10)
   plt.plot(x, np.sin(x))
   plt.plot(x, np.cos(x))
   
Note: If you are looking to load Thebe dynamically, check the custom launch button `in the example here. `_