Plotly bar chart dynamic labels are getting cut off

I have a horizontal bar chart in my shiny app created by Plotly where the values and tick labels are dynamic names chosen according to user's input. The length of the labels varies and therefore the long labels getting cut off, the expectation of the left margin is that it should push the chart to the right. Just wondering if there is any way to fix this.


Recent versions of plotly have a automargin feature enabled by default, which should help workaround this problem, but there are cases where the constraints of the plot's container make it impossible to display the string sensibly. In this case, you might want to specify the layout.margin.l and/or layout.width

For any more specific advice I'd need a reprex: