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/features/visualization/data-hover/DataHoverRow.tsx

28 lines
635 B

import { FeatureLike } from 'ol/Feature';
import React from 'react';
import { ArrayDataFrame, DataFrame } from '@grafana/data';
import { DataHoverView } from './DataHoverView';
type Props = {
feature?: FeatureLike;
};
export const DataHoverRow = ({ feature }: Props) => {
let data: DataFrame;
let rowIndex = 0;
if (!feature) {
return null;
}
data = feature.get('frame');
if (data) {
rowIndex = feature.get('rowIndex');
} else {
const { geometry, ...properties } = feature.getProperties();
data = new ArrayDataFrame([properties]);
}
return <DataHoverView data={data} rowIndex={rowIndex} />;
};