LuisSanchez commented on code in PR #36993:
URL: https://github.com/apache/superset/pull/36993#discussion_r2741369758
##########
superset-frontend/src/explore/components/ExploreViewContainer/index.jsx:
##########
@@ -571,6 +571,29 @@ function ExploreViewContainer(props) {
}
}
+ // Automatically set axis title margins when titles are added or removed
+ if (changedControlKeys.includes('x_axis_title')) {
+ const xAxisTitle = props.controls.x_axis_title?.value || '';
+ const currentMargin = props.controls.x_axis_title_margin?.value ?? 0;
+
+ if (xAxisTitle && currentMargin < 30) {
+ props.actions.setControlValue('x_axis_title_margin', 30);
+ } else if (!xAxisTitle && currentMargin !== 0) {
+ props.actions.setControlValue('x_axis_title_margin', 0);
+ }
+ }
+
+ if (changedControlKeys.includes('y_axis_title')) {
+ const yAxisTitle = props.controls.y_axis_title?.value || '';
+ const currentMargin = props.controls.y_axis_title_margin?.value ?? 0;
+
Review Comment:
Logic was updated to automatically set margin to 30 when adding / updating
title if current margin is less than 30 (X and Y axis).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]