Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • informationsvisualisierung-2024/infovis-projekt
1 result
Show changes
Commits on Source (4)
......@@ -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."
......
......@@ -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 )
......