Skip to content

Commit 30ca437

Browse files
committed
Merge remote-tracking branch 'origin/main' into Fix-vertical-polar-lines
# Conflicts: # CHANGELOG.md
2 parents c01fa6e + b98eb87 commit 30ca437

File tree

6 files changed

+72
-8
lines changed

6 files changed

+72
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
## [Unreleased]
44

5-
### Fixed
5+
### Fixed
66

7+
- Fix drilldown regroup strategy on fake-split charts.
78
- From now vertical line connections are curved lines.
89
- Remove duplicated circles on line-circle transition.
910
- Fix area-circle polar connection transition.

src/chart/options/options.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ std::optional<ChannelId> Options::secondaryStackType() const
9898
return std::nullopt;
9999
}
100100

101+
bool Options::isStacked() const
102+
{
103+
auto dims = stackChannel().dimensions();
104+
dims.split_by(mainAxis().dimensions());
105+
return !dims.empty();
106+
}
107+
101108
Channels Options::shadowChannels() const
102109
{
103110
auto shadow = channels.shadow();
@@ -122,12 +129,11 @@ void Options::drilldownTo(const Options &other)
122129
{
123130
auto &stackChannel = this->stackChannel();
124131

132+
if (this->split && !isSplit()) this->split = false;
133+
125134
for (auto &&dim : other.getChannels().getDimensions())
126135
if (!getChannels().isSeriesUsed(dim))
127136
stackChannel.addSeries(dim);
128-
if (stackChannel.isDimension()
129-
&& geometry == ShapeType::rectangle)
130-
this->align = Base::Align::Type::stretch;
131137
}
132138

133139
void Options::intersection(const Options &other)
@@ -192,9 +198,9 @@ bool Options::sameShadowAttribs(const Options &other) const
192198

193199
return shape == shapeOther && coordSystem == other.coordSystem
194200
&& angle == other.angle && orientation == other.orientation
195-
&& split == other.split && dataFilter == other.dataFilter
196-
&& align == other.align && sort == other.sort
197-
&& reverse == other.reverse;
201+
&& isSplit() == other.isSplit()
202+
&& dataFilter == other.dataFilter && align == other.align
203+
&& sort == other.sort && reverse == other.reverse;
198204
}
199205

200206
bool Options::sameAttributes(const Options &other) const

src/chart/options/options.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ class Options
109109
return channels.at(stackChannelType());
110110
}
111111

112+
[[nodiscard]] const Channel &stackChannel() const
113+
{
114+
return channels.at(stackChannelType());
115+
}
116+
117+
[[nodiscard]] bool isStacked() const;
118+
[[nodiscard]] bool isSplit() const
119+
{
120+
return split
121+
&& (stackChannelType() != subAxisType() || isStacked());
122+
}
123+
112124
Heading title{std::nullopt};
113125
Heading subtitle{std::nullopt};
114126
Heading caption{std::nullopt};

test/e2e/test_cases/test_cases.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3236,7 +3236,7 @@
32363236
"refs": ["bd104b0"]
32373237
},
32383238
"web_content/cookbook/style/dark_theme": {
3239-
"refs": ["f7c42b8"]
3239+
"refs": ["b23128f"]
32403240
},
32413241
"web_content/cookbook/style/highligh_markers": {
32423242
"refs": ["54fc3d3"]

test/e2e/tests/fixes.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"91": {
88
"refs": ["1732a49"]
99
},
10+
"143": {
11+
"refs": ["4396a67"]
12+
},
1013
"144": {
1114
"refs": ["fde02e4"]
1215
},

test/e2e/tests/fixes/143.mjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
const testSteps = [
2+
(chart) => {
3+
const data = {
4+
series: [
5+
{
6+
name: 'Colors',
7+
type: 'dimension',
8+
values: ['red', 'green', 'blue', 'red', 'green', 'blue', 'red', 'green', 'blue']
9+
},
10+
{
11+
name: 'Letters',
12+
type: 'dimension',
13+
values: ['a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'c']
14+
},
15+
{
16+
name: 'Val',
17+
type: 'measure',
18+
values: [3, 5, 4, 3 + 1, 5 + 1, 4 + 1, 3 + 2, 5 + 2, 4 + 2]
19+
}
20+
]
21+
}
22+
23+
return chart.animate({
24+
data,
25+
config: {
26+
y: 'Colors',
27+
x: 'Val'
28+
}
29+
})
30+
},
31+
(chart) =>
32+
chart.animate(
33+
{
34+
y: 'Val',
35+
x: 'Letters',
36+
split: true
37+
},
38+
{ regroupStrategy: 'drilldown' }
39+
)
40+
]
41+
42+
export default testSteps

0 commit comments

Comments
 (0)