mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
NodeGraph: Include frames with name edges or nodes in node graph (#46047)
* Include frames with name edges or nodes in node graph
This commit is contained in:
parent
3b487c2661
commit
cb1649e9b8
@ -76,7 +76,7 @@ Click on the node and select "Show in Graph layout" option to switch back to gra
|
||||
|
||||
This visualization needs a specific shape of the data to be returned from the data source in order to correctly display it.
|
||||
|
||||
Data source needs to return two data frames, one for nodes and one for edges, and you also have to set `frame.meta.preferredVisualisationType = 'nodeGraph'` on both data frames if you want them to be automatically shown in node graph in Explore.
|
||||
Data source needs to return two data frames, one for nodes and one for edges. You have to set `frame.meta.preferredVisualisationType = 'nodeGraph'` on both data frames or name them `nodes` and `edges` respectively for the node graph to render.
|
||||
|
||||
### Node parameters
|
||||
|
||||
|
@ -323,5 +323,14 @@ export function getNodeGraphDataFrames(frames: DataFrame[]) {
|
||||
// processing pipeline which ends up populating redux state with proper data. As we move towards more dataFrame
|
||||
// oriented API it seems like a better direction to move such processing into to visualisations and do minimal
|
||||
// and lazy processing here. Needs bigger refactor so keeping nodeGraph and Traces as they are for now.
|
||||
return frames.filter((frame) => frame.meta?.preferredVisualisationType === 'nodeGraph');
|
||||
return frames.filter((frame) => {
|
||||
if (frame.meta?.preferredVisualisationType === 'nodeGraph') {
|
||||
return true;
|
||||
}
|
||||
if (frame.name === 'nodes' || frame.name === 'edges') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user