Improve and document handling of linecolour and linetype #94
Labels
enhancement
New feature requests or suggestions for enhancement of existing features
help wanted
We are looking for someone to help with this issue
plots
Issue relates to plotting functionality
Currently the handling of the colour and linetypes used in mizer plots is a mess. There are some good aspects to it, but they are undocumented and hidden in the mess. It would be really good if someone could clean this up.
Here is a description of how things are handled at the moment:
There are two slots in a MizerParams object:
When a new MizerParams object is created with
emptyParams()
, these slots get initialised with hard-coded values, except where the user included columnslinetype
andlinecolour
in the species_params data frame. This happens in lines 575 and following in the file MizerParams-class.R.The mizer plots, which are created with ggplot2, then use the
@linecolour
slot viascale_colour_manual()
andscale_linetype_manual()
.The
@linecolour
and@linetype
slots are also modified in the functionsaddSpecies()
,removeSpecies()
andrenameSpecies()
, for obvious reasons.Linetypes and linecolours for unstructured resources are currently set in
setResourceDynamics()
, but because the code for unstructured resources is going to be taken out of mizer again, to be placed into a mizer extension, you can ignore that code. But the message is that extensions will need to be able to add extra entries into the linecolours and linetypes slots or whatever takes their place in your improved scheme.There are two very desirable goals for any improvement:
The setting of line colours and types should be documented
The default colour palette should not be hardcoded but changeable by the user, possibly by setting an options variable.
In addition, it would be nice to make the code a bit more elegant and robust.
The text was updated successfully, but these errors were encountered: