Required By is one of the interactive graphs Understand can draw of your code — call trees, dependencies, control flow, and more.
Required By
Languages: Rust, WebTargets: Files, Generics
Variants: Classic, Cluster, Compare, Relationship, Simplified
Show what requires a selected JavaScript file or Rust trait, directly or indirectly.
For a selected JavaScript file, this shows an edge to each file that requires it, then recurses into each of those files’ own requirers, building a multi-level tree. For a selected Rust trait, this shows an edge to each generic parameter, associated type, or trait that requires it as a bound, then continues to recurse if one of those requirers is itself a trait with its own requirers.
Rooted at constants.js below, the graph shows constants.js required by config.js and logger.js. Both are required by database.js, which is itself required by api.js and auth.js. api.js and auth.js are each required by app.js, which nothing requires. The inverse graph, Requires, shows the reverse relationship — everything the selected file or Rust entity requires, directly or indirectly.
See the following code and corresponding graph
// app.js
const { getUsers } = require('./api');
const { login } = require('./auth');
// api.js
const { connect, query } = require('./database');
// auth.js
const { connect, query } = require('./database');
// database.js
const { log, error } = require('./logger');
const { config } = require('./config');
// config.js
const { API_URL, MAX_RETRIES } = require('./constants');
// logger.js
const { TIMEOUT_MS } = require('./constants');
// constants.js
Required By - Classic
The Classic variant is similar to the Simplified variant, showing all relationships in a simple tree, but it uses a custom layout algorithm instead of Graphviz.
Required By - Cluster
The Cluster variant groups entities by their containing class/file/architecture.
Required By - Compare
The Compare variant shows how the graph has changed relative to the project's comparison database.
Required By - Relationship
The Relationship variant filters the graph to only paths connecting the two entities.
Required By - Simplified
The Simplified variant shows all relationships in a simple tree (no clusters)