Skip to content

Wordwrap long legends#2128

Open
aestoltm wants to merge 19 commits into
ubccr:mainfrom
aestoltm:wordwrap_long_legends
Open

Wordwrap long legends#2128
aestoltm wants to merge 19 commits into
ubccr:mainfrom
aestoltm:wordwrap_long_legends

Conversation

@aestoltm
Copy link
Copy Markdown
Contributor

@aestoltm aestoltm commented Dec 3, 2025

Description

Depends on PR #2127 . Will also require PRs on the various XDMoD modules (https://github.com/ubccr/xdmod-xsede/pull/1099 and ubccr/xdmod-appkernels#145).

Add word wrapping to long legend entries. Plotly JS does not support automatic word wrap on legends, therefore, we have to pragmatically determine the word wrap condition based on the chart div width (also including when we resize the browser window).

Before:
before

After:
after

Motivation and Context

Long legends were unviewable before, especially detrimental for exported charts

Tests performed

Tested on 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 20:23
@aestoltm aestoltm added enhancement Enhancement of the functionality of an existing feature Category:Metric Explorer Metric Explorer / Usage labels Dec 3, 2025
@aestoltm aestoltm force-pushed the wordwrap_long_legends branch from 1112d73 to 26d783c Compare January 12, 2026 21:48
@aestoltm aestoltm added this to the 11.5.0 milestone Jan 13, 2026
) {
$rank = $meDataSeries['legendrank'] / 3;
$meDataSeries['name'] = "${rank}. " . $meDataSeries['name'];
$meDataSeries['oname'] = "${rank}. " . $meDataSeries['oname'];
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.

I don't quite understand the need to add yet another parameter to the chart config that is a copy of an existing parameter. The word wrapping is all done in the javascript, so why do you need a new parameter?

Also (assuming this new parameter is necessary): Is this going to cause breakage with existing saved charts? or with charts saved in the report generator?

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

Labels

Category:Metric Explorer Metric Explorer / Usage enhancement Enhancement of the functionality of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants