Your First Notebook
In this section, you will create a simple notebook, execute a few cells, and learn how code is executed inside the sandbox.
By the end of this tutorial, you will understand:
- How notebooks are organized
- How cells are executed
- How results are displayed
- How the sandbox manages variables and state
Creating a Notebook
Create a new notebook from the File → New menu.
A new notebook contains an empty workspace where you can add and execute cells.
A notebook is composed of independent cells that can be executed individually.
Notebook
├── Cell 1
├── Cell 2
└── Cell 3Each cell contains a piece of JavaScript code.
Together, cells form a complete analysis workflow.
Running Code
Cells
A cell is the basic execution unit of a notebook.
Create a new cell and enter the following code:
notebook.log('Hello World');Execution
Execute the cell using the Run button, or type Shift + Enter.
The notebook sends the cell code to the sandbox, where it is executed.
Each execution is independent and can be repeated as many times as needed.
You can modify the code and execute the cell again at any time.
Results
After execution, the result appears directly below the cell.
Hello WorldLogs, warnings, errors and successes are all displayed near the cell that produced them.
This makes it easy to understand where a result originates.
Understanding the Sandbox
The sandbox is the runtime environment used by all notebook cells.
It executes code and stores the notebook runtime state.
Variable Isolation
Create two separate cells.
Cell 1
var total = 100;
notebook.log(total);Cell 2
notebook.log(total);Execute the first cell, then the second one.
If the first cell will display the log of total, you will get an error displayed for the second cell.
(line: 1) total is not definedThe second cell cannot access the variable created by the first cell because each cell has its own local scope.
This isolation prevents accidental conflicts between cells.
Shared Variables
To share a value between cells, store it in the sandbox global scope.
Cell 1
window.total = 100;Cell 2
notebook.log(total);The second cell can now access the value because it is stored in the shared sandbox state.
Sandbox Lifecycle
The sandbox remains active while the notebook is open.
Global Variables, loaded datasets and runtime objects remain available between executions.
If needed, the sandbox can be restarted to clear all runtime state and start from a clean environment.
At anytime, you can click the menu Edit → Restart Sandbox.
After a restart, global variables and runtime objects must be recreated.
Next Step
Now that you understand how notebooks, cells, and the sandbox work together, you are ready to start working with datasets and DataFrames.