Word wrap for long labels
Open
Nobody has claimed this yet.
feature
P3
- Dominant language
- JavaScript
- Stars
- 18.3k
- Forks
- 2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Description
Is there an option to reflow long text labels?
- For example, a long label without reflow (plotly tries to autocorrect by slanting the labels instead of reflowing the text, but it still doesn't fit)
- And a simple manual fix with a few
<br>in the code that I'd like to have Plotly be able to do with a simplewrap: trueoption
JS code for this chart
var data = [{
// first screenshot labels
//x: ['giraffes', 'orangutans', "Very Long Text Label That Doesn't Fit Properly"],
// second screenshot labels
x: ['giraffes', 'orangutans', "Very Long<br>Text Label That<br>Doesn't Fit<br>Properly"],
y: [20, 14, 23],
type: 'bar'
}]
Plotly.newPlot('PlotlyDivSimple', data, {})
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue provides a Plotly.newPlot example but names no repository file or test. Start by tracing how Plotly.newPlot lays out and renders categorical labels, then identify the relevant label tests; done means a wrapping option reflows long labels as requested while retaining explicit br-line breaks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100