From 862da1b0c478b51062772c1f6723d6d90763234b Mon Sep 17 00:00:00 2001
From: "Aamon P. Hoffmann" <aamon.hoffmann@student.uni-halle.de>
Date: Sun, 5 Jan 2025 13:41:36 +0100
Subject: [PATCH] fix not showing spinner when switching views (for real for
 real)

---
 src/Main.elm                     | 16 ++++++++--------
 src/Views/ForceDirectedGraph.elm |  6 ++++--
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/Main.elm b/src/Main.elm
index 6d7f961..f222790 100644
--- a/src/Main.elm
+++ b/src/Main.elm
@@ -194,14 +194,14 @@ viewHome global =
     case global.progress of
         Loading ->
             Html.div [ Html.Attributes.style "margin" "auto" ]
-            [ Html.div [ Html.Attributes.class "loader" ] []
-            , Html.div
-                [ Html.Attributes.style "position" "relative"
-                , Html.Attributes.style "left" "1.5rem"
-                , Html.Attributes.style "bottom" "5rem"
+                [ Html.div [ Html.Attributes.class "loader" ] []
+                , Html.div
+                    [ Html.Attributes.style "position" "relative"
+                    , Html.Attributes.style "left" "1.5rem"
+                    , Html.Attributes.style "bottom" "5rem"
+                    ]
+                    [ Html.text "Loading Data..." ]
                 ]
-                [ Html.text "Loading Data..." ]
-            ]
 
         Failure msg ->
             Html.text (msg |> (++) "Error while loading data. ")
@@ -237,7 +237,7 @@ viewHome global =
                     , Html.b [] [ text "Chernoff Gesichtern" ]
                     , text " vergleichen kannst."
                     , text " Durch "
-                    , Html.b [] [ text "Klick auf ein Drittland"]
+                    , Html.b [] [ text "Klick auf ein Drittland" ]
                     , text " und ggf. anschließende Auswahl eines "
                     , Html.b [] [ text "Konsulats" ]
                     , text " kannst du die zur Berechnung der Gesichter verwendeten Daten filtern."
diff --git a/src/Views/ForceDirectedGraph.elm b/src/Views/ForceDirectedGraph.elm
index df273b8..6412e4a 100644
--- a/src/Views/ForceDirectedGraph.elm
+++ b/src/Views/ForceDirectedGraph.elm
@@ -26,10 +26,12 @@ import TypedSvg.Core exposing (Attribute, Svg, text)
 import TypedSvg.Types exposing (AlignmentBaseline(..), AnchorAlignment(..), Paint(..), ShapeRendering(..), TextRendering(..), px)
 import Utils exposing (flag)
 
+
 icon : Html Msg
 icon =
     Html.i [ Html.Attributes.class "fa-solid fa-hexagon-nodes fa-xl" ] []
 
+
 w : Float
 w =
     1000
@@ -104,7 +106,7 @@ view global local =
                     ]
             , Html.div [ Html.Attributes.class "legend", style "width" "19%" ]
                 [ Html.div [ style "display" "flex" ]
-                    [ Html.h3 [ style "margin-top" "0rem", style "margin-bottom" "0rem",style "align-content" "center" ]
+                    [ Html.h3 [ style "margin-top" "0rem", style "margin-bottom" "0rem", style "align-content" "center" ]
                         [ Html.text "Legende"
                         ]
                     , if not <| local.highlight == "" then
@@ -458,7 +460,7 @@ updateGraphWithList =
 
 calculateModel : List Entry -> Local.Model -> Cmd Local.Msg
 calculateModel data local =
-    Task.perform Local.RecalcEnd (Process.sleep 0 |> Task.andThen (\_ -> postInit data local))
+    Task.perform Local.RecalcEnd (Process.sleep 10 |> Task.andThen (\_ -> Process.sleep 0) |> Task.andThen (\_ -> postInit data local))
 
 
 update : Local.Msg -> Global -> Local.Model -> ( Global, Local.Model, Cmd Msg )
-- 
GitLab