.. annotate(hline|vline, "text", style, value) to add a horizontal or
vertical line to the plot for the current series on a UserChart.
style is one of solid, dash, dot, dashdot or dashdotdot which are
the standard Qt pen styles for drawing lines.
I also took the opportunity to refactor how annotations are passed
from the datafilter down to the generic plot. This should make it
far easier to add annotations in the future.
.. fixed a SEGV in the voronoi annotation, which was related to memory
management and the sqrt_nsites variable (honestly, I am amazed it
ever worked).
.. labels in Python and R charts are now broken, will fixup shortly when
worked out how it should work (annotations are related to a series).
.. added a new variant for annotations to plot a voronoi diagram
via a datafilter.
the centers are as returned by the kmeans() function so the
x and y values follow each other (i.e. x1 x2 x3 y1 y2 y3)
.. it is ingrated into the userchart and down to the genericplot
for the series it arrives in.
.. next commit will add the drawing code to generic plot.
.. it was always rather dodgy, but caused issues when charts
recreated on config changed (like interacts badly with
the setUpdatesEnabled() call.
.. has a nice effect of stopping the jarring repaints too
which were horrible when themes changed.
Fixes#4029
.. returns the powerindex for the given power and duration
which can be vectors.
.. useful to transform meanmax power to strengths and
weakness rating.
.. axis settings updated to enable users to smooth and group by
for data series on the axis.
.. since group by needs to aggregate the series also have a new
config term to define the aggregation method (Average, Total,
Peak et al).
.. grouping and smoothing is applied in UserChart not the Generic
chart or plot, so this functionality will not be available from
Python and R charts (mostly because axis management and config
is done differently).
Fixes#3999.
.. Tab becomes AthleteTab - since Tab is almost meaningless
TabView becomes AbstractView - since its the base for all the views
there are no functional changes or fixes in this commit.
.. User charts can be scaled (lines, texts, markers, legend)
.. Plot area background color honours overview card color
when we're on an overview.
.. when adding a user chart to an overview make it span a couple
of columns and 3 times deeper than a metric tile.
NOTE:
There are two bugs that need to be squashed individually
and are related to user charts on overview:
1. Mouse event handling seems to be broken for user
charts in Overview.
2. User chart axis colors are always black when the series
are configured to use named colors.
.. User Chart annotation labels now work when a standard color
has been selected.
.. The name of the standard color "CP Curve" has been renamed
to "Mean-maximal Power" to more accurately reflect how it
is used in the Critical Power standard charts.
.. Global settings (themes, metadata etc) are now maintained
in the config dialog as in the past, whilst athlete settings
(such as zones, measures etc) are now maintained in a new
config dialog accessible from the athlete view (gear icon).
.. Config changes are communicated via two signals;
* Context::configChanged(qint32)
* GlobalContext::configChanged(qint32)
Crucially, all global context signals are cascaded through
the athlete contexts-- so athlete specific widgets only
need to connect to the athlete context signal (and will get
athlete and global config change notifications).
Whilst global widgets such as the sidebar and mainwindow
need only connect to the globalcontext signal since they
are not interested in athlete specific details.
[publish binaries]
.. GlobalContext::context() provides a global context that is not
tied to an athlete or MainWindow.
.. At present it just offers signals for config changes but will
likely see more context move across as the application preferences
and athlete configuration are separated as we enhance support
for multiple athletes.
.. Enable click through from the data points on a generic chart
when on trends view.
.. This commit includes the 'addCurve' bindings to pass the
activity filenames from R, Python and the User Chart.
.. It also includes a new DataFilter function 'filename' to
get a vector of strings that are the filenames for the
activities in the selected date range (or the filename
for the currently selected activity).
.. The second commit will include the interaction code for
GenericPlot to click-thru a selection.
.. Update builtin functions to support working with strings as well
as numeric vectors; e.g. sort, uniq, aggregate
.. next commit will add some new functions that are specific to
working with strings; e.g. tolower/upper, split, replace.
.. due to qt-bug 62285 we need to use local time not UTC for timespec
since qt charts converts to local time internally.
.. this fixes axes starting at 1hr instead of 0h.
.. be consistent with dates and always work with days since
1900/01/01. That way date arithmetic is consistent in the
data filter.
.. the GenericChart converts data to MS since Epoch if the axis
is a date range, in the same way it does for Time axes.
.. allow data labels for points on the chart, added to User, R and
Python chart addCurve() etc.
.. NOTE: opengl painting ignores this setting so should be disabled
for data series that want labels. We do not do this
automatically, but might consider that later.
.. add annotation labels from within a datafilter, ultimately
gets shown alongside the legend in generic plot.
.. this only works from a user chart, so need to add an equivalent
API to call from Python and R.
.. you can now configure if a series is shown on the legend, this is
for lines or curves that are there for illustration but do not
need to be displayed in the legend / hovered.
.. support for axes that are time based, assuming the user has
supplied in seconds starting from 0 (which is true for an
activity).
.. since QT charts requires times to be in MS since Epoch
and we don't know if we need to convert from seconds
until the axis is configured the series data is updated
just before charts are created in GenericChart.
This means that anyone using generic plot directly will
need to do this conversion. For this reason all integration
across the GC codebase should be via GenericChart.
R, Python and now User charts integrate via Generic Chart
so this should not really be an issue.
.. setUpdatesEnabled() to stop output did not help at
all with respect to the jarring effet of watching
plots added when in stack mode.
.. for some reason adding this QApplication::processEvents()
fixes that. Go figure.
Fixup stack view a) minimum height for plots, b) added a
scroll area to manage more plots than fit on the screen
and will layout horizontally or vertically.
Stack charts now when set as an option, in which case all
data series are given their own plot.
Or alternatively, where data series have different x-axis
names, they get a plot for each x-axis.
Need to fixup a) minimum height as can get squashed and
b) scroll area needed as well as c) layout direction.
.. added GenericChart which manages a collection of plots, so
you can plot multiple series stacked (like in AllPlot).
.. additionally added option to set layout vertical or
horizontal, since its useful to layout scatter plots
horizontally where time series will be largely vertical.
.. at this point the code is slightly refactored to add
GenericChart between PythonChart and GenericPlots.
.. will shortly add code to support managing multiple plots
in layouts and adapting if settings change (.e.g the
python script is edited, settings are changed).