Skip to content

Template quirk #4980

Closed
Closed
@alexcjohnson

Description

@alexcjohnson

A strange effect of #4904:

  • If you want to use the template to override default colors for axis lines that are hidden by default, now you need to explicitly hide those lines.
  • We decided in that PR that this behavior is more self-consistent, because that's how the regular figure attributes work: if you provide a color, it makes the line visible by default. So the template should do that too, otherwise it has a strange difference vs a regular figure.
  • EXCEPT that templates are often used just to provide new defaults but the intent is not to override other parts of the logic. In the case of axis lines this has two undesirable effects:
    • Sometimes the data itself causes the lines to show. For example bar charts by default turn on the zero line. But now if you have a template that recolors the zero line and then turns it back off, bar charts won't be able to automatically turn it back on.
    • If the user provides a new color for the line in the main figure, it won't cause the line to turn on, as it would without the template present.

Both of these are demonstrated in https://codepen.io/alexcjohnson/pen/VweyRJe?editors=1010 - without the template, both the xaxis line and the x=0 line show:
Screen Shot 2020-07-03 at 3 03 07 PM
But with the template they both disappear:
Screen Shot 2020-07-03 at 3 03 23 PM

Since there is a clear use case for both variants, I kind of think we need a new concept in the template, of a "new default" value, that doesn't count as having provided a value, so can't affect any other logic.

@archmoj @nicolaskruchten @wbrgss thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions