Stencila keeps track of the code dependecies between the code cells. It supports reactive programming which means that the code and the respective outputs will get updated, when you change a piece of code they depend on. It is a similar principle as behind the behavior of spreadsheet applications. You can refer to specific outputs from any code cell in any part of your Stencila document. Stencila does all this using its execution engine.
if you want to capture the output of the cell so that you can refer to it throughout the document, you need to create a variable and assign (
=) the output. To be more precise, you are capturing the result of the evaluation of the cell.
Note that, the variables in Stencila are non-mutable.
var x = 4 var y = Math.sqrt(x)
Now you can refer to the output of the cell using the variable
If you do not capture the output explicitly, you will not be able to refer to it later on. For example:
var x = 4 Math.sqrt(x)
The result of the
2 but you will not be able to refer to it since it has not been captured explicitly in a variable.
Summarizing: the output of this cell is not captured and the result of evaluating this cell is 2 (
Stencila provides you with ability to use multiple programming languages to write interactive code within
one document, working on the same data. In other words, you can manipulate the same data switching between different programming
languages. This capability is achieved through
data interchange feature.
*The object fields and methods are saved within the schema-defined object/array and converted accordingly.