Console Reference: c3Notebook
c3Notebook creates a new JavaScript execution environment as a new tab in your C3 AI Console instance. You can optionally provide some code as a string, which executes when the new tab opens.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
code | string | Any code to execute immediately in the new notebook. | |
options | object | Options for the notebook instance. |
Notebook Options
The options parameter may have any of the following properties:
restore: A boolean value. When true,c3Notebookwill attempt to restore a saved notebook or create a new one with a saved state.
Example
Create a notebook with a single cell containing some specified code:
JavaScript
// Open a new notebook tab with a single cell containing `var a = 4`;
c3Notebook("var a = 4;");Create a notebook with a recoverable state:
JavaScript
// Open a new notebook tab with a single cell containing `var a = 4`;
c3Notebook("var a = 4;", { restore: true });Create an empty notebook tab:
JavaScript
// Open a new notebook tab with a single cell containing `var a = 4`;
c3Notebook();