Explore: Align multiple log volumes (#64356)
* Align log volumes on x an y axes * Move helper functions to logs/utils * Add tests * Simplify supplementaryQueries.ts * Fix tests * Revert code simplifications To simplify the PR, this can be added in a separate PR * Fix reusing logs volume when limited/non-limited are used * Use more specific property name * Add missing property * Stretch graph to selected range but only if there's data available * Fix unit tests * Fix calculating maximum when bars are stacked * Sort log volumes by data source name * Simplify logic to determine if log volumes can be zoomed in
This commit is contained in:
@@ -205,29 +205,6 @@ export type LogsVolumeCustomMetaData = {
|
||||
sourceQuery: DataQuery;
|
||||
};
|
||||
|
||||
export const getLogsVolumeAbsoluteRange = (
|
||||
dataFrames: DataFrame[],
|
||||
defaultRange: AbsoluteTimeRange
|
||||
): AbsoluteTimeRange => {
|
||||
return dataFrames[0].meta?.custom?.absoluteRange || defaultRange;
|
||||
};
|
||||
|
||||
export const getLogsVolumeDataSourceInfo = (dataFrames: DataFrame[]): { name: string } | null => {
|
||||
const customMeta = dataFrames[0]?.meta?.custom;
|
||||
|
||||
if (customMeta && customMeta.datasourceName) {
|
||||
return {
|
||||
name: customMeta.datasourceName,
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export const isLogsVolumeLimited = (dataFrames: DataFrame[]) => {
|
||||
return dataFrames[0]?.meta?.custom?.logsVolumeType === LogsVolumeType.Limited;
|
||||
};
|
||||
|
||||
/**
|
||||
* Data sources that support supplementary queries in Explore.
|
||||
* This will enable users to see additional data when running original queries.
|
||||
|
||||
Reference in New Issue
Block a user