mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Move amendTimeSeries in @grafana/data package (#89456)
* move amendTimeSeries in @grafana/data package * betterer and prettier
This commit is contained in:
parent
d750af0c48
commit
957957e62a
@ -143,6 +143,14 @@ exports[`better eslint`] = {
|
||||
"packages/grafana-data/src/panel/registryFactories.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"packages/grafana-data/src/table/amendTimeSeries.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "5"]
|
||||
],
|
||||
"packages/grafana-data/src/themes/colorManipulator.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
@ -4611,14 +4619,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "2"]
|
||||
],
|
||||
"public/app/features/live/data/amendTimeSeries.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "5"]
|
||||
],
|
||||
"public/app/features/logs/components/InfiniteScroll.tsx:5381": [
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"]
|
||||
],
|
||||
|
@ -16,6 +16,7 @@ export * from './themes';
|
||||
export * from './monaco';
|
||||
export * from './geo/layer';
|
||||
export * from './query';
|
||||
export { amendTable, trimTable, type Table } from './table/amendTimeSeries';
|
||||
export {
|
||||
type ValueMatcherOptions,
|
||||
type BasicValueMatcherOptions,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Table, amendTable } from "./amendTimeSeries";
|
||||
import { Table, amendTable } from './amendTimeSeries';
|
||||
|
||||
describe('amendTable', () => {
|
||||
it('should append nextTable when there is no overlap (nextTable after prevTable)', () => {
|
@ -1,4 +1,4 @@
|
||||
import { closestIdx } from '@grafana/data';
|
||||
import { closestIdx } from '../';
|
||||
|
||||
export type Table = [times: number[], ...values: any[][]];
|
||||
|
||||
@ -98,7 +98,7 @@ export function trimTable(table: Table, fromTime: number, toTime: number): Table
|
||||
|
||||
if (fromIdx != null || toIdx != null) {
|
||||
times = times.slice(fromIdx ?? 0, toIdx);
|
||||
vals = vals.map(vals2 => vals2.slice(fromIdx ?? 0, toIdx));
|
||||
vals = vals.map((vals2) => vals2.slice(fromIdx ?? 0, toIdx));
|
||||
}
|
||||
|
||||
return [times, ...vals];
|
Loading…
Reference in New Issue
Block a user