Skip to content

Commit 30b7178

Browse files
authored
Merge pull request #621 from vizzuhq/regression_fix
0.14.0 Regression - fake-split intermediate step not the same
2 parents 0398c1c + 2708c4b commit 30b7178

File tree

6 files changed

+59
-11
lines changed

6 files changed

+59
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
### Fixed
66

77
- Fix align on fake-split charts
8+
- Drilldown on split chart is fade.
9+
- Fix aggregate on split chart.
810
- Do not interpolate hiding/showing legend
911
- Fix aggregator interface for 'set' channel parameter:
1012
- From now not accepted the same dimension on the same channel.

src/chart/animator/animation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void Animation::addKeyframe(const Gen::PlotPtr &next,
128128
auto begin = std::ref(intermediate0 ? intermediate0 : target);
129129

130130
auto &&intermediate1Instant =
131-
intermediate1 && strategy == RegroupStrategy::aggregate
131+
intermediate1 && strategy != RegroupStrategy::fade
132132
&& begin.get()->getOptions()->looksTheSame(
133133
*intermediate1->getOptions());
134134
begin = intermediate1 ? std::ref(intermediate1) : begin;

src/chart/options/options.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ Channels Options::shadowChannels() const
111111
&ch2 = shadow.at(ChannelId::noop);
112112
auto &&stacker : shadow.getDimensions({data(stackChannels),
113113
std::size_t{1} + secondary.has_value()})) {
114-
ch1.removeSeries(stacker);
114+
if (stackChannelType() != subAxisType() || !isSplit())
115+
ch1.removeSeries(stacker);
115116
ch2.removeSeries(stacker);
116117
}
117118

@@ -122,7 +123,7 @@ void Options::drilldownTo(const Options &other)
122123
{
123124
auto &stackChannel = this->stackChannel();
124125

125-
if (this->split && !isSplit()) this->split = {};
126+
if (!isSplit() || !other.isSplit()) this->split = {};
126127

127128
for (auto &&dim : other.getChannels().getDimensions())
128129
if (!getChannels().isSeriesUsed(dim))
@@ -134,12 +135,14 @@ void Options::intersection(const Options &other)
134135
for (auto &&dim : getChannels().getDimensions())
135136
if (!other.getChannels().isSeriesUsed(dim))
136137
getChannels().removeSeries(dim);
138+
139+
split = {};
137140
}
138141

139142
bool Options::looksTheSame(const Options &other) const
140143
{
141144
if (channels.anyAxisSet()
142-
&& channels.at(Gen::ChannelId::label).isEmpty()) {
145+
&& channels.at(ChannelId::label).isEmpty()) {
143146
auto thisCopy = *this;
144147
thisCopy.simplify();
145148

@@ -154,6 +157,8 @@ bool Options::looksTheSame(const Options &other) const
154157

155158
void Options::simplify()
156159
{
160+
if (isSplit()) return;
161+
157162
// remove all dimensions, only used at the end of stack
158163
auto &stackChannel = this->stackChannel();
159164

test/e2e/test_cases/test_cases.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2453,7 +2453,7 @@
24532453
"refs": ["e5678fa"]
24542454
},
24552455
"ww_noFade/wNoFade_Tests/Marker_transition_problem/area_column_time_sum": {
2456-
"refs": ["67ef3d7"]
2456+
"refs": ["727c6d5"]
24572457
},
24582458
"ww_noFade/wNoFade_Tests/Marker_transition_problem/area_orientation": {
24592459
"refs": ["8c0d580"]

test/e2e/tests/fixes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"refs": ["1732a49"]
99
},
1010
"143": {
11-
"refs": ["fb8a740"]
11+
"refs": ["95b9c83"]
1212
},
1313
"144": {
1414
"refs": ["fde02e4"]

test/e2e/tests/fixes/143.mjs

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ const testSteps = [
1212
type: 'dimension',
1313
values: ['a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'c']
1414
},
15+
{
16+
name: 'Letters2',
17+
type: 'dimension',
18+
values: ['a', 'a', 'a', 'a', 'a', 'b', 'b', 'b', 'b']
19+
},
1520
{
1621
name: 'Val',
1722
type: 'measure',
@@ -24,19 +29,55 @@ const testSteps = [
2429
data,
2530
config: {
2631
y: 'Colors',
27-
x: 'Val'
32+
x: 'Val',
33+
split: true
2834
}
2935
})
3036
},
3137
(chart) =>
3238
chart.animate(
3339
{
34-
y: 'Val',
35-
x: 'Letters',
36-
split: true
40+
y: ['Letters2', 'Val'],
41+
x: 'Letters'
3742
},
3843
{ regroupStrategy: 'drilldown' }
39-
)
44+
),
45+
(chart) =>
46+
chart.animate(
47+
{
48+
y: ['Letters2', 'Colors', 'Val']
49+
},
50+
{ regroupStrategy: 'drilldown' }
51+
),
52+
(chart) =>
53+
chart.animate({
54+
config: {
55+
y: 'Colors',
56+
x: 'Val'
57+
}
58+
}),
59+
(chart) =>
60+
chart.animate({
61+
config: {
62+
y: ['Letters2', 'Val'],
63+
x: 'Letters'
64+
}
65+
}),
66+
(chart) =>
67+
chart.animate({
68+
y: ['Letters2', 'Val']
69+
}),
70+
(chart) =>
71+
chart.animate({
72+
y: ['Letters2', 'Colors', 'Val']
73+
}),
74+
(chart) =>
75+
chart.animate({
76+
config: {
77+
y: ['Letters2', 'Colors'],
78+
x: 'Val'
79+
}
80+
})
4081
]
4182

4283
export default testSteps

0 commit comments

Comments
 (0)