Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v0.5] API Changes #44

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

[v0.5] API Changes #44

wants to merge 5 commits into from

Conversation

jentfoo
Copy link
Member

@jentfoo jentfoo commented Jan 27, 2025

This PR includes the changes for the future v0.5 release. Changes included for this release:

  • Go minimum version updated to 1.18 to enable the use of generics.
  • Config helper functions True(), False(), BoolPointer(bool), and FloatPointer(float64) have been replaced by charts.Ptr
  • API's marked as deprecated / replaced have been removed
    • Series.Label.Formatter was replaced with Series.Label.FormatTemplate
    • Series.Label.Position was replaced with SeriesLabelPosition on the chart Options struct (only bar and horizontal bar use this field)
    • SeriesList.GetMinMax was removed, use the better Series.Summary() function.
    • drawing.ColorFromRGB replaced with charts.ColorFromRGBA (supporting both formats now)
    • drawing package had several functions expected to be unused externally that were removed
  • Small API changes without a deprecation notice:

Before merging we will describe all API changes on our version migration guide here: https://github.com/go-analyze/charts/wiki/Version-Migration-Guide

@jentfoo jentfoo added the enhancement New feature or request label Jan 27, 2025
@jentfoo jentfoo self-assigned this Jan 27, 2025
@jentfoo jentfoo marked this pull request as draft January 27, 2025 16:43
@jentfoo jentfoo changed the title v0.5 API Changes and Deprecation removals [v0.5] API Changes Jan 27, 2025
@jentfoo jentfoo force-pushed the v0.5-dev branch 5 times, most recently from 3ab64e3 to 268dafe Compare February 4, 2025 04:24
This change matches other configuration where we accept bool pointers. Allowing the default (nil) to be able to be enabled or disabled depending on other configuration (specifically if the series is stacked). But also allowing a user to override this option and force a behavior.
Because of the horizontal layout two Y axis's do not make sense for this chart. Prior to this API change it would result in a confusing / bugged chart if a second Y-Axis is specified.
This commit updates the minimum supported go version to 1.18 so that we can include the use of generics.

With that ability, the following functions have been replaced:
* `True()`
* `False()`
* `BoolPointer()`
* `FloatPointer()`

Instead these are all done through the generic `Ptr` function as shown in the examples.
These two helper functions help make an easy conversion to the []float64 slice needed for our chart values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant