-
Notifications
You must be signed in to change notification settings - Fork 75
Move to(Start) keeping inside group #1489
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
base: master
Are you sure you want to change the base?
Move to(Start) keeping inside group #1489
Conversation
|
||
/** | ||
* Moves columns, previously selected with [move] to a new position specified | ||
* by [columnIndex] within the column group (remaining inside the group). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*if insideGroup == true
that is
* ### Examples: | ||
* ```kotlin | ||
* df.move { age and weight }.to(0) | ||
* df.move("age", "weight").to(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about an example with insideGroup = true?
* ``` | ||
* | ||
* @param [columnIndex] The index specifying the position in the [ColumnGroup] columns | ||
* * where the selected columns will be moved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
floating "*"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no information about @param insideGroup
public fun <T, C> MoveClause<T, C>.toStart(): DataFrame<T> = to(0) | ||
|
||
/** | ||
* Moves columns, previously selected with [move] to the start of their [ColumnGroup] (remaining inside the group). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only if insideGroup = true
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/move.kt
Outdated
Show resolved
Hide resolved
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/move.kt
Outdated
Show resolved
Hide resolved
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/move.kt
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
// move columns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably easier to view the logic using a when
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and lift return
out of the when-statement
* where the selected columns will be moved. | ||
* | ||
* @param [insideGroup] If true, selected columns will be moved remaining inside their group, | ||
* else they will be moved on top level. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*to the top level
|
||
/** | ||
* Moves columns, previously selected with [move] to a new position specified | ||
* by [columnIndex]. If insideGroup is true, selected columns will be moved remaining within their [ColumnGroup], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"insideGroup" can have "[]"
Oh, I see we also have these shortcut functions:
Could you do the same there as with |
About #1255
It comes with docs and a test case