Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lukasmasuch
Copy link
Collaborator

@lukasmasuch lukasmasuch commented Sep 26, 2024

Describe your changes

Adds a row_height parameter to st.dataframe and st.data_editor that allows the configuration of the row height. Also, potentially auto-activated word wrapping in text columns as shown here:

image

GitHub Issue Link (if applicable)

Testing Plan

  • Added e2e tests.

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@github-actions
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 11, 2024
@lukasmasuch lukasmasuch removed the stale label Oct 11, 2024
@lukasmasuch lukasmasuch added the do-not-merge PR is blocked from merging label Oct 23, 2024
@vmatt
Copy link

vmatt commented Jan 15, 2025

Hey, I really need this feature, when can be expected to be merged?

@lukasmasuch
Copy link
Collaborator Author

Hey, I really need this feature, when can be expected to be merged?

This will probably be released in 1.43 (~in one month).

@vmatt
Copy link

vmatt commented Jan 28, 2025

Cool, thanks!

@lukasmasuch lukasmasuch added security-assessment-completed Security assessment has been completed for PR change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users and removed do-not-merge PR is blocked from merging labels Feb 11, 2025
@sfc-gh-lmasuch sfc-gh-lmasuch changed the title [Prototype] Allow configuring dataframe row height Allow configuring the row height for st.dataframe and st.data_editor Feb 12, 2025
@sfc-gh-lmasuch sfc-gh-lmasuch marked this pull request as ready for review February 12, 2025 00:42
@sfc-gh-lmasuch sfc-gh-lmasuch requested a review from a team as a code owner February 12, 2025 00:42
element.useContainerWidth ||
(notNullOrUndefined(element.width) && element.width > 0)

// Allow content wrapping if the configured row height is greater than 4rem
Copy link
Collaborator

@raethlein raethlein Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please make the comment more specific please and say why 4rem is the limit here? Where does this magic number come from, like is it arbitrarily chosen because it looks good or is it derived from some other sizes we have? Also, should it be theme-able in case someone changes the sizes of the overall app?

Copy link
Collaborator Author

@lukasmasuch lukasmasuch Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arbitrarily chosen because it looks good

Yep, its arbitrarily chosen because it looked and felt good. I will add that as comment.

Also, should it be theme-able in case someone changes the sizes of the overall app?

Thats why it is using rem not px to automatically adapt to the configured root font size (the only way to currently re-scale apps). I will also add that as a comment.

An optional dict of kwargs to pass to the callback.

row_height : int or None
The height of each row in the data editor in pixels. If ``row_height``
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The height of each row in the data editor in pixels. If ``row_height``
The height of each row in the data editor in pixels. If ``row_height``

Copy link
Collaborator

@raethlein raethlein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just left a comment about where the 4rem are coming from

@lukasmasuch lukasmasuch merged commit 5a703ba into develop Feb 12, 2025
32 checks passed
@lukasmasuch lukasmasuch deleted the feature/configurable-dataframe-row-height branch February 12, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

5 participants