Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Provenance<T, S, A>

Type parameters

  • T

    Reprents the given state of an application as defined in initProvenance.

  • S

    Reprents the given event types in your application. Event types are used to differentiate between different actions that create nodes.

  • A

    Reprents the given "extra" type for storing metadata. Extra is a way to store customized metadata.

Hierarchy

  • Provenance

Index

Properties

addAction

addAction: (label: string, action: ActionFunction<T>) => Action<T, S, A>

Function for creating new nodes in the graph. Creates and returns an Action object which can be further customized before applying the action, which created a new node. For further documentation on the Action object, see Action.ts

param

Label to be associated with this action.

param

ActionFunction type function used to change the state. See ActionFunction documentation above.

Type declaration

addAnnotationToNode

addAnnotationToNode: (id: NodeID, annotation: string) => void

Stores the given annotation string in the artifacts of the node with the given NodeID

Type declaration

    • (id: NodeID, annotation: string): void
    • Parameters

      • id: NodeID
      • annotation: string

      Returns void

addArtifactObserver

addArtifactObserver: (func: ArtifactSubscriberFunction<A>) => void

Type declaration

addExtraToNodeArtifact

addExtraToNodeArtifact: (id: NodeID, extra: A) => void

Adds one extra object to the node with the given NodeID. Can be called multiple times on the same node to store multiple extras.

Type declaration

    • (id: NodeID, extra: A): void
    • Parameters

      Returns void

addGlobalObserver

addGlobalObserver: (func: SubscriberFunction<T>) => void

Global observer which is called whenever the state of the application changes whatsoever.

Type declaration

addObserver

addObserver: (propPath: string[], func: SubscriberFunction<T>) => void

Adds an observer to the key in the state Object which propPath leads to. For example, if your state looked like { selected: 'A', position: { A: 10 B: 5 C: 13 } }

And you wanted an observer which was called whenever a node is selected, your propPath would be ['selected'].

If you wanted an observer strictly for when the position of A changed, your propPath would be ['position', 'A']

Second parameter is associated subscriber function which is called when the observer is triggered

Type declaration

applyAction

applyAction: (label: string, action: ActionFunction<T>, args?: any[], metadata?: NodeMetadata<S>, artifacts?: Artifacts<A>, eventType?: S, complex?: undefined | false | true, ephemeral?: undefined | false | true) => T

OUTDATED Old way to apply an action. addAction combined with the functions in Action.ts replace this.

Type declaration

    • (label: string, action: ActionFunction<T>, args?: any[], metadata?: NodeMetadata<S>, artifacts?: Artifacts<A>, eventType?: S, complex?: undefined | false | true, ephemeral?: undefined | false | true): T
    • Parameters

      • label: string
      • action: ActionFunction<T>
      • Optional args: any[]
      • Optional metadata: NodeMetadata<S>
      • Optional artifacts: Artifacts<A>
      • Optional eventType: S
      • Optional complex: undefined | false | true
      • Optional ephemeral: undefined | false | true

      Returns T

current

current: () => ProvenanceNode<T, S, A>

Returns the current Provenance Node object

Type declaration

done

done: () => void

Function to call when finished setting up observers. Allows for url state sharing easily.

Type declaration

    • (): void
    • Returns void

exportProvenanceGraph

exportProvenanceGraph: () => string

Exports the entire provenance graph in JSON form. Not compressed.

Type declaration

    • (): string
    • Returns string

exportState

exportState: (partial?: undefined | false | true) => string

Exports the current nodes state. Returns a compressed string representing the JSON form of the current state

Type declaration

    • (partial?: undefined | false | true): string
    • Parameters

      • Optional partial: undefined | false | true

      Returns string

getBookmark

getBookmark: (id: NodeID) => boolean

Gets the bookmark of the node with the given ID.

Type declaration

    • Parameters

      Returns boolean

getDiffFromNode

getDiffFromNode: (id: NodeID) => any[]

Returns the deep-diff of a node compared to its parent

Type declaration

getExtraFromArtifact

getExtraFromArtifact: (id: NodeID) => Extra<A>[]

Returns all extras stored on the node with the given NodeID

Type declaration

goBackNSteps

goBackNSteps: (n: number) => void

Goes N step backwards in the provenance graph. Calls the Global Observer if there is one. Also calls any observers for which their associated state has changed with the new node.

param

number of steps to traverse backwards in the provenance graph.

Type declaration

    • (n: number): void
    • Parameters

      • n: number

      Returns void

goBackOneStep

goBackOneStep: () => void

Goes one step backwards in the provenance graph. Equivalent to 'undo' Calls the Global Observer if there is one. Also calls any observers for which their associated state has changed with the new node.

Type declaration

    • (): void
    • Returns void

goBackToNonEphemeral

goBackToNonEphemeral: () => void

Traverses up the graph until the most recent node which is not ephemeral is found. Sets that node to current.

Type declaration

    • (): void
    • Returns void

goForwardOneStep

goForwardOneStep: () => void

Goes one step forward in the provenance graph. Equivalent to 'redo' Calls the Global Observer if there is one. Also calls any observers for which their associated state has changed with the new node.

Type declaration

    • (): void
    • Returns void

goForwardToNonEphemeral

goForwardToNonEphemeral: () => void

Traverses down the graph until the most recent node which is not ephemeral is found. Sets that node to current.

Type declaration

    • (): void
    • Returns void

goToNode

goToNode: (id: NodeID) => void

Jumps to the node in the provenance graph with the given id. Calls the Global Observer if there is one. Also calls any observers for which their associated state has changed with the new node.

param

NodeID of the node in the ProvenanceGraph to jump to.

Type declaration

graph

graph: () => ProvenanceGraph<T, S, A>

Returns the ProvenanceGraph object

Type declaration

importLinearStates

importLinearStates: (states: T[], labels?: string[], metadata?: NodeMetadata<S>[]) => void

Given a series of linear states, constructs a new provenance graph. Designed mostly for recreating old provenance graphs. Using exportProvenanceGraph and importProvenanceGraph is preferred

Type declaration

    • (states: T[], labels?: string[], metadata?: NodeMetadata<S>[]): void
    • Parameters

      • states: T[]
      • Optional labels: string[]
      • Optional metadata: NodeMetadata<S>[]

      Returns void

importProvenanceGraph

importProvenanceGraph: (importString: string) => void

Imports an entire, non compressed provenance graph in JSON form. Replaces the current provenance graph with the new one.

Type declaration

    • (importString: string): void
    • Parameters

      • importString: string

      Returns void

importState

importState: (importString: string) => void

Imports the given state. Decompresses the given string and creates a new node with that state.

param

Decompressed string recieved from exportState function to import.

Type declaration

    • (importString: string): void
    • Parameters

      • importString: string

      Returns void

reset

reset: () => void

Returns to the root node.

Type declaration

    • (): void
    • Returns void

root

root: () => RootNode<T, S>

Returns the Root Node object

Type declaration

setBookmark

setBookmark: (id: NodeID, b: boolean) => void

Sets the bookmark of the node with the given ID. the bookmark is set to true or false, equivalent on the second parameter.

Type declaration

    • (id: NodeID, b: boolean): void
    • Parameters

      Returns void

Generated using TypeDoc