TableCellRanges {basictabler} | R Documentation |
R6 class that manages cell ranges (e.g. for merged cells).
Description
The 'TableCellRanges' class contains a list of cell ranges and provides basic utility methods such as finding intersecting ranges to support the functioning of the 'BasicTable' class.
Format
R6Class
object.
Active bindings
ranges
A list of cell ranges - where each element in the list is another list containing the range extent.
Methods
Public methods
Method new()
Create a new 'TableCellRanges' object.
Usage
TableCellRanges$new(parentTable)
Arguments
parentTable
Owning table.
Returns
No return value.
Method addRange()
Add a cell range to the list of cell ranges. It is not necessary to specify all parameters. rFrom and cFrom must be specified. Only one of rSpan and rTo needs to be specified. Only one of cSpan and cTo needs to be specified.
Usage
TableCellRanges$addRange( rFrom = NULL, cFrom = NULL, rSpan = NULL, cSpan = NULL, rTo = NULL, cTo = NULL )
Arguments
rFrom
Row number of the top-left cell in the cell range.
cFrom
Column number of the top-left cell in the cell range.
rSpan
Number of rows spanned by the cell range.
cSpan
Number of columns spanned by the cell range.
rTo
Row number of the bottom-right cell in the cell range.
cTo
Column number of the bottom-right cell in the cell range.
Returns
No return value.
Method findIntersectingRange()
Find a cell range in the list of cell ranges that intersects with the specified cell range. It is not necessary to specify all parameters. rFrom and cFrom must be specified. Only one of rSpan and rTo needs to be specified. Only one of cSpan and cTo needs to be specified.
Usage
TableCellRanges$findIntersectingRange( rFrom = NULL, cFrom = NULL, rSpan = NULL, cSpan = NULL, rTo = NULL, cTo = NULL )
Arguments
rFrom
Row number of the top-left cell in the cell range.
cFrom
Column number of the top-left cell in the cell range.
rSpan
Number of rows spanned by the cell range.
cSpan
Number of columns spanned by the cell range.
rTo
Row number of the bottom-right cell in the cell range.
cTo
Column number of the bottom-right cell in the cell range.
Returns
No return value.
Method deleteRange()
Delete the cell range from the list that contains the specified cell.
Usage
TableCellRanges$deleteRange(r = NULL, c = NULL)
Arguments
r
Row number of a cell in the cell range to be deleted.
c
Column number of a cell in the cell range to be deleted.
Returns
No return value.
Method clear()
Clear the list of cell ranges.
Usage
TableCellRanges$clear()
Returns
No return value.
Method updateAfterRowInsert()
Internal use only.
Usage
TableCellRanges$updateAfterRowInsert(r = NULL)
Arguments
r
Row number.
Returns
No return value.
Method updateAfterRowDelete()
Internal use only.
Usage
TableCellRanges$updateAfterRowDelete(r = NULL)
Arguments
r
Row number.
Returns
No return value.
Method updateAfterColumnInsert()
Internal use only.
Usage
TableCellRanges$updateAfterColumnInsert(c = NULL)
Arguments
c
Column number.
Returns
No return value.
Method updateAfterColumnDelete()
Internal use only.
Usage
TableCellRanges$updateAfterColumnDelete(c = NULL)
Arguments
c
Column number.
Returns
No return value.
Method asList()
Return the contents of this object as a list for debugging.
Usage
TableCellRanges$asList()
Returns
A list of various object properties.
Method asJSON()
Return the contents of this object as JSON for debugging.
Usage
TableCellRanges$asJSON()
Returns
A JSON representation of various object properties.
Method clone()
The objects of this class are cloneable with this method.
Usage
TableCellRanges$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
# TableCellRanges objects are never created outside of the BasicTable class.
# For examples of working with merged cells, see the Introduction vignette.