Chore: Avoid floating point numbers for maxDataPoints (#108292)
* avoid floating point numbers * prettier
This commit is contained in:
@@ -43,6 +43,7 @@ export interface ChangeSizePayload {
|
|||||||
exploreId: string;
|
exploreId: string;
|
||||||
width: number;
|
width: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const changeSizeAction = createAction<ChangeSizePayload>('explore/changeSize');
|
export const changeSizeAction = createAction<ChangeSizePayload>('explore/changeSize');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,7 +53,9 @@ interface ChangePanelsState {
|
|||||||
exploreId: string;
|
exploreId: string;
|
||||||
panelsState: ExplorePanelsState;
|
panelsState: ExplorePanelsState;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const changePanelsStateAction = createAction<ChangePanelsState>('explore/changePanels');
|
export const changePanelsStateAction = createAction<ChangePanelsState>('explore/changePanels');
|
||||||
|
|
||||||
export function changePanelState(
|
export function changePanelState(
|
||||||
exploreId: string,
|
exploreId: string,
|
||||||
panel: PreferredVisualisationType,
|
panel: PreferredVisualisationType,
|
||||||
@@ -83,6 +86,7 @@ interface ChangeCorrelationHelperData {
|
|||||||
exploreId: string;
|
exploreId: string;
|
||||||
correlationEditorHelperData?: ExploreCorrelationHelperData;
|
correlationEditorHelperData?: ExploreCorrelationHelperData;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const changeCorrelationHelperData = createAction<ChangeCorrelationHelperData>(
|
export const changeCorrelationHelperData = createAction<ChangeCorrelationHelperData>(
|
||||||
'explore/changeCorrelationHelperData'
|
'explore/changeCorrelationHelperData'
|
||||||
);
|
);
|
||||||
@@ -99,17 +103,20 @@ interface InitializeExplorePayload {
|
|||||||
datasourceInstance?: DataSourceApi;
|
datasourceInstance?: DataSourceApi;
|
||||||
eventBridge: EventBusExtended;
|
eventBridge: EventBusExtended;
|
||||||
}
|
}
|
||||||
|
|
||||||
const initializeExploreAction = createAction<InitializeExplorePayload>('explore/initializeExploreAction');
|
const initializeExploreAction = createAction<InitializeExplorePayload>('explore/initializeExploreAction');
|
||||||
|
|
||||||
export interface SetUrlReplacedPayload {
|
export interface SetUrlReplacedPayload {
|
||||||
exploreId: string;
|
exploreId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const setUrlReplacedAction = createAction<SetUrlReplacedPayload>('explore/setUrlReplaced');
|
export const setUrlReplacedAction = createAction<SetUrlReplacedPayload>('explore/setUrlReplaced');
|
||||||
|
|
||||||
export interface SaveCorrelationsPayload {
|
export interface SaveCorrelationsPayload {
|
||||||
exploreId: string;
|
exploreId: string;
|
||||||
correlations: CorrelationData[];
|
correlations: CorrelationData[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const saveCorrelationsAction = createAction<SaveCorrelationsPayload>('explore/saveCorrelationsAction');
|
export const saveCorrelationsAction = createAction<SaveCorrelationsPayload>('explore/saveCorrelationsAction');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,6 +137,7 @@ export interface InitializeExploreOptions {
|
|||||||
position?: number;
|
position?: number;
|
||||||
eventBridge: EventBusExtended;
|
eventBridge: EventBusExtended;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize Explore state with state from the URL and the React component.
|
* Initialize Explore state with state from the URL and the React component.
|
||||||
* Call this only on components for with the Explore state has not been initialized.
|
* Call this only on components for with the Explore state has not been initialized.
|
||||||
@@ -214,7 +222,7 @@ export const paneReducer = (state: ExploreItemState = makeExplorePaneState(), ac
|
|||||||
state = timeReducer(state, action);
|
state = timeReducer(state, action);
|
||||||
|
|
||||||
if (changeSizeAction.match(action)) {
|
if (changeSizeAction.match(action)) {
|
||||||
const containerWidth = action.payload.width;
|
const containerWidth = Math.floor(action.payload.width);
|
||||||
return { ...state, containerWidth };
|
return { ...state, containerWidth };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user