Skip to content

Commit

Permalink
Explain that you need to call Canvas::CalcAllSizes() when you call Se…
Browse files Browse the repository at this point in the history
…tData() additional times to replot everything.
  • Loading branch information
Blake-Madden committed Sep 7, 2023
1 parent 72a29f3 commit 3abc313
Show file tree
Hide file tree
Showing 21 changed files with 48 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/base/canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ namespace Wisteria

/// @brief Calculates the sizes of all objects on the canvas.
/// @param dc The DC to measure content with.
/// @details Call this if customizations have been made to a subobject
/// @details Call this if changes have been made to a subobject
/// (e.g., a plot) and you wish to refresh the content.
void CalcAllSizes(wxDC& dc);
/** @brief The scaling of the canvas's size compared to the minimum size.
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/boxplot.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ namespace Wisteria::Graphs
@param data The data to use for the plot.
@param continuousColumnName The column from the dataset to analyze.
@param groupColumnName The group column to split the data into (this is optional).
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found by name, throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to @c wxString::FromUTF8()
when formatting it for an error message.*/
Expand Down
6 changes: 4 additions & 2 deletions src/graphs/candlestickplot.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ namespace Wisteria::Graphs
@param lowColumnName The column containing the lowest price during the day.
@param highColumnName The column containing the highest price during the day.
@param closeColumnName The column containing the closing price.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found by name, throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
@c wxString::FromUTF8() when formatting it for an error message.*/
The exception's @c what() message is UTF-8 encoded, so pass it to
@c wxString::FromUTF8() when formatting it for an error message.*/
void SetData(std::shared_ptr<const Data::Dataset> data,
const wxString& dateColumnName,
const wxString& openColumnName, const wxString& highColumnName,
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/categoricalbarchart.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ namespace Wisteria::Graphs
@param blDisplay Which type of labels to display at the end of the bars.\n
Note that numeric labels (value or percentages) will be shown as integers
(i.e., no precision) for simplicity.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found by name, throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
@c wxString::FromUTF8() when formatting it for an error message.*/
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/crawfordgraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ namespace Wisteria::Graphs
@param syllablesPer100WordsColumnName The column containing the documents'
syllables per 100 words (a continuous column).
@param groupColumnName The (optional) categorical column to use for grouping.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found, throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
@c wxString::FromUTF8() when formatting it for an error message.*/
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/danielsonbryan2plot.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ namespace Wisteria::Graphs
@param scoreColumnName The column containing the documents' scores
(a continuous column).
@param groupColumnName The (optional) categorical column to use for grouping.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found, throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
@c wxString::FromUTF8() when formatting it for an error message.*/
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/fleschchart.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ namespace Wisteria::Graphs
the syllables-per-word ruler, showing the document names under each bracket.\n
This will only be applied if there are 1-50 documents on the
graph, and the document names must be in the dataset's ID column.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found, throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
@c wxString::FromUTF8() when formatting it for an error message.*/
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/ganttchart.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ namespace Wisteria::Graphs
@param groupColumnName The grouping column to use.\n
This will set the colors of the task's bars, based on their groups.
Note that this can be the same column as the resource or task name columns.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found by name,
throws an exception.\n
The exception's @c what() message is UTF-8 encoded,
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/heatmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ namespace Wisteria::Graphs
It is assumed that it is sorted by the value that the caller
wants to display left to right, but then also by group. These
groups will be drawn top-to-bottom.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found by name,
throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
Expand Down
4 changes: 3 additions & 1 deletion src/graphs/histogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ namespace Wisteria::Graphs
The exception's @c what() message is UTF-8 encoded, so pass it to
@c wxString::FromUTF8() when formatting it for an error message.
@note Observation names are pulled from the dataset's ID column and the first few are
implicitly added to the bins' selection label.*/
implicitly added to the bins' selection label.\n
Also, call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.*/
void SetData(std::shared_ptr<const Data::Dataset> data,
const wxString& continuousColumnName,
const std::optional<const wxString> groupColumnName = std::nullopt,
Expand Down
4 changes: 3 additions & 1 deletion src/graphs/likertchart.h
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,9 @@ namespace Wisteria::Graphs
@param questionColumns The vector of categorical columns to use as questions.
@param groupColumnName The (optional) group column.
@sa SetLabels().
@note Grouping is used if the chart type is categorized (see GetSurveyType()).
@note Grouping is used if the chart type is categorized (see GetSurveyType()).\n
Also, call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@warning The string tables in the categorical columns need to be synchronized prior
to calling this. In other works, ensure that the columns use the same string
and integral code assignments.\n
Expand Down
4 changes: 3 additions & 1 deletion src/graphs/lineplot.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ namespace Wisteria::Graphs
@param groupColumnName The (optional) categorical column to use for grouping.
This will split the data into separate lines based on this grouping column.
@note To add missing points to the data so that a gap in the line will appear,
set the point in question to NaN (@c std::numeric_limits<double>::quiet_NaN()).
set the point in question to NaN (@c std::numeric_limits<double>::quiet_NaN()).\n
Also, call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@warning The data points are drawn in the order that they appear in the dataset.
The plot will make no effort to sort the data or ensure that it is.\n
This is by design in case you need a line series to go backwards in certain
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/lixgauge.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ namespace Wisteria::Graphs
@param scoreColumnName The column containing the documents' scores
(a continuous column).
@param groupColumnName The (optional) categorical column to use for grouping.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found, throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
@c wxString::FromUTF8() when formatting it for an error message.*/
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/lixgaugegerman.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ namespace Wisteria::Graphs
@param scoreColumnName The column containing the documents' scores
(a continuous column).
@param groupColumnName The (optional) categorical column to use for grouping.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found, throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
@c wxString::FromUTF8() when formatting it for an error message.*/
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/lrroadmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ namespace Wisteria::Graphs
This is a bitmask that can include multiple flags. The default is to include all IVs.
@param dvName The name of the dependent variable from the original analysis.\n
This will be used on the legend and default caption.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found by name, throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to @c wxString::FromUTF8()
when formatting it for an error message.*/
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/piechart.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ namespace Wisteria::Graphs
@param groupColumn2Name The (optional) second grouping ring.\n
This inner ring will be shown as subgroups within each slice
along the (parent) outer ring.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found by name,
throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/proconroadmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ namespace Wisteria::Graphs
@param minimumCountForItem The minimum occurrence for an item to be included.\n
This is useful for excluding items not mentioned often in the survey.
The default is to include all items.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found by name, throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
@c wxString::FromUTF8() when formatting it for an error message.*/
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/sankeydiagram.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ namespace Wisteria::Graphs
Note that if a group from @c fromWeightColumnName occurs with multiple values
from this column, then it will be sorted by the first value from this column
that it encountered.
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found by name, throws an exception.\n
Also throws an exception if only @c fromWeightColumnName is provided but
@c toWeightColumnName was not (or vice versa).\n
Expand Down
2 changes: 2 additions & 0 deletions src/graphs/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ namespace Wisteria::Graphs
The columns will appear in the order that you specify here.
@param transpose @c true to transpose the data (i.e., display the columns
from the data as rows).
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found by name,
throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
Expand Down
4 changes: 3 additions & 1 deletion src/graphs/wcurveplot.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ namespace Wisteria::Graphs
@param groupColumnName The grouping column to use.
This is required and cannot be @c std::nullopt.
@note To add missing points to the data so that a gap in the line will appear,
set the point in question to NaN (@c std::numeric_limits<double>::quiet_NaN()).
set the point in question to NaN (@c std::numeric_limits<double>::quiet_NaN()).\n
Also, call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@warning The data points are drawn in the order that they appear in the dataset.
The plot will make no effort to sort the data or ensure that it is.
This is by design in case you need a line series to go backwards in certain spots
Expand Down
4 changes: 3 additions & 1 deletion src/graphs/wordcloud.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ namespace Wisteria::Graphs
@param maxWords The maximum number of words to show
(going from the highest-to-lowest frequently occurring words).\n
This is performed after the words not meeting the min and min frequency criteria
has been removed (if applicable).\n
has been removed (if applicable).
@note Call the parent canvas's `CalcAllSizes()` when setting to a new dataset to
re-plot the data.
@throws std::runtime_error If any columns can't be found by name,
throws an exception.\n
The exception's @c what() message is UTF-8 encoded, so pass it to
Expand Down

0 comments on commit 3abc313

Please sign in to comment.