Interface GridOverlayView

Pass to GridOverlay callback to allow them to render to over a grid

interface GridOverlayView {
    anchor: AnchorLocation;
    bounds: Bounds;
    cellLayout: CellLayout;
    freezeTopLeft: TopLeft;
    insets: Rectangle;
    scrollOrientation: ScrollOrientation;
    scrollTopLeft: TopLeft;
    totalSize: Size;
    viewportSize: Size;
    visibleCellRange: CellRangeCoords;
    zoom: number;
    allViews(): Partial<Record<AnchorLocation, GridOverlayView>>;
    clipBounds(rect?, insets?): Bounds;
    getCellCoordsFromOffset(x, y, actualCell?): CellCoords;
    getCellRangeBounds(range?, adjustment?): Bounds;
    getCoordsAsRange(coords): CellRangeCoords;
    getRelativePointFromOffset(x, y): Point;
    getTotalCellRange(): CellRangeCoords;
    getVisibleColumnOffsets(): SizedOffset;
    getVisibleColumns(): number[];
    getVisibleRowOffsets(): SizedOffset;
    getVisibleRows(): number[];
    scrollCellIntoView(coords, options?): Promise<Partial<TopLeft>>;
    toAbsoluteBounds(rect): Bounds;
    toViewBounds(rect): Bounds;
}

Properties

bounds: Bounds

The bounds of the the overlay relative to the total view.

cellLayout: CellLayout

Allow for dimensions to be determined for various cells. The cellLayout is inclusive of the zoom

freezeTopLeft: TopLeft
insets: Rectangle
scrollOrientation: ScrollOrientation

Indicate the allowable scroll directions

scrollTopLeft: TopLeft
totalSize: Size
viewportSize: Size

This is the size for all views (but not including the headers)

visibleCellRange: CellRangeCoords

This captures the total viewable range. This will have the sames values as

See

  • getVisibleRows and
  • getVisibleColumns
zoom: number

Useful for internal rendering.

Remarks

The cell layout will account for zoom factors already.

Methods

  • Clip a rectangle against the viewport. A negative inset will extend outside of the viewport; this is useful when elements should visually 'flow' of of the viewport. Selection with borders is an example of this

    Parameters

    Returns Bounds

  • Return the coords at the offset.

    Parameters

    • x: number

      The x offset relative to the view

    • y: number

      The y offset relative to the view

    • Optional actualCell: boolean

      Don't return the topLeft of a merge.

    Returns CellCoords

    Default Value

    false.
    
  • Return a bounds for a given range. If not specified then will return for the cellRange.

    Parameters

    • Optional range: CellRangeCoords
    • Optional adjustment: Partial<Rectangle>

      This allows you to adjust the rect. Note - This is not like insets

    Returns Bounds

    Remarks

    The bounds are relative to the view.

  • Return the cell as a range. If this cell is merged this will be reflected. Note - This is slightly more sophisticated than rowSpan and colSpan because it allows for queries that are not on the top/left

    Parameters

    Returns CellRangeCoords

  • Parameters

    • x: number
    • y: number

    Returns Point

  • Useful for scanning. Contains a list of column offsets that are visible. Guaranteed to be non-null but may be zero length if no column are visible.

    Returns number[]

  • Useful for scanning. Contains a list of row offsets that are visible. Guaranteed to be non-null but may be zero length if no rows are visible.

    Returns number[]

  • Scroll the cell into view. If the coord does not have an index it will only scroll in a single direction.

    Parameters

    • coords: Partial<CellCoords>
    • Optional options: boolean | ScrollIntoViewOptions

    Returns Promise<Partial<TopLeft>>

  • Return the absolute bounds for a viewport bounds

    Parameters

    Returns Bounds

  • Return the viewport bounds for an absolute bounds

    Parameters

    Returns Bounds