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:

  • Estimated number of items,
  • Estimated number of rows,
  • Estimated number of columns.

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}`);

Constructors

Methods

Constructors

Methods

  • Estimates the number of rows and columns for a given set of parameters.

    Parameters

    Returns [number, number, number]

    An array containing the estimated number of items, rows, and columns.

    Will log an error message if an error occurs during estimation.