Foam

Graph Visualization

Foam comes with a graph visualization of your notes. To see the graph execute the Foam: Show Graph command.

Your files, such as notes and documents, are shown as the nodes of the graph along with the tags defined in your notes. The edges of the graph represent either a link between two files or a file that contains a certain tag. A node in the graph will grow in size with the number of connections it has, representing stronger or more defined concepts and topics.

Graph Navigation

With the Foam graph visualization you can:

Filter View

If you only wish to view certain types of notes or tags, or want to hide linked attachment nodes then you can apply filters to the graph.

Graph filtering demo

Custom Graph Styles

The Foam graph will use the current VS Code theme by default, but it’s possible to customize it with the foam.graph.style setting.

Graph style demo

A sample configuration object is provided below, you can provide as many or as little configuration as you wish:

"foam.graph.style": {
    "background": "#202020",
    "fontSize": 12,
    "lineColor": "#277da1",
    "lineWidth": 0.2,
    "particleWidth": 1.0,
    "highlightedForeground": "#f9c74f",
    "node": {
        "note": "#277da1",
    }
}

Style Nodes by Type

It is possible to customize the style of a node based on the type property in the YAML frontmatter of the corresponding document.

There are a few default node types defined by Foam that are displayed in the graph:

For example the following backlinking.md note:

---
type: feature
---
# Backlinking

...

And the following settings.json:

"foam.graph.style": {
    "background": "#202020",
    "node": {
        "note": "#277da1",
        "placeholder": "#545454",
        "tag": "#f9c74f",
        "feature": "red",
    }
}

Will result in the following graph:

Style node by type