NodeGraph: Fix edges dataframe miscategorization (#76842)
* in node graph, fix edges dataframe miscategorization A dataframe named "edges" could end up getting categorized as a nodes dataframe if it was missing a "source" field, resulting in a very confusing error message "id field is required for nodes dataframe" instead of a more sensible error message about the missing source field. * Fix lint --------- Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
This commit is contained in:
co-authored by
Andrej Ocenas
parent
a26318714f
commit
4b6b3b7018
@@ -607,7 +607,7 @@ export const getGraphFrame = (frames: DataFrame[]) => {
|
||||
return frames.reduce<GraphFrame>(
|
||||
(acc, frame) => {
|
||||
const sourceField = frame.fields.filter((f) => f.name === 'source');
|
||||
if (sourceField.length) {
|
||||
if (frame.name === 'edges' || sourceField.length) {
|
||||
acc.edges.push(frame);
|
||||
} else {
|
||||
acc.nodes.push(frame);
|
||||
|
||||
Reference in New Issue
Block a user