Skip to content

Commit 3db16a1

Browse files
committed
Fix split chart intermediate steps
1 parent ed8b43e commit 3db16a1

File tree

6 files changed

+45
-17
lines changed

6 files changed

+45
-17
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
### Fixed
66

77
- Fix align on fake-split charts
8-
- Fix fake-split charts intermediate step jump.
8+
- Drilldown on split chart is fade.
9+
- Fix aggregate on split chart.
910
- Do not interpolate hiding/showing legend
1011
- Fix aggregator interface for 'set' channel parameter:
1112
- 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 & 7 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,13 +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(ChannelId::label).isEmpty()
143-
&& isSplit() == other.isSplit()) {
145+
&& channels.at(ChannelId::label).isEmpty()) {
144146
auto thisCopy = *this;
145147
thisCopy.simplify();
146148

@@ -155,8 +157,9 @@ bool Options::looksTheSame(const Options &other) const
155157

156158
void Options::simplify()
157159
{
160+
if (isSplit()) return;
161+
158162
// remove all dimensions, only used at the end of stack
159-
auto split = isSplit();
160163
auto &stackChannel = this->stackChannel();
161164

162165
auto dimensions = stackChannel.dimensions();
@@ -170,8 +173,6 @@ void Options::simplify()
170173
++dim) {
171174
stackChannel.removeSeries(*dim);
172175
}
173-
if (split && !stackChannel.hasDimension())
174-
stackChannel.addSeries(*dimensions.begin());
175176
}
176177

177178
bool Options::operator==(const Options &other) const

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": ["82f3abf"]
11+
"refs": ["95b9c83"]
1212
},
1313
"144": {
1414
"refs": ["fde02e4"]

test/e2e/tests/fixes/143.mjs

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,49 @@ const testSteps = [
2929
data,
3030
config: {
3131
y: 'Colors',
32-
x: 'Val'
32+
x: 'Val',
33+
split: true
3334
}
3435
})
3536
},
3637
(chart) =>
3738
chart.animate(
3839
{
39-
y: 'Val',
40-
x: 'Letters',
41-
split: true
40+
y: ['Letters2', 'Val'],
41+
x: 'Letters'
4242
},
4343
{ regroupStrategy: 'drilldown' }
4444
),
4545
(chart) =>
4646
chart.animate({
47-
y: ['Colors', 'Letters2', 'Val']
48-
})
47+
y: ['Letters2', 'Colors', 'Val']
48+
},
49+
{ regroupStrategy: 'drilldown' }
50+
),
51+
(chart) => chart.animate({
52+
config: {
53+
y: 'Colors',
54+
x: 'Val'
55+
}
56+
}),
57+
(chart) => chart.animate({
58+
config: {
59+
y: ['Letters2', 'Val'],
60+
x: 'Letters',
61+
}
62+
}),
63+
(chart) => chart.animate({
64+
y: ['Letters2', 'Val']
65+
}),
66+
(chart) => chart.animate({
67+
y: ['Letters2', 'Colors', 'Val']
68+
}),
69+
(chart) => chart.animate({
70+
config: {
71+
y: ['Letters2', 'Colors'],
72+
x: 'Val'
73+
}
74+
})
4975
]
5076

5177
export default testSteps

0 commit comments

Comments
 (0)