clustree
clustree copied to clipboard
Redesign aesthetics interface (possibly tidyeval)
The current interface for defining aesthetics using metadata columns requires a string giving the name of the column (e.g. node_AES) and a string giving the name of a function to summarise samples in each cluster (e.g. node_AES_aggr). This approach has the following limitations:
- Can't use anonymous functions (e.g.
node_colour_aggr = function(x) {...}) (doing this has other issues around naming) - Only one column can be used for each aesthetic
- Can't set other arguments in functions
- Many function arguments, need (at least) two for each aesthetic
How could we address some of these issues?
- Use tidyeval
- Use non-standard evaluation, e.g. names instead of strings
- Specify aesthetics using a list
aes = list(node_colour = list(func = mean, x = colA), ...)
- Directly pass ggplot
aes
Possible issues to consider:
- Allowing static aesthetics (e.g. `node_colour = "red")
- Checking function arguments exist
- Summarise columns
- Naming
Allow direct passing of summarised node statistics for aesthetics, possible via a node_metadata argument. See #31 for example.