Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
- Allow configuration of horizontal legend max height [[#7359](https://.com/plotly/plotly.js/pull/7359)]
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,18 @@ module.exports = {
editType: 'legend',
description: 'Sets the color of the border enclosing the legend.'
},
maxheight: {
valType: 'number',
min: 0,
editType: 'legend',
description: [
'Sets the max height (in px) of the legend, or max height ratio (reference height * ratio) if less than one.',
'Default value is: 0.5 for horizontal legends; 1 for vertical legends. The minimum allowed height is 30px.',
'For a ratio of 0.5, the legend will take up to 50% of the reference height before displaying a scrollbar.',
'The reference height is the full layout height except for vertically oriented legends with',
'a `yref` of `"paper"`, where the reference height is the plot height.'
].join(' ')
},
borderwidth: {
valType: 'number',
min: 0,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -188,6 +188,7 @@ function groupDefaults(legendId, layoutIn, layoutOut, fullData) {

coerce('xanchor', defaultXAnchor);
coerce('yanchor', defaultYAnchor);
coerce('maxheight', isHorizontal ? 0.5 : 1);
coerce('valign');
Lib.noneOrAll(containerIn, containerOut, ['x', 'y']);

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -3442,6 +3442,12 @@
"min": 30,
"valType": "number"
},
"maxheight": {
"description": "Sets the max height (in px) of the legend, or max height ratio (reference height * ratio) if less than one. Default value is: 0.5 for horizontal legends; 1 for vertical legends. The minimum allowed height is 30px. For a ratio of 0.5, the legend will take up to 50% of the reference height before displaying a scrollbar. The reference height is the full layout height except for vertically oriented legends with a `yref` of `\"paper\"`, where the reference height is the plot height.",
"editType": "legend",
"min": 0,
"valType": "number"
},
"orientation": {
"description": "Sets the orientation of the legend.",
"dflt": "v",
Expand Down