Most likely a newbie question, as i'm fairly new to Android dev - I am having troubles preserving the state of AndroidView in my @Composable on configuration change/navigation , as factory block is called (as expected) and my chart gets reinstantiated.

```
@Composable
fun ChartView(viewModel:ViewModel, modifier:Modifier){
    val context = LocalContext.current
    val chart = remember { DataChart(context) }

    AndroidView(
        modifier = modifier,
        factory = { context ->
            Log.d("DEBUGLOG", "chart init")
            chart
        },
        update = { chart ->
            Log.d("DEBUGLOG", "chart update")
        })
}

```

The `DataChart` is a 3rd party component with a complex chart, i would like to preserve the zoom/scrolling state. I know i can use ViewModel to preserve UI state across conf. changes, but given the complexity of saving zoom/scrolling state, i'd like to ask if there is any other easier approach to achieve this?

I tried to move the whole chart instance to viewModel, but as it's using context i get a warning about context object leaks.

Any help would be appreciated!