From 3b4bdcf7fac9cbd1addf0c4ceda45dcbb23289fd Mon Sep 17 00:00:00 2001 From: David Vegh Date: Fri, 13 Sep 2024 10:14:35 +0200 Subject: [PATCH 01/25] Set version to 0.13.0 --- .../workflows/docker-vizzu-dev-desktop.yml | 2 +- .github/workflows/docker-vizzu-dev-wasm.yml | 2 +- CHANGELOG.md | 2 ++ CONTRIBUTING.md | 4 +-- src/chart/main/version.cpp | 2 +- tools/ci/gcp/cloudbuild/cloudbuild.yaml | 26 +++++++++---------- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docker-vizzu-dev-desktop.yml b/.github/workflows/docker-vizzu-dev-desktop.yml index 754b36495..d4dacbae1 100644 --- a/.github/workflows/docker-vizzu-dev-desktop.yml +++ b/.github/workflows/docker-vizzu-dev-desktop.yml @@ -24,6 +24,6 @@ jobs: - name: Build and Publish run: | IMAGE="vizzu-dev-desktop" - IMAGE_NAME="vizzu/$IMAGE:0.12" + IMAGE_NAME="vizzu/$IMAGE:0.13" docker build -t $IMAGE_NAME -f tools/ci/docker/$IMAGE . docker push $IMAGE_NAME diff --git a/.github/workflows/docker-vizzu-dev-wasm.yml b/.github/workflows/docker-vizzu-dev-wasm.yml index 5b5308e8f..b7af2a232 100644 --- a/.github/workflows/docker-vizzu-dev-wasm.yml +++ b/.github/workflows/docker-vizzu-dev-wasm.yml @@ -24,6 +24,6 @@ jobs: - name: Build and Publish run: | IMAGE="vizzu-dev-wasm" - IMAGE_NAME="vizzu/$IMAGE:0.12" + IMAGE_NAME="vizzu/$IMAGE:0.13" docker build -t $IMAGE_NAME -f tools/ci/docker/$IMAGE . docker push $IMAGE_NAME diff --git a/CHANGELOG.md b/CHANGELOG.md index 861a4cc17..80c5ec1c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +## [0.13.0] - 2024-09-13 + ### Fixed - Legend title bottomPadding extended. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6ee27633a..eb140dfaa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,7 +70,7 @@ docker run -i -t -v .:/workspace vizzu/vizzu-dev-desktop bash or you can use a specific version of the prebuilt image: ```sh -docker run -i -t -v .:/workspace vizzu/vizzu-dev-desktop:0.12 bash +docker run -i -t -v .:/workspace vizzu/vizzu-dev-desktop:0.13 bash ``` Run the following commands to build and run the `WASM` version's development @@ -84,7 +84,7 @@ docker run -i -t -v .:/workspace vizzu/vizzu-dev-wasm bash or you can use a specific version of the prebuilt image: ```sh -docker run -i -t -v .:/workspace vizzu/vizzu-dev-wasm:0.12 bash +docker run -i -t -v .:/workspace vizzu/vizzu-dev-wasm:0.13 bash ``` ### Building the project diff --git a/src/chart/main/version.cpp b/src/chart/main/version.cpp index de7c3492d..eb10f41f0 100644 --- a/src/chart/main/version.cpp +++ b/src/chart/main/version.cpp @@ -2,6 +2,6 @@ #include "base/app/version.h" -const App::Version Vizzu::Main::version(0, 12, 1); +const App::Version Vizzu::Main::version(0, 13, 0); const char *const Vizzu::Main::siteUrl = "https://vizzu.io/"; diff --git a/tools/ci/gcp/cloudbuild/cloudbuild.yaml b/tools/ci/gcp/cloudbuild/cloudbuild.yaml index bee298903..3434921b2 100644 --- a/tools/ci/gcp/cloudbuild/cloudbuild.yaml +++ b/tools/ci/gcp/cloudbuild/cloudbuild.yaml @@ -3,15 +3,15 @@ steps: id: pull_wasm waitFor: - '-' - args: ['pull', 'vizzu/vizzu-dev-wasm:0.12'] + args: ['pull', 'vizzu/vizzu-dev-wasm:0.13'] - name: 'gcr.io/cloud-builders/docker' id: pull_desktop waitFor: - '-' - args: ['pull', 'vizzu/vizzu-dev-desktop:0.12'] + args: ['pull', 'vizzu/vizzu-dev-desktop:0.13'] - - name: vizzu/vizzu-dev-wasm:0.12 + - name: vizzu/vizzu-dev-wasm:0.13 id: init waitFor: - pull_wasm @@ -24,7 +24,7 @@ steps: ./tools/ci/run/init-py.sh dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.12 + - name: vizzu/vizzu-dev-wasm:0.13 id: check_src waitFor: - init @@ -41,7 +41,7 @@ steps: npm run lint:src fi dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.12 + - name: vizzu/vizzu-dev-wasm:0.13 id: check_docs waitFor: - init @@ -58,7 +58,7 @@ steps: npm run lint:docs fi dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.12 + - name: vizzu/vizzu-dev-wasm:0.13 id: check_tools waitFor: - init @@ -77,7 +77,7 @@ steps: fi dir: /workspace - - name: vizzu/vizzu-dev-desktop:0.12 + - name: vizzu/vizzu-dev-desktop:0.13 id: build_desktop_clangformat waitFor: - pull_desktop @@ -97,7 +97,7 @@ steps: fi dir: /workspace - - name: vizzu/vizzu-dev-desktop:0.12 + - name: vizzu/vizzu-dev-desktop:0.13 id: build_desktop_clangtidy waitFor: - build_desktop_clangformat @@ -113,7 +113,7 @@ steps: ./tools/ci/run/pkg-build-desktop-clangtidy.sh fi dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.12 + - name: vizzu/vizzu-dev-wasm:0.13 id: build_wasm waitFor: - build_desktop_clangformat @@ -134,7 +134,7 @@ steps: ./tools/ci/run/pkg-build-js.sh dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.12 + - name: vizzu/vizzu-dev-wasm:0.13 id: lib_sha waitFor: - build_wasm @@ -157,7 +157,7 @@ steps: fi dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.12 + - name: vizzu/vizzu-dev-wasm:0.13 id: test waitFor: - lib_sha @@ -172,7 +172,7 @@ steps: fi dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.12 + - name: vizzu/vizzu-dev-wasm:0.13 id: docs waitFor: - test @@ -215,7 +215,7 @@ steps: - VIZZUHQ_GITHUB_USER - VIZZUHQ_GITHUB_EMAIL - - name: vizzu/vizzu-dev-wasm:0.12 + - name: vizzu/vizzu-dev-wasm:0.13 id: publish waitFor: - docs From aa2a8948e3ab9d14264addc596ca695ea0c75a8c Mon Sep 17 00:00:00 2001 From: David Vegh Date: Fri, 13 Sep 2024 10:49:21 +0200 Subject: [PATCH 02/25] fix tutorial --- docs/tutorial/chart_layout.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/tutorial/chart_layout.md b/docs/tutorial/chart_layout.md index 5aa4a3458..529f5ad04 100644 --- a/docs/tutorial/chart_layout.md +++ b/docs/tutorial/chart_layout.md @@ -23,9 +23,7 @@ are aligned. ```javascript chart.animate({ style: { - title: { - backgroundColor: '#A0A0A0' - }, + backgroundColor: '#A0A0A0', plot: { backgroundColor: '#D2D2D2' }, From 9d8ff12597732b691782c7566a7e98ee5b692591 Mon Sep 17 00:00:00 2001 From: David Vegh Date: Fri, 13 Sep 2024 10:58:35 +0200 Subject: [PATCH 03/25] fix tutorial 2 --- docs/tutorial/shorthands_store.js | 2 +- docs/tutorial/shorthands_store.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorial/shorthands_store.js b/docs/tutorial/shorthands_store.js index 3840a3fc2..d8e7514d5 100644 --- a/docs/tutorial/shorthands_store.js +++ b/docs/tutorial/shorthands_store.js @@ -140,7 +140,7 @@ Promise.all([dataLoaded, mdChartLoaded]).then((results) => { return chart.animate({ style: { 'plot.xAxis.label.fontSize': '150%', - 'title.backgroundColor': '#A0A0A0' + 'plot.backgroundColor': '#A0A0A0' } }) } diff --git a/docs/tutorial/shorthands_store.md b/docs/tutorial/shorthands_store.md index 4981e6bbd..300345b04 100644 --- a/docs/tutorial/shorthands_store.md +++ b/docs/tutorial/shorthands_store.md @@ -122,7 +122,7 @@ chart.animate({ style: { // plot: { xAxis: { label: { fontSize: '150%' } } } 'plot.xAxis.label.fontSize': '150%', - 'title.backgroundColor': '#A0A0A0' + 'plot.backgroundColor': '#A0A0A0' } }) ``` From c87327eec1f2ed5788e3ad910a590b2a025d2136 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Thu, 19 Sep 2024 17:46:00 +0200 Subject: [PATCH 04/25] - Implement drawStraightLine straightFactor (vertical polar lines are curves). - Remove duplicated circles on line-circle transition - Fix area - circle polar transition. - This commit broke the line-rectangle polar connection linearity. --- src/base/anim/interpolated.h | 8 +++ src/chart/generator/plotbuilder.cpp | 4 +- src/chart/main/style.h | 4 +- src/chart/rendering/colorbuilder.cpp | 2 +- src/chart/rendering/drawaxes.cpp | 7 +-- src/chart/rendering/drawmarkerinfo.cpp | 3 +- src/chart/rendering/markerrenderer.cpp | 56 +++++++++++-------- .../rendering/markers/abstractmarker.cpp | 3 +- .../rendering/markers/connectingmarker.cpp | 43 +++++++++++--- src/chart/rendering/painter/drawline.cpp | 37 ++++++++---- src/chart/rendering/painter/drawline.h | 11 +++- src/chart/rendering/painter/painter.cpp | 5 +- 12 files changed, 123 insertions(+), 60 deletions(-) diff --git a/src/base/anim/interpolated.h b/src/base/anim/interpolated.h index 339fa78cb..185bf3680 100644 --- a/src/base/anim/interpolated.h +++ b/src/base/anim/interpolated.h @@ -132,6 +132,14 @@ template class Interpolated return values[has_second && static_cast(index)]; } + [[nodiscard]] std::optional get_index( + const Type &type) const + { + if (values[0].value == type) return first; + if (has_second && values[1].value == type) return second; + return {}; + } + template // NOLINTNEXTLINE(cppcoreguidelines-missing-std-forward) [[nodiscard]] auto get(T &&) const = delete; diff --git a/src/chart/generator/plotbuilder.cpp b/src/chart/generator/plotbuilder.cpp index ea70e5ddd..e27cbb2a1 100644 --- a/src/chart/generator/plotbuilder.cpp +++ b/src/chart/generator/plotbuilder.cpp @@ -184,9 +184,7 @@ PlotBuilder::sortedBuckets(const Buckets &buckets, bool main) const void PlotBuilder::addSpecLayout(Buckets &buckets) { - auto geometry = plot->getOptions() - ->geometry.get_or_first(::Anim::first) - .value; + auto geometry = plot->getOptions()->geometry.values[0].value; if (auto &markers = plot->markers; isConnecting(geometry)) { Charts::TableChart::setupVector(markers, true); } diff --git a/src/chart/main/style.h b/src/chart/main/style.h index 24ef6cd79..a99bcfac8 100644 --- a/src/chart/main/style.h +++ b/src/chart/main/style.h @@ -106,9 +106,7 @@ struct Font [[nodiscard]] std::string calculatedFamily() const { if (fontFamily.has_value()) - if (auto &&ff = - fontFamily->get_or_first(::Anim::first).value; - !ff.empty()) + if (auto &&ff = fontFamily->values[0].value; !ff.empty()) return ff; if (fontParent) return fontParent->calculatedFamily(); diff --git a/src/chart/rendering/colorbuilder.cpp b/src/chart/rendering/colorbuilder.cpp index 3a726de60..446fc0f99 100644 --- a/src/chart/rendering/colorbuilder.cpp +++ b/src/chart/rendering/colorbuilder.cpp @@ -24,7 +24,7 @@ ColorBuilder::ColorBuilder(const LightnessRange &lightnessRange, Gfx::Color ColorBuilder::render( const Anim::Interpolated &colorBase) const { - if (!colorBase.get_or_first(::Anim::first).value.isDiscrete() + if (!colorBase.values[0].value.isDiscrete() && !colorBase.get_or_first(::Anim::second) .value.isDiscrete()) { auto pos = colorBase.combine( diff --git a/src/chart/rendering/drawaxes.cpp b/src/chart/rendering/drawaxes.cpp index 2f3935afb..d20e1c988 100644 --- a/src/chart/rendering/drawaxes.cpp +++ b/src/chart/rendering/drawaxes.cpp @@ -370,12 +370,11 @@ void DrawAxes::drawDimensionLabel(bool horizontal, draw(text.get_or_first(index), position.weight); if (!labelStyle.position->interpolates() && !text.interpolates()) - draw(text.get_or_first(::Anim::first)); + draw(text.values[0]); else if (labelStyle.position->interpolates()) - draw(text.get_or_first(::Anim::first), - position.weight); + draw(text.values[0], position.weight); else if (text.interpolates()) { - draw(text.get_or_first(::Anim::first)); + draw(text.values[0]); draw(text.get_or_first(::Anim::second)); } }); diff --git a/src/chart/rendering/drawmarkerinfo.cpp b/src/chart/rendering/drawmarkerinfo.cpp index 4b1193794..fa3d931d7 100644 --- a/src/chart/rendering/drawmarkerinfo.cpp +++ b/src/chart/rendering/drawmarkerinfo.cpp @@ -195,8 +195,7 @@ void DrawMarkerInfo::draw(Gfx::ICanvas &canvas, const Geom::Rect &boundary) const { for (const auto &info : plot->getMarkersInfo()) { - auto &&[cnt1, weight1] = - info.second.get_or_first(::Anim::first); + auto &&[cnt1, weight1] = info.second.values[0]; if (!info.second.interpolates() && cnt1) { MarkerDC dc(*this, canvas, boundary, cnt1); dc.draw(weight1); diff --git a/src/chart/rendering/markerrenderer.cpp b/src/chart/rendering/markerrenderer.cpp index eb5a36c6a..6467ef632 100644 --- a/src/chart/rendering/markerrenderer.cpp +++ b/src/chart/rendering/markerrenderer.cpp @@ -110,20 +110,31 @@ void MarkerRenderer::drawMarkers(Gfx::ICanvas &canvas, draw(canvas, painter, circle, 1, false); - blended.marker.prevMainMarker.visit( - [this, &blended, &canvas, &painter]( - ::Anim::InterpolateIndex index, - const auto &value) - { - draw(canvas, - painter, - ConnectingMarker{ctx(), - blended.marker, - index, - Gen::ShapeType::line}, - value.weight, - true); - }); + auto drawMarker = [this, &blended, &canvas, &painter]( + ::Anim::InterpolateIndex index, + const auto &value) + { + draw(canvas, + painter, + ConnectingMarker{ctx(), + blended.marker, + index, + Gen::ShapeType::line}, + value.weight, + true); + }; + + if (blended.marker.prevMainMarker.interpolates()) + blended.marker.prevMainMarker.visit(drawMarker); + else { + auto index = + getOptions() + .geometry.get_index(Gen::ShapeType::line) + .value(); + drawMarker(index, + blended.marker.prevMainMarker.get_or_first( + index)); + } } else { std::optional other; @@ -178,9 +189,7 @@ void MarkerRenderer::drawMarkers(Gfx::ICanvas &canvas, if (containsSingle) { auto lineIndex = isConnecting( - getOptions() - .geometry.get_or_first(::Anim::first) - .value) + getOptions().geometry.values[0].value) ? ::Anim::first : ::Anim::second; @@ -195,9 +204,8 @@ void MarkerRenderer::drawMarkers(Gfx::ICanvas &canvas, } else drawMarker(::Anim::first, - ::Anim::Weighted{blended.marker.prevMainMarker - .get_or_first(::Anim::first) - .value, + ::Anim::Weighted{ + blended.marker.prevMainMarker.values[0].value, sum_weight}); } } @@ -211,7 +219,7 @@ void MarkerRenderer::drawLabels(Gfx::ICanvas &canvas) const if (blended.marker.enabled == false) continue; drawLabel(canvas, blended, - axis.unit.get_or_first(::Anim::first).value, + axis.unit.values[0].value, keepMeasure, ::Anim::first); drawLabel(canvas, @@ -270,7 +278,11 @@ void MarkerRenderer::draw(Gfx::ICanvas &canvas, {Geom::Line(p0, p1), false}))) { painter.drawStraightLine(line, abstractMarker.lineWidth, - static_cast(abstractMarker.linear)); + getOptions().coordSystem.factor( + Gen::CoordSystem::cartesian) + == 1.0 + ? 1.0 + : static_cast(abstractMarker.linear)); renderedChart.emplace( Draw::Marker{abstractMarker.marker.enabled != false, diff --git a/src/chart/rendering/markers/abstractmarker.cpp b/src/chart/rendering/markers/abstractmarker.cpp index 090f5b69a..abd0c3c32 100644 --- a/src/chart/rendering/markers/abstractmarker.cpp +++ b/src/chart/rendering/markers/abstractmarker.cpp @@ -67,8 +67,7 @@ AbstractMarker AbstractMarker::createInterpolated( { const auto &options = ctx.getOptions(); - auto fromShapeType = - options.geometry.get_or_first(::Anim::first).value; + auto fromShapeType = options.geometry.values[0].value; auto fromMarker = create(ctx, marker, fromShapeType, lineIndex); diff --git a/src/chart/rendering/markers/connectingmarker.cpp b/src/chart/rendering/markers/connectingmarker.cpp index 225f0c92c..dc6f88924 100644 --- a/src/chart/rendering/markers/connectingmarker.cpp +++ b/src/chart/rendering/markers/connectingmarker.cpp @@ -29,6 +29,18 @@ ConnectingMarker::ConnectingMarker(const DrawingContext &ctx, auto isLine = type == Gen::ShapeType::line; auto isArea = type == Gen::ShapeType::area; + auto needConnection = + !ctx.getOptions().geometry.interpolates() + || isConnecting( + ctx.getOptions().geometry.get_or_first(lineIndex).value); + + auto otherNeedConnection = isConnecting( + ctx.getOptions() + .geometry + .get_or_first(lineIndex == ::Anim::first ? ::Anim::second + : ::Anim::first) + .value); + auto polar = ctx.getOptions().coordSystem.factor( Gen::CoordSystem::polar); auto horizontal = @@ -37,6 +49,14 @@ ConnectingMarker::ConnectingMarker(const DrawingContext &ctx, linear = !polar || horizontal; + auto &&isHorizontal = + ctx.getOptions().orientation.get_or_first(lineIndex).value + == Gen::Orientation::horizontal; + + auto &&isPolar = + ctx.getOptions().coordSystem.get_or_first(lineIndex).value + == Gen::CoordSystem::polar; + lineWidth[0] = lineWidth[1] = 0; const auto *prev = @@ -49,7 +69,8 @@ ConnectingMarker::ConnectingMarker(const DrawingContext &ctx, if (prev) { enabled = labelEnabled && prev->enabled; connected = Math::FuzzyBool::And(enabled, - marker.prevMainMarker.get_or_first(lineIndex).weight); + marker.prevMainMarker.get_or_first(lineIndex).weight, + needConnection); if (auto &&pc = marker.polarConnection.get_or_first(lineIndex); pc.value) { @@ -59,6 +80,9 @@ ConnectingMarker::ConnectingMarker(const DrawingContext &ctx, || Math::FuzzyBool::Or(polar, pc.weight).more(); connected = connected && newPolar && horizontal; enabled = enabled && newPolar && horizontal; + + if (polar != false && prev != &marker) + linear = linear || Math::FuzzyBool{isHorizontal}; } } else { @@ -92,13 +116,16 @@ ConnectingMarker::ConnectingMarker(const DrawingContext &ctx, auto prevSpacing = prev->spacing * prev->size / 2; auto prevPos = prev->position; - if (polar != false - && ctx.getOptions() - .orientation.get_or_first(lineIndex) - .value - == Gen::Orientation::horizontal - && prev != &marker && prevPos.x >= 1) { - prevPos.x -= 1; + if (polar != false && isHorizontal && prev != &marker) { + if (prevPos.x >= 1) + prevPos.x -= 1; + else if (needConnection && !otherNeedConnection + && isPolar + && marker.polarConnection + .get_or_first(lineIndex) + .value) { + prevPos.x -= 1; + } } points[3] = prevPos - prevSpacing; diff --git a/src/chart/rendering/painter/drawline.cpp b/src/chart/rendering/painter/drawline.cpp index 97c7dcf23..213c369d3 100644 --- a/src/chart/rendering/painter/drawline.cpp +++ b/src/chart/rendering/painter/drawline.cpp @@ -8,6 +8,7 @@ #include "base/math/interpolation.h" #include "coordinatesystem.h" +#include "drawpolygon.h" #include "pathsampler.h" namespace Vizzu::Draw @@ -22,15 +23,14 @@ DrawLine::DrawLine(const Geom::Line &line, DrawLine::DrawLine(const Geom::Line &line, std::array widths, - [[maybe_unused]] double straightFactor, - CoordinateSystem &coordSys, + const Options &options, Gfx::ICanvas &canvas) { - auto pBeg = coordSys.convert(line.begin); - auto pEnd = coordSys.convert(line.end); + auto pBeg = options.coordSys.convert(line.begin); + auto pEnd = options.coordSys.convert(line.end); - auto wBeg = widths[0] * coordSys.getRect().size.minSize(); - auto wEnd = widths[1] * coordSys.getRect().size.minSize(); + auto wBeg = widths[0] * options.coordSys.getRect().size.minSize(); + auto wEnd = widths[1] * options.coordSys.getRect().size.minSize(); const auto &[p0, p1, p2, p3] = Geom::ConvexQuad::Isosceles(pBeg, pEnd, wBeg * 2, wEnd * 2) @@ -41,12 +41,25 @@ DrawLine::DrawLine(const Geom::Line &line, if (pBeg != pEnd) { canvas.circle(Geom::Circle(pEnd, wEnd)); - canvas.beginPolygon(); - canvas.addPoint(p0); - canvas.addPoint(p1); - canvas.addPoint(p2); - canvas.addPoint(p3); - canvas.endPolygon(); + if (options.straightFactor == 1.0) { + canvas.beginPolygon(); + canvas.addPoint(p0); + canvas.addPoint(p1); + canvas.addPoint(p2); + canvas.addPoint(p3); + canvas.endPolygon(); + } + else { + DrawPolygon({options.coordSys.getOriginal(p0), + options.coordSys.getOriginal(p1), + options.coordSys.getOriginal(p2), + options.coordSys.getOriginal(p3)}, + {static_cast(options), + {.toCircleFactor = 0, + .straightFactor = options.straightFactor}}, + canvas, + false); + } } } diff --git a/src/chart/rendering/painter/drawline.h b/src/chart/rendering/painter/drawline.h index 3acaf5bcd..2d14c5379 100644 --- a/src/chart/rendering/painter/drawline.h +++ b/src/chart/rendering/painter/drawline.h @@ -14,14 +14,21 @@ namespace Vizzu::Draw class DrawLine { public: + struct LineOptions + { + double straightFactor; + }; + + struct Options : PathSampler::Options, LineOptions + {}; + DrawLine(const Geom::Line &line, const PathSampler::Options &options, Gfx::ICanvas &canvas); DrawLine(const Geom::Line &line, std::array widths, - double straightFactor, - CoordinateSystem &coordSys, + const Options &options, Gfx::ICanvas &canvas); private: diff --git a/src/chart/rendering/painter/painter.cpp b/src/chart/rendering/painter/painter.cpp index c08fe01fa..c3dd324c2 100644 --- a/src/chart/rendering/painter/painter.cpp +++ b/src/chart/rendering/painter/painter.cpp @@ -20,7 +20,10 @@ void Painter::drawStraightLine(const Geom::Line &line, std::array widths, double straightFactor) { - Draw::DrawLine(line, widths, straightFactor, system, getCanvas()); + DrawLine(line, + widths, + {{pathSamplerOptions, system}, {straightFactor}}, + getCanvas()); } void Painter::drawPolygon(const std::array &ps, From 21d3aa916712106c14e6693ff9e483dbf2a195f1 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 20 Sep 2024 10:44:52 +0200 Subject: [PATCH 05/25] - Fix line-rectangle polar connection linearity. - Remove all unwanted vertical line connection. --- src/chart/rendering/markers/abstractmarker.cpp | 3 +-- src/chart/rendering/markers/rectanglemarker.cpp | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/chart/rendering/markers/abstractmarker.cpp b/src/chart/rendering/markers/abstractmarker.cpp index abd0c3c32..3697f9f7c 100644 --- a/src/chart/rendering/markers/abstractmarker.cpp +++ b/src/chart/rendering/markers/abstractmarker.cpp @@ -83,8 +83,7 @@ AbstractMarker AbstractMarker::createInterpolated( aMarker.labelEnabled = fromMarker.labelEnabled + toMarker.labelEnabled; - auto sum = - static_cast(fromMarker.enabled + toMarker.enabled); + auto sum = static_cast(aMarker.enabled); using Math::interpolate; using Vizzu::Draw::interpolate; diff --git a/src/chart/rendering/markers/rectanglemarker.cpp b/src/chart/rendering/markers/rectanglemarker.cpp index c0866ed28..0c41fd46f 100644 --- a/src/chart/rendering/markers/rectanglemarker.cpp +++ b/src/chart/rendering/markers/rectanglemarker.cpp @@ -20,6 +20,11 @@ RectangleMarker::RectangleMarker(const Gen::Marker &marker, const Styles::Chart &style) : SingleDrawMarker(marker, options, Gen::ShapeType::rectangle) { + if (marker.polarConnection.contains(true)) { + enabled = enabled.more(); + labelEnabled = labelEnabled.more(); + } + linear = options.coordSystem.factor(Gen::CoordSystem::polar) == 0; border = Math::FuzzyBool(true); From fa713feed2ed4080a3b9a6bb1f11e2ace0fa5563 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 20 Sep 2024 15:52:21 +0200 Subject: [PATCH 06/25] Fix all polar connectivity interpolation (without enabled) --- .../rendering/markers/abstractmarker.cpp | 26 ++- .../rendering/markers/connectingmarker.cpp | 17 +- .../rendering/markers/rectanglemarker.cpp | 11 +- test/e2e/test_cases/test_cases.json | 192 +++++++++--------- test/e2e/tests/fixes.json | 4 +- 5 files changed, 128 insertions(+), 122 deletions(-) diff --git a/src/chart/rendering/markers/abstractmarker.cpp b/src/chart/rendering/markers/abstractmarker.cpp index 3697f9f7c..b4b929eaa 100644 --- a/src/chart/rendering/markers/abstractmarker.cpp +++ b/src/chart/rendering/markers/abstractmarker.cpp @@ -83,12 +83,25 @@ AbstractMarker AbstractMarker::createInterpolated( aMarker.labelEnabled = fromMarker.labelEnabled + toMarker.labelEnabled; - auto sum = static_cast(aMarker.enabled); + auto enableFactorBase = static_cast(toMarker.enabled); + auto labelEnableFactorBase = + static_cast(toMarker.labelEnabled); + auto enableSum = static_cast(aMarker.enabled); + auto labelEnableSum = static_cast(aMarker.labelEnabled); + + if (marker.polarConnection.interpolates()) { + auto firstWeight = options.geometry.values[0].weight; + auto secondWeight = options.geometry.values[1].weight; + enableSum = firstWeight + secondWeight; + enableFactorBase = secondWeight; + labelEnableSum = firstWeight + secondWeight; + labelEnableFactorBase = secondWeight; + } using Math::interpolate; using Vizzu::Draw::interpolate; - if (sum > 0.0) { - auto factor = static_cast(toMarker.enabled) / sum; + if (!Math::Floating::is_zero(enableSum)) { + auto factor = enableFactorBase / enableSum; aMarker.morphToCircle = interpolate(fromMarker.morphToCircle, toMarker.morphToCircle, factor); @@ -107,11 +120,8 @@ AbstractMarker AbstractMarker::createInterpolated( aMarker.center = interpolate(fromMarker.center, toMarker.center, factor); } - sum = static_cast( - fromMarker.labelEnabled + toMarker.labelEnabled); - if (sum > 0.0) { - auto factor = - static_cast(toMarker.labelEnabled) / sum; + if (!Math::Floating::is_zero(labelEnableSum)) { + auto factor = labelEnableFactorBase / labelEnableSum; aMarker.dataRect = interpolate(fromMarker.dataRect, toMarker.dataRect, factor); diff --git a/src/chart/rendering/markers/connectingmarker.cpp b/src/chart/rendering/markers/connectingmarker.cpp index dc6f88924..7eba36dff 100644 --- a/src/chart/rendering/markers/connectingmarker.cpp +++ b/src/chart/rendering/markers/connectingmarker.cpp @@ -53,10 +53,6 @@ ConnectingMarker::ConnectingMarker(const DrawingContext &ctx, ctx.getOptions().orientation.get_or_first(lineIndex).value == Gen::Orientation::horizontal; - auto &&isPolar = - ctx.getOptions().coordSystem.get_or_first(lineIndex).value - == Gen::CoordSystem::polar; - lineWidth[0] = lineWidth[1] = 0; const auto *prev = @@ -117,15 +113,12 @@ ConnectingMarker::ConnectingMarker(const DrawingContext &ctx, auto prevPos = prev->position; if (polar != false && isHorizontal && prev != &marker) { - if (prevPos.x >= 1) - prevPos.x -= 1; - else if (needConnection && !otherNeedConnection - && isPolar - && marker.polarConnection - .get_or_first(lineIndex) - .value) { + if (!otherNeedConnection + && marker.polarConnection.get_or_first(lineIndex) + .value) + prevPos.x = 0; + else if (prevPos.x >= 1) prevPos.x -= 1; - } } points[3] = prevPos - prevSpacing; diff --git a/src/chart/rendering/markers/rectanglemarker.cpp b/src/chart/rendering/markers/rectanglemarker.cpp index 0c41fd46f..32bc81a36 100644 --- a/src/chart/rendering/markers/rectanglemarker.cpp +++ b/src/chart/rendering/markers/rectanglemarker.cpp @@ -20,12 +20,15 @@ RectangleMarker::RectangleMarker(const Gen::Marker &marker, const Styles::Chart &style) : SingleDrawMarker(marker, options, Gen::ShapeType::rectangle) { - if (marker.polarConnection.contains(true)) { - enabled = enabled.more(); - labelEnabled = labelEnabled.more(); + linear = options.coordSystem.factor(Gen::CoordSystem::polar) == 0; + + if (marker.polarConnection.interpolates() + && options.geometry.contains(Gen::ShapeType::line)) { + linear = linear + || !marker.polarConnection.factor(true) + .less(); } - linear = options.coordSystem.factor(Gen::CoordSystem::polar) == 0; border = Math::FuzzyBool(true); auto spacing = Geom::Size{ diff --git a/test/e2e/test_cases/test_cases.json b/test/e2e/test_cases/test_cases.json index 1c472d1f8..3fdd55c32 100644 --- a/test/e2e/test_cases/test_cases.json +++ b/test/e2e/test_cases/test_cases.json @@ -1088,7 +1088,7 @@ "refs": ["9156aed"] }, "ww_animTiming/descartes-polar/04_d-p_l-r-l": { - "refs": ["a9f1acc"] + "refs": ["f366de0"] }, "ww_animTiming/descartes-polar/05_d-p_r-c-r": { "refs": ["589670f"] @@ -1103,7 +1103,7 @@ "refs": ["0f70691"] }, "ww_animTiming/descartes-polar/09_d-p_r-a-r": { - "refs": ["be8d104"] + "refs": ["55c186a"] }, "ww_animTiming/descartes-polar/10_d-p_c-a-c": { "refs": ["b0867e9"] @@ -1115,13 +1115,13 @@ "refs": ["fc14838"] }, "ww_animTiming/descartes-polar/13_d-p_r-l-r": { - "refs": ["15d5a73"] + "refs": ["e56c58b"] }, "ww_animTiming/descartes-polar/14_d-p_c-l-c": { - "refs": ["938812e"] + "refs": ["1cca9e2"] }, "ww_animTiming/descartes-polar/15_d-p_a-l-a": { - "refs": ["a8dfc58"] + "refs": ["4dc6044"] }, "ww_animTiming/descartes-polar/16_d-p_l-l-l": { "refs": ["06a95bb"] @@ -1136,7 +1136,7 @@ "refs": ["258dd84"] }, "ww_animTiming/descartes-polar_orient/04_d-p_o_l-r-l": { - "refs": ["566b94b"] + "refs": ["61edf3a"] }, "ww_animTiming/descartes-polar_orient/05_d-p_o_r-c-r": { "refs": ["2597bae"] @@ -1148,7 +1148,7 @@ "refs": ["fc1cb70"] }, "ww_animTiming/descartes-polar_orient/08_d-p_o_l-c-l": { - "refs": ["b9b8aa8"] + "refs": ["df5e0ee"] }, "ww_animTiming/descartes-polar_orient/09_d-p_o_r-a-r": { "refs": ["915f0e7"] @@ -1160,19 +1160,19 @@ "refs": ["ae824e3"] }, "ww_animTiming/descartes-polar_orient/12_d-p_o_l-a-l": { - "refs": ["6ec1184"] + "refs": ["a2ac0fe"] }, "ww_animTiming/descartes-polar_orient/13_d-p_o_r-l-r": { - "refs": ["134abc6"] + "refs": ["d4f67e3"] }, "ww_animTiming/descartes-polar_orient/14_d-p_o_c-l-c": { - "refs": ["8aa4954"] + "refs": ["a0d648f"] }, "ww_animTiming/descartes-polar_orient/15_d-p_o_a-l-a": { - "refs": ["7860be5"] + "refs": ["bc84b66"] }, "ww_animTiming/descartes-polar_orient/16_d-p_o_l-l-l": { - "refs": ["dd0a062"] + "refs": ["e148dab"] }, "ww_animTiming/descartes/02_d-d_c-r-c": { "refs": ["3faedf5"] @@ -1223,7 +1223,7 @@ "refs": ["6308997"] }, "ww_animTiming/descartes_orientation/08_d-d_o_l-c-l": { - "refs": ["22154e5"] + "refs": ["f28e3dc"] }, "ww_animTiming/descartes_orientation/09_d-d_o_r-a-r": { "refs": ["510468f"] @@ -1241,7 +1241,7 @@ "refs": ["41e0602"] }, "ww_animTiming/descartes_orientation/14_d-d_o_c-l-c": { - "refs": ["093a398"] + "refs": ["131af6e"] }, "ww_animTiming/descartes_orientation/15_d-d_o_a-l-a": { "refs": ["a80df8a"] @@ -1253,16 +1253,16 @@ "refs": ["9c83277"] }, "ww_animTiming/polar/03_p-p_a-r-a": { - "refs": ["edecec8"] + "refs": ["f9f0cc4"] }, "ww_animTiming/polar/04_p-p_l-r-l": { - "refs": ["ea99f2d"] + "refs": ["4febd5c"] }, "ww_animTiming/polar/07_p-p_a-c-a": { - "refs": ["1332f2d"] + "refs": ["fb0c733"] }, "ww_animTiming/polar/08_p-p_l-c-l": { - "refs": ["74b94a1"] + "refs": ["7bd7908"] }, "ww_animTiming/polar/12_p-p_l-a-l": { "refs": ["f251b2a"] @@ -1274,10 +1274,10 @@ "refs": ["0311aa9"] }, "ww_animTiming/polar_orientation/03_p-p_o_a-r-a": { - "refs": ["c59ccb0"] + "refs": ["f2ebf70"] }, "ww_animTiming/polar_orientation/04_p-p_o_l-r-l": { - "refs": ["68150ee"] + "refs": ["af91ba4"] }, "ww_animTiming/polar_orientation/05_p-p_o_r-c-r": { "refs": ["6ccc432"] @@ -1286,10 +1286,10 @@ "refs": ["e000171"] }, "ww_animTiming/polar_orientation/07_p-p_o_a-c-a": { - "refs": ["1c1ab44"] + "refs": ["64747e0"] }, "ww_animTiming/polar_orientation/08_p-p_o_l-c-l": { - "refs": ["6881493"] + "refs": ["e137c9a"] }, "ww_animTiming/polar_orientation/09_p-p_o_r-a-r": { "refs": ["e9c6c6c"] @@ -1301,19 +1301,19 @@ "refs": ["79d5d9c"] }, "ww_animTiming/polar_orientation/12_p-p_o_l-a-l": { - "refs": ["65dea13"] + "refs": ["75ba273"] }, "ww_animTiming/polar_orientation/13_p-p_o_r-l-r": { - "refs": ["11e70a1"] + "refs": ["a7e0ab4"] }, "ww_animTiming/polar_orientation/14_p-p_o_c-l-c": { - "refs": ["0617afd"] + "refs": ["123e4e2"] }, "ww_animTiming/polar_orientation/15_p-p_o_a-l-a": { - "refs": ["2976962"] + "refs": ["deba322"] }, "ww_animTiming/polar_orientation/16_p-p_o_l-l-l": { - "refs": ["4efd558"] + "refs": ["328ca4c"] }, "ww_animTiming/without-descartes/01_w-d_r-r-r": { "refs": ["b70c147"] @@ -1337,7 +1337,7 @@ "refs": ["9608ca6"] }, "ww_animTiming/without-descartes/14_w-d_c-l-c": { - "refs": ["4f2189e"] + "refs": ["212412e"] }, "ww_animTiming/without-descartes_orientation/01_w-d_o_r-r-r": { "refs": ["818d911"] @@ -1361,7 +1361,7 @@ "refs": ["fc11721"] }, "ww_animTiming/without-descartes_orientation/14_w-d_o_c-l-c": { - "refs": ["cd98518"] + "refs": ["601b0a2"] }, "ww_animTiming/without-polar/01_w-p_r-r-r": { "refs": ["a4a97ca"] @@ -1376,16 +1376,16 @@ "refs": ["24fbf25"] }, "ww_animTiming/without-polar/09_w-p_r-a-r": { - "refs": ["54c54c6"] + "refs": ["be1dede"] }, "ww_animTiming/without-polar/10_w-p_c-a-c": { "refs": ["dce51a8"] }, "ww_animTiming/without-polar/13_w-p_r-l-r": { - "refs": ["1bba49b"] + "refs": ["ef7ce14"] }, "ww_animTiming/without-polar/14_w-p_c-l-c": { - "refs": ["a0482ba"] + "refs": ["4c9fd28"] }, "ww_animTiming/without-polar_orientation/01_w-p_o_r-r-r": { "refs": ["0e2708d"] @@ -1406,10 +1406,10 @@ "refs": ["0cdf7ab"] }, "ww_animTiming/without-polar_orientation/13_w-p_o_r-l-r": { - "refs": ["c39ace0"] + "refs": ["8ace216"] }, "ww_animTiming/without-polar_orientation/14_w-p_o_c-l-c": { - "refs": ["9372907"] + "refs": ["310bca2"] }, "ww_animTiming/without/02_w-w_c-r-c": { "refs": ["5c53b35"] @@ -1421,7 +1421,7 @@ "refs": ["364be69"] }, "ww_animTiming_TESTS/descartes-polar/04_d-p_l-r-l": { - "refs": ["9cd0ddb"] + "refs": ["13bb8eb"] }, "ww_animTiming_TESTS/descartes-polar/05_d-p_r-c-r": { "refs": ["34d40d3"] @@ -1436,25 +1436,25 @@ "refs": ["2a00b7b"] }, "ww_animTiming_TESTS/descartes-polar/09_d-p_r-a-r": { - "refs": ["890e554"] + "refs": ["241717d"] }, "ww_animTiming_TESTS/descartes-polar/10_d-p_c-a-c": { - "refs": ["c0200ec"] + "refs": ["fa11489"] }, "ww_animTiming_TESTS/descartes-polar/11_d-p_a-a-a": { "refs": ["380d844"] }, "ww_animTiming_TESTS/descartes-polar/12_d-p_l-a-l": { - "refs": ["f6ea21b"] + "refs": ["5742097"] }, "ww_animTiming_TESTS/descartes-polar/13_d-p_r-l-r": { - "refs": ["a19f540"] + "refs": ["2301f92"] }, "ww_animTiming_TESTS/descartes-polar/14_d-p_c-l-c": { - "refs": ["54b0bb6"] + "refs": ["bd52f94"] }, "ww_animTiming_TESTS/descartes-polar/15_d-p_a-l-a": { - "refs": ["6ca7bba"] + "refs": ["f70d732"] }, "ww_animTiming_TESTS/descartes-polar/16_d-p_l-l-l": { "refs": ["9339eee"] @@ -1469,7 +1469,7 @@ "refs": ["7f347da"] }, "ww_animTiming_TESTS/descartes-polar_orient/04_d-p_o_l-r-l": { - "refs": ["9920465"] + "refs": ["83c2227"] }, "ww_animTiming_TESTS/descartes-polar_orient/05_d-p_o_r-c-r": { "refs": ["c75d9f8"] @@ -1481,7 +1481,7 @@ "refs": ["7814ee1"] }, "ww_animTiming_TESTS/descartes-polar_orient/08_d-p_o_l-c-l": { - "refs": ["51db7fd"] + "refs": ["d1af57c"] }, "ww_animTiming_TESTS/descartes-polar_orient/09_d-p_o_r-a-r": { "refs": ["8d5c8f9"] @@ -1493,19 +1493,19 @@ "refs": ["46e05ce"] }, "ww_animTiming_TESTS/descartes-polar_orient/12_d-p_o_l-a-l": { - "refs": ["1f73bbe"] + "refs": ["3431b25"] }, "ww_animTiming_TESTS/descartes-polar_orient/13_d-p_o_r-l-r": { - "refs": ["c924251"] + "refs": ["745bcc1"] }, "ww_animTiming_TESTS/descartes-polar_orient/14_d-p_o_c-l-c": { - "refs": ["cc465eb"] + "refs": ["3e965dc"] }, "ww_animTiming_TESTS/descartes-polar_orient/15_d-p_o_a-l-a": { - "refs": ["462e6f3"] + "refs": ["c4ebe6f"] }, "ww_animTiming_TESTS/descartes-polar_orient/16_d-p_o_l-l-l": { - "refs": ["a279a34"] + "refs": ["a8e7684"] }, "ww_animTiming_TESTS/descartes/02_d-d_c-r-c": { "refs": ["0d390b7"] @@ -1556,7 +1556,7 @@ "refs": ["090aa87"] }, "ww_animTiming_TESTS/descartes_orientation/08_d-d_o_l-c-l": { - "refs": ["bd18904"] + "refs": ["ed95ea2"] }, "ww_animTiming_TESTS/descartes_orientation/09_d-d_o_r-a-r": { "refs": ["0518e9e"] @@ -1574,7 +1574,7 @@ "refs": ["ae93a4f"] }, "ww_animTiming_TESTS/descartes_orientation/14_d-d_o_c-l-c": { - "refs": ["a3e30f3"] + "refs": ["38d92d3"] }, "ww_animTiming_TESTS/descartes_orientation/15_d-d_o_a-l-a": { "refs": ["c3059bf"] @@ -1586,16 +1586,16 @@ "refs": ["1626e70"] }, "ww_animTiming_TESTS/polar/03_p-p_a-r-a": { - "refs": ["e6c658e"] + "refs": ["27df4a5"] }, "ww_animTiming_TESTS/polar/04_p-p_l-r-l": { - "refs": ["664ad70"] + "refs": ["b963cec"] }, "ww_animTiming_TESTS/polar/07_p-p_a-c-a": { - "refs": ["e42b953"] + "refs": ["9f78e08"] }, "ww_animTiming_TESTS/polar/08_p-p_l-c-l": { - "refs": ["0f9e4ac"] + "refs": ["67cc9c2"] }, "ww_animTiming_TESTS/polar/12_p-p_l-a-l": { "refs": ["b6033de"] @@ -1607,10 +1607,10 @@ "refs": ["3e8e994"] }, "ww_animTiming_TESTS/polar_orientation/03_p-p_o_a-r-a": { - "refs": ["247e0e5"] + "refs": ["d256eb4"] }, "ww_animTiming_TESTS/polar_orientation/04_p-p_o_l-r-l": { - "refs": ["f2eba74"] + "refs": ["900f7e1"] }, "ww_animTiming_TESTS/polar_orientation/05_p-p_o_r-c-r": { "refs": ["eec1551"] @@ -1619,10 +1619,10 @@ "refs": ["0eec91f"] }, "ww_animTiming_TESTS/polar_orientation/07_p-p_o_a-c-a": { - "refs": ["ab5150c"] + "refs": ["f2e4e2e"] }, "ww_animTiming_TESTS/polar_orientation/08_p-p_o_l-c-l": { - "refs": ["6f00d13"] + "refs": ["597a4a4"] }, "ww_animTiming_TESTS/polar_orientation/09_p-p_o_r-a-r": { "refs": ["2d97baa"] @@ -1634,19 +1634,19 @@ "refs": ["403eab0"] }, "ww_animTiming_TESTS/polar_orientation/12_p-p_o_l-a-l": { - "refs": ["829d7e4"] + "refs": ["5f58693"] }, "ww_animTiming_TESTS/polar_orientation/13_p-p_o_r-l-r": { - "refs": ["af327d1"] + "refs": ["741f884"] }, "ww_animTiming_TESTS/polar_orientation/14_p-p_o_c-l-c": { - "refs": ["eb2f301"] + "refs": ["cec95dc"] }, "ww_animTiming_TESTS/polar_orientation/15_p-p_o_a-l-a": { - "refs": ["2e15bb0"] + "refs": ["69225cb"] }, "ww_animTiming_TESTS/polar_orientation/16_p-p_o_l-l-l": { - "refs": ["d5ec291"] + "refs": ["f8cc72f"] }, "ww_animTiming_TESTS/without-descartes/01_w-d_r-r-r": { "refs": ["2b4cdc2"] @@ -1670,7 +1670,7 @@ "refs": ["092323b"] }, "ww_animTiming_TESTS/without-descartes/14_w-d_c-l-c": { - "refs": ["bed8b83"] + "refs": ["34fea0f"] }, "ww_animTiming_TESTS/without-descartes_orientation/01_w-d_o_r-r-r": { "refs": ["c1a4e74"] @@ -1694,7 +1694,7 @@ "refs": ["315ed20"] }, "ww_animTiming_TESTS/without-descartes_orientation/14_w-d_o_c-l-c": { - "refs": ["d3bc324"] + "refs": ["0e02fb2"] }, "ww_animTiming_TESTS/without-polar/01_w-p_r-r-r": { "refs": ["bed35af"] @@ -1709,16 +1709,16 @@ "refs": ["8aa8969"] }, "ww_animTiming_TESTS/without-polar/09_w-p_r-a-r": { - "refs": ["46de857"] + "refs": ["98efc41"] }, "ww_animTiming_TESTS/without-polar/10_w-p_c-a-c": { - "refs": ["e3dec41"] + "refs": ["cf99b6e"] }, "ww_animTiming_TESTS/without-polar/13_w-p_r-l-r": { - "refs": ["798c705"] + "refs": ["8b692da"] }, "ww_animTiming_TESTS/without-polar/14_w-p_c-l-c": { - "refs": ["c57b2a2"] + "refs": ["922aeb8"] }, "ww_animTiming_TESTS/without-polar_orientation/01_w-p_o_r-r-r": { "refs": ["37efd09"] @@ -1739,10 +1739,10 @@ "refs": ["a7536ab"] }, "ww_animTiming_TESTS/without-polar_orientation/13_w-p_o_r-l-r": { - "refs": ["2533d59"] + "refs": ["4f0eeb2"] }, "ww_animTiming_TESTS/without-polar_orientation/14_w-p_o_c-l-c": { - "refs": ["5b1737a"] + "refs": ["7de03e7"] }, "ww_animTiming_TESTS/without/02_w-w_c-r-c": { "refs": ["b3c498f"] @@ -2072,7 +2072,7 @@ "refs": ["75afc74"] }, "ww_next_steps/next_steps_byOperations/wREGIEKBOL/03_d-w_lin": { - "refs": ["556ceb3"] + "refs": ["b187a26"] }, "ww_next_steps/next_steps_byOperations/wREGIEKBOL/03_d-w_rec": { "refs": ["957ce26"] @@ -2375,28 +2375,28 @@ "refs": ["d84f5c2"] }, "ww_noFade/wNoFade_Tests/2_des_pol-without/line/02_d-w_lin": { - "refs": ["2ddbad5"] + "refs": ["999cc6a"] }, "ww_noFade/wNoFade_Tests/2_des_pol-without/line/03_d-w_lin": { - "refs": ["3130ac9"] + "refs": ["32f51fc"] }, "ww_noFade/wNoFade_Tests/2_des_pol-without/line/04a_d-w_lin": { "refs": ["d09f657"] }, "ww_noFade/wNoFade_Tests/2_des_pol-without/line/04b_d-w_lin": { - "refs": ["f9234b3"] + "refs": ["c40e8be"] }, "ww_noFade/wNoFade_Tests/2_des_pol-without/line/05a_d-w_lin": { "refs": ["321d6d2"] }, "ww_noFade/wNoFade_Tests/2_des_pol-without/line/05b_d-w_lin": { - "refs": ["d2b1996"] + "refs": ["217a3a4"] }, "ww_noFade/wNoFade_Tests/2_des_pol-without/line/06a_d-w_lin": { "refs": ["5535e2d"] }, "ww_noFade/wNoFade_Tests/2_des_pol-without/line/06b_d-w_lin": { - "refs": ["1c38f5e"] + "refs": ["4bf0ef8"] }, "ww_noFade/wNoFade_Tests/2_des_pol-without/rectangle/02_d-w_rec": { "refs": ["8875cd9"] @@ -2447,7 +2447,7 @@ "refs": ["295cd11"] }, "ww_noFade/wNoFade_Tests/Marker_transition_problem/Bubble_Stacked_Bubble_to_Line": { - "refs": ["fc2c6f5"] + "refs": ["3a3e32f"] }, "ww_noFade/wNoFade_Tests/Marker_transition_problem/Treemap_Stacked_Treemap_to_Area": { "refs": ["81d6324"] @@ -2795,52 +2795,52 @@ "refs": ["2e541e8"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line/02_d-w_lin": { - "refs": ["35d4b53"] + "refs": ["af095b3"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line/03_d-w_lin": { - "refs": ["34888f4"] + "refs": ["63e68d9"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line/04a_d-w_lin": { - "refs": ["0b5cfca"] + "refs": ["96588fa"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line/04b_d-w_lin": { - "refs": ["fed989b"] + "refs": ["a875461"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line/05a_d-w_lin": { - "refs": ["d277215"] + "refs": ["6cc2044"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line/05b_d-w_lin": { - "refs": ["766e734"] + "refs": ["2eec790"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line/06a_d-w_lin": { - "refs": ["2b50812"] + "refs": ["1a01ad2"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line/06b_d-w_lin": { - "refs": ["dc085d3"] + "refs": ["4379d9e"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line_V1/02_d-w_lin_V1": { - "refs": ["59a5eca"] + "refs": ["baf283b"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line_V1/03_d-w_lin_V1": { - "refs": ["97049c3"] + "refs": ["bbbe97d"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line_V1/04a_d-w_lin_V1": { - "refs": ["a2f12e4"] + "refs": ["d54ded8"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line_V1/04b_d-w_lin_V1": { - "refs": ["943758b"] + "refs": ["301bf52"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line_V1/05a_d-w_lin_V1": { - "refs": ["9e34c31"] + "refs": ["782c89f"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line_V1/05b_d-w_lin_V1": { - "refs": ["85096d5"] + "refs": ["90a3827"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line_V1/06a_d-w_lin_V1": { - "refs": ["c46e80f"] + "refs": ["b2cba67"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line_V1/06b_d-w_lin_V1": { - "refs": ["567fac4"] + "refs": ["7765764"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/rectangle/02_d-w_rec": { "refs": ["e4716d2"] @@ -3188,13 +3188,13 @@ "refs": ["aa768ea"] }, "www_new_analytical_operations/operations/07_distribute/Bubble_Stacked_Bubble_to_Line": { - "refs": ["3880e09"] + "refs": ["8098657"] }, "www_new_analytical_operations/operations/07_distribute/Treemap_Stacked_Treemap_to_Area": { "refs": ["8d3ed9f"] }, "basic_animations/markers_morph/marker_trans_polar": { - "refs": ["e0b4253"] + "refs": ["3360eb3"] }, "web_content/cookbook/chart_types/exploded_pie_chart": { "refs": ["d1ed484"] diff --git a/test/e2e/tests/fixes.json b/test/e2e/tests/fixes.json index 2ddbf8e0c..21afca426 100644 --- a/test/e2e/tests/fixes.json +++ b/test/e2e/tests/fixes.json @@ -20,7 +20,7 @@ "refs": ["e4b8a2f"] }, "327": { - "refs": ["47ed740"] + "refs": ["6b87c18"] }, "333": { "refs": ["6a5536c"] @@ -32,7 +32,7 @@ "refs": ["1467e41"] }, "536": { - "refs": ["b0a2fc6"] + "refs": ["d360d53"] }, "540": { "refs": ["91b45be"] From 734927f232cdcd267ffd57c207f900d0b3d3f927 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 20 Sep 2024 22:14:03 +0200 Subject: [PATCH 07/25] Fix unique testcase --- CHANGELOG.md | 9 ++++ .../rendering/markers/connectingmarker.cpp | 11 ++++- src/chart/rendering/painter/drawline.cpp | 2 +- test/e2e/test_cases/test_cases.json | 44 +++++++++---------- test/e2e/tests/fixes.json | 4 +- 5 files changed, 43 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80c5ec1c2..71fceeaae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ ## [Unreleased] +### Fixed + +- From now vertical line connections are curved lines. +- Remove duplicated circles on line-circle transition. +- Fix area-circle polar connection transition. +- Fix line-rectangle polar connection linearity. +- Fix all polar connection interpolation (except fading). +- Remove unwanted line connections from line-circle + orientation changed anim. + ## [0.13.0] - 2024-09-13 ### Fixed diff --git a/src/chart/rendering/markers/connectingmarker.cpp b/src/chart/rendering/markers/connectingmarker.cpp index 7eba36dff..339055dbf 100644 --- a/src/chart/rendering/markers/connectingmarker.cpp +++ b/src/chart/rendering/markers/connectingmarker.cpp @@ -47,12 +47,19 @@ ConnectingMarker::ConnectingMarker(const DrawingContext &ctx, ctx.getOptions().orientation.factor( Gen::Orientation::horizontal); - linear = !polar || horizontal; - auto &&isHorizontal = ctx.getOptions().orientation.get_or_first(lineIndex).value == Gen::Orientation::horizontal; + linear = !polar || horizontal + || Math::FuzzyBool::And( + !isHorizontal + && ctx.plot->axises.at(Gen::Channel::Type::x) + .dimension.enabled, + ctx.plot->axises.at(Gen::Channel::Type::x) + .measure.enabled.factor(false), + !horizontal); + lineWidth[0] = lineWidth[1] = 0; const auto *prev = diff --git a/src/chart/rendering/painter/drawline.cpp b/src/chart/rendering/painter/drawline.cpp index 213c369d3..f78d1bf39 100644 --- a/src/chart/rendering/painter/drawline.cpp +++ b/src/chart/rendering/painter/drawline.cpp @@ -54,7 +54,7 @@ DrawLine::DrawLine(const Geom::Line &line, options.coordSys.getOriginal(p1), options.coordSys.getOriginal(p2), options.coordSys.getOriginal(p3)}, - {static_cast(options), + {static_cast(options), {.toCircleFactor = 0, .straightFactor = options.straightFactor}}, canvas, diff --git a/test/e2e/test_cases/test_cases.json b/test/e2e/test_cases/test_cases.json index 3fdd55c32..049f78fb4 100644 --- a/test/e2e/test_cases/test_cases.json +++ b/test/e2e/test_cases/test_cases.json @@ -185,13 +185,13 @@ "refs": ["dae308e"] }, "data_fault_and_formats/column_rectangle_less_disc": { - "refs": ["f2cce92"] + "refs": ["e84920a"] }, "data_fault_and_formats/column_rectangle_more_conti": { "refs": ["7ebabe4"] }, "data_fault_and_formats/column_rectangle_more_disc": { - "refs": ["87e3a08"] + "refs": ["2c2e36e"] }, "data_fault_and_formats/rectangle_data_cube": { "refs": ["e504add"] @@ -1151,28 +1151,28 @@ "refs": ["df5e0ee"] }, "ww_animTiming/descartes-polar_orient/09_d-p_o_r-a-r": { - "refs": ["915f0e7"] + "refs": ["4f241d6"] }, "ww_animTiming/descartes-polar_orient/10_d-p_o_c-a-c": { "refs": ["a2a9605"] }, "ww_animTiming/descartes-polar_orient/11_d-p_o_a-a-a": { - "refs": ["ae824e3"] + "refs": ["bf6abe1"] }, "ww_animTiming/descartes-polar_orient/12_d-p_o_l-a-l": { - "refs": ["a2ac0fe"] + "refs": ["fb238ec"] }, "ww_animTiming/descartes-polar_orient/13_d-p_o_r-l-r": { - "refs": ["d4f67e3"] + "refs": ["6a458bb"] }, "ww_animTiming/descartes-polar_orient/14_d-p_o_c-l-c": { - "refs": ["a0d648f"] + "refs": ["47b646a"] }, "ww_animTiming/descartes-polar_orient/15_d-p_o_a-l-a": { - "refs": ["bc84b66"] + "refs": ["2b08ef5"] }, "ww_animTiming/descartes-polar_orient/16_d-p_o_l-l-l": { - "refs": ["e148dab"] + "refs": ["1061105"] }, "ww_animTiming/descartes/02_d-d_c-r-c": { "refs": ["3faedf5"] @@ -1292,28 +1292,28 @@ "refs": ["e137c9a"] }, "ww_animTiming/polar_orientation/09_p-p_o_r-a-r": { - "refs": ["e9c6c6c"] + "refs": ["7356a12"] }, "ww_animTiming/polar_orientation/10_p-p_o_c-a-c": { - "refs": ["3112502"] + "refs": ["b770021"] }, "ww_animTiming/polar_orientation/11_p-p_o_a-a-a": { - "refs": ["79d5d9c"] + "refs": ["3432c12"] }, "ww_animTiming/polar_orientation/12_p-p_o_l-a-l": { "refs": ["75ba273"] }, "ww_animTiming/polar_orientation/13_p-p_o_r-l-r": { - "refs": ["a7e0ab4"] + "refs": ["6a73484"] }, "ww_animTiming/polar_orientation/14_p-p_o_c-l-c": { - "refs": ["123e4e2"] + "refs": ["eec715a"] }, "ww_animTiming/polar_orientation/15_p-p_o_a-l-a": { - "refs": ["deba322"] + "refs": ["064b0b7"] }, "ww_animTiming/polar_orientation/16_p-p_o_l-l-l": { - "refs": ["328ca4c"] + "refs": ["798b994"] }, "ww_animTiming/without-descartes/01_w-d_r-r-r": { "refs": ["b70c147"] @@ -1484,7 +1484,7 @@ "refs": ["d1af57c"] }, "ww_animTiming_TESTS/descartes-polar_orient/09_d-p_o_r-a-r": { - "refs": ["8d5c8f9"] + "refs": ["ed4d5c6"] }, "ww_animTiming_TESTS/descartes-polar_orient/10_d-p_o_c-a-c": { "refs": ["6c32188"] @@ -1496,7 +1496,7 @@ "refs": ["3431b25"] }, "ww_animTiming_TESTS/descartes-polar_orient/13_d-p_o_r-l-r": { - "refs": ["745bcc1"] + "refs": ["13ba67a"] }, "ww_animTiming_TESTS/descartes-polar_orient/14_d-p_o_c-l-c": { "refs": ["3e965dc"] @@ -1625,10 +1625,10 @@ "refs": ["597a4a4"] }, "ww_animTiming_TESTS/polar_orientation/09_p-p_o_r-a-r": { - "refs": ["2d97baa"] + "refs": ["0584e64"] }, "ww_animTiming_TESTS/polar_orientation/10_p-p_o_c-a-c": { - "refs": ["238fd07"] + "refs": ["d1f70e0"] }, "ww_animTiming_TESTS/polar_orientation/11_p-p_o_a-a-a": { "refs": ["403eab0"] @@ -1637,10 +1637,10 @@ "refs": ["5f58693"] }, "ww_animTiming_TESTS/polar_orientation/13_p-p_o_r-l-r": { - "refs": ["741f884"] + "refs": ["9ec60a5"] }, "ww_animTiming_TESTS/polar_orientation/14_p-p_o_c-l-c": { - "refs": ["cec95dc"] + "refs": ["4a68bd6"] }, "ww_animTiming_TESTS/polar_orientation/15_p-p_o_a-l-a": { "refs": ["69225cb"] diff --git a/test/e2e/tests/fixes.json b/test/e2e/tests/fixes.json index 21afca426..0eaaa25be 100644 --- a/test/e2e/tests/fixes.json +++ b/test/e2e/tests/fixes.json @@ -20,7 +20,7 @@ "refs": ["e4b8a2f"] }, "327": { - "refs": ["6b87c18"] + "refs": ["8eb7c5d"] }, "333": { "refs": ["6a5536c"] @@ -50,7 +50,7 @@ "refs": ["034ee91"] }, "47977099": { - "refs": ["2845349"] + "refs": ["1310b69"] }, "53913538": { "refs": ["90f6d38"] From c01fa6eeb077bff6e772a77deee6e857232da3ff Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 20 Sep 2024 22:49:50 +0200 Subject: [PATCH 08/25] Fix 3 always failing TCs --- test/e2e/test_cases/test_cases.json | 4 ++-- test/e2e/tests/fixes.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/test_cases/test_cases.json b/test/e2e/test_cases/test_cases.json index 049f78fb4..b7aad2257 100644 --- a/test/e2e/test_cases/test_cases.json +++ b/test/e2e/test_cases/test_cases.json @@ -185,13 +185,13 @@ "refs": ["dae308e"] }, "data_fault_and_formats/column_rectangle_less_disc": { - "refs": ["e84920a"] + "refs": ["f2cce92"] }, "data_fault_and_formats/column_rectangle_more_conti": { "refs": ["7ebabe4"] }, "data_fault_and_formats/column_rectangle_more_disc": { - "refs": ["2c2e36e"] + "refs": ["87e3a08"] }, "data_fault_and_formats/rectangle_data_cube": { "refs": ["e504add"] diff --git a/test/e2e/tests/fixes.json b/test/e2e/tests/fixes.json index 0eaaa25be..ad51ba411 100644 --- a/test/e2e/tests/fixes.json +++ b/test/e2e/tests/fixes.json @@ -50,7 +50,7 @@ "refs": ["034ee91"] }, "47977099": { - "refs": ["1310b69"] + "refs": ["2845349"] }, "53913538": { "refs": ["90f6d38"] From 81e99b4e86f8aa252b304e469b10716a2ecb5b5a Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 27 Sep 2024 15:37:26 +0200 Subject: [PATCH 09/25] Add axisId --- src/base/refl/auto_enum.h | 62 ++++++++++++------- src/chart/animator/planner.cpp | 8 +-- src/chart/generator/axis.h | 20 ++++-- src/chart/generator/guides.cpp | 22 ++++--- src/chart/generator/guides.h | 4 +- src/chart/generator/plotbuilder.cpp | 2 +- src/chart/main/style.h | 4 +- src/chart/options/advancedoptions.cpp | 0 src/chart/options/advancedoptions.h | 0 src/chart/options/channel.cpp | 12 +++- src/chart/options/channel.h | 25 +++++++- src/chart/options/options.cpp | 2 +- src/chart/options/options.h | 2 - src/chart/rendering/drawaxes.cpp | 34 +++++----- src/chart/rendering/drawaxes.h | 11 ++-- src/chart/rendering/drawguides.cpp | 2 +- src/chart/rendering/drawinterlacing.cpp | 12 ++-- .../rendering/markers/abstractmarker.cpp | 1 + .../rendering/markers/connectingmarker.cpp | 1 + 19 files changed, 140 insertions(+), 84 deletions(-) delete mode 100644 src/chart/options/advancedoptions.cpp delete mode 100644 src/chart/options/advancedoptions.h diff --git a/src/base/refl/auto_enum.h b/src/base/refl/auto_enum.h index 3ab0167b4..97c3ecc9f 100644 --- a/src/base/refl/auto_enum.h +++ b/src/base/refl/auto_enum.h @@ -34,8 +34,27 @@ namespace Detail { template using real_t = std::underlying_type_t; -template From, real_t To> - requires(!std::same_as>) +template +concept UniqueNames = requires { + static_cast(unique_enum_names(E{})); +}; + +template +concept UniqueRange = requires { + static_cast, real_t>>(unique_from_to(E{})); +}; + +template + requires(UniqueRange) +consteval std::pair, real_t> from_to() +{ + constexpr auto res = unique_from_to(E{}); + static_assert(res.first <= res.second, "Invalid range"); + return res; +} + +template From = {}, real_t To = {}> + requires(!UniqueRange && !std::same_as>) consteval std::pair, real_t> from_to() { if constexpr (std::is_signed_v> @@ -44,39 +63,40 @@ consteval std::pair, real_t> from_to() return from_to(); else if constexpr (!Name::name(To)>().empty()) return from_to(); - else - return {From, To}; + else { + static_assert(From != To, "Not found any enum string"); + return {From, To - 1}; + } } template - requires(std::same_as>) + requires(!UniqueRange && std::same_as>) consteval std::pair, real_t> from_to() { - return {false, false}; + constexpr auto has_false = + !Name::name(false)>().empty(); + constexpr auto has_true = + !Name::name(true)>().empty(); + static_assert(has_false || has_true, "Not found any enum string"); + return {!has_false, has_true}; } template requires(!std::same_as>) consteval real_t count() { - auto [from, to] = from_to(); - return static_cast>(to - from); + auto [from, to] = from_to(); + return static_cast>(to - from + 1); } template requires(std::same_as>) consteval int count() { - return Name::name(false)>().empty() - ? 0 - : 1 + !Name::name(true)>().empty(); + auto [from, to] = from_to(); + return to - from + 1; } -template -concept UniqueNames = requires { - static_cast(unique_enum_names(E{})); -}; - template , F... Ix> consteval auto whole_array(std::integer_sequence = {}) { @@ -87,7 +107,7 @@ consteval auto whole_array(std::integer_sequence = {}) return res; } else { - constexpr auto first = Detail::from_to().first; + constexpr auto first = Detail::from_to().first; std::array(Ix + first)>().size() + ... + (sizeof...(Ix) - 1))> @@ -109,7 +129,7 @@ constexpr std::array enum_name_holder = Detail::whole_array( Detail::count()>{}); template -constexpr std::array enum_name_holder = +constinit const std::array enum_name_holder = Detail::whole_array( std::make_integer_sequence()>{}); @@ -143,7 +163,7 @@ template constexpr std::array enum_names = get_names(); template Type enum_name(E name) { - constexpr auto first = Detail::from_to().first; + constexpr auto first = Detail::from_to().first; constexpr auto n = std::size(enum_names); if (static_cast( static_cast>(name) - first) @@ -159,7 +179,7 @@ Type enum_name(E name) template constexpr E get_enum(const std::string_view &data) { - constexpr auto first = Detail::from_to().first; + constexpr auto first = Detail::from_to().first; Detail::real_t ix{}; for (auto v : enum_names) { if (v == data) break; @@ -204,7 +224,7 @@ struct EnumArray : std::array)> template requires(std::is_enum_v && sizeof...(Args) == Detail::count() - && Detail::from_to().first == 0) + && Detail::from_to().first == 0) struct EnumVariant : std::variant { using base_variant = std::variant; diff --git a/src/chart/animator/planner.cpp b/src/chart/animator/planner.cpp index d3cdf4ea5..7efd5edef 100644 --- a/src/chart/animator/planner.cpp +++ b/src/chart/animator/planner.cpp @@ -425,8 +425,8 @@ bool Planner::needVertical() const != target->axises.at(Gen::ChannelId::y).measure || source->axises.at(Gen::ChannelId::y).dimension != target->axises.at(Gen::ChannelId::y).dimension - || source->guides.at(Gen::ChannelId::y) - != target->guides.at(Gen::ChannelId::y) + || source->guides.at(Gen::AxisId::y) + != target->guides.at(Gen::AxisId::y) || (isAnyLegend(Gen::ChannelId::size) && (source->axises.at(Gen::ChannelId::size).common != target->axises.at(Gen::ChannelId::size).common @@ -472,8 +472,8 @@ bool Planner::needHorizontal() const != target->axises.at(Gen::ChannelId::x).measure || source->axises.at(Gen::ChannelId::x).dimension != target->axises.at(Gen::ChannelId::x).dimension - || source->guides.at(Gen::ChannelId::x) - != target->guides.at(Gen::ChannelId::x) + || source->guides.at(Gen::AxisId::x) + != target->guides.at(Gen::AxisId::x) || source->anyAxisSet != target->anyAxisSet || source->keepAspectRatio != target->keepAspectRatio || (source->markerConnectionOrientation diff --git a/src/chart/generator/axis.h b/src/chart/generator/axis.h index 719334b72..1e07318c0 100644 --- a/src/chart/generator/axis.h +++ b/src/chart/generator/axis.h @@ -154,12 +154,22 @@ struct Axises return axises.at(channelType); } - [[nodiscard]] const Axis &other(ChannelId channelType) const + [[nodiscard]] const Axis &at(AxisId axisType) const { - switch (channelType) { - case ChannelId::x: return axises.at(ChannelId::y); - case ChannelId::y: return axises.at(ChannelId::x); - default: throw std::logic_error("not an axis channel"); + return axises.at(asChannel(axisType)); + } + + [[nodiscard]] Axis &at(AxisId axisType) + { + return axises.at(asChannel(axisType)); + } + + [[nodiscard]] const Axis &other(AxisId axisType) const + { + switch (axisType) { + default: + case AxisId::x: return at(AxisId::y); + case AxisId::y: return at(AxisId::x); } } diff --git a/src/chart/generator/guides.cpp b/src/chart/generator/guides.cpp index c86a52b2a..0d0657c40 100644 --- a/src/chart/generator/guides.cpp +++ b/src/chart/generator/guides.cpp @@ -1,7 +1,5 @@ #include "guides.h" -#include - #include "base/math/interpolation.h" #include "chart/options/align.h" #include "chart/options/channel.h" @@ -92,18 +90,22 @@ Guides::Guides(const Options &options) || (!yIsMeasure && !yOpt.isEmpty()))); } -GuidesByAxis &Guides::at(ChannelId channel) +GuidesByAxis &Guides::at(AxisId channel) { - if (channel == ChannelId::x) return x; - if (channel == ChannelId::y) return y; - throw std::out_of_range("guides index out of range"); + switch (channel) { + default: + case AxisId::x: return x; + case AxisId::y: return y; + } } -const GuidesByAxis &Guides::at(ChannelId channel) const +const GuidesByAxis &Guides::at(AxisId channel) const { - if (channel == ChannelId::x) return x; - if (channel == ChannelId::y) return y; - throw std::out_of_range("guides index out of range"); + switch (channel) { + default: + case AxisId::x: return x; + case AxisId::y: return y; + } } bool Guides::hasAnyGuides() const diff --git a/src/chart/generator/guides.h b/src/chart/generator/guides.h index 6f3738560..4c8fd731b 100644 --- a/src/chart/generator/guides.h +++ b/src/chart/generator/guides.h @@ -32,8 +32,8 @@ struct Guides GuidesByAxis y; explicit Guides(const Options &options); - [[nodiscard]] const GuidesByAxis &at(ChannelId channel) const; - GuidesByAxis &at(ChannelId channel); + [[nodiscard]] const GuidesByAxis &at(AxisId channel) const; + GuidesByAxis &at(AxisId channel); [[nodiscard]] bool hasAnyGuides() const; }; diff --git a/src/chart/generator/plotbuilder.cpp b/src/chart/generator/plotbuilder.cpp index ea70e5ddd..dd5e5c03c 100644 --- a/src/chart/generator/plotbuilder.cpp +++ b/src/chart/generator/plotbuilder.cpp @@ -433,7 +433,7 @@ void PlotBuilder::calcDimensionAxis(ChannelId type) if (scale.isMeasure() || !scale.hasDimension()) return; - auto &&isTypeAxis = isAxis(type); + auto &&isTypeAxis = asAxis(type).has_value(); if (auto merge = scale.labelLevel == 0; isTypeAxis) { for (const auto &marker : plot->markers) { if (!marker.enabled) continue; diff --git a/src/chart/main/style.h b/src/chart/main/style.h index 24ef6cd79..979b514dc 100644 --- a/src/chart/main/style.h +++ b/src/chart/main/style.h @@ -363,9 +363,9 @@ struct PlotParams struct Plot : Padding, Box, PlotParams { - [[nodiscard]] const Axis &getAxis(Gen::ChannelId id) const + [[nodiscard]] const Axis &getAxis(Gen::AxisId id) const { - return id == Gen::ChannelId::x ? xAxis : yAxis; + return id == Gen::AxisId::x ? xAxis : yAxis; } }; diff --git a/src/chart/options/advancedoptions.cpp b/src/chart/options/advancedoptions.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/chart/options/advancedoptions.h b/src/chart/options/advancedoptions.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/chart/options/channel.cpp b/src/chart/options/channel.cpp index 5b839ebec..a04859865 100644 --- a/src/chart/options/channel.cpp +++ b/src/chart/options/channel.cpp @@ -16,9 +16,17 @@ namespace Vizzu::Gen { -bool isAxis(ChannelId type) +std::optional asAxis(ChannelId type) { - return type == ChannelId::x || type == ChannelId::y; + return type == ChannelId::x || type == ChannelId::y + ? std::make_optional(static_cast( + static_cast(type))) + : std::nullopt; +} + +ChannelId asChannel(AxisId type) +{ + return static_cast(static_cast(type)); } Channel Channel::makeChannel(Type id) diff --git a/src/chart/options/channel.h b/src/chart/options/channel.h index 3cf7c59ba..eb8f5e573 100644 --- a/src/chart/options/channel.h +++ b/src/chart/options/channel.h @@ -22,6 +22,28 @@ enum class ChannelId : std::uint8_t { y, noop }; +using ChannelIdType = std::underlying_type_t; + +enum class AxisId : ChannelIdType { + x = static_cast(ChannelId::x), + y = static_cast(ChannelId::y) +}; + +consteval auto unique_from_to(AxisId) +{ + return std::pair{static_cast(AxisId::x), + static_cast(AxisId::y)}; +} + +static_assert(Refl::enum_names.size() == 2); +static_assert(std::ranges::all_of(Refl::enum_names, + [](std::string_view name) + { + return static_cast( + Refl::get_enum(name)) + == static_cast( + Refl::get_enum(name)); + })); class Channel { @@ -68,7 +90,8 @@ class Channel Base::AutoParam step{}; }; -bool isAxis(ChannelId type); +std::optional asAxis(ChannelId type); +ChannelId asChannel(AxisId type); } diff --git a/src/chart/options/options.cpp b/src/chart/options/options.cpp index f5827371a..620f184dc 100644 --- a/src/chart/options/options.cpp +++ b/src/chart/options/options.cpp @@ -66,7 +66,7 @@ const Channel *Options::subAxisOf(ChannelId id) const if (id == ChannelId::size && channels.anyAxisSet()) { return &channels.at(ChannelId::size); } - if (isAxis(id)) { + if (asAxis(id)) { if (channels.at(id).isDimension() && id == mainAxisType()) return &subAxis(); return &channels.at(ChannelId::size); diff --git a/src/chart/options/options.h b/src/chart/options/options.h index 8a4bc42b8..0e7710da8 100644 --- a/src/chart/options/options.h +++ b/src/chart/options/options.h @@ -26,8 +26,6 @@ namespace Vizzu::Gen class Options { - using ChannelIdType = std::underlying_type_t; - public: enum class LegendId : ChannelIdType { color = static_cast(ChannelId::color), diff --git a/src/chart/rendering/drawaxes.cpp b/src/chart/rendering/drawaxes.cpp index 2f3935afb..3cf781e03 100644 --- a/src/chart/rendering/drawaxes.cpp +++ b/src/chart/rendering/drawaxes.cpp @@ -31,8 +31,8 @@ void DrawAxes::drawGeometries() const { interlacing.drawGeometries(); - drawAxis(Gen::ChannelId::x); - drawAxis(Gen::ChannelId::y); + drawAxis(Gen::AxisId::x); + drawAxis(Gen::AxisId::y); DrawGuides{{ctx()}, canvas, painter}.draw(); } @@ -44,13 +44,13 @@ void DrawAxes::drawLabels() const drawDimensionLabels(true); drawDimensionLabels(false); - drawTitle(Gen::ChannelId::x); - drawTitle(Gen::ChannelId::y); + drawTitle(Gen::AxisId::x); + drawTitle(Gen::AxisId::y); } -Geom::Line DrawAxes::getAxis(Gen::ChannelId axisIndex) const +Geom::Line DrawAxes::getAxis(Gen::AxisId axisIndex) const { - auto horizontal = axisIndex == Gen::ChannelId::x; + auto horizontal = axisIndex == Gen::AxisId::x; auto offset = plot->axises.other(axisIndex).measure.origo(); @@ -63,10 +63,10 @@ Geom::Line DrawAxes::getAxis(Gen::ChannelId axisIndex) const return {}; } -void DrawAxes::drawAxis(Gen::ChannelId axisIndex) const +void DrawAxes::drawAxis(Gen::AxisId axisIndex) const { auto eventTarget = - Events::Targets::axis(axisIndex == Gen::ChannelId::x); + Events::Targets::axis(axisIndex == Gen::AxisId::x); auto lineBaseColor = *rootStyle.plot.getAxis(axisIndex).color; @@ -97,7 +97,7 @@ void DrawAxes::drawAxis(Gen::ChannelId axisIndex) const } } -Geom::Point DrawAxes::getTitleBasePos(Gen::ChannelId axisIndex, +Geom::Point DrawAxes::getTitleBasePos(Gen::AxisId axisIndex, ::Anim::InterpolateIndex index) const { typedef Styles::AxisTitle::Position Pos; @@ -125,12 +125,12 @@ Geom::Point DrawAxes::getTitleBasePos(Gen::ChannelId axisIndex, case VPos::begin: break; } - return axisIndex == Gen::ChannelId::x + return axisIndex == Gen::AxisId::x ? Geom::Point{parallel, orthogonal} : Geom::Point{orthogonal, parallel}; } -Geom::Point DrawAxes::getTitleOffset(Gen::ChannelId axisIndex, +Geom::Point DrawAxes::getTitleOffset(Gen::AxisId axisIndex, ::Anim::InterpolateIndex index, bool fades) const { @@ -166,12 +166,12 @@ Geom::Point DrawAxes::getTitleOffset(Gen::ChannelId axisIndex, fades ? calcVSide(titleStyle.vside->get_or_first(index).value) : titleStyle.vside->combine(calcVSide); - return axisIndex == Gen::ChannelId::x + return axisIndex == Gen::AxisId::x ? Geom::Point{parallel, -orthogonal} : Geom::Point{orthogonal, -parallel}; } -void DrawAxes::drawTitle(Gen::ChannelId axisIndex) const +void DrawAxes::drawTitle(Gen::AxisId axisIndex) const { const auto &titleString = plot->axises.at(axisIndex).common.title; @@ -252,7 +252,7 @@ void DrawAxes::drawTitle(Gen::ChannelId axisIndex) const titleStyle, *rootEvents.draw.plot.axis.title, Events::Targets::axisTitle(title.value, - axisIndex == Gen::ChannelId::x), + axisIndex == Gen::AxisId::x), {.colorTransform = Gfx::ColorTransform::Opacity(weight), .flip = upsideDown}); @@ -262,8 +262,7 @@ void DrawAxes::drawTitle(Gen::ChannelId axisIndex) const void DrawAxes::drawDimensionLabels(bool horizontal) const { - auto axisIndex = - horizontal ? Gen::ChannelId::x : Gen::ChannelId::y; + auto axisIndex = horizontal ? Gen::AxisId::x : Gen::AxisId::y; const auto &labelStyle = rootStyle.plot.getAxis(axisIndex).label; @@ -295,8 +294,7 @@ void DrawAxes::drawDimensionLabel(bool horizontal, enabled.labels); if (weight == 0) return; - auto axisIndex = - horizontal ? Gen::ChannelId::x : Gen::ChannelId::y; + auto axisIndex = horizontal ? Gen::AxisId::x : Gen::AxisId::y; const auto &labelStyle = rootStyle.plot.getAxis(axisIndex).label; auto drawLabel = OrientedLabel{{ctx()}}; diff --git a/src/chart/rendering/drawaxes.h b/src/chart/rendering/drawaxes.h index 588fa7135..8b84ffa7c 100644 --- a/src/chart/rendering/drawaxes.h +++ b/src/chart/rendering/drawaxes.h @@ -21,15 +21,14 @@ class DrawAxes : public DrawingContext DrawInterlacing interlacing; private: - [[nodiscard]] Geom::Line getAxis(Gen::ChannelId axisIndex) const; - [[nodiscard]] Geom::Point getTitleBasePos( - Gen::ChannelId axisIndex, + [[nodiscard]] Geom::Line getAxis(Gen::AxisId axisIndex) const; + [[nodiscard]] Geom::Point getTitleBasePos(Gen::AxisId axisIndex, ::Anim::InterpolateIndex index) const; - [[nodiscard]] Geom::Point getTitleOffset(Gen::ChannelId axisIndex, + [[nodiscard]] Geom::Point getTitleOffset(Gen::AxisId axisIndex, ::Anim::InterpolateIndex index, bool fades) const; - void drawAxis(Gen::ChannelId axisIndex) const; - void drawTitle(Gen::ChannelId axisIndex) const; + void drawAxis(Gen::AxisId axisIndex) const; + void drawTitle(Gen::AxisId axisIndex) const; void drawDimensionLabels(bool horizontal) const; void drawDimensionLabel(bool horizontal, const Geom::Point &origo, diff --git a/src/chart/rendering/drawguides.cpp b/src/chart/rendering/drawguides.cpp index bd272755a..a1be45a78 100644 --- a/src/chart/rendering/drawguides.cpp +++ b/src/chart/rendering/drawguides.cpp @@ -23,7 +23,7 @@ void DrawGuides::draw() void DrawGuides::draw(bool horizontal) { - auto axisId = horizontal ? Gen::ChannelId::x : Gen::ChannelId::y; + auto axisId = horizontal ? Gen::AxisId::x : Gen::AxisId::y; const auto &guideStyle = rootStyle.plot.getAxis(axisId).guides; diff --git a/src/chart/rendering/drawinterlacing.cpp b/src/chart/rendering/drawinterlacing.cpp index 99f92fe5b..75e110de4 100644 --- a/src/chart/rendering/drawinterlacing.cpp +++ b/src/chart/rendering/drawinterlacing.cpp @@ -39,8 +39,7 @@ void DrawInterlacing::drawTexts() const void DrawInterlacing::draw(bool horizontal, bool text) const { - auto axisIndex = - horizontal ? Gen::ChannelId::y : Gen::ChannelId::x; + auto axisIndex = horizontal ? Gen::AxisId::y : Gen::AxisId::x; auto interlacingColor = *rootStyle.plot.getAxis(axisIndex).interlacing.color; @@ -111,8 +110,7 @@ void DrawInterlacing::draw( const auto &enabled = horizontal ? plot->guides.y : plot->guides.x; - auto axisIndex = - horizontal ? Gen::ChannelId::y : Gen::ChannelId::x; + auto axisIndex = horizontal ? Gen::AxisId::y : Gen::AxisId::x; const auto &axisStyle = rootStyle.plot.getAxis(axisIndex); @@ -251,8 +249,7 @@ void DrawInterlacing::drawDataLabel( const ::Anim::String &unit, double alpha) const { - auto axisIndex = - horizontal ? Gen::ChannelId::y : Gen::ChannelId::x; + auto axisIndex = horizontal ? Gen::AxisId::y : Gen::AxisId::x; const auto &labelStyle = rootStyle.plot.getAxis(axisIndex).label; auto drawLabel = OrientedLabel{{ctx()}}; @@ -308,8 +305,7 @@ void DrawInterlacing::drawSticks(double tickIntensity, bool horizontal, const Geom::Point &tickPos) const { - auto axisIndex = - horizontal ? Gen::ChannelId::y : Gen::ChannelId::x; + auto axisIndex = horizontal ? Gen::AxisId::y : Gen::AxisId::x; const auto &axisStyle = rootStyle.plot.getAxis(axisIndex); const auto &tickStyle = axisStyle.ticks; diff --git a/src/chart/rendering/markers/abstractmarker.cpp b/src/chart/rendering/markers/abstractmarker.cpp index 090f5b69a..db391d73c 100644 --- a/src/chart/rendering/markers/abstractmarker.cpp +++ b/src/chart/rendering/markers/abstractmarker.cpp @@ -6,6 +6,7 @@ #include "base/anim/interpolated.h" #include "base/geom/line.h" +#include "base/math/floating.h" #include "chart/generator/marker.h" #include "chart/main/style.h" #include "chart/options/shapetype.h" diff --git a/src/chart/rendering/markers/connectingmarker.cpp b/src/chart/rendering/markers/connectingmarker.cpp index 225f0c92c..1f58ad88f 100644 --- a/src/chart/rendering/markers/connectingmarker.cpp +++ b/src/chart/rendering/markers/connectingmarker.cpp @@ -9,6 +9,7 @@ #include "base/math/fuzzybool.h" #include "chart/generator/marker.h" #include "chart/generator/plot.h" +#include "chart/options/channel.h" #include "chart/options/coordsystem.h" #include "chart/options/orientation.h" #include "chart/options/shapetype.h" From 4603ff35cc2d741f84316cbcc265ae0bb1fd7bfb Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 27 Sep 2024 16:11:04 +0200 Subject: [PATCH 10/25] Fix clang tidy --- src/base/refl/auto_enum.h | 4 +++- src/chart/rendering/markers/abstractmarker.cpp | 1 - src/chart/rendering/markers/connectingmarker.cpp | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/base/refl/auto_enum.h b/src/base/refl/auto_enum.h index 97c3ecc9f..0879151f8 100644 --- a/src/base/refl/auto_enum.h +++ b/src/base/refl/auto_enum.h @@ -53,7 +53,9 @@ consteval std::pair, real_t> from_to() return res; } -template From = {}, real_t To = {}> +template From = real_t{}, + real_t To = real_t{}> requires(!UniqueRange && !std::same_as>) consteval std::pair, real_t> from_to() { diff --git a/src/chart/rendering/markers/abstractmarker.cpp b/src/chart/rendering/markers/abstractmarker.cpp index db391d73c..090f5b69a 100644 --- a/src/chart/rendering/markers/abstractmarker.cpp +++ b/src/chart/rendering/markers/abstractmarker.cpp @@ -6,7 +6,6 @@ #include "base/anim/interpolated.h" #include "base/geom/line.h" -#include "base/math/floating.h" #include "chart/generator/marker.h" #include "chart/main/style.h" #include "chart/options/shapetype.h" diff --git a/src/chart/rendering/markers/connectingmarker.cpp b/src/chart/rendering/markers/connectingmarker.cpp index 1f58ad88f..225f0c92c 100644 --- a/src/chart/rendering/markers/connectingmarker.cpp +++ b/src/chart/rendering/markers/connectingmarker.cpp @@ -9,7 +9,6 @@ #include "base/math/fuzzybool.h" #include "chart/generator/marker.h" #include "chart/generator/plot.h" -#include "chart/options/channel.h" #include "chart/options/coordsystem.h" #include "chart/options/orientation.h" #include "chart/options/shapetype.h" From dd9dd9304ec984e8b11a4f6f4c024ebb7ef37609 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 27 Sep 2024 16:37:04 +0200 Subject: [PATCH 11/25] Fix channel.step --- src/chart/rendering/drawinterlacing.cpp | 3 +- test/e2e/tests/fixes.json | 3 + test/e2e/tests/fixes/252.mjs | 102 ++++++++++++++++++++++++ 3 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 test/e2e/tests/fixes/252.mjs diff --git a/src/chart/rendering/drawinterlacing.cpp b/src/chart/rendering/drawinterlacing.cpp index 99f92fe5b..a3a75a915 100644 --- a/src/chart/rendering/drawinterlacing.cpp +++ b/src/chart/rendering/drawinterlacing.cpp @@ -148,7 +148,8 @@ void DrawInterlacing::draw( auto iMin = axisBottom > 0 ? std::floor(-axis.origo() / (2 * stripWidth)) * 2 - : std::round(axis.range.getMin() - stepSize); + : std::round( + (axis.range.getMin() - stepSize) / stepSize); auto interlaceCount = 0U; const auto maxInterlaceCount = 1000U; diff --git a/test/e2e/tests/fixes.json b/test/e2e/tests/fixes.json index 2ddbf8e0c..ddc974f84 100644 --- a/test/e2e/tests/fixes.json +++ b/test/e2e/tests/fixes.json @@ -16,6 +16,9 @@ "163": { "refs": ["a82431f"] }, + "252": { + "refs": ["00f01d9"] + }, "320": { "refs": ["e4b8a2f"] }, diff --git a/test/e2e/tests/fixes/252.mjs b/test/e2e/tests/fixes/252.mjs new file mode 100644 index 000000000..41ec5d116 --- /dev/null +++ b/test/e2e/tests/fixes/252.mjs @@ -0,0 +1,102 @@ +function time(y, m, d) { + return y + (m - 1) / 12 + (d - 1) / 31 / 12 +} + +const testSteps = [ + (chart) => + chart.animate({ + data: { + series: [ + { + name: 'Name', + type: 'dimension', + values: [ + 'Apple Pie', + 'Banana Bread', + 'Cupcake', + 'Donut', + 'Eclair', + 'Froyo', + 'Gingerbread', + 'Honeycomb', + 'Ice Cream Sandwich', + 'Jelly Bean', + 'KitKat', + 'Lollipop', + 'Marshmallow', + 'Nougat', + 'Orea' + ] + }, + { + name: 'Time', + type: 'measure', + values: [ + time(2008, 9, 23), + time(2009, 4, 9), + time(2009, 4, 27), + time(2009, 9, 15), + time(2009, 10, 26), + time(2010, 4, 29), + time(2010, 12, 6), + time(2011, 2, 22), + time(2011, 10, 12), + time(2012, 4, 12), + time(2013, 10, 31), + time(2014, 11, 3), + time(2015, 10, 5), + time(2016, 8, 22), + time(2017, 8, 21) + ] + }, + { + name: 'Placement', + type: 'measure', + values: [1, -1, 1.5, -1.5, 1, -2, 1.5, -1.5, 1, -1, 1, -1, 1, -1, 1] + } + ] + } + }), + (chart) => + chart.animate({ + config: { + x: { + set: 'Time', + range: { min: 2008.5, max: 2018.1 }, + step: 1, + ticks: true, + title: null + }, + y: { + set: 'Placement', + interlacing: false, + labels: false, + markerGuides: false, + title: null + }, + label: 'Name', + geometry: 'circle' + }, + style: { + plot: { + xAxis: { + label: { + numberFormat: 'none', + position: 'axis' + } + }, + marker: { + guides: { + color: '#666666' + } + } + } + } + }), + (chart) => + chart.animate({ + x: { step: 2 } + }) +] + +export default testSteps From a686e2d6b8148726f5d6c1e8f115b06173795759 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 27 Sep 2024 16:40:07 +0200 Subject: [PATCH 12/25] Add changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80c5ec1c2..0aadb4b17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- Fix again measure axis labels when the axis range and step set too. + ## [0.13.0] - 2024-09-13 ### Fixed From 1cfe483fb34449a374fc3bcf25efe468aa034b28 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 27 Sep 2024 17:16:59 +0200 Subject: [PATCH 13/25] Fix drilldown 'fakely' splitted charts --- CHANGELOG.md | 4 ++++ src/chart/options/options.cpp | 18 ++++++++++----- src/chart/options/options.h | 12 ++++++++++ test/e2e/tests/fixes.json | 3 +++ test/e2e/tests/fixes/143.mjs | 42 +++++++++++++++++++++++++++++++++++ 5 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 test/e2e/tests/fixes/143.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index 80c5ec1c2..607da0ad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- Fix drilldown regroup strategy on fake-split charts. + ## [0.13.0] - 2024-09-13 ### Fixed diff --git a/src/chart/options/options.cpp b/src/chart/options/options.cpp index f5827371a..00561e85e 100644 --- a/src/chart/options/options.cpp +++ b/src/chart/options/options.cpp @@ -98,6 +98,13 @@ std::optional Options::secondaryStackType() const return std::nullopt; } +bool Options::isStacked() const +{ + auto dims = stackChannel().dimensions(); + dims.split_by(mainAxis().dimensions()); + return !dims.empty(); +} + Channels Options::shadowChannels() const { auto shadow = channels.shadow(); @@ -122,12 +129,11 @@ void Options::drilldownTo(const Options &other) { auto &stackChannel = this->stackChannel(); + if (this->split && !isStacked()) this->split = false; + for (auto &&dim : other.getChannels().getDimensions()) if (!getChannels().isSeriesUsed(dim)) stackChannel.addSeries(dim); - if (stackChannel.isDimension() - && geometry == ShapeType::rectangle) - this->align = Base::Align::Type::stretch; } void Options::intersection(const Options &other) @@ -192,9 +198,9 @@ bool Options::sameShadowAttribs(const Options &other) const return shape == shapeOther && coordSystem == other.coordSystem && angle == other.angle && orientation == other.orientation - && split == other.split && dataFilter == other.dataFilter - && align == other.align && sort == other.sort - && reverse == other.reverse; + && isSplit() == other.isSplit() + && dataFilter == other.dataFilter && align == other.align + && sort == other.sort && reverse == other.reverse; } bool Options::sameAttributes(const Options &other) const diff --git a/src/chart/options/options.h b/src/chart/options/options.h index 8a4bc42b8..acfba7bbc 100644 --- a/src/chart/options/options.h +++ b/src/chart/options/options.h @@ -109,6 +109,18 @@ class Options return channels.at(stackChannelType()); } + const Channel &stackChannel() const + { + return channels.at(stackChannelType()); + } + + [[nodiscard]] bool isStacked() const; + [[nodiscard]] bool isSplit() const + { + return split + && (stackChannelType() != subAxisType() || isStacked()); + } + Heading title{std::nullopt}; Heading subtitle{std::nullopt}; Heading caption{std::nullopt}; diff --git a/test/e2e/tests/fixes.json b/test/e2e/tests/fixes.json index 2ddbf8e0c..26352b2f8 100644 --- a/test/e2e/tests/fixes.json +++ b/test/e2e/tests/fixes.json @@ -7,6 +7,9 @@ "91": { "refs": ["1732a49"] }, + "143": { + "refs": ["4396a67"] + }, "144": { "refs": ["fde02e4"] }, diff --git a/test/e2e/tests/fixes/143.mjs b/test/e2e/tests/fixes/143.mjs new file mode 100644 index 000000000..db662e8ba --- /dev/null +++ b/test/e2e/tests/fixes/143.mjs @@ -0,0 +1,42 @@ +const testSteps = [ + (chart) => { + const data = { + series: [ + { + name: 'Colors', + type: 'dimension', + values: ['red', 'green', 'blue', 'red', 'green', 'blue', 'red', 'green', 'blue'] + }, + { + name: 'Letters', + type: 'dimension', + values: ['a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'c'] + }, + { + name: 'Val', + type: 'measure', + values: [3, 5, 4, 3 + 1, 5 + 1, 4 + 1, 3 + 2, 5 + 2, 4 + 2] + } + ] + } + + return chart.animate({ + data, + config: { + y: 'Colors', + x: 'Val' + } + }) + }, + (chart) => + chart.animate( + { + y: 'Val', + x: 'Letters', + split: true + }, + { regroupStrategy: 'drilldown' } + ) +] + +export default testSteps From 4aac8c0db1dc37f95fae1c120307b94da0086f34 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 27 Sep 2024 17:28:21 +0200 Subject: [PATCH 14/25] Fix size-stacked splitted chart intermediate splitness --- src/chart/options/options.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chart/options/options.cpp b/src/chart/options/options.cpp index 00561e85e..af48464e3 100644 --- a/src/chart/options/options.cpp +++ b/src/chart/options/options.cpp @@ -129,7 +129,7 @@ void Options::drilldownTo(const Options &other) { auto &stackChannel = this->stackChannel(); - if (this->split && !isStacked()) this->split = false; + if (this->split && !isSplit()) this->split = false; for (auto &&dim : other.getChannels().getDimensions()) if (!getChannels().isSeriesUsed(dim)) From 2478dbf5dca9b5f3f019810e13b5e49d2ca91f77 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 27 Sep 2024 17:30:04 +0200 Subject: [PATCH 15/25] clang-tidy --- src/chart/options/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chart/options/options.h b/src/chart/options/options.h index acfba7bbc..ebade4a01 100644 --- a/src/chart/options/options.h +++ b/src/chart/options/options.h @@ -109,7 +109,7 @@ class Options return channels.at(stackChannelType()); } - const Channel &stackChannel() const + [[nodiscard]] const Channel &stackChannel() const { return channels.at(stackChannelType()); } From 9a3fa054f43038bd5f0b9c9d134bc5279cbd80df Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Fri, 27 Sep 2024 17:45:33 +0200 Subject: [PATCH 16/25] Fix dark theme --- test/e2e/test_cases/test_cases.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/test_cases/test_cases.json b/test/e2e/test_cases/test_cases.json index 1c472d1f8..4aeb8aeac 100644 --- a/test/e2e/test_cases/test_cases.json +++ b/test/e2e/test_cases/test_cases.json @@ -3236,7 +3236,7 @@ "refs": ["bd104b0"] }, "web_content/cookbook/style/dark_theme": { - "refs": ["f7c42b8"] + "refs": ["b23128f"] }, "web_content/cookbook/style/highligh_markers": { "refs": ["54fc3d3"] From 8b622b3c0b46fb4d3bdfdf980f99275709a636ca Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Tue, 1 Oct 2024 16:12:50 +0200 Subject: [PATCH 17/25] More axisId --- src/chart/animator/planner.cpp | 14 +++++++------- src/chart/animator/planner.h | 2 +- src/chart/options/channel.cpp | 5 +++++ src/chart/options/channel.h | 3 +++ src/chart/options/channels.h | 11 ++++++++++- src/chart/options/options.cpp | 4 ++-- src/chart/options/options.h | 10 +++++----- 7 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/chart/animator/planner.cpp b/src/chart/animator/planner.cpp index 7efd5edef..9aa646b88 100644 --- a/src/chart/animator/planner.cpp +++ b/src/chart/animator/planner.cpp @@ -383,7 +383,7 @@ bool Planner::needColor() const } size_t Planner::dimensionCount(const Gen::Plot *plot, - Gen::ChannelId type) + Gen::AxisId type) { return plot->getOptions() ->getChannels() @@ -401,15 +401,15 @@ bool Planner::verticalBeforeHorizontal() const || !srcOpt->getChannels().anyAxisSet() || !trgOpt->getChannels().anyAxisSet()) { if (srcOpt->getChannels().anyAxisSet()) - return srcOpt->subAxisType() == Gen::ChannelId::y; + return srcOpt->subAxisType() == Gen::AxisId::y; if (trgOpt->getChannels().anyAxisSet()) - return trgOpt->mainAxisType() == Gen::ChannelId::y; + return trgOpt->mainAxisType() == Gen::AxisId::y; } - auto srcXcnt = dimensionCount(source, Gen::ChannelId::x); - auto srcYcnt = dimensionCount(source, Gen::ChannelId::y); - auto trgXcnt = dimensionCount(target, Gen::ChannelId::x); - auto trgYcnt = dimensionCount(target, Gen::ChannelId::y); + auto srcXcnt = dimensionCount(source, Gen::AxisId::x); + auto srcYcnt = dimensionCount(source, Gen::AxisId::y); + auto trgXcnt = dimensionCount(target, Gen::AxisId::x); + auto trgYcnt = dimensionCount(target, Gen::AxisId::y); if ((trgYcnt != srcYcnt) || (trgXcnt != srcXcnt)) { return (trgYcnt > srcYcnt) || (trgXcnt < srcXcnt); diff --git a/src/chart/animator/planner.h b/src/chart/animator/planner.h index b0cae3561..28bb4d61b 100644 --- a/src/chart/animator/planner.h +++ b/src/chart/animator/planner.h @@ -50,7 +50,7 @@ class Planner : public ::Anim::Group [[nodiscard]] bool positionMorphNeeded() const; [[nodiscard]] bool verticalBeforeHorizontal() const; static size_t dimensionCount(const Gen::Plot *plot, - Gen::ChannelId type); + Gen::AxisId type); [[nodiscard]] bool isAnyLegend(Gen::ChannelId type) const; diff --git a/src/chart/options/channel.cpp b/src/chart/options/channel.cpp index a04859865..46cc995ab 100644 --- a/src/chart/options/channel.cpp +++ b/src/chart/options/channel.cpp @@ -29,6 +29,11 @@ ChannelId asChannel(AxisId type) return static_cast(static_cast(type)); } +bool operator==(const AxisId &axis, const ChannelId &channel) +{ + return asChannel(axis) == channel; +} + Channel Channel::makeChannel(Type id) { switch (id) { diff --git a/src/chart/options/channel.h b/src/chart/options/channel.h index eb8f5e573..d4aa75b27 100644 --- a/src/chart/options/channel.h +++ b/src/chart/options/channel.h @@ -93,6 +93,9 @@ class Channel std::optional asAxis(ChannelId type); ChannelId asChannel(AxisId type); +[[nodiscard]] bool operator==(const AxisId &axis, + const ChannelId &channel); + } #endif diff --git a/src/chart/options/channels.h b/src/chart/options/channels.h index 57c929839..d5fa83a13 100644 --- a/src/chart/options/channels.h +++ b/src/chart/options/channels.h @@ -31,7 +31,16 @@ class Channels const std::span &channelTypes) const; [[nodiscard]] const Channel &at(const ChannelId &id) const; - Channel &at(const ChannelId &id); + [[nodiscard]] Channel &at(const ChannelId &id); + + [[nodiscard]] const Channel &at(const AxisId &id) const + { + return at(asChannel(id)); + } + [[nodiscard]] Channel &at(const AxisId &id) + { + return at(asChannel(id)); + } void removeSeries(const Data::SeriesIndex &index); diff --git a/src/chart/options/options.cpp b/src/chart/options/options.cpp index 546b8650c..c07bf5f14 100644 --- a/src/chart/options/options.cpp +++ b/src/chart/options/options.cpp @@ -81,7 +81,7 @@ ChannelId Options::stackChannelType() const if (channels.anyAxisSet()) { switch (geometry.get()) { case ShapeType::area: - case ShapeType::rectangle: return subAxisType(); + case ShapeType::rectangle: return asChannel(subAxisType()); default: case ShapeType::circle: case ShapeType::line: return ChannelId::size; @@ -93,7 +93,7 @@ ChannelId Options::stackChannelType() const std::optional Options::secondaryStackType() const { if (channels.anyAxisSet() && geometry == ShapeType::line) - return subAxisType(); + return asChannel(subAxisType()); return std::nullopt; } diff --git a/src/chart/options/options.h b/src/chart/options/options.h index 9982a07fe..abe910f01 100644 --- a/src/chart/options/options.h +++ b/src/chart/options/options.h @@ -66,9 +66,9 @@ class Options void reset(); - [[nodiscard]] ChannelId mainAxisType() const + [[nodiscard]] AxisId mainAxisType() const { - return isHorizontal() ? ChannelId::x : ChannelId::y; + return isHorizontal() ? AxisId::x : AxisId::y; } [[nodiscard]] bool isHorizontal() const @@ -79,9 +79,9 @@ class Options == Gen::Orientation::horizontal; } - [[nodiscard]] ChannelId subAxisType() const + [[nodiscard]] AxisId subAxisType() const { - return isHorizontal() ? ChannelId::y : ChannelId::x; + return isHorizontal() ? AxisId::y : AxisId::x; } [[nodiscard]] const Channel &mainAxis() const @@ -116,7 +116,7 @@ class Options [[nodiscard]] bool isSplit() const { return split - && (stackChannelType() != subAxisType() || isStacked()); + && (subAxisType() != stackChannelType() || isStacked()); } Heading title{std::nullopt}; From d13424e752da2789f755e823124dfc3d615eb751 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Tue, 1 Oct 2024 17:32:00 +0200 Subject: [PATCH 18/25] Fix center axis --- src/chart/generator/plotbuilder.cpp | 19 +++++++++++++------ .../circle/08_d-w_cir_2c.mjs | 1 - .../circle_V1/08_d-w_cir_V1_2c.mjs | 3 +-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/chart/generator/plotbuilder.cpp b/src/chart/generator/plotbuilder.cpp index 98c260901..2b1de357e 100644 --- a/src/chart/generator/plotbuilder.cpp +++ b/src/chart/generator/plotbuilder.cpp @@ -477,16 +477,23 @@ void PlotBuilder::addAlignment(const Buckets &subBuckets) const { if (static_cast(plot->getOptions()->split)) return; - if (std::signbit( - plot->axises.at(plot->getOptions()->subAxisType()) - .measure.range.getMin()) - || std::signbit( - plot->axises.at(plot->getOptions()->subAxisType()) - .measure.range.getMax())) + auto &subAxisRange = + plot->axises.at(plot->getOptions()->subAxisType()) + .measure.range; + if (std::signbit(subAxisRange.getMin()) + || std::signbit(subAxisRange.getMax())) return; if (plot->getOptions()->align == Base::Align::Type::none) return; + if (plot->getOptions()->align == Base::Align::Type::center) { + auto &&halfSize = subAxisRange.size() / 2.0; + if (!Math::Floating::is_zero(halfSize)) + subAxisRange = Math::Range::Raw( + subAxisRange.getMin() - halfSize, + subAxisRange.getMax() - halfSize); + } + auto &&vectical = !plot->getOptions()->isHorizontal(); const Base::Align align{plot->getOptions()->align, Math::Range(0.0, 1.0)}; diff --git a/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle/08_d-w_cir_2c.mjs b/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle/08_d-w_cir_2c.mjs index 14434d78c..5b18a57a7 100755 --- a/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle/08_d-w_cir_2c.mjs +++ b/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle/08_d-w_cir_2c.mjs @@ -43,7 +43,6 @@ const testSteps = [ size: { set: ['Year', 'Country'] } }, title: 'Stack Discs', - align: 'center' } }), diff --git a/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle_V1/08_d-w_cir_V1_2c.mjs b/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle_V1/08_d-w_cir_V1_2c.mjs index 431819f10..285d75774 100755 --- a/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle_V1/08_d-w_cir_V1_2c.mjs +++ b/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle_V1/08_d-w_cir_V1_2c.mjs @@ -42,8 +42,7 @@ const testSteps = [ noop: null, size: { set: ['Year', 'Country'] } }, - title: 'Stack Discs', - align: 'center' + title: 'Stack Discs' } }), From adc3ff81dc97872a34e24c8f6b3f7ff7eb938334 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Tue, 1 Oct 2024 17:34:22 +0200 Subject: [PATCH 19/25] polarConnection only in rect - line geom --- test/e2e/test_cases/test_cases.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/e2e/test_cases/test_cases.json b/test/e2e/test_cases/test_cases.json index 6a6c9b478..ddf197684 100644 --- a/test/e2e/test_cases/test_cases.json +++ b/test/e2e/test_cases/test_cases.json @@ -113,7 +113,7 @@ "refs": ["69db5d4"] }, "basic_animations/someOtherTests/merge_split_area_stream_2dis_1con": { - "refs": ["b1e67de"] + "refs": ["e331f23"] }, "basic_animations/someOtherTests/total_time_area_bar": { "refs": ["d908ab5"] @@ -506,7 +506,7 @@ "refs": ["08e742c"] }, "web_content/analytical_operations/compare/stream_stacked": { - "refs": ["8200148"] + "refs": ["845f43a"] }, "web_content/analytical_operations/compare/waterfall": { "refs": ["6c43732"] @@ -620,10 +620,10 @@ "refs": ["dcff220"] }, "web_content/analytical_operations/filter/stream_1": { - "refs": ["2710f78"] + "refs": ["4f827d6"] }, "web_content/analytical_operations/filter/stream_2": { - "refs": ["75719ee"] + "refs": ["9793ec1"] }, "web_content/analytical_operations/misc/donut_to_coxcomb": { "refs": ["76f76c6"] @@ -770,7 +770,7 @@ "refs": ["4e1f1e8"] }, "web_content/analytical_operations/sum/stream_stacked": { - "refs": ["9f4e0b4"] + "refs": ["9d0aeee"] }, "web_content/analytical_operations/sum/treemap": { "refs": ["d8a8b1c"] @@ -800,7 +800,7 @@ "refs": ["bf2c4b9"] }, "web_content_removed/animated/merge_split_area_stream_3dis_1con": { - "refs": ["305f396"] + "refs": ["c9c9175"] }, "web_content_removed/animated/merge_split_bar": { "refs": ["cf60e63"] @@ -923,10 +923,10 @@ "refs": ["4bebc47"] }, "web_content/presets/graph/stream": { - "refs": ["1be4e97"] + "refs": ["83e8724"] }, "web_content/presets/graph/stream_vertical": { - "refs": ["cc443a6"] + "refs": ["15b5f83"] }, "web_content/presets/graph/violin": { "refs": ["683b150"] @@ -1037,7 +1037,7 @@ "refs": ["c1a8d39"] }, "web_content/static/graph/stream_stacked": { - "refs": ["843591b"] + "refs": ["3ab1f0c"] }, "web_content/static/chart/waterfall": { "refs": ["2aeab23"] @@ -3065,10 +3065,10 @@ "refs": ["52a2da9"] }, "ww_samples_for_presets/cartesian_coo_sys/32_C_A_stream_graph": { - "refs": ["9d218d6"] + "refs": ["dd86c4e"] }, "ww_samples_for_presets/cartesian_coo_sys/33_C_A_stream_graph_vert": { - "refs": ["14a0296"] + "refs": ["bd982e1"] }, "ww_samples_for_presets/cartesian_coo_sys/34_C_A_violin_graph": { "refs": ["0cddf74"] From a6436791123a22f6cd129f3d11eb0b268a143053 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Tue, 1 Oct 2024 18:59:29 +0200 Subject: [PATCH 20/25] fix test format --- .../wNoFade_cases/2_des_pol-without/circle/08_d-w_cir_2c.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle/08_d-w_cir_2c.mjs b/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle/08_d-w_cir_2c.mjs index 5b18a57a7..9d2b2637e 100755 --- a/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle/08_d-w_cir_2c.mjs +++ b/test/e2e/test_cases/ww_noFade/wNoFade_cases/2_des_pol-without/circle/08_d-w_cir_2c.mjs @@ -42,7 +42,7 @@ const testSteps = [ noop: null, size: { set: ['Year', 'Country'] } }, - title: 'Stack Discs', + title: 'Stack Discs' } }), From 15852e819f64920b901ad5e12599b9638fac9dc2 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Tue, 1 Oct 2024 19:38:21 +0200 Subject: [PATCH 21/25] Fix 2 changed testcases --- test/e2e/test_cases/test_cases.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/test_cases/test_cases.json b/test/e2e/test_cases/test_cases.json index ddf197684..e48843225 100644 --- a/test/e2e/test_cases/test_cases.json +++ b/test/e2e/test_cases/test_cases.json @@ -2738,7 +2738,7 @@ "refs": ["9efe1ec"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/circle/08_d-w_cir_2c": { - "refs": ["ac16890"] + "refs": ["940bc39"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/circle_V1/03_d-w_cir_V1": { "refs": ["327ca16"] @@ -2765,7 +2765,7 @@ "refs": ["30f4ada"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/circle_V1/08_d-w_cir_V1_2c": { - "refs": ["1a81ceb"] + "refs": ["cc6ba1d"] }, "ww_noFade/wNoFade_cases/2_des_pol-without/line-rectangle/02_d-d_lin": { "refs": ["64361fc"] From c1b7514c915cba44152028015f2ad964f493d4f7 Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Tue, 1 Oct 2024 19:39:57 +0200 Subject: [PATCH 22/25] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f493fc473..f7b33819e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Fix line-rectangle polar connection linearity. - Fix all polar connection interpolation (except fading). - Remove unwanted line connections from line-circle + orientation changed anim. +- Move axis to the center on align: center charts. ## [0.13.0] - 2024-09-13 From f2a862e7b308e4942beb12c1272afbbe6c31517d Mon Sep 17 00:00:00 2001 From: Bela Schaum Date: Tue, 1 Oct 2024 19:43:44 +0200 Subject: [PATCH 23/25] 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 24/25] 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 From fae2e2d5b3babe374123a0d3ecaf211d47ab86e3 Mon Sep 17 00:00:00 2001 From: David Vegh Date: Thu, 3 Oct 2024 09:42:22 +0200 Subject: [PATCH 25/25] Set version to 0.14.0 --- .../workflows/docker-vizzu-dev-desktop.yml | 2 +- .github/workflows/docker-vizzu-dev-wasm.yml | 2 +- CHANGELOG.md | 2 ++ CONTRIBUTING.md | 4 +-- src/chart/main/version.cpp | 2 +- tools/ci/gcp/cloudbuild/cloudbuild.yaml | 26 +++++++++---------- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docker-vizzu-dev-desktop.yml b/.github/workflows/docker-vizzu-dev-desktop.yml index d4dacbae1..9ce4b1fb0 100644 --- a/.github/workflows/docker-vizzu-dev-desktop.yml +++ b/.github/workflows/docker-vizzu-dev-desktop.yml @@ -24,6 +24,6 @@ jobs: - name: Build and Publish run: | IMAGE="vizzu-dev-desktop" - IMAGE_NAME="vizzu/$IMAGE:0.13" + IMAGE_NAME="vizzu/$IMAGE:0.14" docker build -t $IMAGE_NAME -f tools/ci/docker/$IMAGE . docker push $IMAGE_NAME diff --git a/.github/workflows/docker-vizzu-dev-wasm.yml b/.github/workflows/docker-vizzu-dev-wasm.yml index b7af2a232..4c2941f98 100644 --- a/.github/workflows/docker-vizzu-dev-wasm.yml +++ b/.github/workflows/docker-vizzu-dev-wasm.yml @@ -24,6 +24,6 @@ jobs: - name: Build and Publish run: | IMAGE="vizzu-dev-wasm" - IMAGE_NAME="vizzu/$IMAGE:0.13" + IMAGE_NAME="vizzu/$IMAGE:0.14" docker build -t $IMAGE_NAME -f tools/ci/docker/$IMAGE . docker push $IMAGE_NAME diff --git a/CHANGELOG.md b/CHANGELOG.md index e174cf8c3..47445188a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +## [0.14.0] - 2024-10-03 + ### Fixed - Fix again measure axis labels when the axis range and step set too. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eb140dfaa..1275cb24f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,7 +70,7 @@ docker run -i -t -v .:/workspace vizzu/vizzu-dev-desktop bash or you can use a specific version of the prebuilt image: ```sh -docker run -i -t -v .:/workspace vizzu/vizzu-dev-desktop:0.13 bash +docker run -i -t -v .:/workspace vizzu/vizzu-dev-desktop:0.14 bash ``` Run the following commands to build and run the `WASM` version's development @@ -84,7 +84,7 @@ docker run -i -t -v .:/workspace vizzu/vizzu-dev-wasm bash or you can use a specific version of the prebuilt image: ```sh -docker run -i -t -v .:/workspace vizzu/vizzu-dev-wasm:0.13 bash +docker run -i -t -v .:/workspace vizzu/vizzu-dev-wasm:0.14 bash ``` ### Building the project diff --git a/src/chart/main/version.cpp b/src/chart/main/version.cpp index eb10f41f0..7760ef6f0 100644 --- a/src/chart/main/version.cpp +++ b/src/chart/main/version.cpp @@ -2,6 +2,6 @@ #include "base/app/version.h" -const App::Version Vizzu::Main::version(0, 13, 0); +const App::Version Vizzu::Main::version(0, 14, 0); const char *const Vizzu::Main::siteUrl = "https://vizzu.io/"; diff --git a/tools/ci/gcp/cloudbuild/cloudbuild.yaml b/tools/ci/gcp/cloudbuild/cloudbuild.yaml index 3434921b2..ab967791e 100644 --- a/tools/ci/gcp/cloudbuild/cloudbuild.yaml +++ b/tools/ci/gcp/cloudbuild/cloudbuild.yaml @@ -3,15 +3,15 @@ steps: id: pull_wasm waitFor: - '-' - args: ['pull', 'vizzu/vizzu-dev-wasm:0.13'] + args: ['pull', 'vizzu/vizzu-dev-wasm:0.14'] - name: 'gcr.io/cloud-builders/docker' id: pull_desktop waitFor: - '-' - args: ['pull', 'vizzu/vizzu-dev-desktop:0.13'] + args: ['pull', 'vizzu/vizzu-dev-desktop:0.14'] - - name: vizzu/vizzu-dev-wasm:0.13 + - name: vizzu/vizzu-dev-wasm:0.14 id: init waitFor: - pull_wasm @@ -24,7 +24,7 @@ steps: ./tools/ci/run/init-py.sh dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.13 + - name: vizzu/vizzu-dev-wasm:0.14 id: check_src waitFor: - init @@ -41,7 +41,7 @@ steps: npm run lint:src fi dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.13 + - name: vizzu/vizzu-dev-wasm:0.14 id: check_docs waitFor: - init @@ -58,7 +58,7 @@ steps: npm run lint:docs fi dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.13 + - name: vizzu/vizzu-dev-wasm:0.14 id: check_tools waitFor: - init @@ -77,7 +77,7 @@ steps: fi dir: /workspace - - name: vizzu/vizzu-dev-desktop:0.13 + - name: vizzu/vizzu-dev-desktop:0.14 id: build_desktop_clangformat waitFor: - pull_desktop @@ -97,7 +97,7 @@ steps: fi dir: /workspace - - name: vizzu/vizzu-dev-desktop:0.13 + - name: vizzu/vizzu-dev-desktop:0.14 id: build_desktop_clangtidy waitFor: - build_desktop_clangformat @@ -113,7 +113,7 @@ steps: ./tools/ci/run/pkg-build-desktop-clangtidy.sh fi dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.13 + - name: vizzu/vizzu-dev-wasm:0.14 id: build_wasm waitFor: - build_desktop_clangformat @@ -134,7 +134,7 @@ steps: ./tools/ci/run/pkg-build-js.sh dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.13 + - name: vizzu/vizzu-dev-wasm:0.14 id: lib_sha waitFor: - build_wasm @@ -157,7 +157,7 @@ steps: fi dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.13 + - name: vizzu/vizzu-dev-wasm:0.14 id: test waitFor: - lib_sha @@ -172,7 +172,7 @@ steps: fi dir: /workspace - - name: vizzu/vizzu-dev-wasm:0.13 + - name: vizzu/vizzu-dev-wasm:0.14 id: docs waitFor: - test @@ -215,7 +215,7 @@ steps: - VIZZUHQ_GITHUB_USER - VIZZUHQ_GITHUB_EMAIL - - name: vizzu/vizzu-dev-wasm:0.13 + - name: vizzu/vizzu-dev-wasm:0.14 id: publish waitFor: - docs