- Notifications
You must be signed in to change notification settings - Fork175
feat: support variable node height#238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Very interesting! I am in the middle or re-working the code for a new version, so I am not going to merge this yet. But can you help me understand the steps you took? Can you summarize the changes you've made in this branch? What is the use case you needed the variable heights for? |
hasanayan commentedMar 28, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Sure. We need to style our tree view so that rows have different height based on their levels or their order in the branch, that's why we needed this and we are currently using it with slight modifications from this PR. I was going to update this PR with our final changes and open others based on our needs but apparently now is not the right time. Do you have any date in mind to release the new version? I can tell you about our use cases. Here is the summary of suggested changes in this PR;
exporttypeRowHeightCalculatorParams<T>=Pick<NodeApi<T>,|"childIndex"|"children"|"data"|"parent"|"id"|"rowIndex"|"tree"|"isRoot"|"isLeaf"|"isClosed"|"isOpen"|"isAncestorOf"|"level">; the omitted properties of the NodeApi could be passed, too. I wasn't well versed with the library and I did not include those states so that I don't break anything I don't know. Plus, whatever you provide to rowHeight calculation function, you have to track places that might trigger changes to them it internally and re-draw the list after the change.(explained in the last point) and I didn't want to do that until there is a green light from you 😄 -DnD cursor positioning relies on computing top offset of specific rows which was a simple -It renders -Whenever a change is made on the list data (re-ordering, renaming, dnd etc), it calls |
Thank you for the detailed explanation. This is a good plan. I don't have a date for the new release. But I am actively working on it. |
josh-complex commentedMay 22, 2024
Would really love to see this feature 👍 We use dynamic row heights in our current unvirtualized tree, and working this into the current arborist implementation is rough to say the least |
simonpeters commentedJul 11, 2024
What library are you using? |
hoarseProgramming commentedAug 27, 2025
Hi Hasanayan! I'm interested in trying out your variable row sizes, and was wondering if you're still working with your version of react-arborist and how you've been working with the variable row sizes in your project? Since react-arborist isn't being maintained anymore it would be cool to try out your version. |
Uh oh!
There was an error while loading.Please reload this page.
Hello, this is a first attempt at supporting variable row heights. I tested it with the existing examples and it seems to work fine with both exact and dynamic row heights.