Skip to content

Conversation

@r0h1tK7
Copy link

@r0h1tK7 r0h1tK7 commented Sep 1, 2025

Description

This pull request introduces a new feature that adds a font size slider to most of the plotting tabs in the application. The primary goal of this enhancement is to improve user experience by allowing for dynamic customization of plot text elements, such as titles, axis labels, and tick marks. This feature provides better readability for analysis and presentation purposes.

The font size slider has been implemented on the following tabs:

  • Annotations
  • Anno. Vs Anno.
  • Boxplot
  • Features
  • Nearest Neighbors
  • Scatterplot
  • Spatial
  • UMAP

Environment

  • OS: macOS
  • Editor: VS Code
  • Package Manager: Conda
  • Branch: font_size_rk

Implementation

The implementation of this feature was divided into two main parts:

  1. UI Enhancements:
  • A ui.input_slider component was added to the sidebar of each respective _ui.py file for the tabs listed above.
  • Each slider is configured with a reasonable min, max, and default font size value to ensure a good user experience out of the box.
  1. Server-Side Logic:
  • The corresponding _server.py file for each tab was modified to read the integer value from the new font size slider upon the "Render Plot" action.

The font size is applied differently depending on the plotting library used by the tab:

  • For matplotlib and seaborn based plots, the font size is set globally for the plot using plt.rcParams.update({'font.size': font_size})
  • For plotly based plots, the font size is applied directly to the figure's layout using fig.update_layout(font=dict(size=font_size))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant