You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the PR. Looking good to me at first glance.
In respect to adding this new attribute to the API, let me request a review from @nicolaskruchten and @alexcjohnson.
@s417-lama we are planning next plotly.js minor (possibly next week) to include new features like this one.
Do you have time to address the remaining comments, so that we could include this feature?
Is there some architectural reason why itemwidth must be at least 30? In some of the plots I would like to have shorter handles, I don't see an easy way to override this without manually creating a legend using manual annotations.
Following up on this, why is itemwidth restricted to be at least 30. I would love to create legends using e.g., itemwidth: 20 in layout.legend.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
It was hard to distinguish different line types (
dashordashdot) in legends because the width of legend items were small.Scatter plot of

dashanddashdotlines:What I did
I added
legend.itemwidthoption to configure the width of legend items.By setting

legend.itemwidth = 60:The option name
itemwidthmight be controversial; for example, in matplotlib, the corresponding option name ishandlelength.