Fix Overlapping Labels in Feat vs Anno Heatmap with Enhanced Axis Controls#66
Conversation
docs: restructure README to focus on interactive visualization dashboard
- Rewrite README.md to focus specifically on SPAC real-time visualization layer - Add concise problem/solution format highlighting dashboard capabilities - Replace ecosystem overview with dashboard-specific features - Add live demo URL for immediate user access - Move detailed project information to separate TECHNICAL_DETAILS.md - Update Docker instructions to match Makefile commands - Add new screenshot of current dashboard interface - Streamline content for better user experience and clarity
…AP#61 small fixes - Update environment.yml to make it consistent with requirement.txt - Update README.md to include TA's name docs clean-up - Update .gitignore to include Jupyter section - Write clearer comments in Dockerfile; remove redundant comments
README: - Add a "Getting Started" section with a link to the getting_started.md - Add a "Contributing" section with a link to the CONTRIBUTING.md - Adjust the format of Project Team Members list and add year CONTRIBUTING: - Adjust the link to markdown format
Reformulation of Student Contributions on Documentation with Additional Updates for 25-26 Data Mine Team
This comment was marked as outdated.
This comment was marked as outdated.
- move dendrogram checkbox from server to ui - move abbreviation slider from server to ui
- remove unused rendering state variable - relocate variables to make the codes more modular (cmap, fontsize) - rename fontsize as axis_fontsize for future implementation of figure_fontsize - relocate adata generation process
bcb6002 to
75ab314
Compare
- Add module-level docstrings to feat_vs_anno_server.py and feat_vs_anno_ui.py - Add NumPy-style docstrings to server and UI functions - Fix docstring quote style to use triple double quotes
- Implement req() checks for required inputs in heatmap generation - Add try/except blocks with logging to handle errors gracefully - Add defensive checks in update_min_max to prevent race conditions during dataset switching - Handle empty data/NaN cases to prevent crashes in min/max calculations - Initialize module-level logger
- Add `utils/plot_utils.py` with type hints - Update `feat_vs_anno_server.py` to use new utility functions - Remove unused `accessible_slider` import from `feat_vs_anno_ui.py`
- remove unused import `accessible_slider` - add space after comma in color map list - remove resolved `TODO` in axis_settings
- Cover abbreviation logic with limits - Cover font styling application - Mock matplotlib objects for isolation - Cover edge cases: empty lists, zero limits, unicode Resolves code-review issue 20
- Add usage examples to abbreviate_labels() and apply_axis_style() docstrings
- Replace magic number with named LAYOUT_RECT constant and explanatory comment - Remove TODO comment about figure configuration since it's not relevant to the current changes
- Fix line lengths exceeding 79 characters in all modified files - Remove trailing whitespace from server, UI, and test files - Ensure consistent code formatting and indentation - Maintain readability while conforming to PEP 8 standards
There was a problem hiding this comment.
Final Code Review for PR #66: Feature vs Annotation Axis Settings Improvements
Generated by Copilot (with Claude Sonnet 4.5) with minor manul editions.
This is the final code review after resolving 20 issues arising from the initial review (also generated by copilot, referring to the contributing guides). See the hidden comment above for more details: #66 (review)).
Overview
This PR enhances the Feature vs Annotation heatmap visualization with significant improvements to UI/UX, code quality, and maintainability.
Changes Summary
- Restructured UI with collapsible sections for better organization
- Added Y-axis rotation and font size controls
- Implemented label abbreviation functionality
- Extracted reusable utility functions to
utils/plot_utils.py - Added comprehensive error handling and logging
- Created unit tests for utility functions
- Achieved full PEP 8 compliance
- Added NumPy-style docstrings throughout
Files Modified
server/feat_vs_anno_server.py- 63 lines changedui/feat_vs_anno_ui.py- 50 lines changedutils/plot_utils.py- 22 lines addedtests/test_utils/test_plot_utils.py- 73 lines added (new file)
✅ Strengths
Code Quality
- Excellent documentation: All functions have comprehensive NumPy-style docstrings with parameters, returns, and examples
- Robust error handling: Proper exception handling with specific
ValueErrorcatches and logging - Input validation: Appropriate use of
req()to prevent null reference errors - Defensive programming: Added None checks in
get_adata()to prevent crashes - Code reusability: Extracted
abbreviate_labels()andapply_axis_style()to utilities module
Testing
- Unit tests created: 6 comprehensive test methods covering:
- Basic abbreviation logic
- Edge cases (empty lists, zero limits)
- Unicode handling
- Style application
- Error prevention
Standards Compliance
- PEP 8 compliant: All line lengths ≤79 characters, no trailing whitespace
- Consistent formatting: Proper spacing, indentation, and code structure
- Convention commits: Clear, descriptive commit messages following project standards
UI/UX Improvements
- Better organization: Collapsible sections for plot and axis settings
- Enhanced controls: Y-axis rotation, font size, and label abbreviation options
- Responsive design: Proper scrolling with 85vh height containers
- Consistent styling: Follows patterns from
nearest_neighbor_ui.py
📊 Review Checklist
Critical Requirements ✅
- ✅ Module docstrings added to both server and UI files
- ✅ Function docstrings follow NumPy style
- ✅ All helper functions properly documented
- ✅ Error handling with logging implemented
- ✅ Input validation with
req()added
Code Quality ✅
- ✅ Utility functions extracted and reusable
- ✅ Defensive programming practices implemented
- ✅ Code duplication eliminated
- ✅ Magic numbers documented with constants
- ✅ Unused imports removed
Documentation ✅
- ✅ Function return values documented
- ✅ Usage examples included in docstrings
- ✅ Clear parameter descriptions
- ✅ TODO comments removed
Testing ✅
- ✅ Unit tests created for utility functions
- ✅ Edge cases covered
- ✅ Tests follow project patterns
Style Compliance ✅
- ✅ PEP 8 line length compliance (79 chars)
- ✅ No trailing whitespace
- ✅ Consistent spacing and formatting
- ✅ Proper import organization
💡 Optional Enhancements
Future Improvements (Not Blocking)
- ARIA Labels: Consider adding explicit
aria-labelattributes to input elements for enhanced screen reader supportui.input_numeric( "hm1_x_label_rotation", "Rotate X Axis Labels (degrees)", **{"aria-label": "X axis label rotation angle in degrees"} )
🎯 Recommendation
Status: ✅ APPROVED - READY TO MERGE
Completion: 19/20 items (95%)
This PR demonstrates excellent code quality and professionalism:
- All critical contributing guidelines requirements met
- Comprehensive documentation throughout
- Robust error handling and validation
- Full test coverage for new utilities
- Complete PEP 8 compliance
- Clean, maintainable code structure
The only remaining item (ARIA labels) is an optional accessibility enhancement that can be tracked as a future improvement if desired.
What This PR Delivers
✅ Enhanced user experience with improved axis controls
✅ Professional, maintainable codebase
✅ Reusable utility functions for the project
✅ Comprehensive test coverage
✅ Full compliance with contributing guidelines
Great work! This is a solid, production-ready contribution. 🎉
📝 Commits
test(fva): add unit tests for plot utilities- bcca35cdocs(plot_utils): add examples to utility functions- 70b033cfix(fva): code clean-up for better readability- 16c5a49style(fva): enforce PEP 8 compliance across feature vs annotation files- 61b0435
Reviewed on: February 10, 2026
Review based on: CONTRIBUTING.md and Copilot Instructions
- Add Mousumi Saha as a contributor - Label year of Data Mine Teams - Reorder 2025-2026 team members alphabetically
Description
This PR enhances the Feature vs Annotation heatmap visualization with improvements to UI/UX, code quality, and maintainability following contributing guidelines.
This PR fixes the issue of overlapping labels in heatmap.
Related Issue/PR
This work is based on student contributions in PR #51
This PR closes Issue Saran-Nag#22
Key Changes
1. Enhanced Axis Customization
2. UI/UX Redesign
Reorganized control panel into three collapsible sections for better usability:
3. Accessibility & Performance
altattributes for screen readers, accessible CSS with focus states, semantic HTML structurerenderUI/uiOutputwithconditionalPanelfor reduced reactivity overheadadataobject, standardizedhm1naming convention4. Code Quality & Standards
utils/plot_utils.pyreq()and defensive checksFiles Modified
server/feat_vs_anno_server.pyui/feat_vs_anno_ui.pyutils/plot_utils.py- New utility functions (22 new lines,abbreviate_labelsandapply_axis_style)tests/test_utils/test_plot_utils.py- Test suite (73 lines, new file, 6 tests for the above two utillity functions)TECHNICAL_DETAILS.md- Updated contributor informationVerification Results
Ready for Review