Spaces:
Running
Fix: Scatter plot zoom and 'Show all labels' not working
Summary
This PR fixes the scatter plot functionality in the OpenHands Index leaderboard where:
- Zoom not working - Logo icons were using domain coordinates instead of data coordinates, causing them to not zoom/pan with the chart
- 'Show all labels' not working - Labels were only shown for Pareto frontier points even when 'Show all labels' was enabled
Changes
The fix synchronizes leaderboard_transformer.py from the staging branch which correctly:
- Uses data coordinates (
xref="x", yref="y") instead of domain coordinates (xref="x domain", yref="y domain") for logo placement so they zoom/pan correctly with the chart - Implements the
show_all_labelsparameter properly to show labels for all data points when enabled
Files Changed
leaderboard_transformer.py: Fixed scatter plot zoom behavior and show_all_labels functionality
This was tested on openhands-index-staging space and is ready to be merged to main.
Summary of Changes
This PR contains the fix for the scatter plot functionality:
Changes Made:
The file leaderboard_transformer.py has been updated to fix two issues:
Zoom functionality - Changed logo/icon positioning from domain coordinates (
xref="x domain", yref="y domain") to data coordinates (xref="x", yref="y") so they zoom/pan correctly with the chart'Show all labels' toggle - The
show_all_labelsparameter now properly shows labels for all data points when enabled (not just Pareto frontier points)
Technical Details:
- Line 1309-1343: Added
if show_all_labels:block to show labels for all points - Line 1279-1305: Changed from
xref="x domain"toxref="x"for proper zoom behavior
How to Test:
- Go to https://huggingface.co/spaces/OpenHands/openhands-index-staging
- Zoom in on a scatter plot - logos should zoom/pan with the chart
- Toggle 'Show all labels' - all labels should appear when enabled
The fix is ready to be merged to main.
Closing this empty PR. The fix has been committed to the fix-scatter-plot-labels-zoom branch. See the branch commits for the actual fix.
Closing this empty PR. The fix has been committed to the fix-scatter-plot-labels-zoom branch.