Skip to content
Snippets Groups Projects
Commit 7e50c2dd authored by Aamon Paul Hoffmann's avatar Aamon Paul Hoffmann
Browse files

slightly adjusted forces

parent 9a535855
No related branches found
No related tags found
No related merge requests found
...@@ -47,9 +47,9 @@ view global local = ...@@ -47,9 +47,9 @@ view global local =
Html.div [ style "width" "100%" ] Html.div [ style "width" "100%" ]
[ Html.div [ style "display" "flex", style "flex-direction" "row", style "align-items" "center", style "margin-bottom" "0.5rem" ] [ Html.div [ style "display" "flex", style "flex-direction" "row", style "align-items" "center", style "margin-bottom" "0.5rem" ]
[ Html.div [] [ Html.div []
[-- Html.h2 [ style "margin-top" "0" ] [ -- Html.h2 [ style "margin-top" "0" ]
-- [ Html.text "Force directed Graph" ] -- [ Html.text "Force directed Graph" ]
Html.div [ style "display" "flex", style "flex-direction" "row", style "gap" "0.5rem" ] Html.div [ style "display" "flex", style "flex-direction" "row", style "gap" "0.5rem" ]
[ Html.button [ Local.ChangeVersion 0 |> propagate |> onClick ] [ Html.button [ Local.ChangeVersion 0 |> propagate |> onClick ]
[ Html.text "Version 1" ] [ Html.text "Version 1" ]
, Html.button [ Local.ChangeVersion 1 |> propagate |> onClick ] , Html.button [ Local.ChangeVersion 1 |> propagate |> onClick ]
...@@ -250,7 +250,7 @@ postInit data local = ...@@ -250,7 +250,7 @@ postInit data local =
( i.id, { strength = 4.0, x = w / 2, y = h / 2, radius = min h w / 3.0 } ) ( i.id, { strength = 4.0, x = w / 2, y = h / 2, radius = min h w / 3.0 } )
else else
( i.id, { strength = 4.0, x = w / 2, y = h / 2, radius = min h w / 1.2 } ) ( i.id, { strength = 4.0, x = w / 2, y = h / 2, radius = min h w / 1.3 } )
) )
|> Force.customRadial |> Force.customRadial
, Graph.nodes graph , Graph.nodes graph
...@@ -268,7 +268,7 @@ postInit data local = ...@@ -268,7 +268,7 @@ postInit data local =
] ]
1 -> 1 ->
[ Force.manyBodyStrength -8 <| [ Force.manyBodyStrength -7 <|
List.map .id <| List.map .id <|
Graph.nodes graph Graph.nodes graph
] ]
...@@ -343,7 +343,7 @@ postInit data local = ...@@ -343,7 +343,7 @@ postInit data local =
|> List.Statistics.mean |> List.Statistics.mean
|> Maybe.withDefault 0 |> Maybe.withDefault 0
in in
{ source = e.from, target = e.to, distance = (min w h / 1.5) * meanIssRat, strength = Just 1 } { source = e.from, target = e.to, distance = (min w h / 1.6) * meanIssRat, strength = Just 1 }
) )
|> Force.customLinks 3 |> Force.customLinks 3
, Force.manyBodyStrength -30 <| , Force.manyBodyStrength -30 <|
...@@ -360,52 +360,6 @@ postInit data local = ...@@ -360,52 +360,6 @@ postInit data local =
(h / 2) (h / 2)
] ]
--Force.customLinks 1
-- (List.map link (Graph.edges graph))
--, Graph.edges graph
-- |> List.map
-- (\i ->
-- if
-- isSchengen
-- (case Graph.get i.from graph of
-- Just ctx ->
-- ctx.node _ -> Graph.Node 0 (Force.entity 0 "")
-- )
-- data
-- && isSchengen
-- (case Graph.get i.to graph of
-- Just ctx ->
-- ctx.node
-- _ ->
-- Graph.Node 0 (Force.entity 0 "")
-- )
-- data
-- || not
-- (isSchengen
-- (case Graph.get i.from graph of
-- Just ctx ->
-- ctx.node
-- _ ->
-- Graph.Node 0 (Force.entity 0 "")
-- )
-- data
-- )
-- && not
-- (isSchengen
-- (case Graph.get i.to graph of
-- Just ctx ->
-- ctx.node
-- _ ->
-- Graph.Node 0 (Force.entity 0 "")
-- )
-- data
-- )
-- then
-- { source = i.from, target = i.to, distance = 3, strength = Just 2 }
-- else
-- { source = i.from, target = i.to, distance = 10, strength = Just 1 }
-- )
-- |> Force.customLinks 1
list = list =
Force.computeSimulation (Force.simulation forces) <| List.map .label <| Graph.nodes graph Force.computeSimulation (Force.simulation forces) <| List.map .label <| Graph.nodes graph
in in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment