Notebook

interface Notebook

Notebook is a main entry point for Kotlin Jupyter API

Properties

Link copied to clipboard

All executed cells of this notebook

Link copied to clipboard
abstract val cellVariables: Map<Int, Set<String>>

Stores info about useful variables in a cell. Key: cellId; Value: set of variable names. Useful <==> declarations + modifying references

Link copied to clipboard
abstract val commManager: CommManager

Manages custom messages

Link copied to clipboard

Current cell

Link copied to clipboard

Current session classpath

Link copied to clipboard

Current color scheme. Works correctly only in Kotlin Notebook plugin

Link copied to clipboard
Link copied to clipboard

Represents the execution host for the Kotlin kernel. Could be null outside of the execution, so use it with care.

Link copied to clipboard
Link copied to clipboard
abstract val jreInfo: JREInfoProvider

Current JRE info

Link copied to clipboard

Jupyter client that started the current kernel session

Link copied to clipboard

Kernel Run mode. Determines some capabilities of a running kernel depending on the environment it's running under

Link copied to clipboard

Current kernel version

Link copied to clipboard
open val lastCell: CodeCell?

Last evaluated cell

Link copied to clipboard

LibraryLoader of the current session

Link copied to clipboard

All requests for libraries made during this session

Link copied to clipboard

Logger factory of the current session

Link copied to clipboard

Renderers processor gives an ability to render values and add new renderers

Link copied to clipboard

Returns the object that allows to access execution results

Link copied to clipboard

Configuration options for the current notebook session.

Link copied to clipboard

Current state of visible variables

Functions

Link copied to clipboard
fun Notebook.animate(nextFrame: () -> Frame<*>?)

Triggers the animation sequence consisting of frames that are produced by the nextFrame function.

fun Notebook.animate(iterable: Iterable<Frame<*>>)

Displays all the frames in this iterable, with respect to the delays.

fun Notebook.animate(frames: Iterator<Frame<*>>)

Displays all the frames left in this frames iterator, with respect to the delays.

fun Notebook.animate(sequence: Sequence<Frame<*>>)

Displays all the frames in this sequence, with respect to the delays.

fun Notebook.animate(framesCount: Int, frameByIndex: (index: Int) -> Frame<*>)

Animates a sequence of frames by displaying them with respect to their delays.

fun Notebook.animate(delay: Duration, nextValue: () -> Any?)
fun Notebook.animate(delay: Duration, sequence: Sequence<*>)
fun <T : Any> Notebook.animate(delay: Duration, firstValue: T?, nextValue: (T) -> T?)
fun Notebook.animate(delay: Duration, framesCount: Int, valueByIndex: (index: Int) -> Any?)

Animates a sequence of values with a specified delay between each frame. The first value is displayed without a delay.

fun Notebook.animate(delay: Duration, iterable: Iterable<*>)

Animates an iterable sequence of values, each one (except first) appearing after a specified delay.

fun Notebook.animate(delay: Duration, iterator: Iterator<*>)

Animates a sequence of values by displaying them with specified delay. The first value is displayed without a delay.

fun <T> Notebook.animate(firstFrame: Frame<T>, nextFrame: (Frame<T>) -> Frame<T>?)

Triggers the animation using a chain of frames, beginning with firstFrame and subsequently obtained through the nextFrame function.

Link copied to clipboard
abstract fun changeColorScheme(newScheme: ColorScheme)

Change color scheme and run callbacks. Works correctly only in Kotlin Notebook plugin

Link copied to clipboard
fun Notebook.display(value: Any, id: String? = null)

Displays the given value in the notebook.

Link copied to clipboard

Information about all display data objects

Link copied to clipboard
abstract fun getCell(id: Int): CodeCell

Mapping allowing to get cell by execution number

Link copied to clipboard

Information about displays with the given id

Link copied to clipboard
abstract fun getLibraryFromDescriptor(descriptorText: String, options: Map<String, String> = emptyMap()): LibraryDefinition

Converts descriptor JSON text into LibraryDefinition

Link copied to clipboard
abstract fun getResult(id: Int): Any?

Mapping allowing to get a result by execution number

Link copied to clipboard
abstract fun history(before: Int): CodeCell?

Get cell by relative offset: 0 for current cell, 1 for previous cell, and so on

Link copied to clipboard
abstract fun prompt(prompt: String = DefaultPromptOptions.PROMPT, isPassword: Boolean = DefaultPromptOptions.IS_PASSWORD): String

Prompts the user for input and returns the entered value as a String.

Link copied to clipboard

Renders HTML as iframe that fixes scrolling and color scheme issues in Kotlin Notebook plugin

Link copied to clipboard

Renders HTML as iframe in Kotlin Notebook or simply in other clients

Link copied to clipboard
fun Notebook.updateDisplay(value: Any, id: String? = null)

Updates the display with the given value.