Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions dashboard/src/components/comparison/metrics-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,22 @@ export function MetricsOverlay({ experimentIds }: MetricsOverlayProps) {
<CartesianGrid strokeDasharray="3 3" />
<XAxis
dataKey="time"
label={{ value: 'Time', position: 'insideBottom', offset: -5 }}
tick={{ fontSize: 10 }}
label={{ value: 'Time', position: 'insideBottom', offset: -5, style: { fontSize: 10 } }}
/>
<YAxis
tick={{ fontSize: 10 }}
label={{ value: 'Value', angle: -90, position: 'insideLeft', style: { fontSize: 10 } }}
/>
<YAxis label={{ value: 'Value', angle: -90, position: 'insideLeft' }} />
<Tooltip
contentStyle={{
backgroundColor: 'hsl(var(--card))',
border: '1px solid hsl(var(--border))',
borderRadius: '0.5rem',
fontSize: '10px',
}}
/>
<Legend />
<Legend wrapperStyle={{ fontSize: '10px' }} />
{metricKeys.map((key, index) => (
<Line
key={key}
Expand Down
14 changes: 7 additions & 7 deletions dashboard/src/components/dashboard/daily-token-usage-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function DailyTokenUsageChart({ data, timeRange }: DailyTokenUsageChartPr
</div>

<ResponsiveContainer width="100%" height={260}>
<LineChart data={chartData} margin={{ left: 0, right: 15, top: 15, bottom: 15 }}>
<LineChart data={chartData} margin={{ left: 10, right: 15, top: 15, bottom: 15 }}>
<CartesianGrid strokeDasharray="3 3" stroke="#e2e8f0" opacity={0.5} />
<XAxis
dataKey="displayDate"
Expand All @@ -100,7 +100,7 @@ export function DailyTokenUsageChart({ data, timeRange }: DailyTokenUsageChartPr
/>
<YAxis
tick={{ fontSize: 10 }}
width={40}
width={50}
tickFormatter={(value) =>
value >= 1000000
? `${(value / 1000000).toFixed(1)}M`
Expand All @@ -112,7 +112,7 @@ export function DailyTokenUsageChart({ data, timeRange }: DailyTokenUsageChartPr
value: 'Tokens',
angle: -90,
position: 'insideLeft',
offset: 8,
offset: -5,
style: { textAnchor: 'middle', fontSize: 11 }
}}
/>
Expand All @@ -121,15 +121,15 @@ export function DailyTokenUsageChart({ data, timeRange }: DailyTokenUsageChartPr
backgroundColor: 'hsl(var(--card))',
border: '1px solid hsl(var(--border))',
borderRadius: '6px',
fontSize: '12px',
fontSize: '10px',
}}
content={({ active, payload, label }) => {
if (!active || !payload || !payload.length) return null;
const data = payload[0].payload;
return (
<div className="bg-card border border-border rounded-md p-2 shadow-sm">
<div className="text-xs font-medium mb-1.5">{label}</div>
<div className="space-y-0.5 text-xs">
<div className="text-[10px] font-medium mb-1.5">{label}</div>
<div className="space-y-0.5 text-[10px]">
<div className="flex items-center gap-2">
<div className="w-2 h-2 rounded-full bg-blue-500"></div>
<span className="text-muted-foreground">Total:</span>
Expand All @@ -151,7 +151,7 @@ export function DailyTokenUsageChart({ data, timeRange }: DailyTokenUsageChartPr
}}
/>
<Legend
wrapperStyle={{ fontSize: '11px' }}
wrapperStyle={{ fontSize: '10px' }}
iconType="circle"
iconSize={8}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function ExperimentsStatusChart({ experiments }: ExperimentsStatusChartPr
cy="48%"
outerRadius={58}
label={({ name, value }) => `${name}: ${value}`}
style={{ fontSize: '11px' }}
style={{ fontSize: '10px' }}
>
{chartData.map((entry, index) => (
<Cell key={`cell-${index}`} fill={entry.color} />
Expand All @@ -73,10 +73,10 @@ export function ExperimentsStatusChart({ experiments }: ExperimentsStatusChartPr
backgroundColor: 'hsl(var(--card))',
border: '1px solid hsl(var(--border))',
borderRadius: '6px',
fontSize: '11px',
fontSize: '10px',
}}
/>
<Legend wrapperStyle={{ fontSize: '11px' }} />
<Legend wrapperStyle={{ fontSize: '10px' }} />
</PieChart>
</ResponsiveContainer>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ export function ExperimentsTimelineChart({ experiments, timeRange }: Experiments
backgroundColor: 'hsl(var(--card))',
border: '1px solid hsl(var(--border))',
borderRadius: '6px',
fontSize: '12px',
fontSize: '10px',
}}
content={({ active, payload, label }) => {
if (!active || !payload || !payload.length) return null;
const data = payload[0].payload;
return (
<div className="bg-card border border-border rounded-md p-2 shadow-sm">
<div className="text-xs font-medium mb-1.5">{label}</div>
<div className="space-y-0.5 text-xs">
<div className="text-[10px] font-medium mb-1.5">{label}</div>
<div className="space-y-0.5 text-[10px]">
<div className="flex items-center gap-2">
<div className="w-2 h-2 rounded-full bg-purple-400"></div>
<span className="text-muted-foreground">Launched:</span>
Expand All @@ -121,7 +121,7 @@ export function ExperimentsTimelineChart({ experiments, timeRange }: Experiments
}}
/>
<Legend
wrapperStyle={{ fontSize: '11px' }}
wrapperStyle={{ fontSize: '10px' }}
iconType="circle"
iconSize={8}
/>
Expand Down
44 changes: 26 additions & 18 deletions dashboard/src/components/metrics/metrics-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,18 +345,26 @@ export function MetricsChart({ metrics, experimentId, title = 'Metrics', descrip
{/* View mode toggle */}
<div className="flex gap-1">
<Button
variant={viewMode === 'timeline' ? 'default' : 'outline'}
variant="outline"
size="sm"
onClick={() => setViewMode('timeline')}
className="h-7 px-3 text-xs"
className={`h-7 px-3 text-xs transition-colors ${
viewMode === 'timeline'
? 'bg-blue-50 border-blue-300 text-blue-700 hover:bg-blue-100'
: 'bg-white hover:bg-gray-50'
}`}
>
Timeline
</Button>
<Button
variant={viewMode === 'pareto' ? 'default' : 'outline'}
variant="outline"
size="sm"
onClick={() => setViewMode('pareto')}
className="h-7 px-3 text-xs"
className={`h-7 px-3 text-xs transition-colors ${
viewMode === 'pareto'
? 'bg-blue-50 border-blue-300 text-blue-700 hover:bg-blue-100'
: 'bg-white hover:bg-gray-50'
}`}
>
Pareto
</Button>
Expand Down Expand Up @@ -477,14 +485,14 @@ export function MetricsChart({ metrics, experimentId, title = 'Metrics', descrip
<CartesianGrid strokeDasharray="3 3" />
<XAxis
dataKey="index"
label={{ value: 'Index', position: 'insideBottom', offset: -5, style: { fontSize: 12 } }}
label={{ value: 'Index', position: 'insideBottom', offset: -5, style: { fontSize: 10 } }}
type="number"
domain={['dataMin', 'dataMax']}
tick={{ fontSize: 11 }}
tick={{ fontSize: 10 }}
/>
<YAxis
label={{ value: 'Value', angle: -90, position: 'insideLeft', style: { fontSize: 12 } }}
tick={{ fontSize: 11 }}
label={{ value: 'Value', angle: -90, position: 'insideLeft', style: { fontSize: 10 } }}
tick={{ fontSize: 10 }}
/>
<Tooltip
cursor={{ strokeDasharray: '5 5', stroke: '#94a3b8', strokeWidth: 1 }}
Expand All @@ -510,10 +518,10 @@ export function MetricsChart({ metrics, experimentId, title = 'Metrics', descrip
lineHeight: '1.4',
}}
>
<div style={{ fontWeight: 600, fontSize: '12px' }}>
<div style={{ fontWeight: 600, fontSize: '10px' }}>
Run: {data.runId}
</div>
<div style={{ fontSize: '12px' }}>
<div style={{ fontSize: '10px' }}>
{selectedKey}: {typeof data.value === 'number' ? data.value.toFixed(4) : data.value}
</div>
</div>
Expand Down Expand Up @@ -599,7 +607,7 @@ export function MetricsChart({ metrics, experimentId, title = 'Metrics', descrip
xaxis: {
title: {
text: `${paretoMetrics[0].key} (${paretoMetrics[0].direction})`,
font: { size: 12, color: '#374151', family: 'system-ui' },
font: { size: 10, color: '#374151', family: 'system-ui' },
},
gridcolor: '#e5e7eb',
gridwidth: 1,
Expand All @@ -610,7 +618,7 @@ export function MetricsChart({ metrics, experimentId, title = 'Metrics', descrip
yaxis: {
title: {
text: `${paretoMetrics[1].key} (${paretoMetrics[1].direction})`,
font: { size: 12, color: '#374151', family: 'system-ui' },
font: { size: 10, color: '#374151', family: 'system-ui' },
},
gridcolor: '#e5e7eb',
gridwidth: 1,
Expand All @@ -621,7 +629,7 @@ export function MetricsChart({ metrics, experimentId, title = 'Metrics', descrip
zaxis: {
title: {
text: `${paretoMetrics[2].key} (${paretoMetrics[2].direction})`,
font: { size: 12, color: '#374151', family: 'system-ui' },
font: { size: 10, color: '#374151', family: 'system-ui' },
},
gridcolor: '#e5e7eb',
gridwidth: 1,
Expand Down Expand Up @@ -672,9 +680,9 @@ export function MetricsChart({ metrics, experimentId, title = 'Metrics', descrip
value: `${paretoMetrics[0].key} (${paretoMetrics[0].direction})`,
position: 'insideBottom',
offset: -10,
style: { fontSize: 12, fill: '#374151' }
style: { fontSize: 10, fill: '#374151' }
}}
tick={{ fontSize: 11, fill: '#6b7280' }}
tick={{ fontSize: 10, fill: '#6b7280' }}
domain={['dataMin - 0.1 * abs(dataMin)', 'dataMax + 0.1 * abs(dataMax)']}
/>
<YAxis
Expand All @@ -685,9 +693,9 @@ export function MetricsChart({ metrics, experimentId, title = 'Metrics', descrip
value: `${paretoMetrics[1].key} (${paretoMetrics[1].direction})`,
angle: -90,
position: 'insideLeft',
style: { fontSize: 12, fill: '#374151' }
style: { fontSize: 10, fill: '#374151' }
}}
tick={{ fontSize: 11, fill: '#6b7280' }}
tick={{ fontSize: 10, fill: '#6b7280' }}
domain={['dataMin - 0.1 * abs(dataMin)', 'dataMax + 0.1 * abs(dataMax)']}
/>
<Tooltip
Expand All @@ -709,7 +717,7 @@ export function MetricsChart({ metrics, experimentId, title = 'Metrics', descrip
borderRadius: '6px',
padding: '8px 12px',
boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
fontSize: '12px',
fontSize: '10px',
}}
>
<div style={{ fontWeight: 600, marginBottom: '4px' }}>
Expand Down
3 changes: 2 additions & 1 deletion dashboard/src/components/ui/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { cn } from '../../lib/utils';

export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
variant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'unknown';
variant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'unknown' | 'info';
}

function Badge({ className, variant = 'default', ...props }: BadgeProps) {
Expand All @@ -14,6 +14,7 @@ function Badge({ className, variant = 'default', ...props }: BadgeProps) {
success: 'border-transparent bg-green-500 text-white hover:bg-green-600',
warning: 'border-transparent bg-yellow-500 text-white hover:bg-yellow-600',
unknown: 'border-transparent bg-purple-100 text-purple-700 hover:bg-purple-200',
info: 'border-transparent bg-blue-500 text-white hover:bg-blue-600',
};

return (
Expand Down
17 changes: 12 additions & 5 deletions dashboard/src/pages/experiments/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import { formatDistanceToNow } from 'date-fns';
import { PieChart, Pie, Cell, ResponsiveContainer, Legend, Tooltip } from 'recharts';
import type { Status } from '../../types';

const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown'> = {
const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown' | 'info'> = {
UNKNOWN: 'unknown',
PENDING: 'warning',
RUNNING: 'default',
RUNNING: 'info',
CANCELLED: 'secondary',
COMPLETED: 'success',
FAILED: 'destructive',
Expand Down Expand Up @@ -260,14 +260,21 @@ export function ExperimentDetailPage() {
cy="48%"
outerRadius={48}
label={({ name, value }) => `${name}: ${value}`}
style={{ fontSize: '12px' }}
style={{ fontSize: '10px' }}
>
{runStatsData.map((entry, index) => (
<Cell key={`cell-${index}`} fill={entry.color} />
))}
</Pie>
<Tooltip />
<Legend wrapperStyle={{ fontSize: '12px' }} />
<Tooltip
contentStyle={{
fontSize: '10px',
backgroundColor: 'hsl(var(--card))',
border: '1px solid hsl(var(--border))',
borderRadius: '6px',
}}
/>
<Legend wrapperStyle={{ fontSize: '10px' }} />
</PieChart>
</ResponsiveContainer>
</div>
Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/pages/experiments/compare.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { ParameterDiff } from '../../components/comparison/parameter-diff';
import { MetricsOverlay } from '../../components/comparison/metrics-overlay';
import type { Status } from '../../types';

const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown'> = {
const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown' | 'info'> = {
UNKNOWN: 'unknown',
PENDING: 'warning',
RUNNING: 'default',
RUNNING: 'info',
CANCELLED: 'secondary',
COMPLETED: 'success',
FAILED: 'destructive',
Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/pages/experiments/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import { Button } from '../../components/ui/button';
import { formatDistanceToNow } from 'date-fns';
import type { Status } from '../../types';

const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown'> = {
const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown' | 'info'> = {
UNKNOWN: 'unknown',
PENDING: 'warning',
RUNNING: 'default',
RUNNING: 'info',
CANCELLED: 'secondary',
COMPLETED: 'success',
FAILED: 'destructive',
Expand Down
17 changes: 12 additions & 5 deletions dashboard/src/pages/projects/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import { formatDistanceToNow } from 'date-fns';
import { PieChart, Pie, Cell, ResponsiveContainer, Legend, Tooltip } from 'recharts';
import type { Status } from '../../types';

const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown'> = {
const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown' | 'info'> = {
UNKNOWN: 'unknown',
PENDING: 'warning',
RUNNING: 'default',
RUNNING: 'info',
CANCELLED: 'secondary',
COMPLETED: 'success',
FAILED: 'destructive',
Expand Down Expand Up @@ -211,14 +211,21 @@ export function ProjectDetailPage() {
cy="48%"
outerRadius={48}
label={({ name, value }) => `${name}: ${value}`}
style={{ fontSize: '12px' }}
style={{ fontSize: '10px' }}
>
{experimentStatsData.map((entry, index) => (
<Cell key={`cell-${index}`} fill={entry.color} />
))}
</Pie>
<Tooltip />
<Legend wrapperStyle={{ fontSize: '12px' }} />
<Tooltip
contentStyle={{
fontSize: '10px',
backgroundColor: 'hsl(var(--card))',
border: '1px solid hsl(var(--border))',
borderRadius: '6px',
}}
/>
<Legend wrapperStyle={{ fontSize: '10px' }} />
</PieChart>
</ResponsiveContainer>
</div>
Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/pages/runs/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import { formatDistanceToNow } from 'date-fns';
import { Eye, Copy, Check } from 'lucide-react';
import type { Status } from '../../types';

const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown'> = {
const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown' | 'info'> = {
UNKNOWN: 'unknown',
PENDING: 'warning',
RUNNING: 'default',
RUNNING: 'info',
CANCELLED: 'secondary',
COMPLETED: 'success',
FAILED: 'destructive',
Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/pages/runs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import { Button } from '../../components/ui/button';
import { formatDistanceToNow } from 'date-fns';
import type { Status } from '../../types';

const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown'> = {
const STATUS_VARIANTS: Record<Status, 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'unknown' | 'info'> = {
UNKNOWN: 'unknown',
PENDING: 'warning',
RUNNING: 'default',
RUNNING: 'info',
CANCELLED: 'secondary',
COMPLETED: 'success',
FAILED: 'destructive',
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading