Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {
alias(kover)
alias(ktlint)
alias(korro) apply false
alias(docProcessor) apply false
alias(kodex) apply false
alias(simpleGit) apply false
alias(dependencyVersions)
alias(buildconfig) apply false
Expand Down
6 changes: 3 additions & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import com.google.devtools.ksp.gradle.KspTask
import com.google.devtools.ksp.gradle.KspTaskJvm
import io.github.devcrocod.korro.KorroTask
import nl.jolanrensen.docProcessor.defaultProcessors.ARG_DOC_PROCESSOR_LOG_NOT_FOUND
import nl.jolanrensen.docProcessor.gradle.creatingProcessDocTask
import nl.jolanrensen.kodex.defaultProcessors.ARG_DOC_PROCESSOR_LOG_NOT_FOUND
import nl.jolanrensen.kodex.gradle.creatingProcessDocTask
import org.gradle.jvm.tasks.Jar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import xyz.ronella.gradle.plugin.simple.git.task.GitTask
Expand All @@ -16,7 +16,7 @@ plugins {
alias(korro)
alias(kover)
alias(ktlint)
alias(docProcessor)
alias(kodex)
alias(simpleGit)
alias(buildconfig)
alias(binary.compatibility.validator)
Expand Down
40 changes: 35 additions & 5 deletions core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/html.kt
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,13 @@ public fun <T> DataFrame<T>.toHTML(
}

/**
* Container for HTML page data in form of String
* Container for HTML page data in the form of a String
* Can be used to compose rendered dataframe tables with additional HTML elements
*/
public data class DataFrameHtmlData(
@Language("css") val style: String = "",
@Language("html", prefix = "<body>", suffix = "</body>") val body: String = "",
@Language("js") val script: String = "",
public class DataFrameHtmlData(
@Language("css") public val style: String = "",
@Language("html", prefix = "<body>", suffix = "</body>") public val body: String = "",
@Language("js") public val script: String = "",
) {
override fun toString(): String =
buildString {
Expand Down Expand Up @@ -646,6 +646,36 @@ public data class DataFrameHtmlData(

public fun withTableDefinitions(): DataFrameHtmlData = tableDefinitions() + this

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is DataFrameHtmlData) return false

if (style != other.style) return false
if (body != other.body) return false
if (script != other.script) return false

return true
}

override fun hashCode(): Int {
var result = style.hashCode()
result = 31 * result + body.hashCode()
result = 31 * result + script.hashCode()
return result
}

public fun copy(
style: String = this.style,
body: String = this.body,
script: String = this.script,
): DataFrameHtmlData = DataFrameHtmlData(style = style, body = body, script = script)

public operator fun component1(): String = style

public operator fun component2(): String = body

public operator fun component3(): String = script

public companion object {
/**
* @return CSS and JS required to render DataFrame tables
Expand Down
6 changes: 3 additions & 3 deletions dataframe-csv/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import nl.jolanrensen.docProcessor.defaultProcessors.ARG_DOC_PROCESSOR_LOG_NOT_FOUND
import nl.jolanrensen.docProcessor.gradle.creatingProcessDocTask
import nl.jolanrensen.kodex.defaultProcessors.ARG_DOC_PROCESSOR_LOG_NOT_FOUND
import nl.jolanrensen.kodex.gradle.creatingProcessDocTask
import org.gradle.jvm.tasks.Jar

plugins {
Expand All @@ -10,7 +10,7 @@ plugins {
alias(kover)
alias(ktlint)
alias(jupyter.api)
alias(docProcessor)
alias(kodex)
alias(binary.compatibility.validator)
alias(kotlinx.benchmark)
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ kotestAsserions = "5.5.4"

jsoup = "1.18.3"
arrow = "18.1.0"
docProcessor = "0.3.10"
kodex = "0.4.0"
simpleGit = "2.0.3" # Can't be updated to 2.1.0+ due to Java 8 compatibility
dependencyVersions = "0.51.0"
plugin-publish = "1.3.0"
Expand Down Expand Up @@ -164,7 +164,7 @@ korro = { id = "io.github.devcrocod.korro", version.ref = "korro" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
dataframe = { id = "org.jetbrains.kotlinx.dataframe", version.ref = "dataframe" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
docProcessor = { id = "nl.jolanrensen.docProcessor", version.ref = "docProcessor" }
kodex = { id = "nl.jolanrensen.kodex", version.ref = "kodex" }
simpleGit = { id = "xyz.ronella.simple-git", version.ref = "simpleGit" }
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
Expand Down
Loading