Skip to content

Commit

Permalink
Merge pull request #1080 from Kotlin/debugger-utils-1
Browse files Browse the repository at this point in the history
Add util classes for custom java type renderers
  • Loading branch information
koperagen authored Feb 27, 2025
2 parents c250329 + eb28a18 commit 43e7d4a
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.jetbrains.kotlinx.dataframe.impl

import org.jetbrains.kotlinx.dataframe.AnyFrame
import org.jetbrains.kotlinx.dataframe.DataFrame
import org.jetbrains.kotlinx.dataframe.api.ValueCount
import org.jetbrains.kotlinx.dataframe.api.count
import org.jetbrains.kotlinx.dataframe.api.map

// Needed to attach an expanded node with lazily evaluated expressions to DataFrame debug view
@Suppress("unused")
internal class Info(val df: AnyFrame)

internal class Counts(val value: Any?, val count: Int) {
override fun toString(): String = "$value -> $count"
}

internal fun DataFrame<ValueCount>.render(): List<Counts> = map { Counts(it[0], it.count) }

0 comments on commit 43e7d4a

Please sign in to comment.