Skip to content

Commit 39ef1de

Browse files
Refactor columnToJs to remove redundant renderRootDf
1 parent 9d80998 commit 39ef1de

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/html.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ internal fun AnyFrame.toHtmlData(
173173
col: ColumnWithPath<*>,
174174
rowsLimit: Int?,
175175
configuration: DisplayConfiguration,
176-
renderRootDf: AnyFrame = this,
177176
): ColumnDataForJs {
178177
val values = if (rowsLimit != null) rows().take(rowsLimit) else rows()
179178
val scale = if (col.isNumber()) col.asNumbers().scale() else 1
@@ -209,7 +208,7 @@ internal fun AnyFrame.toHtmlData(
209208
val parentCols = col.path.indices
210209
.map { i -> col.path.take(i + 1) }
211210
.dropLast(1)
212-
.map { ColumnWithPath(renderRootDf[it], it) }
211+
.map { ColumnWithPath(this@columnToJs[it], it) }
213212
val parentAttributes = parentCols
214213
.map { formatter(FormattingDsl, row, it) }
215214
.reduceOrNull(CellAttributes?::and)
@@ -249,7 +248,7 @@ internal fun AnyFrame.toHtmlData(
249248
val parentCols = col.path.indices
250249
.map { i -> col.path.take(i + 1) }
251250
.dropLast(1)
252-
.map { ColumnWithPath(renderRootDf[it], it) }
251+
.map { ColumnWithPath(this@columnToJs[it], it) }
253252
val parentAttributes = parentCols
254253
.map { hf(FormattingDsl, it) }
255254
.reduceOrNull(CellAttributes?::and)
@@ -265,7 +264,7 @@ internal fun AnyFrame.toHtmlData(
265264
}
266265
val nested = if (col is ColumnGroup<*>) {
267266
col.columns().map {
268-
renderRootDf.columnToJs(it.addParentPath(col.path), rowsLimit, configuration, renderRootDf)
267+
this@columnToJs.columnToJs(it.addParentPath(col.path), rowsLimit, configuration)
269268
}
270269
} else {
271270
emptyList()

0 commit comments

Comments
 (0)