feat(graphs): add chart animation for when a value changes
This commit is contained in:
@@ -22,6 +22,7 @@ import androidx.compose.animation.core.AnimationSpec
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||
import androidx.compose.material3.MaterialTheme.colorScheme
|
||||
import androidx.compose.material3.MaterialTheme.motionScheme
|
||||
import androidx.compose.material3.MaterialTheme.typography
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -96,7 +97,7 @@ fun TimeColumnChart(
|
||||
millisecondsToMinutes(value, minutesFormat)
|
||||
}
|
||||
},
|
||||
animationSpec: AnimationSpec<Float>? = null
|
||||
animationSpec: AnimationSpec<Float>? = motionScheme.defaultEffectsSpec()
|
||||
) {
|
||||
ProvideVicoTheme(rememberM3VicoTheme()) {
|
||||
CartesianChartHost(
|
||||
@@ -160,6 +161,7 @@ fun TimeColumnChart(
|
||||
minZoom = Zoom.min(Zoom.Content, Zoom.fixed())
|
||||
),
|
||||
animationSpec = animationSpec,
|
||||
animateIn = false,
|
||||
modifier = modifier.height(226.dp),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import androidx.compose.animation.core.AnimationSpec
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||
import androidx.compose.material3.MaterialTheme.colorScheme
|
||||
import androidx.compose.material3.MaterialTheme.motionScheme
|
||||
import androidx.compose.material3.MaterialTheme.typography
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -102,7 +103,7 @@ fun TimeLineChart(
|
||||
millisecondsToMinutes(value, minutesFormat)
|
||||
}
|
||||
},
|
||||
animationSpec: AnimationSpec<Float>? = null
|
||||
animationSpec: AnimationSpec<Float>? = motionScheme.defaultEffectsSpec()
|
||||
) {
|
||||
ProvideVicoTheme(rememberM3VicoTheme()) {
|
||||
CartesianChartHost(
|
||||
@@ -183,6 +184,7 @@ fun TimeLineChart(
|
||||
minZoom = Zoom.min(Zoom.Content, Zoom.fixed())
|
||||
),
|
||||
animationSpec = animationSpec,
|
||||
animateIn = false,
|
||||
modifier = modifier.height(224.dp),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user