diff --git a/applications/aws_dashboard/pages/models/layout.py b/applications/aws_dashboard/pages/models/layout.py index 5a381568e..07994f664 100644 --- a/applications/aws_dashboard/pages/models/layout.py +++ b/applications/aws_dashboard/pages/models/layout.py @@ -15,7 +15,7 @@ def models_layout( plugin_rows = [ dbc.Row( plugin, - style={"padding": "0px 0px 0px 0px"}, + style={"padding": "0px 0px 20px 0px"} ) for component_id, plugin in kwargs.items() ] diff --git a/src/sageworks/web_interface/components/correlation_matrix.py b/src/sageworks/web_interface/components/correlation_matrix.py index 198074bf7..270fde511 100644 --- a/src/sageworks/web_interface/components/correlation_matrix.py +++ b/src/sageworks/web_interface/components/correlation_matrix.py @@ -81,9 +81,11 @@ def update_properties(self, data_source_details: dict) -> go.Figure: ) fig.update_layout(margin={"t": 10, "b": 10, "r": 10, "l": 10, "pad": 0}, height=height) - # Now remap the x and y axis labels (so they don't show the index) - fig.update_xaxes(tickvals=x_labels, ticktext=df.columns, tickangle=30, showgrid=False) - fig.update_yaxes(tickvals=y_labels, ticktext=df.index, showgrid=False) + # Truncate labels to a maximum of 23 characters + x_axes_labels = [f"{c[:20]}..." if len(c) > 23 else c for c in df.columns] + y_axes_labels = [f"{c[:20]}..." if len(c) > 23 else c for c in df.index] + fig.update_xaxes(tickvals=x_labels, ticktext=x_axes_labels, tickangle=30, showgrid=False) + fig.update_yaxes(tickvals=y_labels, ticktext=y_axes_labels, showgrid=False) # Now we're going to customize the annotations and filter out low values for i, row in enumerate(df.index): diff --git a/src/sageworks/web_interface/components/plugins/confusion_matrix.py b/src/sageworks/web_interface/components/plugins/confusion_matrix.py index cd1182619..01518bee4 100644 --- a/src/sageworks/web_interface/components/plugins/confusion_matrix.py +++ b/src/sageworks/web_interface/components/plugins/confusion_matrix.py @@ -94,7 +94,7 @@ def update_properties(self, model: CachedModel, **kwargs) -> list: # Apply theme-based layout updates fig.update_layout( template=pio.templates.default, # Use the current theme - margin=dict(l=90, r=10, t=15, b=70), # Custom margins + margin=dict(l=100, r=10, t=15, b=80), # Custom margins height=360, # Fixed height for consistent layout xaxis_title="Predicted", # Add meaningful axis labels yaxis_title="Actual", diff --git a/src/sageworks/web_interface/components/regression_plot.py b/src/sageworks/web_interface/components/regression_plot.py index fc8043abb..e0964ca31 100644 --- a/src/sageworks/web_interface/components/regression_plot.py +++ b/src/sageworks/web_interface/components/regression_plot.py @@ -77,7 +77,7 @@ def update_properties(self, model: Model, inference_run: str) -> go.Figure: ) # Just some fine-tuning of the plot - fig.update_layout(margin=dict(l=70, r=10, t=15, b=50), height=360) # Custom margins + fig.update_layout(margin=dict(l=80, r=10, t=15, b=60), height=360) # Custom margins return fig diff --git a/src/sageworks/web_interface/components/violin_plots.py b/src/sageworks/web_interface/components/violin_plots.py index e84cec1b8..141961d2a 100644 --- a/src/sageworks/web_interface/components/violin_plots.py +++ b/src/sageworks/web_interface/components/violin_plots.py @@ -62,8 +62,10 @@ def update_properties(self, df: pd.DataFrame, figure_args: dict, max_plots: int num_rows, num_columns = self._compute_subplot_layout(num_plots) fig = make_subplots(rows=num_rows, cols=num_columns, vertical_spacing=0.07) for i, col in enumerate(numeric_columns): + # Truncate labels to a maximum of 23 characters + label = f"{col[:20]}..." if len(col) > 23 else col fig.add_trace( - go.Violin(y=df[col], name=col, **figure_args), + go.Violin(y=df[col], name=label, **figure_args), row=i // num_columns + 1, col=i % num_columns + 1, )