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

Add "top left" & "top center" side options to legend title #6711

Merged
merged 6 commits into from
Aug 22, 2023

Conversation

28raining
Copy link
Contributor

To help solve #6668

Added more options to 'side' inside layout -> legend so that when legend is in horizontal orientation the title can be aligned [left, center, right]

One strange thing is that 'top center' and 'top right' work as expected, but to get 'top left' you need to use 'top'.
Because 'top left' is already being used to move the title to the outside-left-side of the legend.
IMO it's a weird behavior but it's been purposely coded, so I didn't touch it

@28raining
Copy link
Contributor Author

mapbox is failing because this domain is down / gone

https://img.nj.gov

which is used in this baseline:
plotly.js/test/image/mocks/mapbox_layers.json

@archmoj
Copy link
Contributor

archmoj commented Aug 21, 2023

Thanks for the PR.
FYI - The baseline tests were now passed.

@archmoj archmoj added feature something new community community contribution status: reviewable labels Aug 21, 2023
@archmoj
Copy link
Contributor

archmoj commented Aug 21, 2023

Great PR.
1 - Let's modify one of the mocks so that it has the top right option.
2 - What does happen if you have these options on a legend with the orientation set to v?

@28raining
Copy link
Contributor Author

Thank you.
1 - Top right test added to existing mock. This highlighted need to account for right-side-border
2 - Added top center to a vertical legend mock. Top, top center and top right do work with vertical too, I believe it's orientation agnostic.

@archmoj archmoj changed the title Adding horixontal alignment for horizontal legend title Add horizontal alignment for legend title Aug 22, 2023
@archmoj
Copy link
Contributor

archmoj commented Aug 22, 2023

Nicely done.
Thanks very much for the PR.
💃

@archmoj archmoj merged commit 46278f5 into plotly:master Aug 22, 2023
1 check passed
@archmoj archmoj changed the title Add horizontal alignment for legend title Add "top left" & "top center" side options to legend title Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community community contribution feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants