Scrollable Canvas Container
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.
calculate Max Distance
: callback to calculate the maximum scrolling distance.
on Draw
: Draw any canvas inside the onDraw scope using the input params in the lambda fxn
draw XAnd YAxis
: Draw the X and Y axis along with the drawing area.
container Background Color
: Background color of the whole container.
is Pinch Zoom Enabled
: True if user can zoom in and out else false
layout Direction
: Used to define the direction of scroll.
on Point Clicked
: Callback for tap detected along with offset for tap.
on Scroll
: Callback when user starts scrolling the graph.
on Zoom In And Out
: Callback when user starts zoomIn and Out w.r.t to the graph
scroll Orientation
: Used to define the scroll orientation