# How to create Data Links in NodeGraph panel?

**URL:** <https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310>\
**Category:** Data Links\
**Tags:** graphing, panel\
**Created:** [June 5, 2024, 2:32pm UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310 "2024-06-05T14:32:50Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bieluk](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@bieluk](https://community.grafana.com/u/bieluk)\
**Post date:** [June 5, 2024, 2:32pm UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/1 "2024-06-05T14:32:50Z")

</div>

Hi, I’m using NodeGraph panel with Nodegraph-API Datasource. Lately I’ve seen in documentation: [Node graph | Grafana documentation](https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/node-graph/#nodes) that there is possibility to nest data links into node data (demo gif). I can see this also when I connect to Grafana TestData datasource, but I don’t understand how it’s done.

I found another post on this topic here:

> /t/missing-documentation-on-how-to-achieve-data-links-in-the-nodes-and-expanding-hidden-nodes-for-nodegraph-plugin/88306

and issue on Github [Add Node Graph Data Link · Issue #82739 · grafana/grafana · GitHub](https://github.com/grafana/grafana/issues/82739) but both without any response. Help, please.

Test data link in Nodegraph from TestData datasource:  
 ![image](https://us1.discourse-cdn.com/grafana/original/3X/3/f/3ff044749aed24817bee28978d6b14380924e1c4.png)

Nodegraph data as table from TestData datasource:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/d/7/d74af6b81029f690618084f34192fe43ac57f5a1.png)

---

<div class="post-metadata">

**Author:** ![sunilvanmullem](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@sunilvanmullem](https://community.grafana.com/u/sunilvanmullem)\
**Post date:** [January 15, 2025, 10:44am UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/2 "2025-01-15T10:44:30Z")

</div>

there is a demo of this functionality in the sandbox:

[Grafana](https://play.grafana.org/d/Pbk2rfBGz/node-graph?orgId=1&from=now-6h&to=now&timezone=utc&editPanel=2).

---

<div class="post-metadata">

**Author:** ![craigl](https://avatars.discourse-cdn.com/v4/letter/c/e9c0ed/32.png) [@craigl](https://community.grafana.com/u/craigl)\
**Post date:** [February 13, 2025, 2:37pm UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/3 "2025-02-13T14:37:41Z")

</div>

The functionality is in the [demo](https://play.grafana.org/d/Pbk2rfBGz/node-graph?orgId=1&from=now-6h&to=now&timezone=utc&tab=queries&editPanel=2) but on my awsmanaged instance (running 10.4) there are no data link or field override options.

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/3/3/335b62ea46cfbcbab6fef920e793b722cd6af303.png)

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [February 13, 2025, 4:25pm UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/4 "2025-02-13T16:25:05Z")

</div>

what does your data look like? can you provide sample data (obfuscated and scrubbed of sensitive data)

here are the requirements

> **[Node graph | Grafana documentation](https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/node-graph/#nodes-dataset)**
>
> Configure options for Grafana's node graph visualization

---

<div class="post-metadata">

**Author:** ![sunilvanmullem](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@sunilvanmullem](https://community.grafana.com/u/sunilvanmullem)\
**Post date:** [February 13, 2025, 5:40pm UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/5 "2025-02-13T17:40:27Z")

</div>

ive got the same issue. i understand that the /api/graph/fields used by the nodegraph datasource plugin should contain field configurations, but there appears to be no documentation for what should be in here.

i’m using something like this, but its not showing the link on nodes with that field\_name.

what should this look like?

```auto
  "nodes_fields": [
    {
      "field_name": "detail__app_name",
      "type": "string",
      "config": {
        "displayName": "App Name",
        "links": [
          {
            "title": "App dashboard for ${__data.fields.title}",
            "url": "/d/${python_app_dash_id}?from=${ __from}&to=${__ to}&var-customer=${customer}&var-environment=${environment}&var-topic=${__data.fields.title}"
          }
        ]
      }
    },

```

the [source code from the plugin](https://github.com/hoptical/nodegraph-api-plugin/blob/main/src/datasource.ts) shows that its not transforming config.links specifically so must be passing them straight through.

```auto
       FieldsResponse.forEach((field: any) => {
          // fieldType can be either number of string
          var fieldType = field['type'] === 'number' ? FieldType.number : FieldType.string;
          // add 'name' and 'type' items to the output object
          var outputField: FrameFieldType = { name: field['field_name'], type: fieldType, config: {} };
          // add color for 'arc__*' items(only apperas for the nodes)
          if ('color' in field) {
            outputField.config.color = { fixedColor: field['color'], mode: FieldColorModeId.Fixed };
          }
          // add disPlayName for 'detail__*' items
          if ('displayName' in field) {
            outputField.config.displayName = field['displayName'];
          }
          outputFields.push(outputField);
        });

```

---

<div class="post-metadata">

**Author:** ![sunilvanmullem](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@sunilvanmullem](https://community.grafana.com/u/sunilvanmullem)\
**Post date:** [February 13, 2025, 5:48pm UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/7 "2025-02-13T17:48:25Z")

</div>

thanks yosiaz, (your comment appears to have been removed?) yes its not valid JSON, but does that matter?

what would be useful is the documentation for /api/graph/fields that describes the data frame expected

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [February 13, 2025, 5:55pm UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/8 "2025-02-13T17:55:11Z")

</div>

yes it does matter if we want to test things out on our side of things. it helps us help you. otherwise it is will be endless back and forth, stumbling in the dark.

so cleaning up your data for test purposes locally I get

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/2/3/23e6910c098c7365cfca7800fe1ef0cfc44d7853.png)

then in data link

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/2/e/2e9b11f97e7302ee9ca32c7ae157ea5aa1085c03.png)

---

<div class="post-metadata">

**Author:** ![sunilvanmullem](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@sunilvanmullem](https://community.grafana.com/u/sunilvanmullem)\
**Post date:** [February 13, 2025, 5:58pm UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/9 "2025-02-13T17:58:59Z")

</div>

OK so lets take the example from the [README](https://github.com/hoptical/nodegraph-api-plugin/blob/main/README.md)

pick a node, any node you would like. What needs to be returned in the data frame so that the nodegraph visualisation displays a link against that node?

this is the endpoint _/api/graph/data_

```auto
{
    "edges": [
        {
            "id": "1",
            "mainStat": "53/s",
            "source": "1",
            "target": "2"
        }
    ],
    "nodes": [
        {
            "arc__failed": 0.7,
            "arc__passed": 0.3,
            "detail__zone": "load",
            "id": "1",
            "subTitle": "instance:#2",
            "title": "Service1"
        },
        {
            "arc__failed": 0.5,
            "arc__passed": 0.5,
            "detail__zone": "transform",
            "id": "2",
            "subTitle": "instance:#3",
            "title": "Service2"
        }
    ]
}

```

here is the output from /api/graph/fields

```auto
{
  "edges_fields": [
    {
      "field_name": "id",
      "type": "string"
    },
    {
      "field_name": "source",
      "type": "string"
    },
    {
      "field_name": "target",
      "type": "string"
    },
    {
      "field_name": "mainStat",
      "type": "number"
    }
  ],
  "nodes_fields": [
    {
      "field_name": "id",
      "type": "string"
    },
    {
      "field_name": "title",
      "type": "string"
    },
    {
      "field_name": "mainStat",
      "type": "string"
    },
    {
      "field_name": "secondaryStat",
      "type": "number"
    },
    {
      "color": "red",
      "field_name": "arc__failed",
      "type": "number"
    },
    {
      "color": "green",
      "field_name": "arc__passed",
      "type": "number"
    },
    {
      "displayName": "Role",
      "field_name": "detail__role",
      "type": "string"
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [February 13, 2025, 7:03pm UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/10 "2025-02-13T19:03:21Z")

</div>

The below solved it for me

> <https://github.com/grafana/grafana/issues/96850#issuecomment-2537637611>
>
> \### What happened?
> 
> Using the Node Graph scenario on the test data source with t…he Node Graph visualization, then creating a test data link, shows the data link multiple times.
> 
> Note: the screenshot shows a data link override being used, but that is not necessary to duplicate the bug.
> 
> !\[Image\](https://github.com/user-attachments/assets/8396e5a8-03ae-45e0-b778-c0c20d16b346)
> 
> 
> 
> \### What did you expect to happen?
> 
> The link to show once.
> 
> \### Did this work before?
> 
> Not sure.
> 
> \### How do we reproduce it?
> 
> 1. Create a node graph panel using the node graph scenario of the test data source.
> 2. Add a data link
> 3. Click a node to see the duplicate links.
> 
> 
> \### Is the bug inside a dashboard panel?
> 
> \<details\>\<summary\>Example Dashboard\</summary\>
> This uses a test data datasource.
> 
> \`\`\`json
> {
> "annotations": {
> "list": \[
> {
> "builtIn": 1,
> "datasource": {
> "type": "grafana",
> "uid": "-- Grafana --"
> },
> "enable": true,
> "hide": true,
> "iconColor": "rgba(0, 211, 255, 1)",
> "name": "Annotations & Alerts",
> "type": "dashboard"
> }
> \]
> },
> "editable": true,
> "fiscalYearStartMonth": 0,
> "graphTooltip": 0,
> "id": 232,
> "links": \[\],
> "panels": \[
> {
> "datasource": {
> "type": "grafana-testdata-datasource",
> "uid": "PD8C576611E62080A"
> },
> "fieldConfig": {
> "defaults": {
> "links": \[
> {
> "title": "Test",
> "url": "google.com"
> }
> \]
> },
> "overrides": \[\]
> },
> "gridPos": {
> "h": 8,
> "w": 12,
> "x": 0,
> "y": 0
> },
> "id": 1,
> "options": {
> "edges": {},
> "nodes": {},
> "zoomMode": "cooperative"
> },
> "pluginVersion": "11.4.0-pre",
> "targets": \[
> {
> "refId": "A",
> "scenarioId": "node\_graph"
> }
> \],
> "title": "Panel Title",
> "type": "nodeGraph"
> }
> \],
> "preload": false,
> "schemaVersion": 40,
> "tags": \[\],
> "templating": {
> "list": \[\]
> },
> "time": {
> "from": "now-6h",
> "to": "now"
> },
> "timepicker": {},
> "timezone": "browser",
> "title": "Node Graph",
> "uid": "be4mnqmd3sr9cf",
> "version": 2,
> "weekStart": ""
> }
> \`\`\`
> \</details\>
> 
> \### Environment (with versions)?
> 
> Grafana: main
> 
> 
> \### Grafana platform?
> 
> None
> 
> \### Datasource(s)?
> 
> Test Datasource

added a url data piece in nodes just for fun: `google.com`

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/9/0/907573f113494e7df7a65ef584a042700c6550d5.png)

Then it shows up in this odd , Open in Explore ui piece

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/1/9/194eb32f008f7f5d6eb70f4e9ce926accde92387.png)

---

<div class="post-metadata">

**Author:** ![sunilvanmullem](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@sunilvanmullem](https://community.grafana.com/u/sunilvanmullem)\
**Post date:** [February 14, 2025, 10:56am UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/11 "2025-02-14T10:56:09Z")

</div>

thanks for that @yosiasz. thats good to know thats one way to do it.

i was also wondering about using config.links in the fields data frame.  
eg if we simplify the fields response to

```auto
{
    "edges_fields": [
    ],
    "nodes_fields": [{
            "field_name": "title",
            "type": "string",
            "config": {
                "displayName": "The title",
                "links": [{
                        "title": "link for for ${__data.fields.title}",
                        "url": "https://www.google.com/?${__data.fields.title}"
                    }
                ]
            }
        },
    ]
}

```

this then adds a link in the node popup.

---

<div class="post-metadata">

**Author:** ![sunilvanmullem](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@sunilvanmullem](https://community.grafana.com/u/sunilvanmullem)\
**Post date:** [February 14, 2025, 1:49pm UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/12 "2025-02-14T13:49:53Z")

</div>

things to be aware of with the above: the data link wont display if:

- there is a conflicting field override in the visualisation for the field
- any variables used, ie ${…} dont exist in the dashboard

there are no helpful error messages in the browser console when nodegraph cant display something.

As mentioned earlier I’ve not been able to find any specification for the dataframe expected from for /api/graph/fields which details the config part (nor has chatgpt). ive raised this as  
[Documentation feedback: clarify where field configs are set in node graph viz · Issue #99103 · grafana/grafana](https://github.com/grafana/grafana/issues/99103)

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [February 14, 2025, 2:55pm UTC](https://community.grafana.com/t/how-to-create-data-links-in-nodegraph-panel/123310/13 "2025-02-14T14:55:33Z")

</div>

so couple of ways to address that I would recommend.

- contribute to the code to implement those features
- use something different as plugin such as business chart or business text with

**plotly**

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/f/e/fef1d1d6b8d8e54483a9535875fc62dabcfa9d1c.png)

or **d3 network**

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/3/c/3c84803328fae5d16b4680e63807d3b3d7b896a3.png)

- submit a bug or feature request
