diff --git a/src/Views/ForceDirectedGraph.elm b/src/Views/ForceDirectedGraph.elm index b5909fd13b5a32572e767851cd0a6f26913340d9..dc77f50b51b1dab476c44ec3e328b34b5131d5cd 100644 --- a/src/Views/ForceDirectedGraph.elm +++ b/src/Views/ForceDirectedGraph.elm @@ -47,9 +47,9 @@ view global local = 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 [] - [-- Html.h2 [ style "margin-top" "0" ] - -- [ Html.text "Force directed Graph" ] - Html.div [ style "display" "flex", style "flex-direction" "row", style "gap" "0.5rem" ] + [ -- Html.h2 [ style "margin-top" "0" ] + -- [ Html.text "Force directed Graph" ] + Html.div [ style "display" "flex", style "flex-direction" "row", style "gap" "0.5rem" ] [ Html.button [ Local.ChangeVersion 0 |> propagate |> onClick ] [ Html.text "Version 1" ] , Html.button [ Local.ChangeVersion 1 |> propagate |> onClick ] @@ -250,7 +250,7 @@ postInit data local = ( i.id, { strength = 4.0, x = w / 2, y = h / 2, radius = min h w / 3.0 } ) 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 , Graph.nodes graph @@ -268,7 +268,7 @@ postInit data local = ] 1 -> - [ Force.manyBodyStrength -8 <| + [ Force.manyBodyStrength -7 <| List.map .id <| Graph.nodes graph ] @@ -343,7 +343,7 @@ postInit data local = |> List.Statistics.mean |> Maybe.withDefault 0 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.manyBodyStrength -30 <| @@ -360,52 +360,6 @@ postInit data local = (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 = Force.computeSimulation (Force.simulation forces) <| List.map .label <| Graph.nodes graph in