Skip to content

Commit 2c0a726

Browse files
authored
Merge pull request #547 from vizzuhq/rectangleSpacing
Add default no rectangle spacing on heatmap and coxcomb
2 parents 4fe64ca + 511042e commit 2c0a726

File tree

15 files changed

+119
-159
lines changed

15 files changed

+119
-159
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Fixed
88

9+
- Add default no rectangle spacing on heatmap and coxcomb.
910
- Change bubblechart behavior on failure.
1011
- Fix reference markers on bubblechart with negative values.
1112
- From now lightness channel goes from light (low value) to dark (high value) colors.

src/chart/main/stylesheet.cpp

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,26 @@ void Sheet::setMarkers()
126126
defaultParams.plot.marker.borderWidth = 1;
127127
defaultParams.plot.marker.fillOpacity = 0.8;
128128
}
129-
130-
if (options->geometry == Gen::ShapeType::rectangle
131-
&& options->coordSystem.get() == Gen::CoordSystem::polar
132-
&& options->getVeritalAxis().isEmpty())
133-
defaultParams.plot.marker.rectangleSpacing = 0;
129+
else if (options->geometry == Gen::ShapeType::rectangle) {
130+
const auto &vertical = options->getVeritalAxis();
131+
const auto &horizontal = options->getHorizontalAxis();
132+
if (auto polar = options->coordSystem.get()
133+
== Gen::CoordSystem::polar;
134+
polar && vertical.isEmpty())
135+
defaultParams.plot.marker.rectangleSpacing = 0;
136+
else if (auto needRectangleSpacing =
137+
vertical.isMeasure()
138+
!= horizontal.isMeasure()
139+
&& (!polar || vertical.isDimension());
140+
!needRectangleSpacing) {
141+
defaultParams.plot.marker.rectangleSpacing = 0;
142+
if (vertical.isDimension()
143+
|| horizontal.isDimension()) {
144+
defaultParams.plot.marker.borderWidth = 0.5;
145+
defaultParams.plot.marker.borderOpacity = 0.7;
146+
}
147+
}
148+
}
134149
}
135150
}
136151

test/e2e/test_cases/static_chart_types/polar_coo_sys/coxcomb_rectangle_1dis_1con.mjs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ const testSteps = [
1414
title: 'Coxcomb Chart',
1515
orientation: 'horizontal',
1616
coordSystem: 'polar'
17-
},
18-
style: {
19-
plot: {
20-
marker: {
21-
rectangleSpacing: 0
22-
}
23-
}
2417
}
2518
})
2619
]

0 commit comments

Comments
 (0)