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

plotly title font size fix #5920

Merged
merged 4 commits into from
Jun 6, 2024
Merged

Conversation

jj-github-jj
Copy link
Contributor

@jj-github-jj jj-github-jj commented Oct 3, 2023

Fixes #5919

fixes plotly title font size

Copy link
Member

@hoxbro hoxbro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution +1:

I think it would be cleaner to do something like this. What do you think?

  def _format_title(self, key, separator=' '):
      """
      Formats the title of the plot.
      """
      title = super()._format_title(key, separator)

      if self.fontsize is not None and "title" in self.fontsize:
          title = {"text": title, "font": {"size": self.fontsize["title"]}}

      return title

A test that confirms that the text size is correct would also be good to have. Which should be possible with hv.render(plot).

And the failing test is likely not related to your PR.

@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.53%. Comparing base (dd0e4d5) to head (c10ee0c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5920   +/-   ##
=======================================
  Coverage   88.53%   88.53%           
=======================================
  Files         323      323           
  Lines       67797    67806    +9     
=======================================
+ Hits        60021    60030    +9     
  Misses       7776     7776           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jj-github-jj
Copy link
Contributor Author

Thank you for your contribution +1:

I think it would be cleaner to do something like this. What do you think?

  def _format_title(self, key, separator=' '):
      """
      Formats the title of the plot.
      """
      title = super()._format_title(key, separator)

      if self.fontsize is not None and "title" in self.fontsize:
          title = {"text": title, "font": {"size": self.fontsize["title"]}}

      return title

A test that confirms that the text size is correct would also be good to have. Which should be possible with hv.render(plot).

And the failing test is likely not related to your PR.

Agree with your changes. Thanks

@hoxbro
Copy link
Member

hoxbro commented Oct 9, 2023

Are you up for implementing them?

@hoxbro hoxbro added the type: enhancement Minor feature or improvement to an existing feature label Nov 23, 2023
@hoxbro hoxbro self-assigned this Jun 6, 2024
@hoxbro hoxbro added this to the 1.19.0 milestone Jun 6, 2024
@hoxbro hoxbro enabled auto-merge (squash) June 6, 2024 12:58
@hoxbro hoxbro merged commit e87f38c into holoviz:main Jun 6, 2024
14 checks passed
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Title font size not working in plotly backend
3 participants