@@ -108,7 +108,7 @@ internal fun tableJs(columns: List<ColumnDataForJs>, id: Int, rootId: Int, nrow:
108
108
val colName = col.renderHeader().escapeForHtmlInJs()
109
109
append(" { name: \" $colName \" , children: $children , rightAlign: ${col.rightAlign} , values: $values }, \n " )
110
110
111
- return colIndex
111
+ return @appendColWithChildren colIndex
112
112
}
113
113
columns.forEach { appendColWithChildren(it) }
114
114
append(" ]" )
@@ -243,8 +243,7 @@ public fun AnyFrame.toStaticHtml(
243
243
is AnyFrame ->
244
244
emitTag(" details" ) {
245
245
emitTag(" summary" ) {
246
- append(" DataFrame " )
247
- append(cellRenderer.content(cellValue, configuration).truncatedContent)
246
+ append(" DataFrame [${cellValue.size} ]" )
248
247
}
249
248
// add the dataframe as a nested table limiting the number of rows if needed
250
249
// CSS will not be included here, as it is already included in the main table
@@ -296,6 +295,7 @@ public fun AnyFrame.toStaticHtml(
296
295
297
296
return DataFrameHtmlData (
298
297
body = buildString { emitTable() },
298
+ // will hide the table if JS is enabled
299
299
script = """
300
300
document.getElementById("$id ").style.display = "none";
301
301
""" .trimIndent(),
@@ -622,7 +622,7 @@ internal class DataFrameFormatter(
622
622
623
623
private fun RenderedContent.addCss (css : String? = null): RenderedContent {
624
624
return if (css != null ) {
625
- copy(truncatedContent = " <span class=\" $css \" >" + truncatedContent + " </span>" , isFormatted = true )
625
+ copy(truncatedContent = " <span class=\" $css \" >$ truncatedContent </span>" , isFormatted = true )
626
626
} else this
627
627
}
628
628
@@ -631,7 +631,7 @@ internal class DataFrameFormatter(
631
631
val ellipsis = " ..." .ellipsis(str)
632
632
if (limit < 4 ) ellipsis
633
633
else {
634
- val len = Math .max (limit - 3 , 1 )
634
+ val len = (limit - 3 ).coerceAtLeast( 1 )
635
635
RenderedContent .textWithLength(str.substring(0 , len).escapeHTML(), len) + ellipsis
636
636
}
637
637
} else {
@@ -766,7 +766,7 @@ internal class DataFrameFormatter(
766
766
val keyLimit = limit - sizeOfValue
767
767
if (key.length > keyLimit) {
768
768
if (limit > 3 ) {
769
- (key + " ..." ).truncate(limit).addCss(structuralClass)
769
+ (" $key ..." ).truncate(limit).addCss(structuralClass)
770
770
} else null
771
771
} else {
772
772
val renderedValue =
0 commit comments