Skip to content

Fix UserJobEfficiencyComponenet and other dashboard errors#2129

Open
aestoltm wants to merge 5 commits intoubccr:mainfrom
aestoltm:fix_user_efficiency_component
Open

Fix UserJobEfficiencyComponenet and other dashboard errors#2129
aestoltm wants to merge 5 commits intoubccr:mainfrom
aestoltm:fix_user_efficiency_component

Conversation

@aestoltm
Copy link
Copy Markdown
Contributor

@aestoltm aestoltm commented Dec 3, 2025

Description

@aaronweeden pointed out an error with the UserJobEfficiencyComponenet dashboard component. The issue was we assumed that plots always have an axis property when some custom plots do not. While exploring the issue I also found various issues with plots that do not have a subtitle.

Motivation and Context

UserJobEfficiencyComponenet dashboard component did not work at all. Other plots had resizing errors (if no subtitle)

Tests performed

Tested on my dev port

Checklist:

  • The pull request description is suitable for a Changelog entry
  • The milestone is set correctly on the pull request
  • The appropriate labels have been added to the pull request

@aestoltm aestoltm requested a review from aaronweeden December 3, 2025 21:01
@aestoltm aestoltm self-assigned this Dec 3, 2025
@aestoltm aestoltm added bug Bugfixes Category:Metric Explorer Metric Explorer / Usage labels Dec 3, 2025
@aestoltm aestoltm added this to the 11.5.0 milestone Jan 13, 2026
*/
function adjustSubtitle(layout, subtitleIndex, legendTopCenter, firstRender) {
let prevLineCount = layout.annotations[1].text.match(/<br \/>/g);
let prevLineCount = layout.annotations[`${subtitleIndex}`].text.match(/<br \/>/g);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

how come you are converting the subtitleIndex variable to a string to do the array lookup? What is the difference between yyour code and layout.annotations[subtitleIndex]

update['legend.y'] -= 0.025;
update['margin.t'] += chartDiv._fullLayout.legend._height + subtitleHeight;

// Observed inconsistency with margin when subtitle is one line long. Unsure of the cause.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment is not particularly useful - what is the inconsistency? how does this relate the code that the comment is next to?


// Observed inconsistency with margin when subtitle is one line long. Unsure of the cause.
if (lineBreakCount > 0) {
if (firstRender) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please can you explain the logic here. It seems like on the first render you ignore the subtitle settings. How come?

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

Labels

bug Bugfixes Category:Metric Explorer Metric Explorer / Usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants