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

Graph: Fix legend overlapping graph area #67912

Merged
merged 1 commit into from
May 9, 2023

Conversation

ashharrison90
Copy link
Contributor

What is this feature?

  • react 18 removed the concept of render callbacks
  • the quick/lazy option was to use requestIdleTimeout, but i didn't realise it wasn't supported in safari 😬
  • instead, let's implement the less lazy option of passing a render callback to the legend as recommended here
  • this is kind of ugly, but the graph panel is very deprecated and will be gone in grafana 11 🤷‍♂️

Why do we need this feature?

  • correctly render a graph panel with legend
  • stop using requestIdleTimeout which isn't supported in safari

Who is this feature for?

  • anyone still using graph panel in grafana 10

Which issue(s) does this PR fix?:

Supersedes #67840

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@ashharrison90 ashharrison90 added area/frontend no-changelog Skip including change in changelog/release notes backport v10.0.x labels May 5, 2023
@ashharrison90 ashharrison90 added this to the 10.0.0 milestone May 5, 2023
@ashharrison90 ashharrison90 requested a review from a team May 5, 2023 13:12
@ashharrison90 ashharrison90 requested a review from a team as a code owner May 5, 2023 13:12
@ashharrison90 ashharrison90 self-assigned this May 5, 2023
@grafanabot
Copy link
Contributor

Hello @ashharrison90!
Backport pull requests need to be either:

  • Pull requests which address bugs,
  • Urgent fixes which need product approval, in order to get merged,
  • Docs changes.

Please, if the current pull request addresses a bug fix, label it with the type/bug label.
If it already has the product approval, please add the product-approved label. For docs changes, please add the type/docs label.
If the pull request modifies CI behaviour, please add the type/ci label.
If none of the above applies, please consider removing the backport label and target the next major/minor release.
Thanks!

Copy link
Contributor

@simPod simPod left a comment

Choose a reason for hiding this comment

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

I've tested this on our instance and can confirm it works as expected.

@ashharrison90 ashharrison90 requested review from a team, tskarhed, L-M-K-B, leeoniya and joshhunt and removed request for a team May 9, 2023 09:57
@ashharrison90 ashharrison90 merged commit 8e75243 into main May 9, 2023
20 of 21 checks passed
@ashharrison90 ashharrison90 deleted the ash/graph-render-callback branch May 9, 2023 14:26
grafanabot pushed a commit that referenced this pull request May 9, 2023
use render callback instead of requestIdleTimeout

(cherry picked from commit 8e75243)
ashharrison90 added a commit that referenced this pull request May 9, 2023
Graph: Fix legend overlapping graph area (#67912)

use render callback instead of requestIdleTimeout

(cherry picked from commit 8e75243)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
@zerok zerok modified the milestones: 10.0.0, 10.0.0-preview, 10.1.x May 31, 2023
@ricky-undeadcoders ricky-undeadcoders modified the milestones: 10.1.x, 10.1.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend backport v10.0.x no-changelog Skip including change in changelog/release notes type/bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants