@@ -10,26 +10,24 @@ import org.jetbrains.kotlinx.dataframe.api.filter
10
10
* The plugin sends Kotlin following code to the kernel to evaluate
11
11
* DISPLAY(KotlinNotebooksPluginUtils.getRowsSubsetForRendering(Out[x], 0, 20), "")
12
12
*/
13
- public class KotlinNotebookPluginUtils {
14
- public companion object {
15
- /* *
16
- * Returns a subset of rows from the given dataframe for rendering.
17
- * It's used for example for dynamic pagination in Kotlin Notebook Plugin.
18
- */
19
- public fun getRowsSubsetForRendering (
20
- dataFrameLike : Any? ,
21
- startIdx : Int ,
22
- endIdx : Int
23
- ): DisableRowsLimitWrapper = when (dataFrameLike) {
24
- null -> throw IllegalArgumentException (" Dataframe is null" )
25
- else -> getRowsSubsetForRendering(convertToDataFrame(dataFrameLike), startIdx, endIdx)
26
- }
27
-
28
- /* *
29
- * Returns a subset of rows from the given dataframe for rendering.
30
- * It's used for example for dynamic pagination in Kotlin Notebook Plugin.
31
- */
32
- public fun getRowsSubsetForRendering (df : AnyFrame , startIdx : Int , endIdx : Int ): DisableRowsLimitWrapper =
33
- DisableRowsLimitWrapper (df.filter { it.index() in startIdx until endIdx })
13
+ public object KotlinNotebookPluginUtils {
14
+ /* *
15
+ * Returns a subset of rows from the given dataframe for rendering.
16
+ * It's used for example for dynamic pagination in Kotlin Notebook Plugin.
17
+ */
18
+ public fun getRowsSubsetForRendering (
19
+ dataFrameLike : Any? ,
20
+ startIdx : Int ,
21
+ endIdx : Int
22
+ ): DisableRowsLimitWrapper = when (dataFrameLike) {
23
+ null -> throw IllegalArgumentException (" Dataframe is null" )
24
+ else -> getRowsSubsetForRendering(convertToDataFrame(dataFrameLike), startIdx, endIdx)
34
25
}
26
+
27
+ /* *
28
+ * Returns a subset of rows from the given dataframe for rendering.
29
+ * It's used for example for dynamic pagination in Kotlin Notebook Plugin.
30
+ */
31
+ public fun getRowsSubsetForRendering (df : AnyFrame , startIdx : Int , endIdx : Int ): DisableRowsLimitWrapper =
32
+ DisableRowsLimitWrapper (df.filter { it.index() in startIdx until endIdx })
35
33
}
0 commit comments