Skip to content

Commit 7c69697

Browse files
authored
Merge pull request #555 from vizzuhq/review
#549 review changes
2 parents 9405570 + 5486a6f commit 7c69697

File tree

23 files changed

+369
-303
lines changed

23 files changed

+369
-303
lines changed

CHANGELOG.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,26 @@
44

55
### Fixed
66

7-
- First marker alpha was different to other marker's alpha
8-
- Make some transactions clearer. (rectangle-line first marker)
7+
- Make some static charts clearer:
8+
- Area/line charts different markers are not connected.
9+
- Not existing or disabled markers have no effect.
10+
- Make some transactions clearer:
11+
- Rectangle - Line/Area first marker not fades, but shrinks.
12+
- The first marker's alpha was different to the other marker's alpha.
13+
- Marker connection rework: Introduce invalid, polar and self connection.
14+
- Marker connection animation step necessity and timing fixes.
15+
- Slipped animation steps (coordinateSystem - connection/orientation) fixes.
16+
- Filtered markers (and their connections):
17+
- Disappearing on hide animation phase.
18+
- Appearing on show animation phase.
919

1020
### Added
1121

12-
- New data handling implemented: Not generating big cube
22+
- New data handling implemented:
23+
- Only existing data generates the chart.
24+
- Reduced memory usage.
25+
- Bigger data capacity.
26+
- Canvas line drawing detail can be set (on C++ side).
1327

1428
## [0.11.4] - 2024-07-09
1529

src/apps/weblib/cinterface.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,12 @@ void vizzu_render(APIHandles::Chart chart,
193193
}
194194

195195
void vizzu_setLineResolution(APIHandles::Canvas canvas,
196-
double dMax,
197-
double hMax)
196+
double distanceMax,
197+
double curveHeightMax)
198198
{
199-
Interface::getInstance().setLineResolution(canvas, dMax, hMax);
199+
Interface::getInstance().setLineResolution(canvas,
200+
distanceMax,
201+
curveHeightMax);
200202
}
201203

202204
const char *style_getList() { return Interface::getStyleList(); }

src/apps/weblib/cinterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ extern void vizzu_render(APIHandles::Chart chart,
6969
double width,
7070
double height);
7171
extern void vizzu_setLineResolution(APIHandles::Canvas canvas,
72-
double dMax,
73-
double hMax);
72+
double distanceMax,
73+
double curveHeightMax);
7474

7575
extern const char *vizzu_errorMessage(
7676
APIHandles::Exception exceptionPtr,

src/apps/weblib/interface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,12 @@ void Interface::render(ObjectRegistryHandle chart,
404404
}
405405

406406
void Interface::setLineResolution(ObjectRegistryHandle canvas,
407-
double dMax,
408-
double hMax)
407+
double distanceMax,
408+
double curveHeightMax)
409409
{
410410
static_cast<Draw::Painter *>(
411411
objects.get<Gfx::ICanvas>(canvas)->getPainter())
412-
->setPathSamplerOptions({dMax, hMax});
412+
->setPathSamplerOptions({distanceMax, curveHeightMax});
413413
}
414414

415415
void Interface::pointerDown(ObjectRegistryHandle chart,

src/apps/weblib/interface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class Interface
5656
double width,
5757
double height);
5858
void setLineResolution(ObjectRegistryHandle canvas,
59-
double dMax,
60-
double hMax);
59+
double distanceMax,
60+
double curveHeightMax);
6161

6262
ObjectRegistryHandle storeAnim(ObjectRegistryHandle chart);
6363
void restoreAnim(ObjectRegistryHandle chart,

src/apps/weblib/ts-api/cvizzu.types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ export interface CVizzu {
9191
_vizzu_pointerLeave(chart: CChartPtr, canvas: CCanvasPtr, pointerId: number): void
9292
_vizzu_wheel(chart: CChartPtr, canvas: CCanvasPtr, delta: number): void
9393
_vizzu_setLogging(enable: boolean): void
94-
_vizzu_update(chart: CChartPtr, time: number): CString
95-
_vizzu_setLineResolution(canvas: CCanvasPtr, dMax: number, hMax: number): void
94+
_vizzu_update(chart: CChartPtr, time: number): void
95+
_vizzu_setLineResolution(canvas: CCanvasPtr, distanceMax: number, curveHeightMax: number): void
9696
_vizzu_render(chart: CChartPtr, canvas: CCanvasPtr, width: number, height: number): void
9797

9898
_vizzu_errorMessage(exceptionPtr: CException, typeinfo: CTypeInfo): CString

src/base/anim/interpolated.h

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ template <typename Type> class Weighted
3434
return value == other.value && weight == other.weight;
3535
}
3636

37-
template <typename Comparator =
38-
std::conditional_t<std::floating_point<Type>,
39-
decltype(Math::Floating::less),
40-
std::less<Type>>>
4137
bool operator<(const Weighted<Type> &other) const
4238
{
43-
return Comparator{}(value, other.value);
39+
using Less = std::conditional_t<std::floating_point<Type>,
40+
decltype(Math::Floating::less),
41+
std::less<Type>>;
42+
return Less{}(value, other.value);
4443
}
4544

4645
[[nodiscard]] bool hasValue() const { return weight > 0.0; }
@@ -224,28 +223,26 @@ template <typename Type> class Interpolated
224223
return res;
225224
}
226225

227-
template <typename T = Type,
228-
typename Cmp = std::conditional_t<std::floating_point<T>,
229-
decltype(Math::Floating::less),
230-
std::less<T>>>
231-
[[nodiscard]] T min() const
226+
template <typename T = Type> [[nodiscard]] T min() const
232227
{
228+
using Less = std::conditional_t<std::floating_point<T>,
229+
decltype(Math::Floating::less),
230+
std::less<T>>;
233231
return !has_second ? this->values[0].value
234232
: std::min(this->values[0].value,
235233
this->values[1].value,
236-
Cmp{});
234+
Less{});
237235
}
238236

239-
template <typename T = Type,
240-
typename Cmp = std::conditional_t<std::floating_point<T>,
241-
decltype(Math::Floating::less),
242-
std::less<T>>>
243-
[[nodiscard]] T max() const
237+
template <typename T = Type> [[nodiscard]] T max() const
244238
{
239+
using Less = std::conditional_t<std::floating_point<T>,
240+
decltype(Math::Floating::less),
241+
std::less<T>>;
245242
return !has_second ? this->values[0].value
246243
: std::max(this->values[0].value,
247244
this->values[1].value,
248-
Cmp{});
245+
Less{});
249246
}
250247
};
251248

src/base/gfx/pathsampler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ void PathSampler::path(const Geom::Point &pConv0,
3232
auto height = 2 * area / (pConv1 - pConv0).abs();
3333

3434
auto needMore =
35-
height > options.hMax
35+
height > options.curveHeightMax
3636
|| ((pConv1 - pConv0).sqrAbs() < (pConv - pConv0).sqrAbs())
3737
|| ((pConv1 - pConv0).sqrAbs() < (pConv - pConv1).sqrAbs());
3838

3939
if (needMore) {
40-
if ((pConv - pConv0).sqrAbs() > options.dMax)
40+
if ((pConv - pConv0).sqrAbs() > options.distanceMax)
4141
path(pConv0, pConv, i0, i, recurseCnt + 1);
4242
}
4343

4444
addPoint(pConv);
4545

4646
if (needMore) {
47-
if ((pConv - pConv1).sqrAbs() > options.dMax)
47+
if ((pConv - pConv1).sqrAbs() > options.distanceMax)
4848
path(pConv, pConv1, i, i1, recurseCnt + 1);
4949
}
5050
}

src/base/gfx/pathsampler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class PathSampler
1313
public:
1414
struct Options
1515
{
16-
double dMax;
17-
double hMax;
16+
double distanceMax;
17+
double curveHeightMax;
1818
};
1919
explicit PathSampler(const Options &options) : options(options) {}
2020

src/base/math/floating.h

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#ifndef MATH_FLOATING
22
#define MATH_FLOATING
33

4-
#include <bit>
54
#include <compare>
65
#include <concepts>
7-
#include <cstdint>
86
#include <limits>
97

108
namespace Math::Floating
@@ -18,43 +16,11 @@ constexpr auto inline less = [](auto a, auto b)
1816
return std::is_lt(std::strong_order(a, b));
1917
};
2018

21-
template <std::floating_point F,
22-
std::size_t v =
23-
std::numeric_limits<F>::is_iec559
24-
&&std::numeric_limits<F>::radix
25-
== 2
26-
&& std::numeric_limits<unsigned char>::digits == 8
27-
? sizeof(F)
28-
: std::size_t{}>
29-
constexpr auto inline can_be_used_as_short_check =
30-
std::bool_constant<false>{};
31-
32-
template <std::floating_point F>
33-
constexpr auto inline can_be_used_as_short_check<F, 4> =
34-
std::integral_constant<std::uint32_t,
35-
std::bit_cast<std::uint32_t>(F{0.0}) == std::uint32_t{}
36-
&& std::bit_cast<std::uint32_t>(F{-0.0})
37-
+ std::bit_cast<std::uint32_t>(F{-0.0})
38-
== std::uint32_t{}>{};
39-
40-
template <std::floating_point F>
41-
constexpr auto inline can_be_used_as_short_check<F, 8> =
42-
std::integral_constant<std::uint64_t,
43-
std::bit_cast<std::uint64_t>(F{0.0}) == std::uint64_t{}
44-
&& std::bit_cast<std::uint64_t>(F{-0.0})
45-
+ std::bit_cast<std::uint64_t>(F{-0.0})
46-
== std::uint64_t{}>{};
47-
4819
constexpr auto inline is_zero = [](auto value)
4920
{
5021
using F = decltype(value);
5122
static_assert(std::floating_point<F>);
52-
if constexpr (auto v = can_be_used_as_short_check<F>; v()) {
53-
const auto val =
54-
std::bit_cast<typename decltype(v)::value_type>(value);
55-
return val + val == 0;
56-
}
57-
else if constexpr (std::numeric_limits<F>::is_iec559) {
23+
if constexpr (std::numeric_limits<F>::is_iec559) {
5824
return value == F{};
5925
}
6026
else {

0 commit comments

Comments
 (0)