From 46223ac96660e3e984a9eaf35e65fa820d3ce21a Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Thu, 18 Jul 2024 18:50:31 +0200 Subject: [PATCH 1/6] review vol1 --- src/chart/generator/marker.cpp | 2 +- src/chart/generator/plot.cpp | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/chart/generator/marker.cpp b/src/chart/generator/marker.cpp index 7cf74a70d..28f7486fc 100644 --- a/src/chart/generator/marker.cpp +++ b/src/chart/generator/marker.cpp @@ -128,7 +128,7 @@ bool Marker::connectMarkers(bool first, next->prevMainMarker = MarkerIndexPosition{prev->idx, prev->pos}; next->polarConnection = polarConnection && first; - return !first || polarConnection; + return true; } if (next && main) { next->prevMainMarker = diff --git a/src/chart/generator/plot.cpp b/src/chart/generator/plot.cpp index 9f9f07538..0c4eeca14 100644 --- a/src/chart/generator/plot.cpp +++ b/src/chart/generator/plot.cpp @@ -173,9 +173,10 @@ void Plot::mergeMarkersAndCellInfo(Plot &source, Plot &target) else if (prePos < target_reindex.size() && target_reindex[prePos].idx == idx) prePos = target_reindex[prePos].pos; - else - throw std::runtime_error( - "Logical error in marker reindex"); + else [[unlikely]] + throw std::logic_error( + "internal error: " + "Marker reindex not matching idx."); } auto &tmarker = tmarkers[ix]; @@ -188,9 +189,10 @@ void Plot::mergeMarkersAndCellInfo(Plot &source, Plot &target) else if (prePos < source_reindex.size() && source_reindex[prePos].idx == idx) prePos = source_reindex[prePos].pos; - else - throw std::runtime_error( - "Logical error in marker reindex"); + else [[unlikely]] + throw std::logic_error( + "internal error: " + "Marker reindex not matching idx."); } if (auto &scell = source.markers[ix].cellInfo, From 2c3543f6f474e7ba5b3f7686a069887cb70a0e04 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 19 Jul 2024 10:46:04 +0200 Subject: [PATCH 2/6] fix buckets -> not allocate all marker's space. Make all sort to stable_sort. --- src/chart/generator/buckets.cpp | 55 ++++++++ src/chart/generator/buckets.h | 71 ++++++++++ src/chart/generator/plotbuilder.cpp | 148 ++++++++++++--------- src/chart/generator/plotbuilder.h | 4 +- src/chart/generator/plotptr.h | 68 ---------- src/chart/speclayout/bubblechart.cpp | 4 +- src/chart/speclayout/sizedependentlayout.h | 19 ++- src/chart/speclayout/treemap.cpp | 10 +- src/dataframe/impl/data_source.cpp | 2 +- src/dataframe/old/types.h | 7 + test/e2e/test_cases/test_cases.json | 146 ++++++++++---------- 11 files changed, 310 insertions(+), 224 deletions(-) create mode 100644 src/chart/generator/buckets.cpp create mode 100644 src/chart/generator/buckets.h diff --git a/src/chart/generator/buckets.cpp b/src/chart/generator/buckets.cpp new file mode 100644 index 000000000..443446076 --- /dev/null +++ b/src/chart/generator/buckets.cpp @@ -0,0 +1,55 @@ + +#include "buckets.h" + +#include + +#include "dataframe/old/types.h" + +#include "marker.h" + +namespace Vizzu::Gen +{ + +Buckets::Buckets(std::span markers) : markers(markers.size()) +{ + std::iota(this->markers.begin(), + this->markers.end(), + markers.data()); +} + +Buckets &Buckets::sort(MarkerIDGet id_get) +{ + marker_id_get = id_get; + std::ranges::stable_sort(markers, + [id_get](Marker *lhs, Marker *rhs) -> bool + { + if (auto &&cmp = lhs->*id_get <=> rhs->*id_get; + std::is_neq(cmp)) + return std::is_lt(cmp); + return lhs < rhs; + }); + return *this; +} + +Buckets::const_iterator &Buckets::const_iterator::operator++() +{ + const auto *const real_end = + parent->markers.data() + parent->markers.size(); + const auto *const curr_end = data.data() + data.size(); + data = {curr_end, + curr_end == real_end + ? curr_end + : std::partition_point(curr_end, + real_end, + [this, + searched = + (*curr_end->*parent->marker_id_get).seriesId]( + Marker *lhs) -> bool + { + return (lhs->*parent->marker_id_get).seriesId + == searched; + })}; + return *this; +} + +} \ No newline at end of file diff --git a/src/chart/generator/buckets.h b/src/chart/generator/buckets.h new file mode 100644 index 000000000..c6d9653b4 --- /dev/null +++ b/src/chart/generator/buckets.h @@ -0,0 +1,71 @@ +#ifndef BUCKETS_H +#define BUCKETS_H + +#include +#include +#include + +namespace Vizzu +{ + +namespace Data +{ +struct MarkerId; +} + +namespace Gen +{ +class Marker; + +struct Buckets +{ + using MarkerIDGet = Data::MarkerId Marker::*; + std::vector markers; + MarkerIDGet marker_id_get{}; + + explicit Buckets(std::span markers); + + Buckets &sort(MarkerIDGet id_get); + + [[nodiscard]] bool empty() const { return markers.empty(); } + + struct const_iterator + { + std::span data; + const Buckets *parent; + + [[nodiscard]] auto operator*() const + { + return std::ranges::views::transform(data, + [this](Marker *marker) + -> std::pair + { + return {*marker, marker->*parent->marker_id_get}; + }); + } + + [[nodiscard]] bool operator!=(const const_iterator &oth) const + { + return data.data() != oth.data.data(); + } + + const_iterator &operator++(); + }; + + [[nodiscard]] const_iterator begin() const + { + return ++const_iterator{{markers.data(), markers.data()}, + this}; + } + + [[nodiscard]] const_iterator end() const + { + const auto end{markers.data() + markers.size()}; + return {{end, end}, this}; + } +}; + +} +} + +#endif // BUCKETS_H diff --git a/src/chart/generator/plotbuilder.cpp b/src/chart/generator/plotbuilder.cpp index 14a68593e..497a01d76 100644 --- a/src/chart/generator/plotbuilder.cpp +++ b/src/chart/generator/plotbuilder.cpp @@ -5,6 +5,7 @@ #include #include +#include "buckets.h" #include "plot.h" namespace Vizzu::Gen @@ -65,20 +66,16 @@ void PlotBuilder::resetDimensionTrackers() const Buckets PlotBuilder::generateMarkers(std::size_t &mainBucketSize) { - Buckets mainBuckets; - Buckets subBuckets; - const auto &mainIds(plot->getOptions()->mainAxis().dimensions()); auto subIds(plot->getOptions()->subAxis().dimensions()); + + auto all_marker = dataCube.df->get_record_count(); if (!dataCube.empty()) { if (plot->getOptions()->geometry == ShapeType::area) subIds.split_by(mainIds); - mainBuckets.resize(dataCube.combinedSizeOf(mainIds)); - mainBucketSize = mainBuckets.size(); - subBuckets.resize(dataCube.combinedSizeOf(subIds)); - - plot->markers.reserve(dataCube.combinedSizeOf({}).first); + mainBucketSize = dataCube.combinedSizeOf(mainIds).first; + plot->markers.reserve(all_marker); } std::multimap map; @@ -99,19 +96,17 @@ Buckets PlotBuilder::generateMarkers(std::size_t &mainBucketSize) plot->markers.size(), needInfo); - mainBuckets[marker.mainId.seriesId][marker.mainId.itemId] = - ▮ - subBuckets[marker.subId.seriesId][marker.subId.itemId] = - ▮ - while (needInfo) { plot->markersInfo.insert({first++->second, Plot::MarkerInfo{Plot::MarkerInfoContent{marker}}}); needInfo = first != last && first->first == markerId; } } - auto &&hasMarkerConnection = linkMarkers(mainBuckets, true); - [[maybe_unused]] auto &&_ = linkMarkers(subBuckets, false); + Buckets buckets(plot->markers); + auto &&hasMarkerConnection = + linkMarkers(buckets.sort(&Marker::mainId), true); + [[maybe_unused]] auto &&_ = + linkMarkers(buckets.sort(&Marker::subId), false); if (hasMarkerConnection && plot->getOptions()->geometry.get() == ShapeType::line @@ -126,34 +121,37 @@ Buckets PlotBuilder::generateMarkers(std::size_t &mainBucketSize) plot->markerConnectionOrientation.emplace( *plot->getOptions()->orientation.get()); } - return subBuckets; + return buckets; } std::vector PlotBuilder::sortedBuckets(const Buckets &buckets, bool main) const { - std::vector sorted(buckets.inner_size()); + std::vector sorted; for (auto &&bucket : buckets) - for (std::size_t ix{}; auto &&marker : bucket) { - auto &[f, s, has] = sorted[ix]; - f = ix++; - if (!marker || static_cast(!marker->enabled)) - continue; - s += marker->size.getCoord( + for (auto &&[marker, idx] : bucket) { + if (static_cast(!marker.enabled)) continue; + + auto it = std::ranges::lower_bound(sorted, + idx.itemId, + std::less{}, + std::mem_fn(&BucketInfo::index)); + if (it == sorted.end() || it->index != idx.itemId) + it = sorted.emplace(it, idx.itemId, 0.0); + + it->size += marker.size.getCoord( !plot->getOptions()->isHorizontal()); - has = true; } if (main && plot->getOptions()->sort == Sort::byValue) - std::sort(sorted.begin(), - sorted.end(), + std::ranges::stable_sort(sorted, [](const BucketInfo &lhs, const BucketInfo &rhs) { - if (auto ord = std::weak_order(lhs.size, rhs.size); - !std::is_eq(ord)) - return std::is_lt(ord); - return lhs.index < rhs.index; + return std::is_lt( + std::strong_order(lhs.size, rhs.size)); + // THIS WILL BE MERGE CONFLICT + // return Math::Floating::less(lhs.size, rhs.size); }); if (main && plot->getOptions()->reverse) @@ -176,13 +174,7 @@ void PlotBuilder::addSpecLayout(Buckets &buckets) Charts::TableChart::setupVector(markers); } else if (!dataCube.empty()) { - buckets.clear(); - buckets.resize(dataCube.combinedSizeOf(size.dimensions())); - - for (auto &marker : markers) - if (marker.enabled) - buckets[marker.sizeId.seriesId] - [marker.sizeId.itemId] = ▮ + buckets.sort(&Marker::sizeId); if (geometry == ShapeType::circle) { Charts::BubbleChartBuilder::setupVector( @@ -205,8 +197,6 @@ Math::Range &PlotBuilder::getMeasTrackRange( bool PlotBuilder::linkMarkers(const Buckets &buckets, bool main) const { auto &&sorted = sortedBuckets(buckets, main); - std::erase_if(sorted, - std::not_fn(std::mem_fn(&BucketInfo::hasElement))); std::vector dimOffset(sorted.size(), std::numeric_limits::lowest()); @@ -234,10 +224,21 @@ bool PlotBuilder::linkMarkers(const Buckets &buckets, bool main) const for (std::size_t ix{}, max = sorted.size(); ix < max; ++ix) { auto &o = dimOffset[ix]; for (const auto &bucket : buckets) { - auto *marker = bucket[sorted[ix].index]; - if (!marker || static_cast(!marker->enabled)) + auto sIx = sorted[ix].index; + auto it = std::ranges::lower_bound(bucket, + sIx, + std::less{}, + [](const std::pair &p) + { + return p.second.itemId; + }); + if (it == bucket.end() || (*it).second.itemId != sIx) continue; - o = std::max(o, marker->size.*coord); + + auto &marker = (*it).first; + if (!marker.enabled) continue; + o = std::max(o, marker.size.*coord); } if (o == std::numeric_limits::lowest()) o = 0.0; @@ -262,12 +263,33 @@ bool PlotBuilder::linkMarkers(const Buckets &buckets, bool main) const double prevPos{}; for (auto i = 0U; i < sorted.size(); ++i) { auto idAct = sorted[i].index; - auto *act = bucket[idAct]; + auto it = std::ranges::lower_bound(bucket, + idAct, + std::less{}, + [](const std::pair + &p) + { + return p.second.itemId; + }); + Marker *act = + it == bucket.end() || (*it).second.itemId != idAct + ? nullptr + : &(*it).first; auto iNext = (i + 1) % sorted.size(); auto idNext = sorted[iNext].index; - - auto *next = bucket[idNext]; + it = std::ranges::lower_bound(bucket, + idNext, + std::less{}, + [](const std::pair + &p) + { + return p.second.itemId; + }); + Marker *next = + it == bucket.end() || (*it).second.itemId != idNext + ? nullptr + : &(*it).first; if (act) prevPos = act->position.*coord += @@ -440,16 +462,15 @@ void PlotBuilder::addAlignment(const Buckets &subBuckets) const for (auto &&bucket : subBuckets) { Math::Range range; - for (auto &&marker : bucket) - if (marker && static_cast(marker->enabled)) - range.include(marker->getSizeBy(vectical)); + for (auto &&[marker, idx] : bucket) + if (marker.enabled) + range.include(marker.getSizeBy(vectical)); auto &&transform = align.getAligned(range) / range; - for (auto &&marker : bucket) - if (marker) - marker->setSizeBy(vectical, - marker->getSizeBy(vectical) * transform); + for (auto &&[marker, idx] : bucket) + marker.setSizeBy(vectical, + marker.getSizeBy(vectical) * transform); } } @@ -468,13 +489,15 @@ void PlotBuilder::addSeparation(const Buckets &subBuckets, auto &&vertical = !plot->getOptions()->isHorizontal(); for (auto &&bucket : subBuckets) - for (auto i = 0U; auto &&marker : bucket) { - if (marker && static_cast(marker->enabled)) { + for (std::size_t i{}, prIx{}; + auto &&[marker, idx] : bucket) { + (i += idx.itemId - std::exchange(prIx, idx.itemId)) %= + ranges.size(); + if (marker.enabled) { ranges[i].include( - marker->getSizeBy(vertical).size()); + marker.getSizeBy(vertical).size()); anyEnabled[i] = true; } - ++i %= ranges.size(); } auto max = Math::Range(0.0, 0.0); @@ -486,12 +509,13 @@ void PlotBuilder::addSeparation(const Buckets &subBuckets, + (anyEnabled[i - 1] ? max.getMax() / 15 : 0); for (auto &&bucket : subBuckets) - for (auto i = 0U; auto &&marker : bucket) { - if (marker) - marker->setSizeBy(vertical, - Base::Align{align, ranges[i]}.getAligned( - marker->getSizeBy(vertical))); - ++i %= ranges.size(); + for (std::size_t i{}, prIx{}; + auto &&[marker, idx] : bucket) { + (i += idx.itemId - std::exchange(prIx, idx.itemId)) %= + ranges.size(); + marker.setSizeBy(vertical, + Base::Align{align, ranges[i]}.getAligned( + marker.getSizeBy(vertical))); } } } diff --git a/src/chart/generator/plotbuilder.h b/src/chart/generator/plotbuilder.h index 23b46c75d..89d2ea80d 100644 --- a/src/chart/generator/plotbuilder.h +++ b/src/chart/generator/plotbuilder.h @@ -9,6 +9,9 @@ namespace Vizzu::Gen { + +struct Buckets; + class PlotBuilder { public: @@ -26,7 +29,6 @@ class PlotBuilder { std::size_t index{}; double size{}; - bool hasElement{}; }; void initDimensionTrackers() const; diff --git a/src/chart/generator/plotptr.h b/src/chart/generator/plotptr.h index 532baf01b..19bbdcada 100644 --- a/src/chart/generator/plotptr.h +++ b/src/chart/generator/plotptr.h @@ -2,7 +2,6 @@ #define PLOTPTR_H #include -#include namespace Vizzu::Gen { @@ -10,73 +9,6 @@ class Plot; using PlotPtr = std::shared_ptr; class Marker; -struct Buckets -{ - // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays) - using MarkerPtrArr = Marker *[]; - std::unique_ptr markers; - std::size_t k{}; - std::size_t n{}; - - void resize(std::pair &&p) - { - auto &&[i, j] = p; - if (k * n < i * j) - markers = std::make_unique(i * j); - k = i; - n = j; - } - - void clear() - { - markers.reset(); - k = 0; - n = 0; - } - - [[nodiscard]] std::size_t inner_size() const { return n; } - - [[nodiscard]] bool empty() const { return !markers; } - - [[nodiscard]] std::size_t size() const { return k; } - - std::span operator[](std::size_t ix) const - { - return {markers.get() + ix * n, n}; - } - - struct const_iterator - { - std::span data; - - [[nodiscard]] const std::span & - operator*() const - { - return data; - } - - [[nodiscard]] bool operator!=(const const_iterator &oth) const - { - return data.data() != oth.data.data(); - } - - const_iterator &operator++() - { - data = {data.data() + data.size(), data.size()}; - return *this; - } - }; - - [[nodiscard]] const_iterator begin() const - { - return {operator[](0)}; - } - - [[nodiscard]] const_iterator end() const - { - return {operator[](k)}; - } -}; } #endif diff --git a/src/chart/speclayout/bubblechart.cpp b/src/chart/speclayout/bubblechart.cpp index e447edcab..e2338de5d 100644 --- a/src/chart/speclayout/bubblechart.cpp +++ b/src/chart/speclayout/bubblechart.cpp @@ -16,13 +16,13 @@ BubbleChart::BubbleChart(const std::vector &circleAreas, std::sqrt(std::abs(circleArea)), std::signbit(circleArea)); - std::sort(markers.begin(), markers.end(), SpecMarker::sizeOrder); + std::ranges::stable_sort(markers, SpecMarker::sizeOrder); generate(); normalize(parent ? parent->circle().boundary() : Geom::Rect{{}, Geom::Size{1, 1}}); - std::sort(markers.begin(), markers.end(), SpecMarker::indexOrder); + std::ranges::stable_sort(markers, SpecMarker::indexOrder); } void BubbleChart::generate() diff --git a/src/chart/speclayout/sizedependentlayout.h b/src/chart/speclayout/sizedependentlayout.h index 31b843305..7d31b1209 100644 --- a/src/chart/speclayout/sizedependentlayout.h +++ b/src/chart/speclayout/sizedependentlayout.h @@ -15,11 +15,11 @@ template struct SizeDependentLayout { if (hierarchy.empty()) return; - std::vector sizes(hierarchy.size()); - for (std::size_t ix{}; const auto &level : hierarchy) - for (auto &sum = sizes[ix++]; const auto &item : level) { - if (!item) continue; - if (auto &&size = item->sizeFactor; + std::vector sizes; + for (const auto &level : hierarchy) + for (auto &sum = sizes.emplace_back(); + const auto &item : level) { + if (auto &&size = item.first.sizeFactor; std::isfinite(size) && size > 0) sum += size; } @@ -30,17 +30,14 @@ template struct SizeDependentLayout const auto &level : hierarchy) { std::vector ssizes(level.size()); for (std::size_t ix{}; const auto &item : level) { - if (item) ssizes[ix] = item->sizeFactor; - ++ix; + ssizes[ix++] = item.first.sizeFactor; } const ChartType subChart(ssizes, it++); for (std::size_t subCnt{}; const auto &item : level) { - if (item) - afterMarkerSetter(*item, - subChart.markers[subCnt]); - ++subCnt; + afterMarkerSetter(item.first, + subChart.markers[subCnt++]); } } } diff --git a/src/chart/speclayout/treemap.cpp b/src/chart/speclayout/treemap.cpp index dae17b2fb..94d187780 100644 --- a/src/chart/speclayout/treemap.cpp +++ b/src/chart/speclayout/treemap.cpp @@ -12,12 +12,10 @@ TreeMap::TreeMap(const std::vector &sizes, { markers.reserve(sizes.size()); - for (auto j = 0U; j < sizes.size(); ++j) - markers.emplace_back(j, - std::abs(sizes[j]), - std::signbit(sizes[j])); + for (auto j = 0U; const double &size : sizes) + markers.emplace_back(j++, std::abs(size), std::signbit(size)); - std::ranges::sort(markers, SpecMarker::sizeOrder); + std::ranges::stable_sort(markers, SpecMarker::sizeOrder); auto start = markers.begin(); while (start != markers.end() && !std::isfinite(start->size())) @@ -28,7 +26,7 @@ TreeMap::TreeMap(const std::vector &sizes, parent ? parent->rect().pos : Geom::Point{0, 1}, parent ? parent->rect().topRight() : Geom::Point{1, 0}); - std::ranges::sort(markers, SpecMarker::indexOrder); + std::ranges::stable_sort(markers, SpecMarker::indexOrder); } void TreeMap::divide(It begin, diff --git a/src/dataframe/impl/data_source.cpp b/src/dataframe/impl/data_source.cpp index 9716056f2..1982c38e6 100644 --- a/src/dataframe/impl/data_source.cpp +++ b/src/dataframe/impl/data_source.cpp @@ -362,7 +362,7 @@ std::vector data_source::get_sorted_indices( { std::vector indices(max); std::iota(indices.begin(), indices.end(), std::size_t{}); - std::sort(indices.begin(), indices.end(), sort); + std::ranges::stable_sort(indices, sort); return indices; } diff --git a/src/dataframe/old/types.h b/src/dataframe/old/types.h index 03b03bb35..a15c3de60 100644 --- a/src/dataframe/old/types.h +++ b/src/dataframe/old/types.h @@ -149,6 +149,13 @@ struct MarkerId { return itemId == id.itemId && seriesId == id.seriesId; } + + [[nodiscard]] auto operator<=>(const MarkerId &id) const + { + if (auto &&cmp = seriesId <=> id.seriesId; std::is_neq(cmp)) + return cmp; + return itemId <=> id.itemId; + } }; } diff --git a/test/e2e/test_cases/test_cases.json b/test/e2e/test_cases/test_cases.json index 9803b53c0..01180cae5 100644 --- a/test/e2e/test_cases/test_cases.json +++ b/test/e2e/test_cases/test_cases.json @@ -2,37 +2,37 @@ "suite": "/test/e2e/test_cases", "test": { "basic_animations/anim_order/circle_without_2_carte_horizontal": { - "refs": ["5f47a5d"] + "refs": ["707b6b4"] }, "basic_animations/anim_order/circle_without_2_carte_vertical": { - "refs": ["02da02f"] + "refs": ["08cd5f2"] }, "basic_animations/anim_order/rectangle_without_2_carte_bar": { - "refs": ["5aa854e"] + "refs": ["5e1ae03"] }, "basic_animations/anim_order/rectangle_without_2_carte_column": { - "refs": ["78c3ea2"] + "refs": ["cc246ec"] }, "basic_animations/anim_order/rectangle_without_2_polar_bar": { - "refs": ["01670c8"] + "refs": ["9e1dad2"] }, "basic_animations/anim_order/rectangle_without_2_polar_column": { - "refs": ["0ea7b0f"] + "refs": ["e80441b"] }, "basic_animations/coordsystems/area_carte_2_polar": { "refs": ["891a0c9"] }, "basic_animations/coordsystems/circle_without_2_carte": { - "refs": ["5a1bcf7"] + "refs": ["2b6fe96"] }, "basic_animations/coordsystems/rectangle_carte_2_polar": { "refs": ["7e4b152"] }, "basic_animations/coordsystems/rectangle_without_2_carte": { - "refs": ["e7c8792"] + "refs": ["75adcfd"] }, "basic_animations/coordsystems/rectangle_without_2_polar": { - "refs": ["2be0b82"] + "refs": ["6413ccc"] }, "basic_animations/labels/axis/circle_negative_2dis_3con": { "refs": ["6d34d02"] @@ -224,7 +224,7 @@ "refs": ["501ed9f"] }, "operations/all_operations_sizeing": { - "refs": ["021133b"] + "refs": ["e4f0ae8"] }, "operations/drilldown_aggregate_tutorial_data/area_drilldown_aggregate": { "refs": ["4552a07"] @@ -419,19 +419,19 @@ "refs": ["f77b4e7"] }, "static_chart_types/without_coo_sys/bubble_circle_1dis_2con": { - "refs": ["614b122"] + "refs": ["1400dd5"] }, "static_chart_types/without_coo_sys/bubble_circle_2dis_1con": { - "refs": ["6cc8556"] + "refs": ["2c9a31d"] }, "static_chart_types/without_coo_sys/bubble_circle_2dis_2con": { - "refs": ["87dcbf7"] + "refs": ["655a57b"] }, "static_chart_types/without_coo_sys/treemap_rectangle_2dis_1con": { - "refs": ["318409f"] + "refs": ["f7608b8"] }, "static_chart_types/without_coo_sys/treemap_rectangle_2dis_2con": { - "refs": ["e937ca7"] + "refs": ["2590c4f"] }, "web_content/analytical_operations/change_dimension/area_polar_stacked": { "refs": ["def2298"] @@ -515,7 +515,7 @@ "refs": ["f55b142"] }, "web_content/analytical_operations/distribute/existingmeasure_bubble": { - "refs": ["e73a21c"] + "refs": ["64a4a75"] }, "web_content/analytical_operations/distribute/existingmeasure_bubble_stacked_1": { "refs": ["f97a6cf"] @@ -692,16 +692,16 @@ "refs": ["7de0252"] }, "web_content/analytical_operations/sum/bubble": { - "refs": ["2aaa42c"] + "refs": ["586f58e"] }, "web_content/analytical_operations/sum/bubble_to_column": { - "refs": ["7d7b800"] + "refs": ["c6d653a"] }, "web_content/analytical_operations/sum/bubble_to_coxcomb": { - "refs": ["1fff749"] + "refs": ["cf457c0"] }, "web_content/analytical_operations/sum/bubble_to_radial": { - "refs": ["d64b5e6"] + "refs": ["740506d"] }, "web_content/analytical_operations/sum/bubbleplot_1": { "refs": ["122fa97"] @@ -773,7 +773,7 @@ "refs": ["797580d"] }, "web_content/analytical_operations/sum/treemap": { - "refs": ["bc5f02b"] + "refs": ["1cb2f0a"] }, "web_content_removed/animated/composition_comparison_pie_coxcomb_column_2dis_2con": { "refs": ["450213e"] @@ -824,7 +824,7 @@ "refs": ["0554a81"] }, "web_content_removed/animated/relationship_comparison_circle_2_bubble_plot": { - "refs": ["320a8c8"] + "refs": ["a76fe9c"] }, "web_content_removed/animated/relationship_total_bubble_plot_column": { "refs": ["abbca71"] @@ -833,16 +833,16 @@ "refs": ["b654c80"] }, "web_content_removed/animated/stack_group_circle": { - "refs": ["d21806b"] + "refs": ["4696a75"] }, "web_content_removed/animated/stack_group_treemap": { - "refs": ["7ceec7a"] + "refs": ["217893d"] }, "web_content_removed/animated/total_element_bubble_2_bar": { - "refs": ["2dd7601"] + "refs": ["f24ef12"] }, "web_content_removed/animated/total_element_bubble_column": { - "refs": ["bc734ad"] + "refs": ["15985e3"] }, "web_content_removed/animated/treemap_radial": { "refs": ["1913066"] @@ -860,7 +860,7 @@ "refs": ["a5bb9b7"] }, "web_content/infinite": { - "refs": ["1911830"] + "refs": ["927ddb9"] }, "web_content/presets/chart/column": { "refs": ["6ba52a1"] @@ -971,10 +971,10 @@ "refs": ["e781687"] }, "web_content/presets/treemap": { - "refs": ["ee86b8d"] + "refs": ["bec5c68"] }, "web_content/presets/treemap_stacked": { - "refs": ["fd329e6"] + "refs": ["676031c"] }, "web_content/presets/heatmap": { "refs": ["a5d7d58"] @@ -983,10 +983,10 @@ "refs": ["8b1976f"] }, "web_content/presets/chart/bubble_stacked": { - "refs": ["d2329be"] + "refs": ["cd1f691"] }, "web_content/presets_config/chart/bubble_stacked": { - "refs": ["d2329be"] + "refs": ["cd1f691"] }, "web_content/static/chart/area": { "refs": ["c691cc4"] @@ -1070,13 +1070,13 @@ "refs": ["8b1976f"] }, "web_content/static/chart/bubble_stacked": { - "refs": ["027ab1e"] + "refs": ["ffab4dd"] }, "web_content/static/treemap": { - "refs": ["78e32f5"] + "refs": ["d89eee4"] }, "web_content/static/treemap_stacked": { - "refs": ["fd329e6"] + "refs": ["676031c"] }, "ww_animTiming/descartes-polar/01_d-p_r-r-r": { "refs": ["a413130"] @@ -1319,100 +1319,100 @@ "refs": ["4c13f24"] }, "ww_animTiming/without-descartes/02_w-d_c-r-c": { - "refs": ["c1dcc50"] + "refs": ["db0a520"] }, "ww_animTiming/without-descartes/05_w-d_r-c-r": { "refs": ["0ffcc3a"] }, "ww_animTiming/without-descartes/06_w-d_c-c-c": { - "refs": ["dbacd44"] + "refs": ["2b7a38d"] }, "ww_animTiming/without-descartes/09_w-d_r-a-r": { "refs": ["4ea3f95"] }, "ww_animTiming/without-descartes/10_w-d_c-a-c": { - "refs": ["0397768"] + "refs": ["daa255d"] }, "ww_animTiming/without-descartes/13_w-d_r-l-r": { "refs": ["27a7a22"] }, "ww_animTiming/without-descartes/14_w-d_c-l-c": { - "refs": ["ff771fa"] + "refs": ["f1f3210"] }, "ww_animTiming/without-descartes_orientation/01_w-d_o_r-r-r": { "refs": ["893cefb"] }, "ww_animTiming/without-descartes_orientation/02_w-d_o_c-r-c": { - "refs": ["d816ac6"] + "refs": ["205dcf7"] }, "ww_animTiming/without-descartes_orientation/05_w-d_o_r-c-r": { "refs": ["aaf6ee2"] }, "ww_animTiming/without-descartes_orientation/06_w-d_o_c-c-c": { - "refs": ["5f9baae"] + "refs": ["d4a5405"] }, "ww_animTiming/without-descartes_orientation/09_w-d_o_r-a-r": { "refs": ["148dfce"] }, "ww_animTiming/without-descartes_orientation/10_w-d_o_c-a-c": { - "refs": ["41e254c"] + "refs": ["1f5318e"] }, "ww_animTiming/without-descartes_orientation/13_w-d_o_r-l-r": { "refs": ["dd50588"] }, "ww_animTiming/without-descartes_orientation/14_w-d_o_c-l-c": { - "refs": ["486641a"] + "refs": ["2afcf2d"] }, "ww_animTiming/without-polar/01_w-p_r-r-r": { "refs": ["499a9a5"] }, "ww_animTiming/without-polar/02_w-p_c-r-c": { - "refs": ["66f8261"] + "refs": ["f3bc652"] }, "ww_animTiming/without-polar/05_w-p_r-c-r": { "refs": ["5099d2c"] }, "ww_animTiming/without-polar/06_w-p_c-c-c": { - "refs": ["6c8afb5"] + "refs": ["dd4525f"] }, "ww_animTiming/without-polar/09_w-p_r-a-r": { "refs": ["a5e456d"] }, "ww_animTiming/without-polar/10_w-p_c-a-c": { - "refs": ["4d0e7ec"] + "refs": ["8559aff"] }, "ww_animTiming/without-polar/13_w-p_r-l-r": { "refs": ["e4cfc98"] }, "ww_animTiming/without-polar/14_w-p_c-l-c": { - "refs": ["007d097"] + "refs": ["52bde70"] }, "ww_animTiming/without-polar_orientation/01_w-p_o_r-r-r": { "refs": ["8e04790"] }, "ww_animTiming/without-polar_orientation/02_w-p_o_c-r-c": { - "refs": ["9523c4a"] + "refs": ["7b2986f"] }, "ww_animTiming/without-polar_orientation/05_w-p_o_r-c-r": { "refs": ["0666d7e"] }, "ww_animTiming/without-polar_orientation/06_w-p_o_c-c-c": { - "refs": ["1cfbfc6"] + "refs": ["eef59b8"] }, "ww_animTiming/without-polar_orientation/09_w-p_o_r-a-r": { "refs": ["2713339"] }, "ww_animTiming/without-polar_orientation/10_w-p_o_c-a-c": { - "refs": ["4a09e73"] + "refs": ["1de8f6a"] }, "ww_animTiming/without-polar_orientation/13_w-p_o_r-l-r": { "refs": ["897320a"] }, "ww_animTiming/without-polar_orientation/14_w-p_o_c-l-c": { - "refs": ["eb38efe"] + "refs": ["fed258d"] }, "ww_animTiming/without/02_w-w_c-r-c": { - "refs": ["1f15b35"] + "refs": ["bb1272a"] }, "ww_animTiming_TESTS/descartes-polar/02_d-p_c-r-c": { "refs": ["e0bac92"] @@ -1652,100 +1652,100 @@ "refs": ["fe3d177"] }, "ww_animTiming_TESTS/without-descartes/02_w-d_c-r-c": { - "refs": ["8c37d1a"] + "refs": ["88b2b02"] }, "ww_animTiming_TESTS/without-descartes/05_w-d_r-c-r": { "refs": ["b6e3dd2"] }, "ww_animTiming_TESTS/without-descartes/06_w-d_c-c-c": { - "refs": ["82cd859"] + "refs": ["039ce24"] }, "ww_animTiming_TESTS/without-descartes/09_w-d_r-a-r": { "refs": ["a24ae0d"] }, "ww_animTiming_TESTS/without-descartes/10_w-d_c-a-c": { - "refs": ["a54f3a0"] + "refs": ["24e278a"] }, "ww_animTiming_TESTS/without-descartes/13_w-d_r-l-r": { "refs": ["8fdb834"] }, "ww_animTiming_TESTS/without-descartes/14_w-d_c-l-c": { - "refs": ["546475a"] + "refs": ["0670215"] }, "ww_animTiming_TESTS/without-descartes_orientation/01_w-d_o_r-r-r": { "refs": ["a452290"] }, "ww_animTiming_TESTS/without-descartes_orientation/02_w-d_o_c-r-c": { - "refs": ["7b57033"] + "refs": ["652c086"] }, "ww_animTiming_TESTS/without-descartes_orientation/05_w-d_o_r-c-r": { "refs": ["ea41a66"] }, "ww_animTiming_TESTS/without-descartes_orientation/06_w-d_o_c-c-c": { - "refs": ["bab1ac2"] + "refs": ["243bedb"] }, "ww_animTiming_TESTS/without-descartes_orientation/09_w-d_o_r-a-r": { "refs": ["fac2e0b"] }, "ww_animTiming_TESTS/without-descartes_orientation/10_w-d_o_c-a-c": { - "refs": ["a2df03d"] + "refs": ["3c280d5"] }, "ww_animTiming_TESTS/without-descartes_orientation/13_w-d_o_r-l-r": { "refs": ["e021402"] }, "ww_animTiming_TESTS/without-descartes_orientation/14_w-d_o_c-l-c": { - "refs": ["606f903"] + "refs": ["a10d7de"] }, "ww_animTiming_TESTS/without-polar/01_w-p_r-r-r": { "refs": ["76ab3e7"] }, "ww_animTiming_TESTS/without-polar/02_w-p_c-r-c": { - "refs": ["f4d7461"] + "refs": ["05857b4"] }, "ww_animTiming_TESTS/without-polar/05_w-p_r-c-r": { "refs": ["b723523"] }, "ww_animTiming_TESTS/without-polar/06_w-p_c-c-c": { - "refs": ["8a5d1d5"] + "refs": ["69926ec"] }, "ww_animTiming_TESTS/without-polar/09_w-p_r-a-r": { "refs": ["b5ed510"] }, "ww_animTiming_TESTS/without-polar/10_w-p_c-a-c": { - "refs": ["e919ff3"] + "refs": ["856de96"] }, "ww_animTiming_TESTS/without-polar/13_w-p_r-l-r": { "refs": ["e6e6e4f"] }, "ww_animTiming_TESTS/without-polar/14_w-p_c-l-c": { - "refs": ["c22a5bc"] + "refs": ["455681c"] }, "ww_animTiming_TESTS/without-polar_orientation/01_w-p_o_r-r-r": { "refs": ["3e27814"] }, "ww_animTiming_TESTS/without-polar_orientation/02_w-p_o_c-r-c": { - "refs": ["10b36c5"] + "refs": ["57b9160"] }, "ww_animTiming_TESTS/without-polar_orientation/05_w-p_o_r-c-r": { "refs": ["ba4a644"] }, "ww_animTiming_TESTS/without-polar_orientation/06_w-p_o_c-c-c": { - "refs": ["9d883a1"] + "refs": ["94cecb2"] }, "ww_animTiming_TESTS/without-polar_orientation/09_w-p_o_r-a-r": { "refs": ["091969c"] }, "ww_animTiming_TESTS/without-polar_orientation/10_w-p_o_c-a-c": { - "refs": ["7de0711"] + "refs": ["7250c68"] }, "ww_animTiming_TESTS/without-polar_orientation/13_w-p_o_r-l-r": { "refs": ["904ffb8"] }, "ww_animTiming_TESTS/without-polar_orientation/14_w-p_o_c-l-c": { - "refs": ["cfad9cb"] + "refs": ["7bdc5fe"] }, "ww_animTiming_TESTS/without/02_w-w_c-r-c": { - "refs": ["19f589f"] + "refs": ["13c14a0"] }, "ww_next_steps/next_steps/02_C_R": { "refs": ["222dbbc"] @@ -1766,7 +1766,7 @@ "refs": ["92eeaaa"] }, "ww_next_steps/next_steps/22_C_C": { - "refs": ["39f7271"] + "refs": ["c9947d0"] }, "ww_next_steps/next_steps/28_C_A": { "refs": ["b109540"] @@ -2048,7 +2048,7 @@ "refs": ["7cf90ec"] }, "ww_next_steps/next_steps_byOperations/wOld_animated/treemap_radial": { - "refs": ["d890730"] + "refs": ["325d40f"] }, "ww_next_steps/next_steps_byOperations/wOld_animated/zoom_area": { "refs": ["5a2fe2c"] @@ -2069,7 +2069,7 @@ "refs": ["47d699d"] }, "ww_next_steps/next_steps_byOperations/wREGIEKBOL/03_d-w_cir": { - "refs": ["54ab4da"] + "refs": ["cf554e8"] }, "ww_next_steps/next_steps_byOperations/wREGIEKBOL/03_d-w_lin": { "refs": ["45222ba"] @@ -2702,7 +2702,7 @@ "refs": ["0d6c930"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/circle/02_d-w_cir": { - "refs": ["f09f4ad"] + "refs": ["3eea2c3"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/circle/03_d-w_cir": { "refs": ["b42c296"] @@ -3140,7 +3140,7 @@ "refs": ["aa1461b"] }, "web_content/presets_config/treemap": { - "refs": ["ee86b8d"] + "refs": ["bec5c68"] }, "ww_samples_for_presets/without_coo_sys/601_W_R_heatmap_gradient": { "refs": ["2a0ba0d"] From 9365d5101c96a42d60fe3aa908de5e54c817cf2e Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 19 Jul 2024 11:15:30 +0200 Subject: [PATCH 3/6] clang tidy --- src/chart/generator/buckets.h | 2 +- src/chart/generator/plotbuilder.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chart/generator/buckets.h b/src/chart/generator/buckets.h index c6d9653b4..9d380ce4f 100644 --- a/src/chart/generator/buckets.h +++ b/src/chart/generator/buckets.h @@ -60,7 +60,7 @@ struct Buckets [[nodiscard]] const_iterator end() const { - const auto end{markers.data() + markers.size()}; + const auto *const end{markers.data() + markers.size()}; return {{end, end}, this}; } }; diff --git a/src/chart/generator/plotbuilder.cpp b/src/chart/generator/plotbuilder.cpp index 497a01d76..55225d6ca 100644 --- a/src/chart/generator/plotbuilder.cpp +++ b/src/chart/generator/plotbuilder.cpp @@ -131,7 +131,7 @@ PlotBuilder::sortedBuckets(const Buckets &buckets, bool main) const for (auto &&bucket : buckets) for (auto &&[marker, idx] : bucket) { - if (static_cast(!marker.enabled)) continue; + if (!marker.enabled) continue; auto it = std::ranges::lower_bound(sorted, idx.itemId, From 8a05e8f4845349854efa9b8d8f8cd3e1524c6b06 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Thu, 25 Jul 2024 18:05:34 +0200 Subject: [PATCH 4/6] review #554 --- src/apps/weblib/cinterface.cpp | 8 +++++--- src/apps/weblib/cinterface.h | 4 ++-- src/apps/weblib/interface.cpp | 6 +++--- src/apps/weblib/interface.h | 4 ++-- src/apps/weblib/ts-api/cvizzu.types.d.ts | 4 ++-- src/base/gfx/pathsampler.cpp | 6 +++--- src/base/gfx/pathsampler.h | 4 ++-- 7 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/apps/weblib/cinterface.cpp b/src/apps/weblib/cinterface.cpp index a02cc9e0f..527ec151f 100644 --- a/src/apps/weblib/cinterface.cpp +++ b/src/apps/weblib/cinterface.cpp @@ -193,10 +193,12 @@ void vizzu_render(APIHandles::Chart chart, } void vizzu_setLineResolution(APIHandles::Canvas canvas, - double dMax, - double hMax) + double distanceMax, + double curveHeightMax) { - Interface::getInstance().setLineResolution(canvas, dMax, hMax); + Interface::getInstance().setLineResolution(canvas, + distanceMax, + curveHeightMax); } const char *style_getList() { return Interface::getStyleList(); } diff --git a/src/apps/weblib/cinterface.h b/src/apps/weblib/cinterface.h index b6082196f..7c78e8abd 100644 --- a/src/apps/weblib/cinterface.h +++ b/src/apps/weblib/cinterface.h @@ -69,8 +69,8 @@ extern void vizzu_render(APIHandles::Chart chart, double width, double height); extern void vizzu_setLineResolution(APIHandles::Canvas canvas, - double dMax, - double hMax); + double distanceMax, + double curveHeightMax); extern const char *vizzu_errorMessage( APIHandles::Exception exceptionPtr, diff --git a/src/apps/weblib/interface.cpp b/src/apps/weblib/interface.cpp index a6fae6928..949b96d47 100644 --- a/src/apps/weblib/interface.cpp +++ b/src/apps/weblib/interface.cpp @@ -404,12 +404,12 @@ void Interface::render(ObjectRegistryHandle chart, } void Interface::setLineResolution(ObjectRegistryHandle canvas, - double dMax, - double hMax) + double distanceMax, + double curveHeightMax) { static_cast( objects.get(canvas)->getPainter()) - ->setPathSamplerOptions({dMax, hMax}); + ->setPathSamplerOptions({distanceMax, curveHeightMax}); } void Interface::pointerDown(ObjectRegistryHandle chart, diff --git a/src/apps/weblib/interface.h b/src/apps/weblib/interface.h index 350324baf..7101ac75f 100644 --- a/src/apps/weblib/interface.h +++ b/src/apps/weblib/interface.h @@ -56,8 +56,8 @@ class Interface double width, double height); void setLineResolution(ObjectRegistryHandle canvas, - double dMax, - double hMax); + double distanceMax, + double curveHeightMax); ObjectRegistryHandle storeAnim(ObjectRegistryHandle chart); void restoreAnim(ObjectRegistryHandle chart, diff --git a/src/apps/weblib/ts-api/cvizzu.types.d.ts b/src/apps/weblib/ts-api/cvizzu.types.d.ts index a0fceb311..f66e4a130 100644 --- a/src/apps/weblib/ts-api/cvizzu.types.d.ts +++ b/src/apps/weblib/ts-api/cvizzu.types.d.ts @@ -91,8 +91,8 @@ export interface CVizzu { _vizzu_pointerLeave(chart: CChartPtr, canvas: CCanvasPtr, pointerId: number): void _vizzu_wheel(chart: CChartPtr, canvas: CCanvasPtr, delta: number): void _vizzu_setLogging(enable: boolean): void - _vizzu_update(chart: CChartPtr, time: number): CString - _vizzu_setLineResolution(canvas: CCanvasPtr, dMax: number, hMax: number): void + _vizzu_update(chart: CChartPtr, time: number): void + _vizzu_setLineResolution(canvas: CCanvasPtr, distanceMax: number, curveHeightMax: number): void _vizzu_render(chart: CChartPtr, canvas: CCanvasPtr, width: number, height: number): void _vizzu_errorMessage(exceptionPtr: CException, typeinfo: CTypeInfo): CString diff --git a/src/base/gfx/pathsampler.cpp b/src/base/gfx/pathsampler.cpp index eb75c11c0..da07c940c 100644 --- a/src/base/gfx/pathsampler.cpp +++ b/src/base/gfx/pathsampler.cpp @@ -32,19 +32,19 @@ void PathSampler::path(const Geom::Point &pConv0, auto height = 2 * area / (pConv1 - pConv0).abs(); auto needMore = - height > options.hMax + height > options.curveHeightMax || ((pConv1 - pConv0).sqrAbs() < (pConv - pConv0).sqrAbs()) || ((pConv1 - pConv0).sqrAbs() < (pConv - pConv1).sqrAbs()); if (needMore) { - if ((pConv - pConv0).sqrAbs() > options.dMax) + if ((pConv - pConv0).sqrAbs() > options.distanceMax) path(pConv0, pConv, i0, i, recurseCnt + 1); } addPoint(pConv); if (needMore) { - if ((pConv - pConv1).sqrAbs() > options.dMax) + if ((pConv - pConv1).sqrAbs() > options.distanceMax) path(pConv, pConv1, i, i1, recurseCnt + 1); } } diff --git a/src/base/gfx/pathsampler.h b/src/base/gfx/pathsampler.h index fea0f6bee..fdcdadc01 100644 --- a/src/base/gfx/pathsampler.h +++ b/src/base/gfx/pathsampler.h @@ -13,8 +13,8 @@ class PathSampler public: struct Options { - double dMax; - double hMax; + double distanceMax; + double curveHeightMax; }; explicit PathSampler(const Options &options) : options(options) {} From fafd45e1db663964cf1ac0b117b926414f0524d7 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 26 Jul 2024 10:09:32 +0200 Subject: [PATCH 5/6] review #553 --- src/base/anim/interpolated.h | 31 ++++++++++++++----------------- src/base/math/floating.h | 36 +----------------------------------- 2 files changed, 15 insertions(+), 52 deletions(-) diff --git a/src/base/anim/interpolated.h b/src/base/anim/interpolated.h index 57cbde8d1..d254786ae 100644 --- a/src/base/anim/interpolated.h +++ b/src/base/anim/interpolated.h @@ -34,13 +34,12 @@ template class Weighted return value == other.value && weight == other.weight; } - template , - decltype(Math::Floating::less), - std::less>> bool operator<(const Weighted &other) const { - return Comparator{}(value, other.value); + using Less = std::conditional_t, + decltype(Math::Floating::less), + std::less>; + return Less{}(value, other.value); } [[nodiscard]] bool hasValue() const { return weight > 0.0; } @@ -224,28 +223,26 @@ template class Interpolated return res; } - template , - decltype(Math::Floating::less), - std::less>> - [[nodiscard]] T min() const + template [[nodiscard]] T min() const { + using Less = std::conditional_t, + decltype(Math::Floating::less), + std::less>; return !has_second ? this->values[0].value : std::min(this->values[0].value, this->values[1].value, - Cmp{}); + Less{}); } - template , - decltype(Math::Floating::less), - std::less>> - [[nodiscard]] T max() const + template [[nodiscard]] T max() const { + using Less = std::conditional_t, + decltype(Math::Floating::less), + std::less>; return !has_second ? this->values[0].value : std::max(this->values[0].value, this->values[1].value, - Cmp{}); + Less{}); } }; diff --git a/src/base/math/floating.h b/src/base/math/floating.h index 0768d3788..5da7a9c67 100644 --- a/src/base/math/floating.h +++ b/src/base/math/floating.h @@ -1,10 +1,8 @@ #ifndef MATH_FLOATING #define MATH_FLOATING -#include #include #include -#include #include namespace Math::Floating @@ -18,43 +16,11 @@ constexpr auto inline less = [](auto a, auto b) return std::is_lt(std::strong_order(a, b)); }; -template ::is_iec559 - &&std::numeric_limits::radix - == 2 - && std::numeric_limits::digits == 8 - ? sizeof(F) - : std::size_t{}> -constexpr auto inline can_be_used_as_short_check = - std::bool_constant{}; - -template -constexpr auto inline can_be_used_as_short_check = - std::integral_constant(F{0.0}) == std::uint32_t{} - && std::bit_cast(F{-0.0}) - + std::bit_cast(F{-0.0}) - == std::uint32_t{}>{}; - -template -constexpr auto inline can_be_used_as_short_check = - std::integral_constant(F{0.0}) == std::uint64_t{} - && std::bit_cast(F{-0.0}) - + std::bit_cast(F{-0.0}) - == std::uint64_t{}>{}; - constexpr auto inline is_zero = [](auto value) { using F = decltype(value); static_assert(std::floating_point); - if constexpr (auto v = can_be_used_as_short_check; v()) { - const auto val = - std::bit_cast(value); - return val + val == 0; - } - else if constexpr (std::numeric_limits::is_iec559) { + if constexpr (std::numeric_limits::is_iec559) { return value == F{}; } else { From 5486a6f5b60a83dad1327fa4bc85d27fdcc5c850 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 26 Jul 2024 11:12:24 +0200 Subject: [PATCH 6/6] Add detailed changelog --- CHANGELOG.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54578436c..66930010f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,26 @@ ### Fixed -- First marker alpha was different to other marker's alpha -- Make some transactions clearer. (rectangle-line first marker) +- Make some static charts clearer: + - Area/line charts different markers are not connected. + - Not existing or disabled markers have no effect. +- Make some transactions clearer: + - Rectangle - Line/Area first marker not fades, but shrinks. + - The first marker's alpha was different to the other marker's alpha. + - Marker connection rework: Introduce invalid, polar and self connection. + - Marker connection animation step necessity and timing fixes. + - Slipped animation steps (coordinateSystem - connection/orientation) fixes. + - Filtered markers (and their connections): + - Disappearing on hide animation phase. + - Appearing on show animation phase. ### Added -- New data handling implemented: Not generating big cube +- New data handling implemented: + - Only existing data generates the chart. + - Reduced memory usage. + - Bigger data capacity. +- Canvas line drawing detail can be set (on C++ side). ## [0.11.4] - 2024-07-09