Repository navigation
XLV-5: row-height overrides in javascript-excel/render (auto-fit) - #102
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XLV-5 (engine): row-height overrides in
javascript-excel/render, so react-xlsx-viewer can auto-fit rows (react-xlsx-viewer issue #14, design in its comments; decision Q11).setRowHeightstakes measured heights in CSS px at zoom 100 % and rebuilds theFloat64Arrayprefix sums from the first changed row onwards, at O(rows after it) per batch. It returns whether anything changed.rowProps[r].height): the file's height wins, as in Excel;Why an array, not an
Iterable: the first push usedIterableand Consumer TS failed.Iterableis an ES2015 lib type, and consumers on TS 5.x in bundler mode default to ES5 libs.ReadonlyArrayworks everywhere. Consumer TS 5.0/5.4/7.0 × 3 resolutions pass locally.Tests (
test/render/render.test.ts, 3 new): stored-height detection; growing rows and rebuilding offsets (rowTop,rowHeight,rowAt); the ignored cases; clamping to the default and to 409 pt.Checked locally (Node 26.13.1): typecheck clean,
npm test863 passed, publint, smoke (tsc node16/nodenext/bundler), docs snippets and the API reference.Minor changeset (pre mode: the next 2.0 alpha). No new dependencies. The viewer PR, which measures and calls
setRowHeights, follows in react-xlsx-viewer.