diff --git a/src/Main.elm b/src/Main.elm index 72af82e548c9866f458cc2d7a6f5cd26c107825c..f222790c9575375af631a4922beb81f3bf6c5b10 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -95,7 +95,7 @@ update msg ( global, local ) = loadingfdg = { fdg | loading = True } in - ( ( { global | view = newView }, local ) + ( ( { global | view = newView }, { local | forcedirectedgraph = loadingfdg } ) , ForceDirectedGraphView.calculateModel global.data loadingfdg |> Cmd.map ForceDirectedGraphView.propagate ) @@ -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 00cfb4c6b9c638d66bef4c4d537d28e75bb6dd67..6412e4aaf444c500dacd4bd152ed5b5a5ec57e59 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 @@ -210,9 +212,6 @@ postInit data local = filteredData = filterForYears data year - -- _ = - -- Debug.log "filteredData" filteredData - countryNames = List.map (\ent -> String.toUpper ent.state) filteredData @@ -343,9 +342,6 @@ postInit data local = ) |> List.Statistics.mean |> Maybe.withDefault 0 - - -- _ = - -- Debug.log "meanIssRat" meanIssRat in { source = e.from, target = e.to, distance = (min w h / 1.5) * meanIssRat, strength = Just 1 } ) @@ -413,14 +409,11 @@ postInit data local = list = Force.computeSimulation (Force.simulation forces) <| List.map .label <| Graph.nodes graph in - Task.succeed (Ok { firstInit | loading = True }) - |> Task.andThen - (\_ -> - Task.succeed - (Ok - (Local.Model (updateGraphWithList graph list) (Force.simulation forces) 0 False "" 0 0) - ) - ) + Task.succeed + (Ok + --(Local.Model (updateGraphWithList graph list) (Force.simulation forces) 0 True "" 0 0) + { local | graph = updateGraphWithList graph list, simulation = Force.simulation forces, loading = True } + ) isSchengen : Graph.Node Local.Entity -> List Entry -> Bool @@ -467,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 )