Skip to content

Tag Rendering

Tags are pseudo-nodes that are created when a page has tags associated with it (either via frontmatter or tagRules). They can either be rendered as individual nodes, or affect the style of the nodes they are associated with.

Tags

{
"tagRenderMode": "node"
}

Tag Rendering Mode

The tagRenderMode option determines how tags are rendered in the graph:

  • none: Tags are not rendered in the graph.
  • node: Tags are rendered as individual nodes in the graph, connected to all nodes that have the corresponding tag. The style of the tags is determined by the tagStyles option.
  • same: Nodes assume the style of the associated tag(s) defined in tagStyles. Nodes with multiple tags will assume the style of the first tag in the list.
  • both: Tags are rendered as individual nodes in the graph, connected to all nodes that have the corresponding tag, and the nodes themselves assume the style of the associated tag(s) defined in tagStyles.
{
"tagRenderMode": "node",
"tagStyles": {
"Tag": {
"shape": "square",
"strokeWidth": 8,
"cornerType": "round",
"strokeCornerRadius": "80%"
}
}
}

Tag Styles

The tagStyles option is an object that defines the style of tags in the graph. Each key in the object corresponds to a tag name, and the value corresponds to a Node Style object.

Nodes copy styles from the associated tag(s) based on the order in which they are specified in the node’s tags list.

{
"tagRenderMode": "node",
"tagStyles": {
"Tag 1": {
"shape": "square",
"shapePoints": 0,
"shapeSize": 6,
"shapeColor": "nodeColor1",
"shapeRotation": 0,
"shapeCornerRadius": "0%",
"strokeWidth": 0,
"strokeColor": "nodeColorTag",
"strokeCornerRadius": "0%",
"cornerType": "normal",
"colliderScale": 1,
"nodeScale": 1,
"neighborScale": 0.7
},
"Tag 2": {
"shape": "triangle",
"shapePoints": 0,
"shapeSize": 6,
"shapeColor": "backgroundColor",
"shapeRotation": 0,
"shapeCornerRadius": "0%",
"strokeWidth": 8,
"strokeColor": "nodeColorTag",
"strokeCornerRadius": "80%",
"cornerType": "round",
"colliderScale": 1,
"nodeScale": 1,
"neighborScale": 0.7
}
}
}
tagStyles.Tag 1
tagStyles.Tag 2