HorizontalBiConvexShape

Rectangle shape with convex shaped sides and an additional convex cutout at the bottom. Useful for Single Horizontal Bar and Stacked Bars Plot rendering.

Primary constructor:

Parameters

planoConvexShape

The internal shape logic used for rendering.

index

Represents the element index within the series.

value

The HorizontalBarPlotEntry used to construct the internal shape as well as the additional convex cutout.

xyGraphScope

Provides access to yAxisModel and acts as an implementation of XYGraphScope.

Constructors

Link copied to clipboard
constructor(xyGraphScope: XYGraphScope<Float, X>, index: Int, value: E)

Properties

Link copied to clipboard
open override val xAxisModel: AxisModel<Float>
Link copied to clipboard
open override val xAxisState: AxisState
Link copied to clipboard
open override val yAxisModel: AxisModel<X>
Link copied to clipboard
open override val yAxisState: AxisState

Functions

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.AreaPlot(data: List<Point<X, Y>>, areaBaseline: AreaBaseline<X, Y>, areaStyle: AreaStyle, modifier: Modifier = Modifier, lineStyle: LineStyle? = null, symbol: @Composable HoverableElementAreaScope.(Point<X, Y>) -> Unit? = null, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

An area plot that draws data as points and lines with a filled area to a baseline.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.AreaPlot2(data: List<Point<X, Y>>, areaBaseline: AreaBaseline<X, Y>, areaStyle: AreaStyle, modifier: Modifier = Modifier.Companion, lineStyle: LineStyle? = null, symbol: @Composable (Point<X, Y>) -> Unit? = null, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

An area plot that draws data as points and lines with a filled area to a baseline.

Link copied to clipboard
open override fun createOutline(size: Size, layoutDirection: LayoutDirection, density: Density): Outline
Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.GroupedHorizontalBarPlot(modifier: Modifier = Modifier, maxBarGroupWidth: Float = 0.9f, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec, content: GroupedHorizontalBarPlotScope<X, Y>.() -> Unit)
fun <X, Y> XYGraphScope<X, Y>.GroupedHorizontalBarPlot(modifier: Modifier = Modifier, maxBarGroupWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase, content: GroupedHorizontalBarPlotScope<X, Y>.() -> Unit)
fun <X, Y, E : BarPlotGroupedPointEntry<Y, X>> XYGraphScope<X, Y>.GroupedHorizontalBarPlot(data: List<E>, modifier: Modifier = Modifier, bar: HorizontalBarComposable<E> = { i, g, _ -> val colors = remember(data) { generateHueColorPalette(data.maxOf { it.d.size }) } DefaultBar( brush = SolidColor(colors[g]), modifier = Modifier.fillMaxWidth(KoalaPlotTheme.sizes.barWidth) ) }, maxBarGroupWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ))

A Horizontal Bar Plot to be used in an XYGraph and that plots multiple series side-by-side.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.GroupedVerticalBarPlot(modifier: Modifier = Modifier, maxBarGroupWidth: Float = 0.9f, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec, content: GroupedVerticalBarPlotScope<X, Y>.() -> Unit)
fun <X, Y> XYGraphScope<X, Y>.GroupedVerticalBarPlot(modifier: Modifier = Modifier, maxBarGroupWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase, content: GroupedVerticalBarPlotScope<X, Y>.() -> Unit)
fun <X, Y, E : BarPlotGroupedPointEntry<X, Y>> XYGraphScope<X, Y>.GroupedVerticalBarPlot(data: List<E>, modifier: Modifier = Modifier, bar: VerticalBarComposable<E> = { i, g, _ -> val colors = remember(data) { generateHueColorPalette(data.maxOf { it.d.size }) } DefaultBar( brush = SolidColor(colors[g]), modifier = Modifier.fillMaxWidth(KoalaPlotTheme.sizes.barWidth) ) }, maxBarGroupWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ))

A Vertical Bar Plot to be used in an XYGraph and that plots multiple series side-by-side.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.HorizontalBarPlot(defaultBar: DefaultHorizontalBarComposable<X, Y> = horizontalSolidBar(Color.Blue), modifier: Modifier = Modifier, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ), content: HorizontalBarPlotScope<X, Y>.() -> Unit)

Creates a Horizontal Bar Plot.

fun <X, Y, E : HorizontalBarPlotEntry<X, Y>> XYGraphScope<X, Y>.HorizontalBarPlot(data: List<E>, modifier: Modifier = Modifier, bar: DefaultHorizontalBarComposable<X, Y>, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ))

A HorizontalBarPlot to be used in an XYGraph and that plots data points as horizontal bars.

fun <Y> XYGraphScope<Float, Y>.HorizontalBarPlot(xData: List<Float>, yData: List<Y>, modifier: Modifier = Modifier, bar: DefaultHorizontalBarComposable<Float, Y>, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ))

A HorizontalBarPlot to be used in an XYGraph and that plots a single series of data points as horizontal bars.

Link copied to clipboard

Factory function to create a Composable that emits a solid colored bar. Each bar features a convex shape on both its starting and ending sides. There's an additional convex cutout at the bottom of the bar.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.HorizontalLineAnnotation(location: Y, lineStyle: LineStyle)

Places a vertical line marker on the plot at the specified x-axis location styled using the provided lineStyle.

Link copied to clipboard

Factory function to create a Composable that emits a solid colored bar. Each bar features a planar shape at one end and a convex shape at the other.

Link copied to clipboard
open override fun Modifier.hoverableElement(element: @Composable () -> Unit): Modifier
Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.LinePlot(data: List<Point<X, Y>>, modifier: Modifier = Modifier, lineStyle: LineStyle? = null, symbol: @Composable HoverableElementAreaScope.(Point<X, Y>) -> Unit? = null, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

A line plot that draws data as points and lines on an XYGraph.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.LinePlot2(data: List<Point<X, Y>>, modifier: Modifier = Modifier, lineStyle: LineStyle? = null, symbol: @Composable (Point<X, Y>) -> Unit? = null, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

A line plot that draws data as points and lines on an XYGraph.

Link copied to clipboard
open override fun scale(point: Point<Float, X>, size: Size): Offset

Transforms point from AxisModel space to display coordinates provided a plot area size.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.StackedAreaPlot(data: List<StackedAreaPlotEntry<X, Y>>, styles: List<StackedAreaStyle>, firstBaseline: AreaBaseline.ConstantLine<X, Y>, modifier: Modifier = Modifier.Companion, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

A Stacked Area Plot is like a line plot but with filled areas between lines, and where each successive line is added to all of the lines before it, so they stack.

Link copied to clipboard
fun <Y> XYGraphScope<Float, Y>.StackedHorizontalBarPlot(modifier: Modifier = Modifier, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ), content: StackedHorizontalBarPlotScope<Float, Y>.() -> Unit)

A Horizontal Bar Plot to be used in an XYGraph and that plots multiple series as a stack of bars.

fun <X, Y, E : HorizontalBarPlotStackedPointEntry<X, Y>> XYGraphScope<X, Y>.StackedHorizontalBarPlot(data: List<E>, modifier: Modifier = Modifier, bar: DefaultHorizontalBarComposable<X, Y>, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ))

Composes a stacked horizontal bar plot. This is a convenience method which defers to HorizontalBarPlot. A stacked bar plot can be also achieved by placing multiple HorizontalBarPlots on an io.github.koalaplot.core.xygraph.XYGraph, one for each "layer" of bars.

Link copied to clipboard
fun <X> XYGraphScope<X, Float>.StackedVerticalBarPlot(modifier: Modifier = Modifier, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ), content: StackedVerticalBarPlotScope<X, Float>.() -> Unit)

A Vertical Bar Plot to be used in an XYGraph and that plots multiple series as a stack of bars.

fun <X, Y, E : VerticalBarPlotStackedPointEntry<X, Y>> XYGraphScope<X, Y>.StackedVerticalBarPlot(data: List<E>, modifier: Modifier = Modifier, bar: DefaultVerticalBarComposable<X, Y>, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ))

Composes a stacked vertical bar plot. This is a convenience method which defers to VerticalBarPlot. A stacked bar plot can be also achieved by placing multiple VerticalBarPlots on an io.github.koalaplot.core.xygraph.XYGraph, one for each "layer" of bars.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.StairstepPlot(data: List<Point<X, Y>>, lineStyle: LineStyle, modifier: Modifier = Modifier, symbol: @Composable HoverableElementAreaScope.(Point<X, Y>) -> Unit? = null, areaStyle: AreaStyle? = null, areaBaseline: AreaBaseline<X, Y>? = null, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

An XY Chart that draws series as points and stairsteps between points.

fun <X, Y> XYGraphScope<X, Y>.StairstepPlot(data: List<Point<X, Y>>, lineStyle: LineStyle, levelLineStyle: (Y) -> LineStyle, cap: StrokeCap = StrokeCap.Square, modifier: Modifier = Modifier, symbol: @Composable HoverableElementAreaScope.(Point<X, Y>) -> Unit? = null, areaStyle: (Y) -> AreaStyle? = null, areaBaseline: AreaBaseline<X, Y>? = null, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

A StairstepPlot that differentiate lineStyle&areaBaseline at each Y-values based on levelLineStyle.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.StairstepPlot2(data: List<Point<X, Y>>, lineStyle: LineStyle, modifier: Modifier = Modifier, symbol: @Composable (Point<X, Y>) -> Unit? = null, areaStyle: AreaStyle? = null, areaBaseline: AreaBaseline<X, Y>? = null, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

An XY Chart that draws series as points and stairsteps between points.

fun <X, Y> XYGraphScope<X, Y>.StairstepPlot2(data: List<Point<X, Y>>, lineStyle: LineStyle, levelLineStyle: (Y) -> LineStyle, cap: StrokeCap = StrokeCap.Square, modifier: Modifier = Modifier, symbol: @Composable (Point<X, Y>) -> Unit? = null, areaStyle: (Y) -> AreaStyle? = null, areaBaseline: AreaBaseline<X, Y>? = null, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

A StairstepPlot that differentiate lineStyle&areaBaseline at each Y-values based on levelLineStyle.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.VerticalBarPlot(defaultBar: DefaultVerticalBarComposable<X, Y> = verticalSolidBar(Color.Blue), modifier: Modifier = Modifier, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ), content: VerticalBarPlotScope<X, Y>.() -> Unit)

Creates a Vertical Bar Plot.

fun <X, Y, E : VerticalBarPlotEntry<X, Y>> XYGraphScope<X, Y>.VerticalBarPlot(data: List<E>, modifier: Modifier = Modifier, bar: DefaultVerticalBarComposable<X, Y>, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ))

A VerticalBarPlot to be used in an XYGraph and that plots data points as vertical bars.

fun <X> XYGraphScope<X, Float>.VerticalBarPlot(xData: List<X>, yData: List<Float>, modifier: Modifier = Modifier, bar: DefaultVerticalBarComposable<X, Float>, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ))

A VerticalBarPlot to be used in an XYGraph and that plots a single series of data points as vertical bars.

Link copied to clipboard

Factory function to create a Composable that emits a solid colored bar. Each bar features a convex shape on both its starting and ending sides. There's an additional convex cutout at the bottom of the bar.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.VerticalLineAnnotation(location: X, lineStyle: LineStyle)

Places a vertical line marker on the plot at the specified x-axis location styled using the provided lineStyle.

Link copied to clipboard

Factory function to create a Composable that emits a solid colored bar. Each bar features a planar starting side and a convex ending side.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.XYAnnotation(location: Point<X, Y>, anchorPoint: AnchorPoint, modifier: Modifier = Modifier, content: @Composable () -> Unit)

Places a Composable as an annotation on an XYGraph with the Composable's anchorPoint placed at the provided location.