Skip to content

Releases: patrykandpatrick/vico

v2.0.0-alpha.3

11 Dec 19:45
406b164
Compare
Choose a tag to compare
v2.0.0-alpha.3 Pre-release
Pre-release

This release fixes an issue where DynamicShaders worked improperly in line charts whose y ranges didn’t include zero. Read the release notes.

v2.0.0-alpha.2

10 Dec 12:17
b52a4bd
Compare
Choose a tag to compare
v2.0.0-alpha.2 Pre-release
Pre-release

This update continues the API cleanup, enables dynamic MergeMode customization, and brings a performance boost. Read the release notes.

v2.0.0-alpha.1

05 Dec 17:52
5d229af
Compare
Choose a tag to compare
v2.0.0-alpha.1 Pre-release
Pre-release

For this release, to simplify the library, reduce its size, and prepare for the introduction of candlestick charts and pie charts, we’ve consolidated how charts are created. We’re also introducing split line styles for line charts. Read the release notes.

v1.13.1

02 Dec 10:21
c5fa17c
Compare
Choose a tag to compare

This release includes the following changes.

API changes

  • In MutableExtraStore, an error affecting remove has been resolved. The function accepted only ExtraStore.Key instances with DrawingModel or a subtype thereof as the type parameter’s value. Now, all ExtraStore.Key instances are accepted.

v1.13.0

19 Nov 12:40
0d002b7
Compare
Choose a tag to compare

This release includes the following changes.

Since v1.13.0-beta.1

Resolved issues

  • Crashes occurred in ComposedChart when no model was available or when the available model had fewer data sets than the ComposedChart had nested Charts.

Since v1.12.0

Improvements

  • The default AxisItemPlacer.Vertical implementation now requests no insets when maxItemCount is zero. Thus, to create an axis with no labels, ticks, or guidelines, it’s sufficient to use AxisItemPlacer.Vertical.default(maxItemCount = 0). (See #445.)
  • When the precision of a chart’s x values is too large for the GCD of their deltas to be calculated, a descriptive exception is now thrown. (See #374.)

API changes

  • The animation system has been entirely rewritten. Difference animations are smoother, behave better when the y range changes due to a data update, and exhibit better performance. Redundant calls to AxisValuesOverrider functions are no longer made, and numerous visual glitches have been resolved. DiffProcessor has been removed in favor of Chart.ModelTransformer and DrawingModelInterpolator. Use the latter for custom difference animations. ColumnChart and LineChart have drawingModelInterpolator fields, and in the compose module, the lineChart and columnChart functions have drawingModelInterpolator parameters. In ChartModelProducer, progressModel has been renamed to transformModel, and its progress parameter has been renamed to fraction. This change is reflected across related APIs.

  • Updates have been made to ChartEntryModelProducer and ComposedChartEntryModelProducer.

    • ComposedChartEntryModelProducer, rather than being a combination of ChartEntryModelProducers, is now independent and uses a list of data sets, with each one corresponding to a single nested Chart. This makes the API easier to use and resolves synchronization-related issues. To run data updates, use runTransaction or runTransactionSuspending. To create a ComposedChartEntryModelProducer, use ComposedChartEntryModelProducer.build, which lets you run an initial Transaction. Refer to the Transaction documentation for more information. Below, the first code block uses APIs from Vico 1.12.0, and the second one shows how to achieve the same result in Vico 1.13.0.

      val chartEntryModelProducer1 = ChartEntryModelProducer(a)
      val chartEntryModelProducer2 = ChartEntryModelProducer(b)
      val composedChartEntryModelProducer = chartEntryModelProducer1 + chartEntryModelProducer2
      chartEntryModelProducer1.setEntries(c)
      chartEntryModelProducer2.setEntries(d)
      val composedChartEntryModelProducer = ComposedChartEntryModelProducer.build {
          add(a)
          add(b)
      }
      composedChartEntryModelProducer.runTransaction {
          /* Because we’re not calling `populate`, the new list of data sets is empty, so we use `add`
          instead of `set`. */
          add(c)
          add(d)
      }
    • The ComposedChartEntryModelProducer.composedChartEntryModelOf function has been removed in favor of the plus operator function for ChartEntryModels.

    • To resolve a problem where ChartEntryModelProducer and ComposedChartEntryModelProducer accepted all updates immediately, even if an update was already running—in which case ConcurrentModificationExceptions and NullPointerExceptions occurred—we’ve reworked the update mechanism. ChartEntryModelProducer#setEntries, ComposedChartEntryModelProducer#runTransaction, and ComposedChartEntryModelProducer.Transaction#commit can reject an update if there’s already one in progress. Each of these functions returns a Boolean indicating whether the requested update has been accepted or rejected. ChartEntryModelProducer#setEntriesSuspending, ComposedChartEntryModelProducer#runTransactionSuspending, and ComposedChartEntryModelProducer.Transaction#commitSuspending suspend the current coroutine until an update can be run. Data updates typically take a few milliseconds to be processed, so unless your chart is frequently updated and you experienced CMEs and NPEs in previous Vico versions, ChartEntryModelProducer#setEntries, ComposedChartEntryModelProducer#runTransaction, and ComposedChartEntryModelProducer.Transaction#commit are safe to use. Because ChartEntryModelProducer and ComposedChartEntryModelProducer now use coroutines, they no longer accept Executors—rather, you can specify a custom CoroutineDispatcher. (See #408.)

    • ChartEntryModelProducer and ComposedChartEntryModelProducer now let you define extras (auxiliary data). These can later be read via ChartEntryModel#extraStore. Extras are useful for properties that should change with the chart data and can’t be directly derived from it or should be precalculated. For example, if you create a list of x-axis labels for your chart data, you can store this list as an extra to ensure that it’s always in sync with the data. ChartEntryModelProducer#setEntries has an updateExtras parameter, and in ComposedChartEntryModelProducer, the Transaction class has an updateExtras function. (See #363.)

  • Automatic padding for extreme HorizontalAxis labels has been introduced. With HorizontalLayout.FullWidth, this option adds such an amount of horizontal padding to the chart that the labels for ChartValues#minX and ChartValues#maxX are fully visible. To turn this on, use the addExtremeLabelPadding parameter of AxisItemPlacer.Horizontal.default or the addExtremeHorizontalAxisLabelPadding XML attribute from the Axis attribute set. AxisItemPlacer.Horizontal has two new functions, getAddFirstLabelPadding and getAddLastLabelPadding. AxisRenderer has a new updateHorizontalDimensions function. In the Chart interface, updateHorizontalDimensions replaces getHorizontalDimensions. (See #431.)

  • Chart placeholders have been added. These are displayed in charts with ChartModelProducers when no ChartEntryModel is available (no data has been added to the ChartModelProducer). The Chart composable function has a placeholder slot, and BaseChartView accepts a child view. For the latter, you can also use BaseChartView#setPlaceholder. In both cases, the default placeholder is blank. Internally, the somewhat ambiguous concept of empty ChartEntryModels has been removed—if there’s no data, there’s no ChartEntryModel. Thus, where appropriate, ChartEntryModel types are now nullable. In particular ChartModelProducer#getModel may now return null. If you’re sure that a ChartEntryModel is available (data has been added), you can use ChartModelProducer#requireModel. (See #414.)

  • For greater flexibility, HorizontalLayout.FullWidth now lets you add both scalable (zoom-dependent) and unscalable padding. startPaddingDp and endPaddingDp have been replaced with scalableStartPaddingDp, scalableEndPaddingDp, unscalableStartPaddingDp, and unscalableEndPaddingDp. The HorizontalLayout.fullWidth function from the compose module has been updated accordingly. (We were unable to use deprecation because Kotlin’s overload resolution doesn’t consider it. When both a deprecated overload and a non-deprecated overload match a call, the deprecated overload may be used, and there’s no direct way around this.) The startContentPadding and endContentPadding XML attributes have been marked as deprecated and replaced with scalableStartContentPadding, scalableEndContentPadding, unscalableStartContentPadding, and unscalableEndContentPadding attributes.

  • In MeasureContext, chartValuesManager (of type ChartValuesManager) has been replaced with chartValuesProvider (of type ChartValuesProvider). ChartValuesProvider has the same getChartValues function that ChartValuesManager does, so it’s sufficient to replace chartValuesManager with chartValuesProvider where the former can’t be resolved. ChartValues updates are to be run earlier on.

  • Selected deprecated APIs with DeprecationLevel.ERROR have been removed.

Resolved issues

  • Automatic scrolling failed to work in some instances. (See here.)
  • Automatically scaled charts’ initial zoom could be incorrectly calculated. (See here.)
  • XML attributes could fail to be applied.
  • The default x step for multi-series data sets could be incorrect. (See #417.)
  • The plus operator function for ChartEntryModels incorrectly handled ComposedChartEntryModels.
  • Charts created via the Chart composable function didn’t respond to changes to the horizontalLayout parameter’s value and density changes that didn’t cause the function to leave and reenter the composition.

Dependency updates

  • All modules now use Kotlin 1.9.20.
  • In the compose, compose-m2, and compose-m3 modules, the Jetpack Compose BOM has been updated from version 2023.09.01 to version 2023.10.01.

v1.13.0-beta.1

12 Nov 14:48
cbad581
Compare
Choose a tag to compare
v1.13.0-beta.1 Pre-release
Pre-release

This release includes the following changes.

Additions

  • ColumnChart and LineChart now have drawingModelInterpolator properties. In the compose module, the lineChart and columnChart functions have drawingModelInterpolator parameters. This enables you to apply custom DrawingModelInterpolators.

API changes

  • ChartEntryModelProducer and ComposedChartEntryModelProducer now let you define extras (auxiliary data). These can later be read via ChartEntryModel#extraStore. Extras are useful for properties that should change with the chart data and can’t be directly derived from it or should be precalculated. For example, if you create a list of x-axis labels for your chart data, you can store this list as an extra to ensure that it’s always in sync with the data. ChartEntryModelProducer#setEntries has an updateExtras parameter, and in ComposedChartEntryModelProducer, the Transaction class has an updateExtras function. As part of this change, DrawingModelStore has been renamed to ExtraStore and updated to allow for storing data of any type. (See #363.)
  • In ChartModelProducer, progressModel has been renamed to transformModel, and its progress parameter has been renamed to fraction. This change is reflected across related APIs.
  • The two *ContentPadding XML attributes have been marked as deprecated and replaced with scalable*ContentPadding and unscalable*ContentPadding attributes. This relates to the introduction of the ability to add unscalable padding via HorizontalLayout.FullWidth—see the changelog for Vico 1.13.0 Alpha 7.

Bug fixes

  • An issue where XML attributes could fail to be applied has been resolved.

Dependency updates

  • All modules now use Kotlin 1.9.20.

v1.13.0-alpha.9

28 Oct 13:44
1e85e1d
Compare
Choose a tag to compare
v1.13.0-alpha.9 Pre-release
Pre-release

This release includes the following changes.

Improvements

  • The default AxisItemPlacer.Vertical implementation now requests no insets when maxItemCount is zero. Thus, to create an axis with no labels, ticks, or guidelines, it’s sufficient to use AxisItemPlacer.Vertical.default(maxItemCount = 0). (See #445.)

API changes

  • Automatic padding for extreme HorizontalAxis labels has been introduced. With HorizontalLayout.FullWidth, this option adds such an amount of horizontal padding to the chart that the labels for ChartValues#minX and ChartValues#maxX are fully visible. To turn this on, use the addExtremeLabelPadding parameter of AxisItemPlacer.Horizontal.default or the addExtremeHorizontalAxisLabelPadding XML attribute from the Axis attribute set. AxisItemPlacer.Horizontal has two new functions, getAddFirstLabelPadding and getAddLastLabelPadding. AxisRenderer has a new updateHorizontalDimensions function. In the Chart interface, updateHorizontalDimensions replaces getHorizontalDimensions. (See #431.)
  • Chart placeholders have been added. These are displayed in charts with ChartModelProducers when no ChartEntryModel is available (no data has been added to the ChartModelProducer). The Chart composable function has a placeholder slot, and BaseChartView accepts a child view. For the latter, you can also use BaseChartView#setPlaceholder. In both cases, the default placeholder is blank. Internally, the somewhat ambiguous concept of empty ChartEntryModels has been removed—if there’s no data, there’s no ChartEntryModel. Thus, where appropriate, ChartEntryModel types are now nullable. In particular ChartModelProducer#getModel may now return null. If you’re sure that a ChartEntryModel is available (data has been added), you can use ChartModelProducer#requireModel. (See #414.)

Bug fixes

  • A problem where ChartEntryModelProducer and ComposedChartEntryModelProducer could cause mutex-related IllegalStateExceptions has been resolved.
  • Several animation-related bugs affecting BaseChartView have been fixed.

Dependency updates

  • In the compose, compose-m2, and compose-m3 modules, the Jetpack Compose BOM has been updated from version 2023.10.00 to version 2023.10.01.

v1.13.0-alpha.8

16 Oct 20:21
1c54394
Compare
Choose a tag to compare
v1.13.0-alpha.8 Pre-release
Pre-release

This release includes the following changes.

Bug fixes

  • An issue where automatically scaled charts’ initial zoom could be incorrectly calculated has been resolved. (See here.)

v1.13.0-alpha.7

15 Oct 12:33
ea43e7b
Compare
Choose a tag to compare
v1.13.0-alpha.7 Pre-release
Pre-release

This release includes the following changes.

API changes

  • For greater flexibility, HorizontalLayout.FullWidth now lets you add both scalable (zoom-dependent) and unscalable padding. startPaddingDp and endPaddingDp have been replaced with scalableStartPaddingDp, scalableEndPaddingDp, unscalableStartPaddingDp, and unscalableEndPaddingDp. The HorizontalLayout.fullWidth function from the compose module has been updated accordingly. (We were unable to use deprecation because Kotlin’s overload resolution doesn’t consider it. When both a deprecated overload and a non-deprecated overload match a call, the deprecated overload may be used, and there’s no direct way around this.)

v1.13.0-alpha.6

11 Oct 12:27
45f1b08
Compare
Choose a tag to compare
v1.13.0-alpha.6 Pre-release
Pre-release

This release includes the following changes.

Bug fixes

  • BaseChartView#setModel now updates MeasureContext#chartValuesProvider, so IllegalStateExceptions thrown by ChartValuesProvider.Empty (“ChartValuesProvider.Empty#getChartValues shouldn’t be used”) no longer occur.
  • A problem where the default x step for multi-series data sets could be incorrect, potentially causing IllegalStateExceptions in ColumnCharts (“Each entry’s x value must be a multiple of the x step”), has been fixed. (See #417.)
  • An issue where BaseChartView could cause NullPointerExceptions when attached or detached has been resolved.