Interactive presentation 📝

import mercury as mr
import numpy as np
from matplotlib import pyplot as plt

app = mr.App(title="Slides demo 📝", description="Wouldn't it be amazing to recompute slides during the show?") 

Recompute slides 🖥️

  • You can create interactive presentation with Mercury
  • Users can recompute slides by changing widgets
  • You can enter full screen by pressing F and exit with Esc
  • Please check next slides ➡️
name = mr.Text(label="What is your name?", value="Piotr")
mr.Markdown(f"""## Hello {name.value}!

{name.value}, this slide is recomputed after name change in the left side bar.

Please change the name value in the left side bar and press **Enter**.

Please check next slide ➡️

""")
samples = mr.Slider(label="How many samples", value=75, min=50, max=100)
color = mr.Select(label="Mark color", value="blue", choices=["blue", "green", "red"])
mr.Markdown("""## Scatter plot 🎲
Please change number of samples and mark color in the left side bar. The plot will be updated during the slide show.""")
_ = plt.plot(np.random.rand(samples.value), np.random.rand(samples.value), "*", color=color.value)

Thank you!

Please check our documentation at RunMercury.com for more information 📚