ScrollableCanvasContainer

fun ScrollableCanvasContainer(modifier: Modifier, calculateMaxDistance: DrawScope.(Float) -> Float, onDraw: DrawScope.(Float, Float) -> Unit, drawXAndYAxis: @Composable BoxScope.(Float, Float) -> Unit, containerBackgroundColor: Color = Color.White, layoutDirection: LayoutDirection = LayoutDirection.Ltr, onPointClicked: (Offset, Float) -> Unit = { _, _ -> }, isPinchZoomEnabled: Boolean = true, onScroll: () -> Unit = {}, onZoomInAndOut: () -> Unit = {}, scrollOrientation: Orientation = Orientation.Horizontal)

ScrollableCanvasContainer is a container used to draw any graph which supports scroll, zoom & tap or drag gestures.

Parameters

modifier

: All modifier related property.

calculateMaxDistance

: callback to calculate the maximum scrolling distance.

onDraw

: Draw any canvas inside the onDraw scope using the input params in the lambda fxn

drawXAndYAxis

: Draw the X and Y axis along with the drawing area.

containerBackgroundColor

: Background color of the whole container.

isPinchZoomEnabled

: True if user can zoom in and out else false

layoutDirection

: Used to define the direction of scroll.

onPointClicked

: Callback for tap detected along with offset for tap.

onScroll

: Callback when user starts scrolling the graph.

onZoomInAndOut

: Callback when user starts zoomIn and Out w.r.t to the graph

scrollOrientation

: Used to define the scroll orientation