Pluto notebooks are reactive! This means that when you change a value or a line of code, Pluto automatically updates all the cells that depend on it. No need to run cells one by one โ Pluto figures out what needs to be updated, and does it for you. โจ
In this example, changing the parameter A and running the first cell will directly re-evaluate the second cell and display the new plot.
A
Cells run automatically when they need to. If a cell uses a variable, it will re-run when that variable changes.
Global variables are deleted when their definition is removed. For example, if you change a cell from apple = 1 to banana = 2, then the apple variable will be deleted. It does not โlinger aroundโ in the background.
apple = 1
banana = 2
apple
You are not allowed to redefine a global variable in a second cell. Two cells cannot both define x.
x
Pluto tracks the dependencies between cells by looking at the syntax tree of your code. Pluto searches for variable assignments and references, and it uses this to build up a reactive dependency graph of your notebook.
Using this dependency graph, Pluto knows how cells relate to each other. Pluto can search โup the treeโ to find out which cells should run before, and โdown the treeโ to find out which cells depend on a given cell.
Read more about Plutoโs reactivity algorithm in:
Pluto does not have a global switch to turn off reactivity, there is no โJupyter modeโ. However, you can turn off reactivity for a specific cell! You can disable a cell. More on this later!