wip player performance

This commit is contained in:
salam committed 2026-06-02 15:39:50 +02:00
1 parent fcbf718492
commit 37d28eec21
12 files changed
+214 -207

No files matched your search

+22 -20
View File
@@ -20,6 +20,7 @@ use Filament\Schemas\Components\Utilities\Set;
use Filament\Schemas\Schema;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\HtmlString;
use PhpOption\None;
class Statistic extends BaseDashboard
{
@@ -29,8 +30,6 @@ class Statistic extends BaseDashboard
protected string $view = 'filament.pages.statistic';
protected string $activeTab = 'tab1';
protected ?string $pollingInterval = null;
protected static ?string $title = 'Statistic';
@@ -93,6 +92,7 @@ class Statistic extends BaseDashboard
->afterStateUpdated(function (callable $set, $state) {
$set('match_id', null);
$set('team_id', null);
$set('tm_player_id', null);
$this->dispatch('filterChanged', filterValue: $state);
}),
Select::make('match_id')
@@ -121,6 +121,7 @@ class Statistic extends BaseDashboard
}
})
// ->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '')
// ->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
->prefixIcon('phosphor-users-three')
->disabled(fn (Get $get) => $get('similar_past_matches') != 'none')
->options(function (Get $get) {
@@ -143,8 +144,8 @@ class Statistic extends BaseDashboard
Select::make('team_position')
->hiddenLabel()
->placeholder('Positiom')
->prefix('Positiom')
->placeholder('Team Position')
->prefix('Team Position')
// ->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '')
->prefixIcon('phosphor-map-pin')
->disabled(fn (Get $get) => $get('similar_past_matches') != 'none')
@@ -159,7 +160,7 @@ class Statistic extends BaseDashboard
DatePicker::make('start_date')
->hiddenLabel()
->native(false)
// ->prefixIconColor('primary')
->prefixIconColor('primary')
->prefixIcon('phosphor-calendar')
->live()
->prefix('Start')
@@ -172,7 +173,7 @@ class Statistic extends BaseDashboard
DatePicker::make('end_date')
->hiddenLabel()
->native(false)
// ->prefixIconColor('primary')
->prefixIconColor('primary')
->prefixIcon('phosphor-calendar')
->live()
->prefix('End')
@@ -202,14 +203,14 @@ class Statistic extends BaseDashboard
->hiddenLabel()
->placeholder('Similar Past Matches')
->prefixIconColor('primary')
->prefixIcon('phosphor-approximate-equals')
// ->prefixIcon('phosphor-approximate-equals')
->suffix(fn (Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('<span class="text-xl">'.$get('accuracy').'</span>') : '')
->columnSpan([
'default' => 1,
'xl' => 2,
])
->suffixAction(
->prefixAction(
Action::make('iconInfo')
->color('gray')
->icon('phosphor-question')
->tooltip(fn () => $this->tooltip_similar_past_matches())
)
@@ -226,20 +227,21 @@ class Statistic extends BaseDashboard
'all' => 'Similar Past Matches All: Database',
]),
Slider::make('accuracy')
->label('Accuracy max: 0.25, steps: 0.025')
// ->label('Accuracy min: 0, max: 0.25, steps: 0.025')
->hiddenLabel()
->hidden(fn (Get $get) => $get('similar_past_matches') == 'none')
// ->fillTrack()
->range(minValue: 0, maxValue: 0.25)
->step(0.025)
->default(5)
->decimalPlaces(1)
->decimalPlaces(3)
->tooltips()
->columnSpan([
'default' => 1,
'xl' => 2,
])
// ->pips()
// ->tooltips()
// ->columnSpan([
// 'default' => 1,
// 'xl' => 2,
// ])
->pips()
->live(),
Select::make('tm_player_id')
->hiddenLabel()
@@ -281,13 +283,13 @@ class Statistic extends BaseDashboard
protected function tooltip_similar_past_matches(): HtmlString
{
$str = '<div class="grid grid-cols-4 gap-4 max-w-lg">';
$str = '<div class="m-3 grid grid-cols-4 gap-2 max-w-lg">';
$str .= '<div class="font-bold">None</div>';
$str .= '<div class="col-span-3">Only selected team within selected league is considered.</div>';
$str .= '<div class="col-span-3"><u>Team</u> within selected league</div>';
$str .= '<div class="font-bold">League</div>';
$str .= '<div class="col-span-3">All events in seleceted league are considered, filtered expected goal handicap and total parameter in the range of <span class="text-blue-500">Accuracy Slider</span> setting.</div>';
$str .= '<div class="col-span-3"><u>Simmilar events</u> in league in the range of slider.</div>';
$str .= '<div class="font-bold">All Database</div>';
$str .= '<div class="col-span-3">Eintire database is considered, filtered expected goal handicap and total parameter in the range of the <br><span class="text-blue-500">Accuracy Slider</span> setting.</div>';
$str .= '<div class="col-span-3"><u>Simmilar events</u> in database in the range of slider.</div>';
$str .= '</div>';
return new HtmlString($str);