openhands openhands commited on
Commit
b6ec318
·
1 Parent(s): 800e404

Remove open/closed distinction from graph, use company logos as data points

Browse files

- Replaced colored markers (pink/yellow) with company logo images on scatter plots
- Downloaded official logos from SimpleIcons CDN (Anthropic, Google, Meta, HuggingFace)
- Created recognizable logos for OpenAI, Mistral, DeepSeek, Cohere, Moonshot
- Updated graph legend to show 'Company Logos' instead of 'Model Openness'
- Maintained invisible hover markers for tooltip functionality
- Model names still labeled on Pareto frontier points
- Tables still show company logos in first column

Co-authored-by: openhands <openhands@all-hands.dev>

assets/logo-alibaba.svg CHANGED
assets/logo-anthropic.svg CHANGED
assets/logo-cohere.svg CHANGED
assets/logo-deepseek.svg CHANGED
assets/logo-google.svg CHANGED
assets/logo-huggingface.svg ADDED
assets/logo-meta.svg CHANGED
assets/logo-mistral.svg CHANGED
assets/logo-moonshot.svg CHANGED
assets/logo-openai.svg CHANGED
assets/logo-unknown.svg CHANGED
assets/logo-xai.svg CHANGED
leaderboard_transformer.py CHANGED
@@ -548,60 +548,58 @@ def _plot_scatter_plotly(
548
  # Use consistent shape for all points (no tooling distinction)
549
  data_plot['shape_symbol'] = default_shape
550
 
551
- # --- Section 6: Plot Markers by "Openness" Category with Company Logos ---
552
  # Collect layout images for company logos
553
  layout_images = []
554
 
555
- for category in category_order:
556
- group = data_plot[data_plot['Openness'] == category]
557
- if group.empty:
558
- continue
559
-
560
- fig.add_trace(go.Scatter(
561
- x=group[x_col_to_use],
562
- y=group[y_col_to_use],
563
- mode='markers',
564
- name=category,
565
- showlegend=False,
566
- text=group['hover_text'],
567
- hoverinfo='text',
568
- marker=dict(
569
- color=color_map.get(category, 'black'),
570
- symbol=default_shape,
571
- size=15,
572
- opacity=0.8,
573
- line=dict(width=1, color='deeppink')
574
- )
575
- ))
576
 
577
- # Add company logo images for each point in this group
578
- for _, row in group.iterrows():
579
- model_name = row.get('Language Model', '')
580
- company_info = get_company_from_model_name(model_name)
581
- logo_path = company_info['path']
582
-
583
- # Read the SVG file and encode as base64 data URI
584
- if os.path.exists(logo_path):
585
- try:
586
- with open(logo_path, 'rb') as f:
587
- encoded_logo = base64.b64encode(f.read()).decode('utf-8')
588
- logo_uri = f"data:image/svg+xml;base64,{encoded_logo}"
589
-
590
- # Add image at data point position with small offset
591
- layout_images.append(dict(
592
- source=logo_uri,
593
- xref="x",
594
- yref="y",
595
- x=row[x_col_to_use],
596
- y=row[y_col_to_use],
597
- sizex=max_reported_cost * 0.06 if max_reported_cost > 0 else 0.5, # Scale relative to data
598
- sizey=3, # Fixed y size in data units
599
- xanchor="center",
600
- yanchor="bottom",
601
- layer="above"
602
- ))
603
- except Exception as e:
604
- logger.warning(f"Could not load logo {logo_path}: {e}")
605
 
606
  # --- Section 7: Add Model Name Labels to Frontier Points ---
607
  if frontier_rows:
 
548
  # Use consistent shape for all points (no tooling distinction)
549
  data_plot['shape_symbol'] = default_shape
550
 
551
+ # --- Section 6: Plot Company Logo Images as Markers (replacing open/closed distinction) ---
552
  # Collect layout images for company logos
553
  layout_images = []
554
 
555
+ # Add invisible markers for hover functionality (all points together, no color distinction)
556
+ fig.add_trace(go.Scatter(
557
+ x=data_plot[x_col_to_use],
558
+ y=data_plot[y_col_to_use],
559
+ mode='markers',
560
+ name='Models',
561
+ showlegend=False,
562
+ text=data_plot['hover_text'],
563
+ hoverinfo='text',
564
+ marker=dict(
565
+ color='rgba(0,0,0,0)', # Invisible markers
566
+ size=25, # Large enough for hover detection
567
+ opacity=0
568
+ )
569
+ ))
570
+
571
+ # Add company logo images for each data point
572
+ for _, row in data_plot.iterrows():
573
+ model_name = row.get('Language Model', '')
574
+ company_info = get_company_from_model_name(model_name)
575
+ logo_path = company_info['path']
576
 
577
+ # Read the SVG file and encode as base64 data URI
578
+ if os.path.exists(logo_path):
579
+ try:
580
+ with open(logo_path, 'rb') as f:
581
+ encoded_logo = base64.b64encode(f.read()).decode('utf-8')
582
+ logo_uri = f"data:image/svg+xml;base64,{encoded_logo}"
583
+
584
+ # Calculate logo size based on data range
585
+ logo_size_x = max_reported_cost * 0.08 if max_reported_cost > 0 else 0.5
586
+ logo_size_y = 4 # Fixed y size in data units
587
+
588
+ # Add image at data point position, centered on the point
589
+ layout_images.append(dict(
590
+ source=logo_uri,
591
+ xref="x",
592
+ yref="y",
593
+ x=row[x_col_to_use],
594
+ y=row[y_col_to_use],
595
+ sizex=logo_size_x,
596
+ sizey=logo_size_y,
597
+ xanchor="center",
598
+ yanchor="middle",
599
+ layer="above"
600
+ ))
601
+ except Exception as e:
602
+ logger.warning(f"Could not load logo {logo_path}: {e}")
 
 
603
 
604
  # --- Section 7: Add Model Name Labels to Frontier Points ---
605
  if frontier_rows:
ui_components.py CHANGED
@@ -307,20 +307,23 @@ def create_legend_markdown(which_table: str) -> str:
307
  """
308
  return legend_markdown
309
 
310
- # Create HTML for plot legend with SVG icons and keys
311
- openness_legend_items = []
312
- for name, info in OPENNESS_SVG_MAP.items():
313
- uri = get_svg_as_data_uri(info["path"])
 
 
 
 
 
 
 
 
314
  if uri:
315
- openness_legend_items.append(
316
  f'<div class="plot-legend-item">'
317
- f'<img class="plot-legend-item-svg" src="{uri}" alt="{name}" title="{name}">'
318
- f'<div class="plot-legend-item-text">'
319
- f'<div>'
320
- f'<span>{name}</span>'
321
- f'</div>'
322
- f'<span class="description">{info["description"]}</span>'
323
- f'</div>'
324
  f'</div>'
325
  )
326
 
@@ -339,9 +342,9 @@ plot_legend_html = f"""
339
  </div>
340
  </div>
341
  <div>
342
- <span class="plot-legend-category-heading">Model Openness</span>
343
  <div style="margin-top: 8px;">
344
- {''.join(openness_legend_items)}
345
  </div>
346
  </div>
347
  </div>
 
307
  """
308
  return legend_markdown
309
 
310
+ # Create HTML for plot legend with company logos
311
+ company_legend_items = []
312
+ # Show a sample of company logos in the legend
313
+ sample_companies = [
314
+ ("Anthropic", "assets/logo-anthropic.svg"),
315
+ ("OpenAI", "assets/logo-openai.svg"),
316
+ ("Google", "assets/logo-google.svg"),
317
+ ("Meta", "assets/logo-meta.svg"),
318
+ ("Mistral", "assets/logo-mistral.svg"),
319
+ ]
320
+ for name, path in sample_companies:
321
+ uri = get_svg_as_data_uri(path)
322
  if uri:
323
+ company_legend_items.append(
324
  f'<div class="plot-legend-item">'
325
+ f'<img class="plot-legend-item-svg" src="{uri}" alt="{name}" title="{name}" style="width: 20px; height: 20px;">'
326
+ f'<span>{name}</span>'
 
 
 
 
 
327
  f'</div>'
328
  )
329
 
 
342
  </div>
343
  </div>
344
  <div>
345
+ <span class="plot-legend-category-heading">Company Logos</span>
346
  <div style="margin-top: 8px;">
347
+ {''.join(company_legend_items)}
348
  </div>
349
  </div>
350
  </div>