The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/plugins/panel/nodeGraph/useCategorizeFrames.ts

16 lines
573 B

import { useMemo } from 'react';
import { DataFrame } from '@grafana/data';
import { getGraphFrame } from './utils';
/**
* As we need 2 dataframes for the service map, one with nodes and one with edges we have to figure out which is which.
* Right now we do not have any metadata for it so we just check preferredVisualisationType and then column names.
* TODO: maybe we could use column labels to have a better way to do this
*/
export function useCategorizeFrames(series: DataFrame[]) {
return useMemo(() => {
return getGraphFrame(series);
}, [series]);
}