Estimates the number of rows and columns for a given set of parameters.
The options for the estimation.
The number of items to estimate for.
The parameters for the estimation.
The fixed page limit.
The screen page limit.
Indicates if screen sharing has started.
Indicates if sharing is active.
The type of event (e.g., "chat", "conference").
Indicates if the alternate grid should be removed.
Indicates if the screen is wide.
Indicates if the screen is medium-sized.
Function to update the removeAltGrid parameter.
Function to calculate rows and columns.
An array containing:
Will log an error message if an error occurs during estimation.
const estimateOptions = { n: 20, parameters: { fixedPageLimit: 10, screenPageLimit: 15, shareScreenStarted: false, shared: false, eventType: 'conference', removeAltGrid: false, isWideScreen: true, isMediumScreen: false, updateRemoveAltGrid: (value) => console.log(`Remove Alt Grid: ${value}`), calculateRowsAndColumns: ({ n }) => { const sqrt = Math.sqrt(n); return [Math.ceil(sqrt), Math.floor(sqrt)]; }, },};const estimateService = new GetEstimate();const [estimatedItems, estimatedRows, estimatedCols] = estimateService.getEstimate(estimateOptions);console.log(`Estimated Items: ${estimatedItems}, Rows: ${estimatedRows}, Columns: ${estimatedCols}`); Copy
const estimateOptions = { n: 20, parameters: { fixedPageLimit: 10, screenPageLimit: 15, shareScreenStarted: false, shared: false, eventType: 'conference', removeAltGrid: false, isWideScreen: true, isMediumScreen: false, updateRemoveAltGrid: (value) => console.log(`Remove Alt Grid: ${value}`), calculateRowsAndColumns: ({ n }) => { const sqrt = Math.sqrt(n); return [Math.ceil(sqrt), Math.floor(sqrt)]; }, },};const estimateService = new GetEstimate();const [estimatedItems, estimatedRows, estimatedCols] = estimateService.getEstimate(estimateOptions);console.log(`Estimated Items: ${estimatedItems}, Rows: ${estimatedRows}, Columns: ${estimatedCols}`);
An array containing the estimated number of items, rows, and columns.
Estimates the number of rows and columns for a given set of parameters.
Param: options
The options for the estimation.
Param: options.n
The number of items to estimate for.
Param: options.parameters
The parameters for the estimation.
Param: options.parameters.fixedPageLimit
The fixed page limit.
Param: options.parameters.screenPageLimit
The screen page limit.
Param: options.parameters.shareScreenStarted
Indicates if screen sharing has started.
Param: options.parameters.shared
Indicates if sharing is active.
Param: options.parameters.eventType
The type of event (e.g., "chat", "conference").
Param: options.parameters.removeAltGrid
Indicates if the alternate grid should be removed.
Param: options.parameters.isWideScreen
Indicates if the screen is wide.
Param: options.parameters.isMediumScreen
Indicates if the screen is medium-sized.
Param: options.parameters.updateRemoveAltGrid
Function to update the removeAltGrid parameter.
Param: options.parameters.calculateRowsAndColumns
Function to calculate rows and columns.
Returns
An array containing:
Throws
Will log an error message if an error occurs during estimation.
Example