Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NodeGraph not displaying anything with Postgres datasource #79

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,21 @@ import { DataFrame } from '@credativ/plutono-data';
*/
export function useCategorizeFrames(series: DataFrame[]) {
return useMemo(() => {
const serviceMapFrames = series.filter((frame) => frame.meta?.preferredVisualisationType === 'nodeGraph');
const serviceMapFrames = series.filter((frame) => {
// Use the data frame if the preferred visualization type was set to nodeGraph.
if (frame.meta?.preferredVisualisationType === 'nodeGraph') {
return true;
}
// Use the data frame if its name is 'nodes' or 'edges'.
if (frame.name === 'nodes' || frame.name === 'edges') {
return true;
}
// Use the data frame if the query was named 'nodes' or 'edges'.
if (frame.refId === 'nodes' || frame.refId === 'edges') {
return true;
}
return false;
});
return serviceMapFrames.reduce(
(acc, frame) => {
const sourceField = frame.fields.filter((f) => f.name === 'source');
Expand Down