File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
util/kandy-samples-utils/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 33package org.jetbrains.kotlinx.kandy.letsplot.samples
44
55import org.jetbrains.kotlinx.dataframe.DataFrame
6+ import org.jetbrains.kotlinx.dataframe.api.FormattedFrame
67import org.jetbrains.kotlinx.dataframe.api.GroupBy
78import org.jetbrains.kotlinx.dataframe.io.toStandaloneHtml
89import org.jetbrains.kotlinx.kandy.ir.Plot
@@ -127,6 +128,20 @@ public abstract class SampleHelper(
127128 saveAsSVG(" ${name} _dark" )
128129 }
129130
131+ /* *
132+ * Saves this [FormattedFrame] as HTML.
133+ */
134+ public fun FormattedFrame <* >.saveDfHtmlSample () {
135+ val name = testName.methodName.replace(" _dataframe" , " " )
136+ val dfHtml = df.toStandaloneHtml(
137+ configuration = getDisplayConfiguration(SamplesDisplayConfiguration ),
138+ getFooter = WritersideFooter
139+ ) + WritersideStyle
140+ // TODO fix static ids
141+ val htmlWithStaticIDs = dfHtml.toString() // replaceIdsWithStatic(dfHtml.toString())
142+ File (pathToResourceFolder, " $name .html" ).writeText(htmlWithStaticIDs)
143+ }
144+
130145 /* *
131146 * Saves this [DataFrame] as HTML.
132147 */
You can’t perform that action at this time.
0 commit comments