@@ -54,43 +54,44 @@ abstract class DataFrameSampleHelper(sampleName: String, subFolder: String = "sa
5454 private val expandNestedFramesScript = DataFrameHtmlData (
5555 script =
5656 """
57- (function () {
58- function expandColumnGroups(df) {
59- for (let col of df.cols) {
60- if (col.parent === undefined && col.children.length > 0) col.expanded = true;
57+ (function () {
58+ function expandColumnGroups(df) {
59+ for (let col of df.cols) {
60+ if (col.parent === undefined && col.children.length > 0) col.expanded = true;
61+ }
6162 }
62- }
6363
64- function expandNestedFrames(df, rootDf) {
65- for (let col of df.cols) {
66- for (let value of col.values) {
67- if (value && value.frameId !== undefined) {
68- rootDf.expandedFrames.add(value.frameId);
69- let child = rootDf.childFrames[value.frameId];
70- if (child) {
71- expandColumnGroups(child);
72- expandNestedFrames(child, rootDf);
64+ function expandNestedFrames(df, rootDf) {
65+ for (let col of df.cols) {
66+ for (let value of col.values) {
67+ if (value && value.frameId !== undefined) {
68+ rootDf.expandedFrames.add(value.frameId);
69+ let child = rootDf.childFrames[value.frameId];
70+ if (child) {
71+ expandColumnGroups(child);
72+ expandNestedFrames(child, rootDf);
73+ }
7374 }
7475 }
7576 }
7677 }
77- }
7878
79- document.querySelectorAll("table.dataframe").forEach(function (table) {
80- if (table.df && table.df.id === table.df.rootId) {
81- let rootDf = table.df;
82- expandNestedFrames(rootDf, rootDf);
83- DataFrame.renderTable(rootDf.id);
84- }
85- });
86- })();
87- """ .trimIndent(),
79+ document.querySelectorAll("table.dataframe").forEach(function (table) {
80+ if (table.df && table.df.id === table.df.rootId) {
81+ let rootDf = table.df;
82+ expandNestedFrames(rootDf, rootDf);
83+ DataFrame.renderTable(rootDf.id);
84+ }
85+ });
86+ })();
87+ """ .trimIndent(),
8888 )
8989
90- fun DataFrame <* >.toExpandedHtml () = toStandaloneHtml(
91- configuration = DisplayConfiguration (enableFallbackStaticTables = false ),
92- getFooter = { " " },
93- ) + expandNestedFramesScript
90+ fun DataFrame <* >.toExpandedHtml () =
91+ toStandaloneHtml(
92+ configuration = DisplayConfiguration (enableFallbackStaticTables = false ),
93+ getFooter = { " " },
94+ ) + expandNestedFramesScript
9495
9596 fun GroupBy <* , * >.toExpandedHtml () = toDataFrame().toExpandedHtml()
9697}
0 commit comments