Skip to content

General

This page gives an overview of all the general configuration options for the graph component, specifically about how it is determines which nodes are shown in the graph, what actions are available, and when the graph is displayed.

Depth

The depth option determines the depth of the graph, how many levels of links are shown.

  • -x: Show the entire graph (the particular value of x is ignored).
  • 0: Show only the current node.
  • 1: Show the current node and its immediate neighbors.
  • x: Show nodes up to x hops away from the current node.
  • 5>: Show the entire graph (the particular value of x is ignored).

When the depth is negative, the graph will show all nodes in the graph, even if they are not reachable from the current node.

The graph will be traversed in the direction specified by the depthDirection option.

{
"depth": 1
}
depth 1

Depth Direction

The depthDirection option determines the direction in which the links of the graph are expanded.

  • both: The graph will be expanded in both directions.
  • incoming: The graph will only be expanded in the direction of incoming links.
  • outgoing: The graph will only be expanded in the direction of outgoing links.

This setting is ignored once a depth of 5 or higher is reached.

{
"depth": 1,
"depthDirection": "both"
}
depth 1

Actions

actions is an array of strings which specify which action buttons are included in the graph.
The order of the actions in the array determines the order in which they are displayed in the top right of the graph.

For more information on what each individual action does, see the Graph Actions page.

{
"actions": [
"fullscreen",
"depth",
"reset-zoom",
"render-arrows",
"render-external",
"render-unresolved",
"settings"
],
"depth": 4
}

Visibility Rules

The visibilityRules option is a list of glob patterns that determine when the <PageGraph /> component (e.g. the graph in the Starlight sidebar) will be shown. When using the plugin it its default configuration (with Starlight), the graph will also only be shown if the sidebar is visible.

<PageGraph /> is shown on all pages.

  • Directorysrc
    • Directorycontent
      • Directorydocs
        • Directoryprivate
          • page.md // <PageGraph> is shown
        • Directorypublic
          • page.md // <PageGraph> is shown
          • cool-stuff.md // <PageGraph> is shown