{{-- resources/views/admin/analysis/_hth_result.blade.php --}} @php $stat = $comparison['stats']; $disc = $comparison['discipline']; $isTime = in_array($disc->result_type, ['time']); $unit = $disc->unit_symbol ?? ''; $hasPasiRival = $comparison['pasiRival'] !== null; $hasCompetitor = $comparison['competitor'] !== null; $calcGap = function($ath, $rival) use ($isTime, $unit) { if ($ath == 0 || $rival == 0) { return ['status' => 'Data Kosong', 'diff' => '-', 'color' => 'text-muted', 'icon' => 'fa-minus']; } $diff = abs($ath - $rival); $fmtDiff = number_format($diff, 2) . ' ' . $unit; if ($ath == $rival) { return ['status' => 'SEIMBANG', 'diff' => '0 ' . $unit, 'color' => 'text-secondary', 'icon' => 'fa-equals']; } $athWins = $isTime ? ($ath < $rival) : ($ath > $rival); if ($athWins) { return ['status' => 'UNGGUL', 'diff' => '+' . $fmtDiff, 'color' => 'text-success', 'icon' => 'fa-arrow-up']; } else { return ['status' => 'TERTINGGAL', 'diff' => '-' . $fmtDiff, 'color' => 'text-danger', 'icon' => 'fa-arrow-down']; } }; $gapPasiPB = $hasPasiRival ? $calcGap($stat['pb']['ath'], $stat['pb']['pasi']) : null; $gapPasiSB = $hasPasiRival ? $calcGap($stat['sb']['ath'], $stat['sb']['pasi']) : null; $gapCompPB = $hasCompetitor ? $calcGap($stat['pb']['ath'], $stat['pb']['comp']) : null; $gapCompSB = $hasCompetitor ? $calcGap($stat['sb']['ath'], $stat['sb']['comp']) : null; @endphp
{{ $disc->name }}

{{ $comparison['athlete']->name }}

Atlet Utama
@if($hasPasiRival)

VS

{{ $comparison['pasiRival']->name }}

Rival Internal
@endif @if($hasCompetitor)

VS

{{ $comparison['competitor']->name }}

Rival Internasional
@endif
@if($hasPasiRival)
GAP vs RIVAL INTERNAL
Personal Best (PB)
{{ $gapPasiPB['status'] }}
{{ $gapPasiPB['diff'] }}
Season Best (SB)
{{ $gapPasiSB['status'] }}
{{ $gapPasiSB['diff'] }}
@endif @if($hasCompetitor)
GAP vs RIVAL INTL.
Personal Best (PB)
{{ $gapCompPB['status'] }}
{{ $gapCompPB['diff'] }}
Season Best (SB)
{{ $gapCompSB['status'] }}
{{ $gapCompSB['diff'] }}
@endif

Visualisasi Proporsi Performa (Doughnut)

@if($isTime)
Catatan Lomba Waktu (Lari): Dalam grafik proporsi Donat, irisan yang lebih kecil justru merepresentasikan waktu yang lebih cepat / lebih baik.
@endif
Proporsi Personal Best (PB)
Proporsi Season Best (SB)

Tabel Perbandingan Statistik ({{ $unit }})

@if($hasPasiRival) @endif @if($hasCompetitor) @endif @if($hasPasiRival) @endif @if($hasCompetitor) @endif @if($hasPasiRival) @endif @if($hasCompetitor) @endif
Indikator Performa {{ $comparison['athlete']->name }} (Utama){{ $comparison['pasiRival']->name }} (Internal){{ $comparison['competitor']->name }} (Intl)
Personal Best (PB)

{{ $stat['pb']['ath'] > 0 ? $stat['pb']['ath'] : '-' }}

{{ $stat['pb']['pasi'] > 0 ? $stat['pb']['pasi'] : '-' }}

{{ $stat['pb']['comp'] > 0 ? $stat['pb']['comp'] : '-' }}

Season Best (SB)

{{ $stat['sb']['ath'] > 0 ? $stat['sb']['ath'] : '-' }}

{{ $stat['sb']['pasi'] > 0 ? $stat['sb']['pasi'] : '-' }}

{{ $stat['sb']['comp'] > 0 ? $stat['sb']['comp'] : '-' }}

@if($hasCompetitor && $comparison['competitor']->notes) @endif