Open source Enterprise Grafana Cloud

Node graph

The Node Graph visualization displays relationships between entities as an interactive graph. Use the Infinity data source to transform your API data into the format required by the Node Graph panel.

For general information about the Node Graph panel, refer to Node graph.

Before you begin

  • Ensure you have the Infinity data source installed and configured
  • Familiarize yourself with the Node Graph panel requirements

Supported data formats

You can create Node Graph visualizations from the following data formats:

  • JSON
  • CSV
  • XML
  • GraphQL

Query structure

A Node Graph visualization requires two queries:

QueryFormatPurpose
Query ANodes - Node GraphDefines the nodes (entities) in the graph
Query BEdges - Node GraphDefines the edges (relationships) between nodes

Nodes query

The nodes query defines the entities displayed in the graph.

Required fields

FieldTypeDescription
idStringUnique identifier for the node

Optional fields

FieldTypeDescription
titleStringPrimary label displayed on the node
subTitleStringSecondary label displayed below the title
mainStatString/NumberPrimary statistic shown on the node
secondaryStatString/NumberSecondary statistic shown on the node
arc__*NumberArc segment value (must sum to 1 across all arc fields)
arc__*_colorStringColor for the corresponding arc segment
detail__*StringAdditional details shown in the node tooltip

Arc fields

Arc fields create colored segments around the node perimeter. The values must be between 0 and 1, and all arc values for a single node should sum to 1.

To specify colors for arc segments, add a corresponding _color field:

Arc fieldColor field
arc__cpuarc__cpu_color
arc__memoryarc__memory_color

Edges query

The edges query defines the relationships between nodes.

Required fields

FieldTypeDescription
idStringUnique identifier for the edge
sourceStringID of the source node
targetStringID of the target node

Optional fields

FieldTypeDescription
mainStatString/NumberPrimary statistic shown on the edge
secondaryStatString/NumberSecondary statistic shown on the edge
detail__*StringAdditional details shown in the edge tooltip

Note

Edges do not support arc fields.

Example

The following example creates a simple network visualization with four servers.

Nodes data (CSV)

csv
id,title,subTitle,mainStat,secondaryStat,arc__cpu,arc__memory,arc__cpu_color,arc__memory_color,detail__role
A,Server A,Application Server,12,10,0.1,0.9,blue,red,Frontend
B,Server B,DB Server,90,87,0.1,0.9,blue,red,Database
C,Server C,Application Server,20,23,0.2,0.8,blue,red,Backend
D,Server D,Middleware Server,47,98,0.9,0.1,blue,red,Cache

Edges data (CSV)

csv
id,source,target,mainStat,secondaryStat,detail__protocol
1,A,B,30,mb/s,TCP
2,A,C,20,mb/s,HTTP
3,B,D,24.2,mb/s,TCP

Query configuration

Query A (Nodes):

  1. Set Type to CSV.
  2. Set Source to Inline and paste the nodes CSV data.
  3. Set Format to Nodes - Node Graph.
  4. Configure columns to map CSV fields to node graph fields, ensuring numeric fields use the number type.

Query B (Edges):

  1. Set Type to CSV.
  2. Set Source to Inline and paste the edges CSV data.
  3. Set Format to Edges - Node Graph.

Column mapping

When your source data uses different field names than the Node Graph format requires, use column aliases to map them.

Source fieldAlias (Node Graph field)Type
cpumainStatnumber
memorysecondaryStatnumber
sub-titlesubTitlestring
disk_usagearc__disknumber

Note

For CSV data, explicitly set numeric columns to the number type. Otherwise, they render as strings and may not display correctly.

JSON example

For JSON data, configure the root selector to extract the array of nodes or edges:

Nodes query:

JSON
{
  "nodes": [
    { "id": "A", "title": "Server A", "arc__cpu": 0.3, "arc__memory": 0.7 },
    { "id": "B", "title": "Server B", "arc__cpu": 0.8, "arc__memory": 0.2 }
  ]
}

Set the root selector to nodes and the format to Nodes - Node Graph.

Edges query:

JSON
{
  "edges": [
    { "id": "1", "source": "A", "target": "B", "mainStat": "100 req/s" }
  ]
}

Set the root selector to edges and the format to Edges - Node Graph.