Skip to content

consistent text mode #4247

Description

@nicolaskruchten

We need a simple way to guarantee that the text displayed within/across traces of the same type is in the same size and orientation. For example if I have two bar traces in a plot with text visible, the text should all be of the same size and either all vertical or all horizontal. Likely this will mean making it all as small as necessary to fit the largest bit of text.

We likely want this to work within treemaps as well: being able to guarantee that short labels aren't being displayed bigger than long labels.

For pies and sunbursts obviously orientation is a bit trickier because it's relative to the sector but for size the logic should be the same. I would expect that below a certain size the text could all be horizontal and above a certain size the text would all just be oriented radially or something.

I don't think we need this to work across trace types (although it should work across traces), e.g. same font size for bars and treemaps in the same figure (but different bar traces should coordinate).

We should probably provide a min/max font size along with some kind of defined fallback if the required size to make it fit is outside of those bounds.

Activity

  1. etpinard commented on Oct 2, 2019

    @etpinard
    Contributor

    For pies and sunbursts obviously orientation is a bit trickier

    Related: #3590

  2. added this to the v1.52.0 milestone on Oct 31, 2019
  3. self-assigned this
    on Nov 19, 2019
  4. archmoj commented on Nov 29, 2019

    @archmoj
    Contributor

    Any idea for attribute names?

  5. nicolaskruchten commented on Nov 29, 2019

    @nicolaskruchten
    ContributorAuthor

    maybe layout.tracetext = {min, max, mode}
    where mode can be clamp or hide ?
    maxmode and minmode?
    so if the text is smaller than min and the minmode is clamp then you set the size to min and overflow
    otherwise you hide?

  6. archmoj commented on Dec 2, 2019

    @archmoj
    Contributor

    I am thinking of adding a module called crossTracePlot.

  7. archmoj commented on Dec 2, 2019

    @archmoj
    Contributor

    How this should operate between subplots?

  8. nicolaskruchten commented on Dec 2, 2019

    @nicolaskruchten
    ContributorAuthor
  9. archmoj commented on Dec 2, 2019

    @archmoj
    Contributor

    So with traces in two different subplots should they use an identical minimum or two minimum values?

  10. nicolaskruchten commented on Dec 2, 2019

    @nicolaskruchten
    ContributorAuthor

    identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions