C3 AI Documentation Home

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

NameRequiredTypeDescription
codestringAny code to execute immediately in the new notebook.
optionsobjectOptions for the notebook instance.

Notebook Options

The options parameter may have any of the following properties:

  • restore: A boolean value. When true, c3Notebook will 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();

See also

Was this page helpful?