Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support simple subtitle parameter (like title) #6856

Closed
mjainGH opened this issue Jan 18, 2024 · 10 comments · Fixed by #7012
Closed

Support simple subtitle parameter (like title) #6856

mjainGH opened this issue Jan 18, 2024 · 10 comments · Fixed by #7012
Assignees
Milestone

Comments

@mjainGH
Copy link

mjainGH commented Jan 18, 2024

Image from Figma mock by @TonyBurbs :

Screen Shot 2024-05-15 at 11 57 46 AM

@TonyBurbs
Copy link

Here is a link to figma for the lowest touch effort:
https://www.figma.com/design/tp9E4awumSOuCG1ZNev09z/Plotly.js-Design-System?node-id=21676%3A325474&t=aE2dNlExZS4pbsNs-1
It's adding in the subtitle and citation without any other major design changes

@ndrezn ndrezn assigned emilykl and unassigned ndrezn May 14, 2024
@emilykl
Copy link
Contributor

emilykl commented May 16, 2024

API for subtitle

  • Same API as title
  • Add a subtitle property directly under layout with the same properties as title

Structure:

  • layout
    • subtitle
      • text: str
      • font: standard font options

@archmoj API-wise this seems pretty straightforward -- do you have any thoughts or suggestions?

@archmoj
Copy link
Contributor

archmoj commented May 16, 2024

I think it should go inside layout.title object instead of layout.
It reminds of when we added minor ticks in #6166.

That would also allow adding multiple titles and subtitles later on.

@archmoj
Copy link
Contributor

archmoj commented May 16, 2024

Also it would be nice (and possibly easy) to have the subtitle option available on the cartesian axes and other places too.

@archmoj
Copy link
Contributor

archmoj commented May 16, 2024

For a quick prototype, perhaps you could add the subtitle text to the end of title.text with a <br> and style it differently.

@alexcjohnson
Copy link
Collaborator

I think it should go inside layout.title object instead of layout. It reminds of when we added minor ticks in #6166.

That would also allow adding multiple titles and subtitles later on.

I think that’s right. Also makes it clear that it inherits positioning from the title (presumably with optional overrides to at least the spacing relative to the main title) and it can inherit the main title font (but smaller, and remove bold if you bolder the main font?)

@emilykl
Copy link
Contributor

emilykl commented May 17, 2024

@archmoj @alexcjohnson Makes sense -- do you mean something like the below?

  • layout
    • title
      • subtitle
        • text
        • font

@archmoj
Copy link
Contributor

archmoj commented May 17, 2024

@archmoj @alexcjohnson Makes sense -- do you mean something like the below?

-layout

  • title

    • subtitle

      • text
      • font

Yes. Let's start with just that. Perhaps we rename subtitle to sub later.

@emilykl emilykl mentioned this issue May 17, 2024
@emilykl
Copy link
Contributor

emilykl commented May 23, 2024

As suggested by @archmoj : A simple working prototype which uses HTML tags to simulate a subtitle:

https://codepen.io/emilykl-code/pen/MWdKYmr

@archmoj
Copy link
Contributor

archmoj commented May 24, 2024

One may wants to add an attribute e.g. spacing (in pixel?) to help increase the space between the title and subtitle.
But I am not sure where it should go in the API i.e. title.spacing or title.subtitle.spacing?

@emilykl emilykl mentioned this issue Jun 4, 2024
3 tasks
@archmoj archmoj removed the Cycle-13 label Jun 25, 2024
@archmoj archmoj added this to the v2.34.0 milestone Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants