FormatClause

class FormatClause<T, C>(val df: DataFrame<T>, val columns: ColumnsSelector<T, C> = { all().cast() }, val oldFormatter: RowColFormatter<T, C>? = null, val filter: RowValueFilter<T, C> = { true }, val oldHeaderFormatter: HeaderColFormatter<*>? = null)

An intermediate class used in the format operation.

This class itself does nothing—it is just a transitional step before specifying how to format the selected columns. It must be followed by one of the positioning methods to produce a new FormattedFrame; a DataFrame with HTML formatting data.

Use the following function to filter the rows to format:

  • where – filters the rows to format using a RowValueFilter.

  • at – Only format in rows with certain indices.

  • notNull – Only format cells that have non-null values.

Use the following functions to finalize this formatting round:

For more information: See format on the documentation website.

See Grammar for more details.

Constructors

Link copied to clipboard
constructor(df: DataFrame<T>, columns: ColumnsSelector<T, C> = { all().cast() }, oldFormatter: RowColFormatter<T, C>? = null, filter: RowValueFilter<T, C> = { true }, oldHeaderFormatter: HeaderColFormatter<*>? = null)

Properties

Link copied to clipboard
internal val columns: ColumnsSelector<T, C>
Link copied to clipboard
internal val df: DataFrame<T>
Link copied to clipboard
internal val filter: RowValueFilter<T, C>
Link copied to clipboard
internal val oldFormatter: RowColFormatter<T, C>?
Link copied to clipboard

Functions

Link copied to clipboard
fun <T, C> FormatClause<T, C>.at(rowIndices: Collection<Int>): FormatClause<T, C>
fun <T, C> FormatClause<T, C>.at(rowRange: IntRange): FormatClause<T, C>
fun <T, C> FormatClause<T, C>.at(vararg rowIndices: Int): FormatClause<T, C>

Only format the selected columns at given row indices.

Link copied to clipboard
internal inline fun <T, C> FormatClause<T, C>.formatImpl(crossinline formatter: RowColFormatter<T, C>): FormattedFrame<T>
Link copied to clipboard

Creates a new FormattedFrame by just changing the background colors of the selected cells.

Link copied to clipboard

Filters the format-selection to only include cells where the value is not null.

Creates a new FormattedFrame that uses the specified CellFormatter to format selected non-null cells of the dataframe.

Link copied to clipboard

Creates a new FormattedFrame that uses the specified RowColFormatter to format the selected cells of the dataframe.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun <T, C> FormatClause<T, C>.where(filter: RowValueFilter<T, C>): FormatClause<T, C>

Filters the rows to format using a RowValueFilter.

Link copied to clipboard
fun <T, C> FormatClause<T, C>.with(formatter: CellFormatter<C>): FormattedFrame<T>

Creates a new FormattedFrame that uses the specified CellFormatter to format the selected cells of the dataframe.