Skip to content

Commit

Permalink
Default to name label if it exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-at-sri committed Aug 12, 2024
1 parent e0fa7d7 commit 865b560
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/logics/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export interface GraphOptions {
}

const selectRandomField = (obj: any) => {
// default to name if exists
if ('name' in obj) return 'name';
if ('Name' in obj) return 'Name';
let firstKey;
for (firstKey in obj) break;
return firstKey;
Expand Down

0 comments on commit 865b560

Please sign in to comment.