Generating a bubble chart can sometimes result in a display issue.
In very rare cases, execution reaches
|
// TODO bubblechart generation failed. It need a fix. |
The unit tests below do not directly hit this code path, but they help illustrate how execution can reach it.
#include <cmath>
#include <iostream>
#include <sstream>
#include <vector>
#include "../util/test.h"
#include "chart/speclayout/bubblechart.h"
using test::operator""_suite;
using test::check;
const static auto tests =
"Chart::Bubblechart"_suite
| "short fail" |
[]
{
std::vector<double> areas;
areas.insert(areas.end(), 7, 1.0);
areas.insert(areas.end(), 34, 0.1);
auto&& bc{Vizzu::Charts::BubbleChart(areas)};
auto&& nextCirc = bc.markers.at(8).circle();
auto&& lastCirc = bc.markers.back().circle();
check->* (nextCirc.center - lastCirc.center).abs() >= nextCirc.radius + lastCirc.radius;
}
| "long fail" |
[]
{
std::vector<double> areas;
areas.insert(areas.end(), 6, 1.0);
areas.insert(areas.end(), 1, 0.64);
areas.insert(areas.end(), 124, 0.008);
auto&& bc{Vizzu::Charts::BubbleChart(areas)};
auto&& nextCirc = bc.markers.at(12).circle();
auto&& lastCirc = bc.markers.back().circle();
check->* (nextCirc.center - lastCirc.center).abs() >= nextCirc.radius + lastCirc.radius;
};
Generating a bubble chart can sometimes result in a display issue.
In very rare cases, execution reaches
vizzu-lib/src/chart/speclayout/bubblechart.cpp
Line 86 in 78ccbd5
The unit tests below do not directly hit this code path, but they help illustrate how execution can reach it.