Methods
(static) get_history() → {Array.<Object>}
get history array from localstore and parse
- Source:
Returns:
an array of graphs
- Type
- Array.<Object>
(static) push_history(graph, history)
push the current state of the graph onto history
Parameters:
Name | Type | Description |
---|---|---|
graph |
Object | the graph you want to add to history |
history |
Array.<Object> | array of graphs, force rewrite |
- Source:
(static) redo() → {Object}
redo the last undo
- Source:
Returns:
the next graph
- Type
- Object
(static) retrieve_latest_graph() → {Object}
get the latest graph object from localstore
- Source:
Returns:
the latest graph object
- Type
- Object
(static) set_history_keys(machine)
sets the localstore key for history retrival and writing
MUST be used before get_history, push_history, etc.
Parameters:
Name | Type | Description |
---|---|---|
machine |
String | type of machine from ['NFA', 'PDA', 'Turing'] |
- Source:
(static) undo() → {Object}
undos the last operation
- Source:
Returns:
the last graph
- Type
- Object
(inner) remove_ignores(graph) → {Object}
Some information of the graph should not be saved to the history. Remove them here.
Parameters:
Name | Type | Description |
---|---|---|
graph |
Object |
- Source:
Returns:
the graph without the unnecessary information
- Type
- Object