Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ public interface WithMargin {
}
}

public typealias Inset = Margin

public interface WithInset {
public var inset: Inset?
public fun inset(all: Double) {
inset = Inset(all, all, all, all)
}

public fun inset(vertical: Double, horizontal: Double) {
inset = Inset(vertical, horizontal, vertical, horizontal)
}

public fun inset(top: Double, horizontal: Double, bottom: Double) {
inset = Inset(top, horizontal, bottom, horizontal)
}

public fun inset(top: Double, right: Double, bottom: Double, left: Double) {
inset = Inset(top, right, bottom, left)
}
}

public data class LineParameters internal constructor(
var color: Color? = null,
var width: Double? = null,
Expand Down Expand Up @@ -322,8 +343,9 @@ public data class PlotCanvas internal constructor(
override var title: TextParameters? = null,
var subtitle: TextParameters? = null,
var caption: TextParameters? = null,
override var margin: Margin? = null
) : SelfInvocationContext, WithBackground, WithTitle, WithMargin {
override var margin: Margin? = null,
override var inset: Inset? = null,
) : SelfInvocationContext, WithBackground, WithTitle, WithMargin, WithInset {
public fun subtitle(block: TextParameters.() -> Unit) {
subtitle = TextParameters().apply(block)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ internal fun CustomStyle.wrap(): theme {
plotSubtitle = plotCanvas.subtitle?.wrap(),
plotTitle = plotCanvas.title?.wrap(),
plotMargin = plotCanvas.margin?.wrap(),
plotInset = plotCanvas.inset?.wrap(),
stripBackground = strip.background?.wrap(),
stripText = strip.text?.wrap(),
axisTooltip = axis.tooltip.background?.wrap(),
Expand All @@ -100,8 +101,6 @@ internal fun CustomStyle.wrap(): theme {
tooltip = layerTooltips.background?.wrap(),
tooltipText = layerTooltips.text?.wrap(),
tooltipTitleText = layerTooltips.title?.wrap()
/*
*/
)

when (val justification = this@wrap.legend.justification) {
Expand Down