-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
595 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Config.Pathfinder exposing (..) | ||
|
||
|
||
addressRadius : Float | ||
addressRadius = | ||
50 | ||
|
||
|
||
type alias Config = | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Css.Pathfinder exposing (..) | ||
|
||
import Config.View as View | ||
import Css exposing (..) | ||
|
||
|
||
addressRoot : View.Config -> List Style | ||
addressRoot vc = | ||
vc.theme.pathfinder.addressRoot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module Effect.Pathfinder exposing (..) | ||
|
||
import Effect.Api as Api | ||
import Msg.Pathfinder exposing (Msg(..)) | ||
import Plugin.Msg as Plugin | ||
import Route.Pathfinder exposing (Route) | ||
|
||
|
||
type Effect | ||
= NavPushRouteEffect Route | ||
| PluginEffect (Cmd Plugin.Msg) | ||
| ApiEffect (Api.Effect Msg) | ||
| CmdEffect (Cmd Msg) | ||
|
||
|
||
perform : Effect -> Cmd Msg | ||
perform eff = | ||
case eff of | ||
-- managed in Effect.elm | ||
NavPushRouteEffect _ -> | ||
Cmd.none | ||
|
||
PluginEffect cmd -> | ||
cmd | ||
|> Cmd.map PluginMsg | ||
|
||
CmdEffect cmd -> | ||
cmd | ||
|
||
-- managed in Effect.elm | ||
ApiEffect _ -> | ||
Cmd.none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
module Init.Pathfinder exposing (..) | ||
|
||
import Init.Graph.History as History | ||
import Init.Graph.Transform as Transform | ||
import Model.Graph exposing (Dragging(..)) | ||
import Model.Pathfinder exposing (Model) | ||
import Route.Pathfinder as Route | ||
|
||
|
||
init : Model | ||
init = | ||
{ networks = [] | ||
, route = Route.Root | ||
, dragging = NoDragging | ||
, transform = Transform.init | ||
, history = History.init | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,32 @@ | ||
module Model.Graph.History exposing (..) | ||
|
||
import Color exposing (Color) | ||
import Init.Graph.History.Entry as Entry | ||
import IntDict exposing (IntDict) | ||
import List.Extra | ||
import Model.Graph.History.Entry as Entry | ||
import Model.Graph.Layer exposing (Layer) | ||
|
||
|
||
type alias Model = | ||
{ past : List Entry.Model | ||
, future : List Entry.Model | ||
type alias Model entry = | ||
{ past : List entry | ||
, future : List entry | ||
} | ||
|
||
|
||
hasPast : Model -> Entry.Model -> Bool | ||
hasPast { past } entry = | ||
hasPast : entry -> Model entry -> entry -> Bool | ||
hasPast init { past } entry = | ||
(List.isEmpty past |> not) | ||
&& ((past /= [ Entry.init ]) | ||
|| (entry /= Entry.init) | ||
&& ((past /= [ init ]) | ||
|| (entry /= init) | ||
) | ||
|
||
|
||
hasFuture : Model -> Bool | ||
hasFuture : Model entry -> Bool | ||
hasFuture { future } = | ||
List.isEmpty future |> not | ||
|
||
|
||
unconsPast : Model -> Maybe ( Entry.Model, List Entry.Model ) | ||
unconsPast : Model entry -> Maybe ( entry, List entry ) | ||
unconsPast { past } = | ||
List.Extra.uncons past | ||
|
||
|
||
unconsFuture : Model -> Maybe ( Entry.Model, List Entry.Model ) | ||
unconsFuture : Model entry -> Maybe ( entry, List entry ) | ||
unconsFuture { future } = | ||
List.Extra.uncons future |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
module Model.Pathfinder exposing (..) | ||
|
||
import Model.Graph exposing (Dragging) | ||
import Model.Graph.History as History | ||
import Model.Graph.Transform as Transform | ||
import Model.Pathfinder.History.Entry as Entry | ||
import Model.Pathfinder.Id exposing (Id) | ||
import Model.Pathfinder.Network exposing (Network) | ||
import Route.Pathfinder | ||
|
||
|
||
type alias Model = | ||
{ networks : List Network | ||
, route : Route.Pathfinder.Route | ||
, dragging : Dragging Id | ||
, transform : Transform.Model Id | ||
, history : History.Model Entry.Model | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module Model.Pathfinder.History.Entry exposing (..) | ||
|
||
import Model.Pathfinder.Network exposing (Network) | ||
|
||
|
||
type alias Model = | ||
{ networks : List Network | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Msg.Pathfinder exposing (..) | ||
|
||
import Model.Graph exposing (Dragging) | ||
import Model.Graph.Coords exposing (Coords) | ||
import Model.Pathfinder.Id exposing (Id) | ||
import Plugin.Msg as Plugin | ||
|
||
|
||
type Msg | ||
= UserClickedGraph (Dragging Id) | ||
| UserWheeledOnGraph Float Float Float | ||
| UserPushesLeftMouseButtonOnGraph Coords | ||
| UserMovesMouseOnGraph Coords | ||
| PluginMsg Plugin.Msg |
Oops, something went wrong.