import React from 'react';
import { THEME, O2_COLOR } from '../theme.js';
// Filled bar — media classifier predict_proba
export function MediaConfBar({ value, color = THEME.accent, height = 8, compact = false }) {
const pct = Math.max(0, Math.min(100, Math.round(value * 100)));
return (
);
}
// Segmented donut arc — oxygen softmax max prob
export function OxygenConfArc({ value, size = 36, color = O2_COLOR }) {
const pct = Math.max(0, Math.min(100, Math.round(value * 100)));
const r = size / 2 - 3;
const c = 2 * Math.PI * r;
return (
30 ? 10 : 9, fontWeight: 600, fontVariantNumeric: 'tabular-nums' }}>
{pct}
);
}
// Range bar with point-estimate marker — quantile regression interval
export function IntervalBar({ value, lo, hi, scaleMin, scaleMax, color, unit = '', height = 6, label = false, width = '100%' }) {
const range = (scaleMax - scaleMin) || 1;
const loPct = Math.max(0, Math.min(100, ((lo - scaleMin) / range) * 100));
const hiPct = Math.max(0, Math.min(100, ((hi - scaleMin) / range) * 100));
const valPct = Math.max(0, Math.min(100, ((value - scaleMin) / range) * 100));
return (
{label && (
{lo}{unit}
{value}{unit}
{hi}{unit}
)}
);
}
export function MonoTag({ children, color = THEME.accent }) {
return (
{children}
);
}
export function SourceBadge({ source = 'tabular', compact = false }) {
const normalized = String(source || 'tabular').toLowerCase();
const isLora = normalized === 'lora';
const color = isLora ? O2_COLOR : THEME.inkFaint;
return (
{isLora ? 'LoRA' : 'tabular'}
);
}