Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Commit fc81af7

Browse files
authored
Merge pull request #10 from hoptical/issue8
Add Compatibility for Grafana of vesions >8.3.5 & <8.00
2 parents d357ecc + 38d6bee commit fc81af7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/datasource.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
MutableDataFrame,
99
FieldType,
1010
FieldColorModeId,
11+
//QueryResultMeta,
1112
} from '@grafana/data';
1213

1314
import { getBackendSrv } from '@grafana/runtime';
@@ -58,13 +59,16 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
5859
});
5960
return outputFields;
6061
}
62+
// Define Frames Meta Data
63+
const frameMetaData: any = { preferredVisualisationType: 'nodeGraph' };
6164
// Extract node fields
6265
const nodeFields: FrameFieldType[] = fieldAssignator(nodeFieldsResponse);
6366
// Create nodes dataframe
6467
const nodeFrame = new MutableDataFrame({
6568
name: 'Nodes',
6669
refId: query.refId,
6770
fields: nodeFields,
71+
meta: frameMetaData,
6872
});
6973
// Extract edge fields
7074
const edgeFields: FrameFieldType[] = fieldAssignator(edgeFieldsResponse);
@@ -73,6 +77,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
7377
name: 'Edges',
7478
refId: query.refId,
7579
fields: edgeFields,
80+
meta: frameMetaData,
7681
});
7782
// Extract graph data of the related api response
7883
const nodes = responseGraphData.data.nodes;

0 commit comments

Comments
 (0)