ConstReadonlycreate: {Dispatches to helper functions to create new dataflow graphs, e.g. from a pipeline or an empty graph.
Readonlyempty: (Creates an empty dataflow graph with the given id map (or a new one if not provided).
Readonlydiff: {The pieces a graph comparison is built from, for a view that brings its own edge shape.
GraphHelper.diffGraphs - which is what you want for two dataflow graphs
Compares the outgoing edges of a single vertex, handing each pair of edges to diffEdge.
Compares all edges of both graphs vertex by vertex, handing each pair to diffEdges.
Optionalproject: (edges: EdgeMap) => (...) | (...)Compare two dataflow graphs and return a report on the differences.
If you simply want to check whether they equal, use <result>.isEqual().
Optionalconfig: Partial<GenericDiffConfiguration>Whether any argument of the call carries a value the program worked out, rather than only literals the
author typed: cat("starting\n") is a log line, cat("n =", length(m)) is a finding.
A call among the arguments counts as computed, even one over literals such as paste("a", "b").
Inverts the given dataflow graph by reversing all edges.
See DataflowGraph#isQuoted, which this answers for graph.
Readonlyname: "Dataflow"Readonlyorigin: (this: void, dfg: DataflowGraph, id: NodeId) => Origin[] | undefinedReturns the origin of a vertex in the dataflow graph
getOriginInDfg - for the underlying function
The packages the given nodes call into, as Dataflow.qualify resolves every call among them.
This is what a selection needs, which is not what the program loads: a library() whose exports the
selection never calls does not make the package needed. Base R is left out unless includeBaseR.
the ids to consider, e.g. the result of a slice
the graph the ids belong to
whether to also report base-R packages
Given the id of a vertex (usually a variable use), this returns a reachable provenance set by calculating a non-interprocedural and non-context sensitive backward slice, but stopping at the given ids! You can obtain the corresponding graph using Dataflow.reduceGraph.
The id to use as a seed for provenance calculation
The graph to perform the provenance calculation on
Optionalconsider: ReadonlySet<NodeId>
The ids to restrict the calculation too (e.g., the ids contained within a function definition to restrict the analysis to)
Which edges to consider in the provenance traversal, if you set this to undefined this will automatically track all edges
Dataflow.provenanceGraph - for a convenience wrapper to directly obtain the graph of the provenance.
A convenience wrapper for reducing the provenance of a graph.
The id to use as a seed for provenance calculation
The graph to perform the provenance calculation on
Optionalconsider: ReadonlySet<NodeId>
The ids to restrict the calculation too (e.g., the ids contained within a function definition to restrict the analysis to)
The qualified identifier of the call with the given id, or undefined if it does not resolve to a package
export and is not itself already namespaced (with purrr loaded, a map() call yields
Identifier.make('map', 'purrr'); an explicit pkg::fn() call yields pkg::fn unchanged).
This is the compact form of Identifier.toQualified, reconstructing both the origins and the call's name from the graph.
The id of the call to qualify
The graph the call is part of
Whether to also qualify a bare base-R call from the package exporting it
(sd yields stats::sd), which needs neither a loaded database nor graph edges.
Set this to false to only qualify what the origins resolve to (or what is already namespaced).
The qualified name of every call of the graph, undefined for the calls that do not qualify.
Prefer this over asking call by call: it resolves each call once for both qualifyBaseR variants.
The graph to qualify
Which of the two results to return, see Dataflow.qualify
Determines whether there is a path from from to to in the given graph (via any edge type, only respecting direction)
Equivalent to reduceGraph followed by invertGraph
but in a single pass over the graph, allocating only one intermediate object instead of two.
Use this when you need the reduced-and-inverted graph for a forward traversal within a restriction set.
Only returns the sub-part of the graph that is determined by the given selection. In other words, this will return a graph with only vertices that are part of the selected ids, and edges that are between such selected vertices.
Resolves the dataflow graph ids from slicing criterion form to ids.
This returns a new graph with the resolved ids.
The main use-case for this is testing - if you do not know/want to fix the specific id,
you can use, e.g. 2@x as a placeholder for the first x in the second line!
OptionalidMap: AstIdMapReadonlysideEffects: {Interprocedural propagation of escaped side effects (attached packages, <<- definitions) to their callers.
ReadonlycallGraphSummaries: <T>(ReadonlypropagateTransitive: (Whether the call's result is passed on -- assigned, handed to another call, returned -- rather than left
for R to auto-print. A bare anova(a, b) is an output the program reports; the summary(m) of
x <- summary(m) is not.
Only an edge that carries the value counts. A plain EdgeType.Reads does not: it also chains the
calls that share a side effect, which would report plot(x) as consumed by the lines(y) drawn after it.
A simple visitor akin to RNode.visitAst to traverse the dataflow graph starting from the start id and only respecting edge direction.
The dataflow graph to operate on.
The start id of the visitation.
The function to execute for each vertex, if this returns true the visitation will stop from this vertex.
Readonlyvisualize: {Maps to the mermaid-centric visualization helper for dataflow graphs and their views
Readonlymermaid: {Mermaid rendering helper for dataflow graphs
Converts a dataflow graph to mermaid graph code that visualizes the graph.
DataflowMermaid.url - render the given graph to a url to mermaid.live
Readonlyname: "DataflowMermaid"This is a simplified version of DataflowMermaid.convert
OptionalincludeEnvironments: booleanOptionalmark: ReadonlySet<(...)>Converts a dataflow graph to a mermaid url that visualizes the graph. This is basically a combination of DataflowMermaid.raw and Mermaid.codeToUrl.
the dataflow graph to render
OptionalincludeEnvironments: boolean
whether to include the environment content in the output
Optionalmark: ReadonlySet<(...)>
which vertices to highlight in the visualization
whether to show a simplified use of the graph with fewer details on the vertices and edges
show the edge-free base-R qualification (stats::acf); false when the signature database is disabled
Readonlyquads: {Readonlyconvert: (graph: DataflowGraph, config: QuadSerializationConfiguration) => string
This is the root helper object to work with the DataflowGraph.
pkg::fnidentifier of a call from its id and graph, or of every call of a graph at once,What it used to re-expose under a second name is imported directly instead: DfEdge for the edges, CallGraph for the call-graph view, Resolve for name and value resolution, and DataflowGraph for the graph itself.