Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better static tables #519

Merged
merged 49 commits into from
Dec 15, 2023
Merged

Better static tables #519

merged 49 commits into from
Dec 15, 2023

Conversation

Jolanrensen
Copy link
Collaborator

@Jolanrensen Jolanrensen commented Nov 27, 2023

Based upon #513, this fix adds better static tables with uncollapsed column groups as well as interactive frame columns using <details> (without JS and optional CSS).
This allows ipynb notebook files to be viewed by simple renderers that don't allow iFrames or JS to be run (such as GitHub). Note that Github strips out the CSS and <details> tags and displays the nested DataFrames in full, so I made sure the limits for nested dataframes were reasonable.
This means: We adhere to the given rowsLimit and nestedRowsLimit (20 and 5 by default respectively) for the top-level and we halve the nestedRowsLimit (rounding up) for each deeper nested DF.

I also updated all notebooks except for the json one (it's too large for GH now)

@Jolanrensen Jolanrensen added this to the 0.13.0 milestone Nov 27, 2023
@Jolanrensen Jolanrensen self-assigned this Nov 27, 2023
@Jolanrensen Jolanrensen linked an issue Nov 28, 2023 that may be closed by this pull request
@Jolanrensen
Copy link
Collaborator Author

Jolanrensen commented Nov 28, 2023

Okay, outside of Github, this static rendering works great, however, Github cannot render anything even smelling interactive. I tried CSS tricks, <details>, but it doesn't help. CSS just doesn't do anything, as well as JS.
So, this is the result we get... What looks better in your opinion?

Before:
image
After:
image

Before:
image
After:
image

Before:
image
After (too large to fit, but is scrollable):
image

@Jolanrensen Jolanrensen marked this pull request as ready for review December 4, 2023 15:40
@Jolanrensen Jolanrensen added the enhancement New feature or request label Dec 5, 2023
Jolanrensen and others added 7 commits December 7, 2023 16:35
Add readArrowReader method to allow loading a dataframe from an ArrowReader
This was already updated but reverted somehow. Fixes unexpected character bug on windows machines.
Update simple-git version to 2.0.3
…nstead of column content as a key for `associateBy`.
Fix performance problem in `rename` implementation
* Ported the fix for JDBC integration from the 0.12.1 branch

* Removed unused imports

* Linting fix

* Update README and improve documentation clarity
@koperagen
Copy link
Collaborator

Ok, i think i understand what's going on in that matrix creation. Looks good! Few suggestions: move implementation to staticHtml.kt, there's now a lot of specific things not related to regular HTML. Second, have you checked escaping? toHTML does escape symbols, maybe cellFormatter that is used will do it, not sure

@Jolanrensen
Copy link
Collaborator Author

Jolanrensen commented Dec 15, 2023

@koperagen Thanks! I'll move it to another file.
As for escaping, yes, that's done by this line:
append(cellRenderer.content(cellValue, configuration).truncatedContent)
The CellRenderer calls renderValueForHtml() which uses the formatter :).

Edit: Okay rebasing on master caused all these extra commits to appear... fun

@Jolanrensen Jolanrensen merged commit 03357b1 into master Dec 15, 2023
1 check passed
@Jolanrensen Jolanrensen deleted the better-static-tables branch January 2, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Static DataFrame output in notebooks is not uncollapsible
5 participants