RenderContext

data class RenderContext(val outputDir: Path = KSL.outDir, val plotDir: Path = KSL.plotDir, val confidenceLevel: Double = 0.95, val numericPrecision: Int = 4, val maxPlotsPerSection: Int = 20)(source)

Shared configuration passed to every ksl.utilities.io.report.visitor.ReportVisitor renderer. Provides output paths, numeric formatting preferences, and rendering limits.

Defaults are drawn from the KSL global singleton so callers need not specify paths explicitly in the common case.

Parameters

outputDir

directory for report files; defaults to KSL.outDir

plotDir

directory for saved plot files; defaults to KSL.plotDir

confidenceLevel

default confidence level for ksl.utilities.io.report.ast.ReportNode.StatTable nodes that do not specify their own; must be in (0, 1)

numericPrecision

number of decimal places for formatted numeric values in comparison tables (ksl.utilities.io.report.ast.ReportNode.StatTable, ksl.utilities.io.report.ast.ReportNode.WeightedStatTable, ksl.utilities.io.report.ast.ReportNode.DataTable); also used as the significant-figure count for property sheet tables via fmtProperty; must be in 0, 15

maxPlotsPerSection

maximum number of plots rendered per section before a truncation notice is emitted; prevents very large HTML files in models with many responses

Constructors

Link copied to clipboard
constructor(outputDir: Path = KSL.outDir, plotDir: Path = KSL.plotDir, confidenceLevel: Double = 0.95, numericPrecision: Int = 4, maxPlotsPerSection: Int = 20)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun fmt(value: Double): String

Formats a Double value to a string using numericPrecision decimal places (%f format). Produces fixed-width columns suitable for side-by-side comparison tables where vertical alignment across rows is important. Returns "—" for Double.isNaN or Double.isInfinite values.

Link copied to clipboard

Formats a Double value to a string using numericPrecision significant figures (%g format). Adapts between fixed and scientific notation based on the magnitude of the value, ensuring that properties spanning many orders of magnitude (e.g. Lag-1 covariance, Von Neumann test statistic, kurtosis) are rendered with consistent precision rather than fixed decimal places. Returns "—" for Double.isNaN or Double.isInfinite values.

Link copied to clipboard
fun pct(value: Double): String

Formats a Double as a percentage string (value × 100) with numericPrecision decimal places and a % suffix. Returns "—" for Double.isNaN or Double.isInfinite values.