Skip to content

Commit 255ba20

Browse files
committed
Merge branch 'main' into readme-and-wiki-branch
2 parents 164d4fe + f68f4ca commit 255ba20

25 files changed

+11280
-95
lines changed

Tests/ArrayCoreTest.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,29 @@ TEST(ArrayCore, showDefaultSettings) {
142142
EXPECT_EQ(result, true);
143143
}
144144

145-
TEST(ArrayCore, showHeatMap1) {
145+
TEST(ArrayCore, showHeatMap1_customAspectRatio) {
146146
EXPECT_EQ(dvs::isPlotlyScriptExists(), true);
147147
vector<vector<double>> values = {{30.3, 40, 98, 76}, {99, 45, 20, 1}, {5, 56, 93, 25}, {45, 23, 90, 2}};
148148
auto config = dv::Config();
149149
config.heatmap.title = "Black & White TEST MATRIX";
150150
config.heatmap.colorSc = dv::config_colorscales::COLORSCALE_GRAYSCALE;
151+
config.heatmap.aspectRatioWidth = 2;
152+
config.heatmap.aspectRatioHeight = 3;
151153
bool result = dv::show(values, "showHeatMap_gray", config);
152154
EXPECT_EQ(result, true);
153155
}
154156

157+
TEST(ArrayCore, showHeatMap1_AutoScale) {
158+
EXPECT_EQ(dvs::isPlotlyScriptExists(), true);
159+
vector<vector<double>> values = {{30.3, 40, 98, 76}, {99, 45, 20, 1}, {5, 56, 93, 25}, {45, 23, 90, 2}};
160+
auto config = dv::Config();
161+
config.heatmap.title = "Black & White TEST MATRIX";
162+
config.heatmap.colorSc = dv::config_colorscales::COLORSCALE_GRAYSCALE;
163+
config.heatmap.isAutoScale = true;
164+
bool result = dv::show(values, "showHeatMap_AutoScale", config);
165+
EXPECT_EQ(result, true);
166+
}
167+
155168
TEST(ArrayCore, showSurface) {
156169
EXPECT_EQ(dvs::isPlotlyScriptExists(), true);
157170
vector<vector<double>> values = {{30.3, 40, 98, 76}, {99, 45, 20, 1}, {5, 56, 93, 25}, {45, 23, 90, 2}};
@@ -322,18 +335,20 @@ TEST(ArrayCore, show2ChartsWithHoldOnCustomSettings) {
322335
config.chart.title = "Custom title";
323336
config.chart.xLabel = "Custom xLabel";
324337
config.chart.yLabel = "Custom yLabel";
338+
config.chart.aspectRatioHeight = 1;
339+
config.chart.aspectRatioWidth = 3;
325340
dv::holdOff(config);
326341
EXPECT_EQ(v1 && v2, true);
327342
}
328343

329344
TEST(ArrayCore, testMyltiplyHoldOnOff) {
330345

331346
vector<double> vec1 = {1, 2, 3, 4, 5, 6, 7};
332-
vector<double> vec2 = {3, 4, 5, 6, 7};
347+
vector<double> vec2 = {3, 4, 5, 6, 27};
333348

334349
dv::holdOn();
335350
bool v1 = dv::show(vec1, "titleHoldOn1");
336-
bool v2 = dv::show(vec1, "titleHoldOn2");
351+
bool v2 = dv::show(vec2, "titleHoldOn2");
337352
dv::holdOff();
338353

339354
dv::holdOff();

0 commit comments

Comments
 (0)