# Local Graph Depth Local graph views always open at depth 1, with the controls panel in the way. This plugin opens them at a depth you choose, with the controls collapsed. ## Behavior - A local graph you open gets your configured depth, and its controls panel starts collapsed. - A pane restored from the saved workspace keeps the depth and controls state it was saved with. - Moving the depth slider in the plugin settings re-depths every open local graph at once. - Otherwise what you set by hand wins. The plugin touches each pane once as it opens, and applies a depth only when the pane is still at Obsidian's default of 1. ## Settings **Default depth** — a slider from 1 to 5, the same range as the depth slider in the local graph controls. The default is 2. Set it to 1 to leave newly opened graphs alone. **Collapse the graph controls** — hides the settings panel when a local graph opens. The gear icon brings it back. On by default. ## Installation ### From the community plugin list Settings → Community plugins → Browse → search for "Local Graph Depth" → Install → Enable. ### Manual 1. Download `main.js` and `manifest.json` from the [latest release](https://github.com/cs31415/local-graph-depth/releases/latest). 2. Put both in `/.obsidian/plugins/local-graph-depth/`. 3. Reload Obsidian, then enable the plugin in Settings → Community plugins. ## How it works A local graph view carries its settings in the `options` object of its view state: `localJumps` holds the depth, `close` collapses the controls panel. On each layout change the plugin looks for local graph panes it has not seen, and writes the keys it wants through `view.setState()`. The view hands those keys to its graph engine, which is the same route the depth slider and the close button take, so the controls, the options and the rendered graph all stay in step. Only `getState()` and `setState()` are used, both public API. The `options` keys themselves are undocumented, but they are the format Obsidian persists in `workspace.json`. If a future release renames them the plugin stops applying its defaults, and fails quietly: the graph still opens, at depth 1. Tested against Obsidian 1.8.4. ## License MIT