Skip to content

Commit c7197ad

Browse files
committed
Review
1 parent 732568e commit c7197ad

File tree

4 files changed

+30
-35
lines changed

4 files changed

+30
-35
lines changed

src/chart/generator/marker.cpp

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ Marker::Marker(const Options &options,
1212
ChannelsStats &stats,
1313
const Data::MultiIndex &index,
1414
MarkerIndex idx,
15-
bool needMarkerInfo,
16-
bool rectangleSpacing) :
15+
bool needMarkerInfo) :
1716
enabled(data.empty() || !index.isEmpty()),
1817
cellInfo(enabled || needMarkerInfo
1918
? data.cellInfo(index, idx, needMarkerInfo)
@@ -76,16 +75,18 @@ Marker::Marker(const Options &options,
7675
index,
7776
horizontal ? &mainId->value : subAxisId);
7877

79-
spacing.x = (horizontal || (lineOrCircle && !polar)
80-
|| (channels.at(ChannelId::y).isDimension()
81-
&& channels.at(ChannelId::y).hasDimension()
82-
&& options.geometry == ShapeType::rectangle
83-
&& options.align != Base::Align::Type::stretch
84-
&& rectangleSpacing))
85-
&& options.getChannels().anyAxisSet()
86-
&& channels.at(ChannelId::x).isDimension()
87-
? 1
88-
: 0;
78+
auto yChannelRectDim =
79+
channels.at(ChannelId::y).isDimension()
80+
&& channels.at(ChannelId::y).hasDimension()
81+
&& options.geometry == ShapeType::rectangle
82+
&& options.align != Base::Align::Type::stretch;
83+
84+
spacing.x =
85+
(horizontal || (lineOrCircle && !polar) || yChannelRectDim)
86+
&& options.getChannels().anyAxisSet()
87+
&& channels.at(ChannelId::x).isDimension()
88+
? 1
89+
: 0;
8990

9091
position.y = size.y = getValueForChannel(channels,
9192
ChannelId::y,
@@ -94,12 +95,13 @@ Marker::Marker(const Options &options,
9495
index,
9596
!horizontal ? &mainId->value : subAxisId);
9697

97-
spacing.y = (!horizontal || lineOrCircle
98-
|| (channels.at(ChannelId::x).isDimension()
99-
&& channels.at(ChannelId::x).hasDimension()
100-
&& options.geometry == ShapeType::rectangle
101-
&& options.align != Base::Align::Type::stretch
102-
&& rectangleSpacing))
98+
auto xChannelRectDim =
99+
channels.at(ChannelId::x).isDimension()
100+
&& channels.at(ChannelId::x).hasDimension()
101+
&& options.geometry == ShapeType::rectangle
102+
&& options.align != Base::Align::Type::stretch;
103+
104+
spacing.y = (!horizontal || lineOrCircle || xChannelRectDim)
103105
&& options.getChannels().anyAxisSet()
104106
&& channels.at(ChannelId::y).isDimension()
105107
? 1

src/chart/generator/marker.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ class Marker
2929
ChannelsStats &stats,
3030
const Data::MultiIndex &index,
3131
MarkerIndex idx,
32-
bool needMarkerInfo,
33-
bool rectangleSpacing);
32+
bool needMarkerInfo);
3433

3534
::Anim::Interpolated<ColorBase> colorBase;
3635
Geom::Point position;

src/chart/generator/plot.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,6 @@ Buckets Plot::generateMarkers()
129129
for (auto &&[ix, mid] : options->markersInfo)
130130
map.emplace(mid, ix);
131131

132-
bool rectangleSpacing{true};
133-
if (auto &&sp = style.plot.marker.rectangleSpacing;
134-
sp && sp->get().has_value())
135-
rectangleSpacing = *sp->get() > 0.0;
136-
137132
for (auto first = map.begin(), last = map.end();
138133
auto &&index : getDataCube()) {
139134
auto &&markerId = markers.size();
@@ -144,8 +139,7 @@ Buckets Plot::generateMarkers()
144139
getStats(),
145140
index,
146141
markerId,
147-
needInfo,
148-
rectangleSpacing);
142+
needInfo);
149143

150144
mainBuckets[marker.mainId.get().seriesId]
151145
[marker.mainId.get().itemId] = &marker;

test/e2e/test_cases/test_cases.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@
17751775
"refs": ["2352b28"]
17761776
},
17771777
"ww_next_steps/next_steps/38_C_L_line": {
1778-
"refs": ["b8ffd23"]
1778+
"refs": ["d03e139"]
17791779
},
17801780
"ww_next_steps/next_steps_Tests/02_C_R": {
17811781
"refs": ["c550e7b"]
@@ -1802,7 +1802,7 @@
18021802
"refs": ["feed828"]
18031803
},
18041804
"ww_next_steps/next_steps_Tests/38_C_L_line": {
1805-
"refs": ["a19aa52"]
1805+
"refs": ["3b273c7"]
18061806
},
18071807
"ww_next_steps/next_steps_Tests/axisLabel_problem": {
18081808
"refs": ["d33f180"]
@@ -2624,7 +2624,7 @@
26242624
"refs": ["9f2a6ba"]
26252625
},
26262626
"ww_noFade/wNoFade_cases/1_des_pol/rectangle_Ve1/04a_rec_Ve1_1c": {
2627-
"refs": ["aa58cd6"]
2627+
"refs": ["cbc5606"]
26282628
},
26292629
"ww_noFade/wNoFade_cases/1_des_pol/rectangle_Ve1/04a_rec_Ve1_2c": {
26302630
"refs": ["40b7f79"]
@@ -2633,7 +2633,7 @@
26332633
"refs": ["819fdce"]
26342634
},
26352635
"ww_noFade/wNoFade_cases/1_des_pol/rectangle_Ve1/06a_rec_Ve1_1c": {
2636-
"refs": ["21ba8df"]
2636+
"refs": ["5586c4d"]
26372637
},
26382638
"ww_noFade/wNoFade_cases/1_des_pol/rectangle_Ve1/07a_rec_Ve1_2c": {
26392639
"refs": ["0d9d4eb"]
@@ -2888,7 +2888,7 @@
28882888
"refs": ["0e97ae5"]
28892889
},
28902890
"ww_noFade/wNoFade_cases/2_des_pol-without/rectangle_V1/04a_d-w_rec_Ve1_1c_V1": {
2891-
"refs": ["7164b5b"]
2891+
"refs": ["537c8d4"]
28922892
},
28932893
"ww_noFade/wNoFade_cases/2_des_pol-without/rectangle_V1/04a_d-w_rec_Ve1_2c_V1": {
28942894
"refs": ["fe2656a"]
@@ -2909,7 +2909,7 @@
29092909
"refs": ["7008537"]
29102910
},
29112911
"ww_noFade/wNoFade_cases/2_des_pol-without/rectangle_Ve1/04a_d-w_rec_Ve1_1c": {
2912-
"refs": ["f9144aa"]
2912+
"refs": ["a1d4c96"]
29132913
},
29142914
"ww_noFade/wNoFade_cases/2_des_pol-without/rectangle_Ve1/04a_d-w_rec_Ve1_2c": {
29152915
"refs": ["3e15bfc"]
@@ -2918,7 +2918,7 @@
29182918
"refs": ["990dc60"]
29192919
},
29202920
"ww_noFade/wNoFade_cases/2_des_pol-without/rectangle_Ve1/06a_d-w_rec_Ve1_1c": {
2921-
"refs": ["a685430"]
2921+
"refs": ["c6fbce3"]
29222922
},
29232923
"ww_noFade/wNoFade_cases/2_des_pol-without/rectangle_Ve1/06a_d-w_rec_Ve1_2c": {
29242924
"refs": ["ac1ed71"]
@@ -2930,7 +2930,7 @@
29302930
"refs": ["27d694a"]
29312931
},
29322932
"ww_noFade/wNoFade_cases/2_des_pol-without/rectangle_Ve1/07a_d-w_rec_Ve2_1c": {
2933-
"refs": ["bcc4e6f"]
2933+
"refs": ["0b50210"]
29342934
},
29352935
"ww_noFade/wNoFade_cases/2_des_pol-without/rectangle_Ve1/07a_d-w_rec_Ve2_2c": {
29362936
"refs": ["fe75086"]

0 commit comments

Comments
 (0)