Skip to content

16 patch #636

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

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,33 @@

## [Unreleased]

## [0.16.3] - 2025-04-28

### Added

- Added new (development) style parameter: 'plot.marker.label.unit' with options 'original' (default) and 'percent'.

## [0.16.2] - 2025-04-03

### Fixed

- Fix "Cerror: vector" where if a lot of categories are present without usage,
memory allocation could be failed.
- Fix appearing split markers starter position to center of separation space.

## [0.16.1] - 2025-02-24

### Fixed

- Fix invalid read/write when animation is contiguous (onFinish callback calls setKeyframe).
- Waterfall chart preset not aligned.
- Split chart count negative values too.
- Split chart count negative values too.
- Visible non-sum aggregated value jumped.
- Add record didn't handle when a measure got an empty string.
- Fix no fontparent set bug.
- Fix NaN handling on markers linking.
- Fix handling negative numbers on stacked charts.
- Fix connected charts when nan values is the prev connection.

## [0.16.0] - 2024-11-28

Expand Down
8 changes: 4 additions & 4 deletions src/base/math/renard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ namespace Math

Renard Renard::R3()
{
static const std::array R3Numbers = {1.0, 2.0, 5.0, 10.0};
static constexpr std::array R3Numbers = {1.0, 2.0, 5.0, 10.0};
return Renard{R3Numbers};
}
Renard Renard::R5()
{
static const std::array R5Numbers =
static constexpr std::array R5Numbers =
{1.0, 1.5, 2.5, 4.0, 6.0, 10.0};
return Renard{R5Numbers};
}

double Renard::ceil(double value)
double Renard::ceil(double value) const
{
if (value == 0.0) return 0.0;

Expand All @@ -39,7 +39,7 @@ double Renard::ceil(double value)
+ std::to_string(value) + ".");
}

double Renard::floor(double value)
double Renard::floor(double value) const
{
if (value == 0.0) return 0.0;

Expand Down
4 changes: 2 additions & 2 deletions src/base/math/renard.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Renard
explicit Renard(std::span<const double> const &numbers) :
numbers(numbers)
{}
double ceil(double value);
double floor(double value);
[[nodiscard]] double ceil(double value) const;
[[nodiscard]] double floor(double value) const;

private:
std::span<const double> numbers;
Expand Down
2 changes: 2 additions & 0 deletions src/chart/animator/keyframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ void Keyframe::prepareActual()
prepareActualMarkersInfo();

actual = std::make_shared<Gen::Plot>(*source);
actual->getStyle().setup();
actual->detachOptions();
}

Expand All @@ -92,6 +93,7 @@ void Keyframe::copyTarget()
if (!targetCopy) {
targetCopy = target;
target = std::make_shared<Gen::Plot>(*targetCopy);
target->getStyle().setup();
target->detachOptions();
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/chart/animator/styles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ void StyleMorphFactory::operator()(const T &source,
template <typename T, typename PT>
requires(std::is_same_v<PT, Text::NumberFormat>
|| std::is_same_v<PT, Text::NumberScale>
|| std::is_same_v<PT, Styles::MarkerLabel::Format>)
|| std::is_same_v<PT, Styles::MarkerLabel::Format>
|| std::is_same_v<PT, Styles::MarkerLabel::Unit>)
void StyleMorphFactory::operator()(const T &, const T &, T &) const
{}

Expand Down
3 changes: 2 additions & 1 deletion src/chart/animator/styles.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ class StyleMorphFactory
template <typename T, typename PT = Style::ParamT<T>>
requires(std::is_same_v<PT, Text::NumberFormat>
|| std::is_same_v<PT, Text::NumberScale>
|| std::is_same_v<PT, Styles::MarkerLabel::Format>)
|| std::is_same_v<PT, Styles::MarkerLabel::Format>
|| std::is_same_v<PT, Styles::MarkerLabel::Unit>)
void operator()(const T &, const T &, T &) const;

private:
Expand Down
6 changes: 4 additions & 2 deletions src/chart/generator/axis.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Vizzu::Gen
struct ChannelStats
{
using TrackType = std::variant<Math::Range<>,
std::vector<std::optional<Data::SliceIndex>>>;
std::map<std::uint32_t, Data::SliceIndex>>;

Refl::EnumArray<ChannelId, TrackType> tracked;
Math::Range<> lightness;
Expand All @@ -35,7 +35,9 @@ struct ChannelStats
void track(ChannelId at, const Data::MarkerId &id)
{
auto &vec = std::get<1>(tracked[at]);
vec[id.itemId] = id.label;
if (id.label)
vec.try_emplace(static_cast<std::uint32_t>(id.itemId),
*id.label);
}

void track(ChannelId at, const double &value)
Expand Down
3 changes: 2 additions & 1 deletion src/chart/generator/marker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ bool Marker::connectMarkers(bool first,
bool main,
bool polarConnection)
{
if (prev && next && main && (!first || polarConnection)) {
if (prev && next && main && (!first || polarConnection)
&& static_cast<bool>(prev->enabled)) {
next->prevMainMarker =
RelativeMarkerIndex{prev->idx, prev - next};
next->polarConnection = polarConnection && first;
Expand Down
4 changes: 3 additions & 1 deletion src/chart/generator/plot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ Plot::Plot(PlotOptionsPtr opts, Styles::Chart style) :
guides(*opts),
options(std::move(opts)),
style(std::move(style))
{}
{
this->style.setup();
}

void Plot::detachOptions()
{
Expand Down
Loading