Fixed Row Visible Index Range
Plan half-open visible fixed-row indexes with positive geometric intersection; exact end contacts are excluded and empty viewports contain no rows.
Description
Plan half-open visible fixed-row indexes with positive geometric intersection; exact end contacts are excluded and empty viewports contain no rows.
Equal-height visible row bounds can be calculated directly without enumerating every row.
When to use this tool
Plan half-open visible fixed-row indexes with positive geometric intersection; exact end contacts are excluded and empty viewports contain no rows.
- Prepare the supplied rowCount, rowExtent, viewportStart, viewportExtent fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter rowCount, rowExtent, viewportStart, viewportExtent. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.firstIndex, result.endExclusive. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Require integer rowCount, positive rowExtent and nonnegative viewportStart/Extent. Clamp floor(viewportStart/rowExtent) to count for firstIndex; use a clamped ceiling at the viewport end for endExclusive, with an empty range for zero extent.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| rowCount | row count. | Integer from 0 to 1e6 inclusive |
| rowExtent | row extent. | Finite number; greater than zero |
| viewportStart | viewport start. | Finite number; zero or greater |
| viewportExtent | viewport extent. | Finite number; zero or greater |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.firstIndex | The first index value under the stated formula or text convention. |
| result.endExclusive | The end exclusive value under the stated formula or text convention. |
{
"input": {
"rowCount": 10,
"rowExtent": 20,
"viewportStart": 15,
"viewportExtent": 30
},
"output": {
"result": {
"firstIndex": 0,
"endExclusive": 3
}
}
} Limitations and assumptions
- The range is half-open and can end at rowCount. No overscan, variable row size or DOM query occurs.
- Rectangle arrays use [x,y,width,height] with nonnegative extents. All dimensions must use the same coordinate frame and unit; values are supplied rather than measured from a page.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- String lists have at most 128 entries of at most 128 code units; matrices have at most 128 rows and columns. Larger numeric lists and parsed JSON have separate bounded budgets. Nonfinite results and excessively large serialized outputs are rejected.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Measure the actual layout when browser behavior matters. The formulas use supplied coordinates and explicit simplifications; they do not account for every box, writing mode, clipping ancestor or simultaneous layout change.
References
Similar or alternative tools
- Variable Row Visible Index Range
Plan visible indexes for explicit positive variable row extents; retain an empty result rather than infer estimated heights.
- Uniform Card Last Row Filler
Plan uniform-grid last-row filler count, with no filler row for zero items; does not generate DOM elements.