HistoryWrapper

class orion_notebook.graph.history_wrapper.HistoryWrapper(value: T)

Bases: object

Class that wraps the history state of a Graph instance. Contains a list of states of the Graph instance in JSON and the current position in the list

can_redo()bool

Returns if the user can go forward in the history states list

Returns

If the user can go forward in the history

Return type

bool

can_undo()bool

Returns if the user can go back in the history states list

Returns

If the user can go back in the history

Return type

bool

get_value()T

Gets the current state from the history state list as a Graph instance

Returns

The last current state from the history state list (Graph instance)

Return type

T

redo()

Moves the history pointer one position forward (if possible), performing an redo

set_value(new_value: T)

Sets a new value in the history state list as the last state

Parameters

new_value (T) – New value to set in the history state list

undo()

Moves the history pointer one position back (if possible), performing an undo