From 7b0455b4d8af2d8a917810cc467376a6d7653a23 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 3 Jan 2021 00:31:55 +0100 Subject: statistics: reverse chart selection logic The old ways was to select the chart first, then depending on the chart choose the binning. Willem says that it should work the other way round: select the binning (or operation) and make the charts depend on that. I'm not arguing one way or the other, just note that the new way is much more tricky, because it is easy to get unsupported combinations. For example, there is no chart where the first variable is unbinned, but the second axis is binned or has an operation. This makes things distinctly more tricky and this code still needs a thorough audit. Since this is all more tricky, implement a "invalid" chart state. Ideally that should be never shown to the user, but let's try to be defensive. Signed-off-by: Berthold Stoeger --- stats/statsstate.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'stats/statsstate.h') diff --git a/stats/statsstate.h b/stats/statsstate.h index d4713d414..1d8fe0b05 100644 --- a/stats/statsstate.h +++ b/stats/statsstate.h @@ -19,7 +19,8 @@ enum class ChartType { HistogramValue, HistogramBox, HistogramStacked, - ScatterPlot + ScatterPlot, + Invalid }; enum class ChartSubType { @@ -35,6 +36,7 @@ enum class ChartSubType { Count }; +struct ChartTypeDesc; // Internal implementation detail struct StatsVariable; struct StatsBinner; enum class StatsOperation : int; @@ -111,9 +113,6 @@ public: StatsOperation var2Operation; private: void validate(bool varChanged); - bool var1Binned; - bool var2Binned; - bool var2HasOperations; int chartFeatures; }; -- cgit v1.2.3-70-g09d2