From f2a862e7b308e4942beb12c1272afbbe6c31517d Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Tue, 1 Oct 2024 19:43:44 +0200 Subject: [PATCH 1/2] Remove align max --- src/apps/weblib/typeschema-api/config.yaml | 2 +- src/chart/options/align.h | 25 ++++++---------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/apps/weblib/typeschema-api/config.yaml b/src/apps/weblib/typeschema-api/config.yaml index 20b7089ab..1b2e32728 100644 --- a/src/apps/weblib/typeschema-api/config.yaml +++ b/src/apps/weblib/typeschema-api/config.yaml @@ -223,7 +223,7 @@ definitions: on where the measure is. In case both axes have measures on them, this is determined by the `orientation` of the chart. type: string - enum: [none, min, center, max, stretch] + enum: [none, min, center, stretch] split: description: | If set to true, markers will be split by the dimension(s) along the axis. diff --git a/src/chart/options/align.h b/src/chart/options/align.h index 390cfa54c..5edd71dde 100644 --- a/src/chart/options/align.h +++ b/src/chart/options/align.h @@ -10,30 +10,17 @@ namespace Vizzu::Base struct Align : private Math::Range { -public: - enum class Type : std::uint8_t { - none, - min, - center, - max, - stretch - }; - - Align(Type type, const Range &range) : - Range(range), - type(type) - {} - - [[nodiscard]] Range getAligned( - const Range &range) const + enum class Type : std::uint8_t { none, min, center, stretch }; + + Align(Type type, const Range &range) : Range(range), type(type) {} + + [[nodiscard]] Range getAligned(const Range &range) const { switch (type) { case Type::none: return range; case Type::min: return range + min - range.getMin(); case Type::center: return range - range.middle() + middle(); - case Type::max: return range + max - range.getMax(); - case Type::stretch: - return static_cast &>(*this); + case Type::stretch: return static_cast(*this); } throw std::logic_error("invalid align type"); } From 450098078870076b1c7318f9f12dae22814f23e3 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Tue, 1 Oct 2024 19:46:25 +0200 Subject: [PATCH 2/2] Add changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f493fc473..c4ec89af4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ - Fix all polar connection interpolation (except fading). - Remove unwanted line connections from line-circle + orientation changed anim. +### Changed + +- Removed the 'align: max' property from the API. That function can be achieved + by setting the axis range to: {min: '100%', max: '0%'}. + + ## [0.13.0] - 2024-09-13 ### Fixed