RevGrid - v0.10.0
    Preparing search index...

    Class RevViewLayout<BGS, BCS, SF>

    Manages the visual layout of the grid, including the arrangement and sizing of rows and columns, scroll positions, and mapping between data and view coordinates.

    Type Parameters

    Implements

    Index

    Anchor

    Bounds

    Cell

    Client Object

    Column

    Invalidate

    Pool

    Row

    Scroll

    Scroll Dimension

    Values

    Anchor

    • get columnScrollAnchorIndex(): number

      The index of the active column which is first non-fixed column in the view (either on left or right depending on Grid alignment)

      Returns number

      Index of active column or -1 if there is no space for scrollable columns (ie only space for fixed columns)

    • get columnScrollAnchorOffset(): number

      Specifies the number of pixels of the anchored column which have been scrolled off the view Changes to allow smooth scrolling

      Returns number

    • get firstScrollableColumnLeftOverflow(): undefined | number

      Returns undefined | number

    • get lastScrollableColumnRightOverflow(): undefined | number

      Returns undefined | number

    • get rowScrollAnchorIndex(): number

      Returns number

    • get unanchoredColumnOverflow(): undefined | number

      Specifies the number of pixels the column at the opposite end of the anchored column has off the view This value will be:

      • undefined if unanchored column does not reach the end of the view.
      • 0 if the unanchored column is touches the edge of the view with no overflow
      • Positive number which specifies the number of pixels the column overflows the grid on the unanchored side

      Returns undefined | number

    • Calculates the scroll anchor for a page left scroll action. Warning: NOT IMPLEMENTED

      Returns undefined | ScrollAnchor

      A new scroll anchor which can be used for page left scrolling or undefined if a left scroll operation is not possible.

    • Calculates the scroll anchor for a page right scroll action. Warning: NOT IMPLEMENTED

      Returns undefined | ScrollAnchor

      A new scroll anchor which can be used for page right scrolling or undefined if a right scroll operation is not possible.

    Bounds

    • get columnsViewWidth(): number

      Returns number

    • get firstScrollableRowViewTop(): undefined | number

      Returns undefined | number

    • get fixedColumnsViewWidth(): number

      Returns number

    • get scrollableCanvasBounds(): undefined | RevCornerRectangle

      Gets the bounds of the canvas which contains the scrollable area.

      Returns undefined | RevCornerRectangle

      A RevCornerRectangle representing the bounds of the scrollable canvas area, or undefined if scrolling is not possible.

    • get scrollableColumnsViewWidth(): number

      Returns number

    • Parameters

      • x: number

        Grid column coordinate.

      • y: number

        Grid row coordinate.

      Returns RevRectangle

      Bounding rect of cell with the given coordinates.

    • Parameters

      • index: number

      Returns number

      The rendered row height at index

    • Parameters

      • index: number

      Returns number

      The rendered column width at index

    Cell

    • Finds a cell at the specified canvas offset.

      Parameters

      • x: number

        The x-coordinate of the canvas offset.

      • y: number

        The y-coordinate of the canvas offset.

      Returns undefined | RevViewCell<BCS, SF>

      The cell at the specified canvas offset, or undefined if not found.

    • Finds a cell at the specified data point.

      Parameters

      • fieldColumnIndex: number

        index of field column within grid

      • subgridRowIndex: number

        index of row within its subgrid within the grid

      • subgrid: RevSubgrid<BCS, SF>

        the subgrid to search within

      Returns undefined | RevViewCell<BCS, SF>

      the cell at the specified index, or undefined if not found

    • Finds a cell at the specified grid row and column.

      Parameters

      • activeColumnIndex: number

        index of active column within grid

      • subgridRowIndex: number

        index of row within its subgrid within the grid

      • subgrid: RevSubgrid<BCS, SF>

        the subgrid to search within

      • canComputePool: boolean

        whether the pool can be recomputed (set to false if called from within animation frame)

      Returns undefined | RevViewCell<BCS, SF>

      the cell at the specified index, or undefined if not found

    • Finds a cell at the specified viewport row and column.

      Parameters

      • viewportColumnIndex: number

        index of column within viewport

      • viewportRowIndex: number

        index of row within viewport

      • canComputePool: boolean

        whether the pool can be recomputed (set to false if called from within animation frame)

      Returns RevViewCell<BCS, SF>

      the cell at the specified index, or undefined if not found

    • Get cell at offset position on canvas.

      Parameters

      • canvasXOffset: number

        x position on canvas.

      • canvasYOffset: number

        y position on canvas.

      Returns undefined | RevLinedHoverCell<BCS, SF>

      Cell at co-ordinate or undefined if none.

    • Parameters

      • canvasOffsetX: number
      • canvasOffsetY: number

      Returns undefined | RevViewCell<BCS, SF>

    Client Object

    clientId: string
    internalParent: RevClientObject

    Column

    • get columnCount(): number

      The number of columns in the view layout.

      Returns number

    • get firstScrollableActiveColumnIndex(): undefined | number

      Returns undefined | number

    • get firstScrollableColumnIndex(): undefined | number

      Index of the first scrollable column in columns

      Returns undefined | number

    • get firstScrollableColumnIsMaximallyInView(): boolean

      Indicates whether the first (left most) scrollable column is displayed in view as much as possible.

      Returns boolean

      true if the first scrollable column is maximally in the view, false otherwise.

    • get lastScrollableActiveColumnIndex(): undefined | number

      Returns undefined | number

    • get lastScrollableColumnIndex(): undefined | number

      Returns undefined | number

    • get lastScrollableColumnIsMaximallyInView(): boolean

      Indicates whether the last (right most) scrollable column is displayed in view as much as possible.

      Returns boolean

      true if the last scrollable column is maximally in the view, false otherwise.

    • get scrollableColumnCount(): number

      Number of columns in columns

      Returns number

    • Parameters

      • canvasOffsetX: number

      Returns number

    • Get the column index matching the provided active column index.

      Parameters

      • activeColumnIndex: number

        The grid column index.

      Returns undefined | RevViewLayoutColumn<BCS, SF>

      The given column if in view or undefined if not.

    • Get the column in viewport with the provided field index.

      Parameters

      • fieldIndex: number

        The grid column index.

      Returns undefined | RevViewLayoutColumn<BCS, SF>

      The column if found and in viewport, otherwise undefined.

    • Parameters

      • canvasOffsetX: number

      Returns number

    • Parameters

      • canvasOffsetX: number

      Returns number

    • Get the index of the column whose edge is closest to the coordinate at pixelX

      Parameters

      • pixelX: number

        The horizontal coordinate.

      Returns number

      The column index under the coordinate at pixelX.

    • Parameters

      • activeColumnIndex: number

      Returns boolean

    • Indicates whether an active column is in view.

      Parameters

      • activeColumnIndex: number

        the column index

      Returns boolean

      true if the column is in view, false otherwise.

    • Check if a field column is in viewport. A column will not be in viewport if it is either not active or scrolled out of view.

      Parameters

      • fieldIndex: number

        the column's field index

      Returns boolean

    • Returns boolean

      The last col was rendered (is in view)

    • Limit an active column index value to within the range of active column indices of columns that are scrollable.

      Parameters

      • activeColumnIndex: number

        The active column index to limit.

      Returns undefined | number

      The passed activeColumnIndex if it is within the range of scrollable columns, or the active column index of the closest scrollable column or undefined if no scrollable columns are present.

    Invalidate

    • Parameters

      • scrollDimensionAsWell: boolean

      Returns void

    • Parameters

      • scrollDimensionAsWell: boolean

      Returns void

    • Parameters

      • scrollDimensionAsWell: boolean

      Returns void

    Pool

    • get columnRowCellPoolComputationInvalid(): boolean

      Returns boolean

    • get rowColumnCellPoolComputationInvalid(): boolean

      Returns boolean

    • Returns void

    • Returns void

    Row

    • get firstScrollableRowIndex(): undefined | number

      Index of the first scrollable row in rows

      Returns undefined | number

    • get firstScrollableSubgridRowIndex(): undefined | number

      Subgrid row index of the first scrollable row

      Returns undefined | number

    • get lastScrollableRowIndex(): undefined | number

      Gets the index of the last row that can be scrolled to in the view. Ensures that vertical computations are performed outside of the animation frame before returning the value.

      Returns undefined | number

      The index of the last scrollable row, or undefined if not available.

    • get lastScrollableRowSubgridRowIndex(): undefined | number

      Gets the subgrid row index of the last scrollable row.

      Ensures that vertical computations are up-to-date before accessing the value. Returns undefined if there is no last scrollable row, otherwise returns the corresponding subgrid row index.

      Returns undefined | number

    • get preMainRowCount(): number

      The number of rows before/above the main subgrid in the view layout.

      Returns number

    • get rowCount(): number

      The number of rows in the view layout.

      Returns number

    • get scrollableRowCount(): number

      Returns number

    • Parameters

      • y: number

      Returns number

    • Parameters

      • canvasOffsetY: number

      Returns number

    • Get the row in viewport with the provided subgrid row index and subgrid.

      Parameters

      • subgridRowIndex: number

        The index of the row within the specified subgrid.

      • subgrid: RevSubgrid<BCS, SF>

        The subgrid to which the row belongs.

      Returns undefined | RevViewLayoutRow<BCS, SF>

      The given row if in viewport or undefined if not.

    • Parameters

      • canvasOffsetY: number

      Returns number

    • Check if a subgrid row is in view.

      Parameters

      • rowIndex: number

        The index of the row (within a subgrid) to check.

      • subgrid: RevSubgrid<BCS, SF>

        The subgrid to check against.

      Returns boolean

      true if the row is in view, otherwise false.

    • Limit a row index value to within the range of indices of rows that are scrollable.

      Parameters

      • rowIndex: number

        The row index to limit.

      Returns undefined | number

      The passed rowIndex if it is within the range of scrollable rows, or the index of the closest scrollable row or undefined if no scrollable rows are present.

    Scroll

    • Ensures that the specified cell is within the viewport. If its column or row is not currently in view, adjusts the viewport to bring them into view.

      Parameters

      • activeColumnIndex: number

        The index of the active column to ensure is in view.

      • mainSubgridRowIndex: number

        The index of the row in main subgrid to ensure is in view.

      • maximally: boolean

        If true, attempts to maximize the visibility of the column and row within the viewport.

      Returns boolean

      true if the viewport start position was changed to bring the column or row into view; otherwise, false.

    • Parameters

      • activeColumnIndex: number
      • maximally: boolean

      Returns boolean

    • Ensures that the specified row index is within the viewport of the grid. If the row is within the fixed rows, no scrolling occurs. Otherwise, the method scrolls the grid to bring the row into view, considering whether the scrolling should be maximal (i.e., align the row at the top of the viewport) and handling edge cases where the viewport size is not an exact multiple of the row height.

      Parameters

      • mainSubgridRowIndex: number

        The index of the row in the main subgrid to ensure in viewport.

      • maximally: boolean

        If true, ensure the row is maximally in view; otherwise do not scroll if it is already partially in view.

      Returns boolean

      true if scrolling was performed to bring the row into view; false otherwise.

      If the scrollable row indices are inconsistent.

    • Scrolls the viewport by the specified number of columns.

      Parameters

      • scrollColumnCount: number

        The number of columns to scroll (can be negative).

      Returns boolean

      true if the viewport was scrolled; otherwise, false.

    • Scrolls the viewport by the specified number of columns and rows.

      Parameters

      • columnCount: number

        The number of columns to scroll (can be negative).

      • rowCount: number

        The number of rows to scroll (can be negative).

      Returns boolean

      true if the viewport was scrolled; otherwise, false.

    • Parameters

      • delta: number

      Returns void

    • Parameters

      • rowScrollCount: number

      Returns boolean

    • Parameters

      • delta: number

      Returns boolean

    • Parameters

      • activeColumnIndex: number

        Index of active column that should be anchor

      • offset: number

      Returns boolean

      true if changed

    • Sets the column scroll anchor to its current limit. This will scroll the viewport as far as possible to the right.

      Returns void

    • Parameters

      • value: number

      Returns boolean

    • Parameters

      • index: number
      • offset: number

      Returns boolean

    • Returns void

    • Parameters

      • viewportStart: number

      Returns void

    Scroll Dimension

    horizontalScrollDimension: RevHorizontalScrollDimension<BGS, BCS, SF>

    Tracks viewport size, position and scrollability in horizontal scroll dimension

    verticalScrollDimension: RevVerticalScrollDimension<BGS, BCS, SF>

    Tracks viewport size, position and scrollability in vertical scroll dimension

    Values

    • Matrix of view values within cells in the viewport.

      Returns unknown[][]