2.0.0-alpha.2
This update continues the API cleanup, enables dynamic MergeMode
customization, and brings a performance boost.
Breaking changes | Addressed |
---|---|
Minor | #481 |
The following parameters and properties have been moved from the hosts to CartesianChart
:
startAxis
topAxis
endAxis
bottomAxis
fadingEdges
legend
Migrate as follows:
- Compose
- Views
The aforementioned parameters of CartesianChartHost
are now parameters
of rememberCartesianChart
. Copy the arguments from the old location to
the new location.
The aforementioned properties of CartesianChartView
are now properties
of CartesianChart
. Access them via the chart
field of
CartesianChartView
(e.g., cartesianChartView.chart.startAxis
). No
changes are required on the XML side.
The mergeMode
property of ColumnCartesianLayer
is now a lambda with a ColumnCartesianLayerModel
parameter. To migrate, add braces to all mergeMode
arguments. Consider the following:
mergeMode = MergeMode.Stack
In Vico 2.0.0-alpha.2
, use this:
mergeMode = { MergeMode.Stack }
This change enables you to dynamically change a ColumnCartesianLayer
’s MergeMode
based on its data. You can also use extras:
val mergeModeKey = ExtraStore.Key<ColumnCartesianLayer.MergeMode>()
cartesianChartModelProducer.runTransaction {
updateExtras { it[mergeModeKey] = MergeMode.Stacked }
...
}
mergeMode = { it.extraStore[mergeModeKey] }
In the compose
module, the following functions have been renamed:
2.0.0-alpha.1 | 2.0.0-alpha.2 |
---|---|
textComponent | rememberTextComponent |
lineComponent | rememberLineComponent |
shapeComponent | rememberShapeComponent |
The logic responsible for calculating the default x step has been optimized and is now twice as fast.