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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3c413da
new static table renderer including fold-out tables in FrameColumns a…
Jolanrensen Nov 24, 2023
d0167f1
rendering movies.ipynb using new method
Jolanrensen Nov 24, 2023
4932159
Merge branch 'master' into better-static-tables
Jolanrensen Nov 24, 2023
0179009
adding docs to html.kt. Rendering movies.ipynb and netflix.ipynb with…
Jolanrensen Nov 27, 2023
507982a
modifying nested df rendering
Jolanrensen Nov 27, 2023
e934bf2
now taking just the body of nested DF in static rendering
Jolanrensen Nov 27, 2023
b883f16
clickable test in movies notebook for github
Jolanrensen Nov 28, 2023
25d0cd9
clickable test in movies notebook for github
Jolanrensen Nov 28, 2023
2679942
clickable test in movies notebook for github
Jolanrensen Nov 28, 2023
966f68b
updated github, movies, and netflix notebooks
Jolanrensen Nov 28, 2023
fb5136a
temp disabling css in netflix.ipynb
Jolanrensen Nov 28, 2023
aec8ed7
static table alignment
Jolanrensen Nov 28, 2023
6a50814
static table text alignment
Jolanrensen Nov 28, 2023
81ca529
github.ipynb alignment
Jolanrensen Nov 28, 2023
7b30f5a
Merge remote-tracking branch 'origin/better-static-tables' into bette…
Jolanrensen Nov 28, 2023
a815983
fixing bottom border header bug
Jolanrensen Nov 29, 2023
839ff5e
better top-aligning for static html cols
Jolanrensen Nov 29, 2023
0e27ffd
fixing bottom border header bug
Jolanrensen Nov 29, 2023
32f208c
Merge branch 'master' into better-static-tables
Jolanrensen Dec 4, 2023
78d5b85
test fix
Jolanrensen Dec 4, 2023
7b48123
updating all example notebooks without json
Jolanrensen Dec 5, 2023
f28959a
added ! to DataColumnArithmetics.kt
Jolanrensen Dec 6, 2023
2a40584
Add readArrow method and ArrowReader extension to allow loading a dat…
fb64 Dec 4, 2023
21cb4ae
Merge pull request #531 from Kotlin/datacolumn-not-arithmetics
Jolanrensen Dec 7, 2023
86b80e0
Merge pull request #529 from fb64/read-arrow-reader
Jolanrensen Dec 8, 2023
733ae63
Update simple-git version to 2.0.3
Jolanrensen Dec 12, 2023
348e9ab
Merge pull request #535 from Jolanrensen/patch-1
Jolanrensen Dec 12, 2023
046cd0c
Fix performance problem in `rename` implementation. Use column path i…
nikitinas Dec 7, 2023
b6983cf
Merge pull request #532 from nikitinas/fix-rename-performance
Jolanrensen Dec 13, 2023
24e0136
Ported the fix for JDBC integration from the 0.12.1 branch (#538)
zaleslaw Dec 14, 2023
e6d41d0
new static table renderer including fold-out tables in FrameColumns a…
Jolanrensen Nov 24, 2023
8609dc3
rendering movies.ipynb using new method
Jolanrensen Nov 24, 2023
7cb5975
github.ipynb alignment
Jolanrensen Nov 28, 2023
81d6c7d
adding docs to html.kt. Rendering movies.ipynb and netflix.ipynb with…
Jolanrensen Nov 27, 2023
04ac85f
modifying nested df rendering
Jolanrensen Nov 27, 2023
07be4e7
now taking just the body of nested DF in static rendering
Jolanrensen Nov 27, 2023
6b1d772
clickable test in movies notebook for github
Jolanrensen Nov 28, 2023
f77943f
clickable test in movies notebook for github
Jolanrensen Nov 28, 2023
c1762dc
clickable test in movies notebook for github
Jolanrensen Nov 28, 2023
fd76457
updated github, movies, and netflix notebooks
Jolanrensen Nov 28, 2023
3f16579
temp disabling css in netflix.ipynb
Jolanrensen Nov 28, 2023
84bd4d2
static table alignment
Jolanrensen Nov 28, 2023
5902846
static table text alignment
Jolanrensen Nov 28, 2023
979cf4c
fixing bottom border header bug
Jolanrensen Nov 29, 2023
eb51808
better top-aligning for static html cols
Jolanrensen Nov 29, 2023
3d93e5b
fixing bottom border header bug
Jolanrensen Nov 29, 2023
45315d5
test fix
Jolanrensen Dec 4, 2023
80ea587
updating all example notebooks without json
Jolanrensen Dec 5, 2023
47b397e
Merge remote-tracking branch 'origin/better-static-tables' into bette…
Jolanrensen Dec 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ This table shows the mapping between main library component versions and minimum
| 0.11.0 | 8 | 1.8.20 | 0.11.0-358 | 3.0.0 | 11.0.0 |
| 0.11.1 | 8 | 1.8.20 | 0.11.0-358 | 3.0.0 | 11.0.0 |
| 0.12.0 | 8 | 1.9.0 | 0.11.0-358 | 3.0.0 | 11.0.0 |
| 0.12.1 | 8 | 1.9.0 | 0.11.0-358 | 3.0.0 | 11.0.0 |

## Usage example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ import org.jetbrains.kotlinx.dataframe.Predicate
import org.jetbrains.kotlinx.dataframe.columns.ColumnReference
import java.math.BigDecimal

public operator fun DataColumn<Boolean>.not(): DataColumn<Boolean> = map { !it }

@JvmName("notBooleanNullable")
public operator fun DataColumn<Boolean?>.not(): DataColumn<Boolean?> = map { it?.not() }

public operator fun ColumnReference<Boolean>.not(): ColumnReference<Boolean> = map { !it }

@JvmName("notBooleanNullable")
public operator fun ColumnReference<Boolean?>.not(): ColumnReference<Boolean?> = map { it?.not() }

public operator fun DataColumn<Int>.plus(value: Int): DataColumn<Int> = map { it + value }

public operator fun DataColumn<Int>.minus(value: Int): DataColumn<Int> = map { it - value }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ internal fun <T, C> RenameClause<T, C>.renameImpl(newNames: Array<out String>):
internal fun <T, C> RenameClause<T, C>.renameImpl(transform: (ColumnWithPath<C>) -> String): DataFrame<T> {
// get all selected columns and their paths
val selectedColumnsWithPath = df.getColumnsWithPaths(columns)
.associateBy { it.data }
.associateBy { it.path }
// gather a tree of all columns where the nodes will be renamed
val tree = df.getColumnsWithPaths { all().rec() }.collectTree()

// perform rename in nodes
tree.allChildrenNotNull().forEach { node ->
tree.allChildrenNotNull().map { it to it.pathFromRoot() }.forEach { (node, originalPath) ->
// Check if the current node/column is a selected column and, if so, get its ColumnWithPath
val column = selectedColumnsWithPath[node.data] ?: return@forEach
val column = selectedColumnsWithPath[originalPath] ?: return@forEach
// Use the found selected ColumnWithPath to query for the new name
val newColumnName = transform(column)
node.name = newColumnName
Expand Down
Loading