Options
All
  • Public
  • Public/Protected
  • All
Menu

External module Graph

Wrattler maintains a dependency graph that is used for evaluating code. The dependency graph is constructed by calling the bind operation of LanguagePlugin for individual languages supported in Wrattler. The graph is created once Wrattler loads a notebook and it is then updated each time a cell is modified. The dependency graph is static, meaning that it is created by analysing source code, rather than by tracking dependencies at runtime.

A node in the graph is represented by the Node type. It is identified by the hash property. A Node also keeps the value of the part of code that the node represents. See the Values module for the types representing values. When code in a cell is modified, a new node with a new hash is created. Its value is initially set to null until the user forces evaluation of the node or any node that depends on it.

  • Node is the main type exported by this module. It represents a graph node, tracks antecedents (nodes that this one depends on) and, importantly, stores value and also errors associated with the node.

  • ExportNode is a special type of node that should be used for nodes that represent exported variables from a cell. If code in your cell produces a data frame, you should create this node for each of the exported data frames. This type has an extra attribute variableName which Wrattler uses to pass variables to cells below in the notebook.

  • Error represents error messages and NodeCache is used when constructing dependency graph to cache nodes so that, when you undo a change, Wrattler reuses the same graph node as before which remembers the previously evaluated results.

  • The remaining types are internal to Wrattler. JavaScript language plugin uses JsNode, which can be either JsExportNode or JsCodeNode. External language plugins uses ExternalNode, which can be either ExternalExportNode or ExternalCodeNode.

Index

Type aliases

ExternalNode

This type represents all possible types of nodes created by External language plugin. The plugin gets only nodes of this type and can pattern match on them using the kind tag.

JsNode

This type represents all possible types of nodes created by JavaScript language plugin. The plugin gets only nodes of this type and can pattern match on them using the kind tag.

Generated using TypeDoc