Releases: patrykandpatrick/vico
v2.2.0-alpha.1
Warning
The old, pre-1.6.2
Maven Central coordinates are being discontinued. Those using them will receive deprecation errors.
Overview
- breaking changes: none1
- addressed: #987, #1046, #1057
- external contributors: @L-Andrade
core
- An issue where maximum-x-precision validation failed to identify some violations has been addressed.
compose
VicoZoomState
has a newzoom
function for programmatic zoom.CartesianChartHost
has a newconsumeMoveEvents
parameter.
views
ZoomHandler
has a newzoom
function for programmatic zoom.CartesianChartView
has a newconsumeMoveEvents
property and a new XML attribute with the same name.
multiplatform
VicoZoomState
has a newzoom
function for programmatic zoom.CartesianChartHost
has a newconsumeMoveEvents
parameter.- The
fill
factory function has been removed; use theFill
constructor instead. - An issue where maximum-x-precision validation failed to identify some violations has been addressed.
-
Excluding
multiplatform
, which is experimental. (It will remain available, but breaking changes are more likely.) ↩
v2.1.3
Overview
- breaking changes: none
- addressed: #1081
compose
- An issue where
NullPointerException
s could occur forShaderProvider
s created viaBrush.toShaderProvider
has been addressed. The root cause was a Compose bug whereSize.isEmpty
sometimes reports false positives, leading toPaint.shader
being incorrectly set tonull
for certain nonzero application areas. A workaround has been added to Vico, but until the Compose bug is fixed, glitches where shaded areas turn blank may occur.
v2.1.2
v2.1.1
Overview
compose
- An issue where
CartesianChartHost
ignored some gestures received duringCartesianChart
updates has been resolved.
multiplatform
- An issue where
CartesianChartHost
ignored some gestures received duringCartesianChart
updates has been resolved.
v2.1.0
This release is effectively identical to version 2.1.0-beta.2
. The following compares versions 2.1.0
and 2.0.0
.
Warning
The old, pre-1.6.2
Maven Central coordinates are being discontinued. Those using them will receive deprecation warnings.
Overview
- breaking changes: minor
- addressed: #353, #805
- external contributors: @L-Andrade
core
- Various performance-related optimizations have been made.
DefaultCartesianMarker.LabelPosition.BelowPoint
has been introduced. This positions the label below the bottommost marked point.- The default dash and gap lengths for
LineCartesianLayer.LineStroke.Dashed
have been updated. - The host and
Transaction
ExtraStore
s have been decoupled: extras added viaCartesianLayer.transform
are now found in the newMeasuringContext.extraStore
, not inCartesianChartModel.extraStore
. This affects only custom animatedCartesianLayer
implementations.1 For standard usage, no action is required. - In
HorizontalAxis
, the protectedCartesianMeasuringContext.getFullXRange
function is deprecated. See the deprecation message for more.
compose
- Various performance-related optimizations have been made.
- In noninteractive Compose previews—which don’t support asynchronous execution—
CartesianChartHost
now handlesCartesianChartModelProducer
communication synchronously, enabling charts to display as expected. For this to work, the consumer must also move processing to the main thread—for example, by callingrunTransaction
fromrunBlocking
rather thanLaunchedEffect
. This should be done only for previews.
multiplatform
This new module provides Compose Multiplatform support for Android, iOS, and desktop. It has two optional companion modules for Material theming: multiplatform-m2
and multiplatform-m3
. These are equivalent to compose-m2
and compose-m3
.
[versions]
vico = "2.1.0"
[libraries]
vico-multiplatform = { group = "com.patrykandpatrick.vico", name = "multiplatform", version.ref = "vico" }
vico-multiplatform-m2 = { group = "com.patrykandpatrick.vico", name = "multiplatform-m2", version.ref = "vico" }
vico-multiplatform-m2 = { group = "com.patrykandpatrick.vico", name = "multiplatform-m3", version.ref = "vico" }
The multiplatform
API is based on the combination of the compose
and core
APIs, with adjustments for Compose Multiplatform and simplifications enabled by it being a dependency across the board. (In contrast, with compose
and core
, the former depends on Jetpack Compose, but the latter is framework-agnostic, using only lower-level android.graphics
APIs.) There are only some minor differences in feature set:
- A
ComponentShader
equivalent isn’t available yet. You can useShaderBrush
instead. ShapeComponent
doesn’t support shadows yet. This is due to Compose Multiplatform’sPaint
lacking shadow functionality.
multiplatform
is experimental; it will remain available, but breaking changes are more likely. While multiplatform
is Jetpack Compose–compatible, compose
support continues. In the distant future, compose
will be removed in favor of multiplatform
, which will then be renamed to compose
.
Learn more about multiplatform
in the guide and in the API reference; for examples, consult the multiplatform
sample charts.
-
This minor breaking change was allowed because (1) as discussed above, it affects only custom animated
CartesianLayer
implementations, which are rare; (2) addressing it is trivial; and (3) it enabled significant performance improvements for all setups. Deprecation was infeasible primarily because the key aspect here is the removal ofCartesianLayer.transform
-added extras fromCartesianChartModel.extraStore
, not merely their addition toCartesianMeasuringContext.extraStore
. These extras areCartesianLayerDrawingModel
s, which are large and slow to hash.CartesianChartModel.extraStore
, in turn, is hashed frequently; this enables the caching of the results ofExtraStore
lambdas. Moving theCartesianLayerDrawingModel
s to a separateExtraStore
drastically decreased the time taken to hashCartesianChartModel.extraStore
. It also made the caching more effective; now, only those extras that may actually be read in these lambdas are used as keys. These two factors significantly boosted drawing performance. ↩
v2.1.0-beta.2
Overview
- breaking changes: none1
multiplatform
- In
CartesianValueFormatter
andCartesianMarker.ValueFormatter
, thedefault
factory functions have new optional parameters:decimalSeparator
,thousandsSeparator
,prefix
, andsuffix
. ForCartesianMarker.ValueFormatter.default
, these new parameters come betweendecimalCount
andcolorCode
; in the unlikely event that you’re usingcolorCode
positionally, switch to a named argument. - The default vertical padding of
Axis
labels and the defaultLegend
row spacing have been increased for alignment with the Android-only modules. (These values are now slightly larger inmultiplatform
than in the Android-only modules, counteracting differences in text rendering between the two environments.) - Compose Multiplatform versions of all remaining sample charts have been introduced.
-
Excluding
multiplatform
, which is experimental. (It will remain available, but breaking changes are more likely.) ↩
v2.0.3
Overview
core
- An issue where
CartesianChart.copy
failed to transfer some data has been addressed. This causedCartesianMarkerVisibilityListener.onShown
to be superfluously reinvoked onCartesianChart
updates that occurred whileCartesianChart.marker
was shown.
v2.1.0-beta.1
Overview
core
- An issue where
CartesianChart.copy
failed to transfer some data has been addressed. This causedCartesianMarkerVisibilityListener.onShown
to be superfluously reinvoked onCartesianChart
updates that occurred whileCartesianChart.marker
was shown.
multiplatform
- An issue where
CartesianChart.copy
failed to transfer some data has been addressed. This causedCartesianMarkerVisibilityListener.onShown
to be superfluously reinvoked onCartesianChart
updates that occurred whileCartesianChart.marker
was shown. - The
CartesianChart
constructor is now protected. Its public visibility was redundant; except in subclasses,CartesianChart
should be instantiated viarememberCartesianChart
.
-
Excluding
multiplatform
, which is experimental. (It will remain available, but breaking changes are more likely.) ↩
v2.1.0-alpha.6
Overview
core
- An issue where
CartesianChart
failed to considerstartAxis
,topAxis
,endAxis
, andbottomAxis
forequals
andhashCode
, leading to missing recompositions incompose
, has been resolved. - Various performance-related optimizations have been made.
- The host and
Transaction
ExtraStore
s have been decoupled: extras added viaCartesianLayer.transform
are now found in the newMeasuringContext.extraStore
, not inCartesianChartModel.extraStore
. This affects only custom animatedCartesianLayer
implementations.1 For standard usage, no action is required. - In
HorizontalAxis
, the protectedCartesianMeasuringContext.getFullXRange
function is deprecated. See the deprecation message for more.
multiplatform
- An issue where
CartesianChart
failed to considerstartAxis
,topAxis
,endAxis
, andbottomAxis
forequals
andhashCode
, leading to missing recompositions, has been resolved. - Various performance-related optimizations have been made.
- The host and
Transaction
ExtraStore
s have been decoupled: extras added viaCartesianLayer.transform
are now found in the newMeasuringContext.extraStore
, not inCartesianChartModel.extraStore
. This affects only custom animatedCartesianLayer
implementations.1 For standard usage, no action is required. - In
HorizontalAxis
, the protectedCartesianMeasuringContext.getFullXRange
function is deprecated. See the deprecation message for more.
-
This minor breaking change was allowed because (1) as discussed above, it affects only custom animated
CartesianLayer
implementations, which are rare; (2) addressing it is trivial; and (3) it enabled significant performance improvements for all setups. Deprecation was infeasible primarily because the key aspect here is the removal ofCartesianLayer.transform
-added extras fromCartesianChartModel.extraStore
, not merely their addition toCartesianMeasuringContext.extraStore
. These extras areCartesianLayerDrawingModel
s, which are large and slow to hash.CartesianChartModel.extraStore
, in turn, is hashed frequently; this enables the caching of the results ofExtraStore
lambdas. Moving theCartesianLayerDrawingModel
s to a separateExtraStore
drastically decreased the time taken to hashCartesianChartModel.extraStore
. It also made the caching more effective; now, only those extras that may actually be read in these lambdas are used as keys. These two factors significantly boosted drawing performance. ↩ ↩2