From 472b37762f5912f9b63fd8e721f9b16f2ffb7e39 Mon Sep 17 00:00:00 2001 From: salam Date: Fri, 22 May 2026 07:04:38 +0200 Subject: [PATCH] wip --- app/Filament/Pages/Statistic.php | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/app/Filament/Pages/Statistic.php b/app/Filament/Pages/Statistic.php index df4b23ef..ded15b43 100644 --- a/app/Filament/Pages/Statistic.php +++ b/app/Filament/Pages/Statistic.php @@ -21,6 +21,7 @@ use Filament\Schemas\Components\Utilities\Get; use Filament\Schemas\Components\Utilities\Set; use Filament\Schemas\Schema; use Illuminate\Contracts\Support\Htmlable; +use Illuminate\Support\HtmlString; class Statistic extends BaseDashboard { @@ -97,6 +98,7 @@ class Statistic extends BaseDashboard ->columnSpanFull(), Section::make() ->compact() + ->collapsible() ->schema([ Select::make('tm_player_id') ->label('Player') @@ -109,12 +111,6 @@ class Statistic extends BaseDashboard ->live(), Select::make('team_position') ->prefixIcon('phosphor-map-pin') - ->suffixAction( - Action::make('iconInfo') - ->color('gray') - ->icon('phosphor-question') - ->tooltip('Lorem ipsum dolor sit amet, consetetur sadipscing elitr.') - ) ->default('all') ->selectablePlaceholder(false) ->options([ @@ -147,7 +143,7 @@ class Statistic extends BaseDashboard Action::make('iconInfo') ->color('gray') ->icon('phosphor-question') - ->tooltip('Lorem ipsum dolor sit amet, consetetur sadipscing elitr.') + ->tooltip(fn () => $this->tooltip_similar_past_matches()) ) ->default('none') ->live() @@ -160,12 +156,12 @@ class Statistic extends BaseDashboard Slider::make('accuracy') ->disabled(fn (Get $get) => $get('similar_past_matches') == 'none') ->fillTrack() - ->default(0.5) + ->default(5) ->step(0.1) ->decimalPlaces(1) ->tooltips() - ->range(minValue: 0, maxValue: 1), - // ->pips(), + ->range(minValue: 0, maxValue: 1) + ->pips(), ])->columns(5) ->columnSpanFull(), @@ -180,4 +176,19 @@ class Statistic extends BaseDashboard MovingAverageChart::make(), ]; } + + protected function tooltip_similar_past_matches(): HtmlString + { + $str = '
'; + $str .= '
None
'; + $str .= '
Only selected team within selected league is considered.
'; + $str .= '
League
'; + $str .= '
All events in seleceted league are considered, filtered expected goal handicap and total parameter in the range of Accuracy Slider setting.
'; + $str .= '
All Database
'; + $str .= '
Eintire database is considered, filtered expected goal handicap and total parameter in the range of the
Accuracy Slider setting.
'; + $str .= '
'; + + return new HtmlString($str); + + } }