napi
includes with the CLI a powerful UI to view and audit your systems.
In the following sections we’ll dive into how to use this tool and each of its features and pages.
Overview
The NanoAPI Audit Tool provides a visual representation of your codebase, enabling intuitive exploration and deeper understanding of your software architecture. The tool generates dependency graphs based on symbol extraction, highlighting relationships between different components, files, and modules within your project.
The main interface consists of four primary areas:
-
Node Inspector: For viewing the relationships between nodes in the current view.
-
Control Bar: For adjusting views and interacting with the visual graph.
-
File Explorer: Provides quick access and navigation through your codebase files.
-
Symbol Extraction: This panel shows the elements to be included in the current extraction.
Node Inspector
The largest element in any of the views, this inspector provides the ability to interact with and drill down into nodes to gain a deeper understanding of the relationships between files or symbols, depending on the current view. The possible interactions are:
-
Click into an Element: Clicking on a single element will reveal the name and additional details on that file and all the dependency and dependent files.
-
Double Click to Change Views: Double-clicking a node on the Project View will take you into the File-level view for that node/file.
-
Action Menu: Right-clicking a node shows an action menu that allows you to show the details pane, highlight the node in the file explorer, or extract the symbols from that file.
-
Details Pane: This panel, revealed through the Action Menu above, shows additional context and details about a specific file or symbol.
Control Bar
Located at the bottom-center of the visualization, the control bar provides essential interactions:
-
Zoom Controls:
-
Zoom In/Out to magnify or minimize the dependency graph.
-
Reset View to return to the default zoom level and orientation.
-
-
Fullscreen Mode:
- Click the Fullscreen icon to expand the visualization for an immersive experience.
-
Metric Selector:
- The Metric dropdown allows selection of different metrics (e.g., dependency count, complexity) to alter node sizing and coloring based on these characteristics. We will dive deeper into these metrics on the Project View page.
File Explorer
On the left panel, the File Explorer lists all files and directories within the analyzed codebase:
-
Navigation:
-
Expand and collapse directories to navigate your code structure.
-
Click the eye icon to highlight specific files.
-
Click the magnifying glass icon to quickly jump to the File-level view for that file.
-
-
Search:
- Use the search bar at the top of the panel to find files or modules quickly.
Symbol Extractor
The Symbol Extractor pane exists on all views and allows for the extraction or editing of an extraction of elements into an output codebase. Read more about how this functionality works under the Symbol Extractor guide.