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:
Connor Lindsey 2022-03-03 06:42:08 -07:00 committed by GitHub
parent 3b487c2661
commit cb1649e9b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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;
});
}