Skip to content

Commit 37ecc69

Browse files
committed
updated kdocs of format with information about colgroups and framecols
1 parent c33e89e commit 37ecc69

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/format.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ import org.jetbrains.kotlinx.dataframe.api.FormattingDsl.linear
1414
import org.jetbrains.kotlinx.dataframe.api.FormattingDsl.linearBg
1515
import org.jetbrains.kotlinx.dataframe.api.FormattingDsl.rgb
1616
import org.jetbrains.kotlinx.dataframe.api.FormattingDsl.textColor
17+
import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup
1718
import org.jetbrains.kotlinx.dataframe.columns.ColumnReference
1819
import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath
20+
import org.jetbrains.kotlinx.dataframe.columns.FrameColumn
1921
import org.jetbrains.kotlinx.dataframe.columns.toColumnSet
2022
import org.jetbrains.kotlinx.dataframe.dataTypes.IFRAME
2123
import org.jetbrains.kotlinx.dataframe.dataTypes.IMG
@@ -66,9 +68,21 @@ import kotlin.reflect.KProperty
6668
*
6769
* You can continue formatting the [FormattedFrame] by calling [format][FormattedFrame.format] on it again.
6870
*
71+
* Specifying a [column group][ColumnGroup] makes all of its inner columns be formatted in the same way unless
72+
* overridden.
73+
*
6974
* Formatting is done additively, meaning you can add more formatting to a cell that's already formatted or
7075
* override certain attributes inherited from its outer group.
7176
*
77+
* Specifying a [frame column][FrameColumn] at the moment does nothing
78+
* ([Issue #1375](https://github.com/Kotlin/dataframe/issues/1375)),
79+
* convert each nested [DataFrame] to a [FormattedFrame] instead:
80+
* ```kt
81+
* df.convert { myFrameCol }.with {
82+
* it.format { someCol }.with { background(green) }
83+
* }.toStandaloneHtml()
84+
* ```
85+
*
7286
* Check out the [Grammar].
7387
*
7488
* For more information: {@include [DocumentationUrls.Format]}

docs/StardustDocs/resources/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.FormatDocs.Grammar.ForHtml.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
window.addEventListener('resize', sendHeight);
8686
</script>
8787
</head>
88-
<body><h3>Definitions:</h3><p><code>cellFormatter: </code><code>FormattingDsl</code><code>.(cell: C) -&gt; </code><code>CellAttributes</code><code>?</code></p><p>    </p><p><code>rowColFormatter: </code><code>FormattingDsl</code><code>.(row: </code><code>DataRow</code><code>&lt;T&gt;, col: </code><code>DataColumn</code><code>&lt;C&gt;) -&gt; </code><code>CellAttributes</code><code>?</code></p><h3>Notation:</h3><p><code><strong>format</strong></code><strong><code> { </code></strong><code><code>columns</code></code><strong><code> }</code></strong></p><p>    
88+
<body><h3>Definitions:</h3><p><code>cellFormatter: </code><code>FormattingDsl</code><code>.(cell: C) -&gt; </code><code>CellAttributes</code><code>?</code></p><p>    </p><p><code>rowColFormatter: </code><code>FormattingDsl</code><code>.(row: </code><code>DataRow</code><code>&lt;T&gt;, col: </code><code>ColumnWithPath</code><code>&lt;C&gt;) -&gt; </code><code>CellAttributes</code><code>?</code></p><h3>Notation:</h3><p><code><strong>format</strong></code><strong><code> { </code></strong><code><code>columns</code></code><strong><code> }</code></strong></p><p>    
8989
<code>[ </code><strong><code>.</code></strong><code><strong><code>where</code></strong></code><strong><code> { </code></strong><code><code>filter</code></code><code>: </code><code><code>RowValueFilter</code></code><strong><code> } </code></strong><code>]</code></p><p>    
9090
<code>[ </code><strong><code>.</code></strong><code><strong><code>at</code></strong></code><strong><code>(</code></strong><code>rowIndices: </code><code>Collection</code><code>&lt;</code><code>Int</code><code>&gt; | </code><code>IntRange</code><code>|</code><strong><code>vararg</code></strong><code> </code><code>Int</code><strong><code>)</code></strong><code> ]</code></p><p>    
9191
<code>[ </code><strong><code>.</code></strong><code><strong><code>notNull</code></strong></code><strong><code>()</code></strong><code> ]</code></p><p>    

0 commit comments

Comments
 (0)