Skip to content

Custom types: Clarify how name impacts behavior, consider alternatives to hardcoded types in tinyplot::tinyplot #543

@katrinabrock

Description

@katrinabrock

Currently there are several places in the tinyplot::tinyplot function where there are different logic branches for different build-in types.

Examples:

https://github.com/grantmcdermott/tinyplot/blob/main/R/tinyplot.R#L1369-L1372

https://github.com/grantmcdermott/tinyplot/blob/main/R/tinyplot.R#L1176

There a couple usability issues with this:

  1. It's not clear from the documentation exactly behavior is controlled by this name variable. In the vignette, it says "fallback behaviour same as "p" type (e.g., legend defaults)" and "think of it as a convenient way to inherit default/fallback behaviour from an existing plot type". But exactly what behavior is controlled by this param, and thus the consequences of choosing one built-in plot type over another is unclear. (For example, what are the consequences of choosing "l" vs "segments" if building a plot type where either could potentially fit?)
  2. IMO It would be even nicer if the options that are currently controlled by these hard-coded type names in tinyplot::tinyplot could instead be controlled by the output of the type_x() function somehow. Maybe in the settings object? In the above examples, it looks like those options are whether empty plots are disallowed and the default x and y labels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions