{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
module Miso.Flow.Types
(
Position (..)
, oppositePosition
, positionToText
, positionFromText
, XYPosition (..)
, xy
, zeroPosition
, XYZPosition (..)
, Dimensions (..)
, zeroDimensions
, Rect (..)
, Box (..)
, Transform
, CoordinateExtent (..)
, NodeExtent (..)
, coordinateExtent
, Viewport (..)
, defaultViewport
, viewportToTransform
, transformToViewport
, SnapGrid (..)
, PanelPosition (..)
, panelPositionToText
, SelectionMode (..)
, SelectionRect (..)
, PanOnScrollMode (..)
, PanOnDrag (..)
, ColorMode (..)
, ZIndexMode (..)
, Align (..)
, Connection (..)
, connection
, HandleConnection (..)
, NodeConnection
, ConnectionMode (..)
, ConnectionState (..)
, ConnectionInProgress (..)
, FinalConnectionState (..)
, noConnection
, connectionInProgress
, OnConnectStartParams (..)
, HandleType (..)
, handleTypeToText
, handleTypeFromText
, Handle (..)
, NodeHandle (..)
, nodeHandle
, NodeId
, Node (..)
, node
, Measured (..)
, noMeasure
, measuredToDimensions
, NodeOrigin (..)
, defaultOrigin
, InternalNode (..)
, internalUserNode
, NodeHandleBounds (..)
, NodeBounds (..)
, NodeDragItem (..)
, NodeLookup
, ParentLookup
, InternalNodeUpdate (..)
, EdgeId
, Edge (..)
, edge
, ConnectionLineType (..)
, EdgeMarker (..)
, edgeMarker
, EdgeMarkerType (..)
, MarkerType (..)
, markerTypeToText
, MarkerProps (..)
, EdgePosition (..)
, EdgeLookup
, ConnectionLookup
, BezierPathOptions (..)
, defaultBezierPathOptions
, SmoothStepPathOptions (..)
, defaultSmoothStepPathOptions
, StepPathOptions (..)
, PaddingWithUnit (..)
, Padding (..)
, defaultFitViewPadding
, FitViewOptions (..)
, defaultFitViewOptions
, ViewportHelperOptions (..)
, defaultViewportHelperOptions
, Interpolation (..)
, SetCenterOptions (..)
, defaultSetCenterOptions
, FitBoundsOptions (..)
, NodeChange (..)
, SetAttributes (..)
, EdgeChange (..)
, ControlPosition (..)
, controlPositionToText
, ControlLinePosition (..)
, ResizeControlVariant (..)
, ResizeControlDirection (..)
, ResizeParams (..)
, ResizeParamsWithDirection (..)
, xyResizerHandlePositions
, xyResizerLinePositions
, ErrorCode
, OnError
) where
import Control.Applicative ((<|>))
import Data.Map.Strict (Map)
import Data.Maybe (catMaybes)
import GHC.Generics (Generic)
import Prelude
import Miso.JSON
( FromJSON (..)
, ToJSON (..)
, Value (..)
, object
, withArray
, withObject
, withText
, (.:)
, (.:?)
, (.=)
)
import Miso.String (MisoString)
data Position
= PositionLeft
| PositionTop
| PositionRight
| PositionBottom
deriving (Int -> Position -> ShowS
[Position] -> ShowS
Position -> String
(Int -> Position -> ShowS)
-> (Position -> String) -> ([Position] -> ShowS) -> Show Position
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Position -> ShowS
showsPrec :: Int -> Position -> ShowS
$cshow :: Position -> String
show :: Position -> String
$cshowList :: [Position] -> ShowS
showList :: [Position] -> ShowS
Show, Position -> Position -> Bool
(Position -> Position -> Bool)
-> (Position -> Position -> Bool) -> Eq Position
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Position -> Position -> Bool
== :: Position -> Position -> Bool
$c/= :: Position -> Position -> Bool
/= :: Position -> Position -> Bool
Eq, Eq Position
Eq Position =>
(Position -> Position -> Ordering)
-> (Position -> Position -> Bool)
-> (Position -> Position -> Bool)
-> (Position -> Position -> Bool)
-> (Position -> Position -> Bool)
-> (Position -> Position -> Position)
-> (Position -> Position -> Position)
-> Ord Position
Position -> Position -> Bool
Position -> Position -> Ordering
Position -> Position -> Position
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Position -> Position -> Ordering
compare :: Position -> Position -> Ordering
$c< :: Position -> Position -> Bool
< :: Position -> Position -> Bool
$c<= :: Position -> Position -> Bool
<= :: Position -> Position -> Bool
$c> :: Position -> Position -> Bool
> :: Position -> Position -> Bool
$c>= :: Position -> Position -> Bool
>= :: Position -> Position -> Bool
$cmax :: Position -> Position -> Position
max :: Position -> Position -> Position
$cmin :: Position -> Position -> Position
min :: Position -> Position -> Position
Ord, (forall x. Position -> Rep Position x)
-> (forall x. Rep Position x -> Position) -> Generic Position
forall x. Rep Position x -> Position
forall x. Position -> Rep Position x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Position -> Rep Position x
from :: forall x. Position -> Rep Position x
$cto :: forall x. Rep Position x -> Position
to :: forall x. Rep Position x -> Position
Generic)
oppositePosition :: Position -> Position
oppositePosition :: Position -> Position
oppositePosition = \case
Position
PositionLeft -> Position
PositionRight
Position
PositionRight -> Position
PositionLeft
Position
PositionTop -> Position
PositionBottom
Position
PositionBottom -> Position
PositionTop
positionToText :: Position -> MisoString
positionToText :: Position -> MisoString
positionToText = \case
Position
PositionLeft -> MisoString
"left"
Position
PositionTop -> MisoString
"top"
Position
PositionRight -> MisoString
"right"
Position
PositionBottom -> MisoString
"bottom"
positionFromText :: MisoString -> Maybe Position
positionFromText :: MisoString -> Maybe Position
positionFromText = \case
MisoString
"left" -> Position -> Maybe Position
forall a. a -> Maybe a
Just Position
PositionLeft
MisoString
"top" -> Position -> Maybe Position
forall a. a -> Maybe a
Just Position
PositionTop
MisoString
"right" -> Position -> Maybe Position
forall a. a -> Maybe a
Just Position
PositionRight
MisoString
"bottom" -> Position -> Maybe Position
forall a. a -> Maybe a
Just Position
PositionBottom
MisoString
_ -> Maybe Position
forall a. Maybe a
Nothing
data XYPosition = XYPosition
{ XYPosition -> Double
xyX :: !Double
, XYPosition -> Double
xyY :: !Double
} deriving (Int -> XYPosition -> ShowS
[XYPosition] -> ShowS
XYPosition -> String
(Int -> XYPosition -> ShowS)
-> (XYPosition -> String)
-> ([XYPosition] -> ShowS)
-> Show XYPosition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> XYPosition -> ShowS
showsPrec :: Int -> XYPosition -> ShowS
$cshow :: XYPosition -> String
show :: XYPosition -> String
$cshowList :: [XYPosition] -> ShowS
showList :: [XYPosition] -> ShowS
Show, XYPosition -> XYPosition -> Bool
(XYPosition -> XYPosition -> Bool)
-> (XYPosition -> XYPosition -> Bool) -> Eq XYPosition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: XYPosition -> XYPosition -> Bool
== :: XYPosition -> XYPosition -> Bool
$c/= :: XYPosition -> XYPosition -> Bool
/= :: XYPosition -> XYPosition -> Bool
Eq, Eq XYPosition
Eq XYPosition =>
(XYPosition -> XYPosition -> Ordering)
-> (XYPosition -> XYPosition -> Bool)
-> (XYPosition -> XYPosition -> Bool)
-> (XYPosition -> XYPosition -> Bool)
-> (XYPosition -> XYPosition -> Bool)
-> (XYPosition -> XYPosition -> XYPosition)
-> (XYPosition -> XYPosition -> XYPosition)
-> Ord XYPosition
XYPosition -> XYPosition -> Bool
XYPosition -> XYPosition -> Ordering
XYPosition -> XYPosition -> XYPosition
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: XYPosition -> XYPosition -> Ordering
compare :: XYPosition -> XYPosition -> Ordering
$c< :: XYPosition -> XYPosition -> Bool
< :: XYPosition -> XYPosition -> Bool
$c<= :: XYPosition -> XYPosition -> Bool
<= :: XYPosition -> XYPosition -> Bool
$c> :: XYPosition -> XYPosition -> Bool
> :: XYPosition -> XYPosition -> Bool
$c>= :: XYPosition -> XYPosition -> Bool
>= :: XYPosition -> XYPosition -> Bool
$cmax :: XYPosition -> XYPosition -> XYPosition
max :: XYPosition -> XYPosition -> XYPosition
$cmin :: XYPosition -> XYPosition -> XYPosition
min :: XYPosition -> XYPosition -> XYPosition
Ord, (forall x. XYPosition -> Rep XYPosition x)
-> (forall x. Rep XYPosition x -> XYPosition) -> Generic XYPosition
forall x. Rep XYPosition x -> XYPosition
forall x. XYPosition -> Rep XYPosition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. XYPosition -> Rep XYPosition x
from :: forall x. XYPosition -> Rep XYPosition x
$cto :: forall x. Rep XYPosition x -> XYPosition
to :: forall x. Rep XYPosition x -> XYPosition
Generic)
xy :: Double -> Double -> XYPosition
xy :: Double -> Double -> XYPosition
xy = Double -> Double -> XYPosition
XYPosition
zeroPosition :: XYPosition
zeroPosition :: XYPosition
zeroPosition = Double -> Double -> XYPosition
XYPosition Double
0 Double
0
data XYZPosition = XYZPosition
{ XYZPosition -> Double
xyzX :: !Double
, XYZPosition -> Double
xyzY :: !Double
, XYZPosition -> Double
xyzZ :: !Double
} deriving (Int -> XYZPosition -> ShowS
[XYZPosition] -> ShowS
XYZPosition -> String
(Int -> XYZPosition -> ShowS)
-> (XYZPosition -> String)
-> ([XYZPosition] -> ShowS)
-> Show XYZPosition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> XYZPosition -> ShowS
showsPrec :: Int -> XYZPosition -> ShowS
$cshow :: XYZPosition -> String
show :: XYZPosition -> String
$cshowList :: [XYZPosition] -> ShowS
showList :: [XYZPosition] -> ShowS
Show, XYZPosition -> XYZPosition -> Bool
(XYZPosition -> XYZPosition -> Bool)
-> (XYZPosition -> XYZPosition -> Bool) -> Eq XYZPosition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: XYZPosition -> XYZPosition -> Bool
== :: XYZPosition -> XYZPosition -> Bool
$c/= :: XYZPosition -> XYZPosition -> Bool
/= :: XYZPosition -> XYZPosition -> Bool
Eq, Eq XYZPosition
Eq XYZPosition =>
(XYZPosition -> XYZPosition -> Ordering)
-> (XYZPosition -> XYZPosition -> Bool)
-> (XYZPosition -> XYZPosition -> Bool)
-> (XYZPosition -> XYZPosition -> Bool)
-> (XYZPosition -> XYZPosition -> Bool)
-> (XYZPosition -> XYZPosition -> XYZPosition)
-> (XYZPosition -> XYZPosition -> XYZPosition)
-> Ord XYZPosition
XYZPosition -> XYZPosition -> Bool
XYZPosition -> XYZPosition -> Ordering
XYZPosition -> XYZPosition -> XYZPosition
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: XYZPosition -> XYZPosition -> Ordering
compare :: XYZPosition -> XYZPosition -> Ordering
$c< :: XYZPosition -> XYZPosition -> Bool
< :: XYZPosition -> XYZPosition -> Bool
$c<= :: XYZPosition -> XYZPosition -> Bool
<= :: XYZPosition -> XYZPosition -> Bool
$c> :: XYZPosition -> XYZPosition -> Bool
> :: XYZPosition -> XYZPosition -> Bool
$c>= :: XYZPosition -> XYZPosition -> Bool
>= :: XYZPosition -> XYZPosition -> Bool
$cmax :: XYZPosition -> XYZPosition -> XYZPosition
max :: XYZPosition -> XYZPosition -> XYZPosition
$cmin :: XYZPosition -> XYZPosition -> XYZPosition
min :: XYZPosition -> XYZPosition -> XYZPosition
Ord, (forall x. XYZPosition -> Rep XYZPosition x)
-> (forall x. Rep XYZPosition x -> XYZPosition)
-> Generic XYZPosition
forall x. Rep XYZPosition x -> XYZPosition
forall x. XYZPosition -> Rep XYZPosition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. XYZPosition -> Rep XYZPosition x
from :: forall x. XYZPosition -> Rep XYZPosition x
$cto :: forall x. Rep XYZPosition x -> XYZPosition
to :: forall x. Rep XYZPosition x -> XYZPosition
Generic)
data Dimensions = Dimensions
{ Dimensions -> Double
dimensionsWidth :: !Double
, Dimensions -> Double
dimensionsHeight :: !Double
} deriving (Int -> Dimensions -> ShowS
[Dimensions] -> ShowS
Dimensions -> String
(Int -> Dimensions -> ShowS)
-> (Dimensions -> String)
-> ([Dimensions] -> ShowS)
-> Show Dimensions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Dimensions -> ShowS
showsPrec :: Int -> Dimensions -> ShowS
$cshow :: Dimensions -> String
show :: Dimensions -> String
$cshowList :: [Dimensions] -> ShowS
showList :: [Dimensions] -> ShowS
Show, Dimensions -> Dimensions -> Bool
(Dimensions -> Dimensions -> Bool)
-> (Dimensions -> Dimensions -> Bool) -> Eq Dimensions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Dimensions -> Dimensions -> Bool
== :: Dimensions -> Dimensions -> Bool
$c/= :: Dimensions -> Dimensions -> Bool
/= :: Dimensions -> Dimensions -> Bool
Eq, Eq Dimensions
Eq Dimensions =>
(Dimensions -> Dimensions -> Ordering)
-> (Dimensions -> Dimensions -> Bool)
-> (Dimensions -> Dimensions -> Bool)
-> (Dimensions -> Dimensions -> Bool)
-> (Dimensions -> Dimensions -> Bool)
-> (Dimensions -> Dimensions -> Dimensions)
-> (Dimensions -> Dimensions -> Dimensions)
-> Ord Dimensions
Dimensions -> Dimensions -> Bool
Dimensions -> Dimensions -> Ordering
Dimensions -> Dimensions -> Dimensions
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Dimensions -> Dimensions -> Ordering
compare :: Dimensions -> Dimensions -> Ordering
$c< :: Dimensions -> Dimensions -> Bool
< :: Dimensions -> Dimensions -> Bool
$c<= :: Dimensions -> Dimensions -> Bool
<= :: Dimensions -> Dimensions -> Bool
$c> :: Dimensions -> Dimensions -> Bool
> :: Dimensions -> Dimensions -> Bool
$c>= :: Dimensions -> Dimensions -> Bool
>= :: Dimensions -> Dimensions -> Bool
$cmax :: Dimensions -> Dimensions -> Dimensions
max :: Dimensions -> Dimensions -> Dimensions
$cmin :: Dimensions -> Dimensions -> Dimensions
min :: Dimensions -> Dimensions -> Dimensions
Ord, (forall x. Dimensions -> Rep Dimensions x)
-> (forall x. Rep Dimensions x -> Dimensions) -> Generic Dimensions
forall x. Rep Dimensions x -> Dimensions
forall x. Dimensions -> Rep Dimensions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Dimensions -> Rep Dimensions x
from :: forall x. Dimensions -> Rep Dimensions x
$cto :: forall x. Rep Dimensions x -> Dimensions
to :: forall x. Rep Dimensions x -> Dimensions
Generic)
zeroDimensions :: Dimensions
zeroDimensions :: Dimensions
zeroDimensions = Double -> Double -> Dimensions
Dimensions Double
0 Double
0
data Rect = Rect
{ Rect -> Double
rectX :: !Double
, Rect -> Double
rectY :: !Double
, Rect -> Double
rectWidth :: !Double
, Rect -> Double
rectHeight :: !Double
} deriving (Int -> Rect -> ShowS
[Rect] -> ShowS
Rect -> String
(Int -> Rect -> ShowS)
-> (Rect -> String) -> ([Rect] -> ShowS) -> Show Rect
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Rect -> ShowS
showsPrec :: Int -> Rect -> ShowS
$cshow :: Rect -> String
show :: Rect -> String
$cshowList :: [Rect] -> ShowS
showList :: [Rect] -> ShowS
Show, Rect -> Rect -> Bool
(Rect -> Rect -> Bool) -> (Rect -> Rect -> Bool) -> Eq Rect
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Rect -> Rect -> Bool
== :: Rect -> Rect -> Bool
$c/= :: Rect -> Rect -> Bool
/= :: Rect -> Rect -> Bool
Eq, Eq Rect
Eq Rect =>
(Rect -> Rect -> Ordering)
-> (Rect -> Rect -> Bool)
-> (Rect -> Rect -> Bool)
-> (Rect -> Rect -> Bool)
-> (Rect -> Rect -> Bool)
-> (Rect -> Rect -> Rect)
-> (Rect -> Rect -> Rect)
-> Ord Rect
Rect -> Rect -> Bool
Rect -> Rect -> Ordering
Rect -> Rect -> Rect
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Rect -> Rect -> Ordering
compare :: Rect -> Rect -> Ordering
$c< :: Rect -> Rect -> Bool
< :: Rect -> Rect -> Bool
$c<= :: Rect -> Rect -> Bool
<= :: Rect -> Rect -> Bool
$c> :: Rect -> Rect -> Bool
> :: Rect -> Rect -> Bool
$c>= :: Rect -> Rect -> Bool
>= :: Rect -> Rect -> Bool
$cmax :: Rect -> Rect -> Rect
max :: Rect -> Rect -> Rect
$cmin :: Rect -> Rect -> Rect
min :: Rect -> Rect -> Rect
Ord, (forall x. Rect -> Rep Rect x)
-> (forall x. Rep Rect x -> Rect) -> Generic Rect
forall x. Rep Rect x -> Rect
forall x. Rect -> Rep Rect x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Rect -> Rep Rect x
from :: forall x. Rect -> Rep Rect x
$cto :: forall x. Rep Rect x -> Rect
to :: forall x. Rep Rect x -> Rect
Generic)
data Box = Box
{ Box -> Double
boxX :: !Double
, Box -> Double
boxY :: !Double
, Box -> Double
boxX2 :: !Double
, Box -> Double
boxY2 :: !Double
} deriving (Int -> Box -> ShowS
[Box] -> ShowS
Box -> String
(Int -> Box -> ShowS)
-> (Box -> String) -> ([Box] -> ShowS) -> Show Box
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Box -> ShowS
showsPrec :: Int -> Box -> ShowS
$cshow :: Box -> String
show :: Box -> String
$cshowList :: [Box] -> ShowS
showList :: [Box] -> ShowS
Show, Box -> Box -> Bool
(Box -> Box -> Bool) -> (Box -> Box -> Bool) -> Eq Box
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Box -> Box -> Bool
== :: Box -> Box -> Bool
$c/= :: Box -> Box -> Bool
/= :: Box -> Box -> Bool
Eq, Eq Box
Eq Box =>
(Box -> Box -> Ordering)
-> (Box -> Box -> Bool)
-> (Box -> Box -> Bool)
-> (Box -> Box -> Bool)
-> (Box -> Box -> Bool)
-> (Box -> Box -> Box)
-> (Box -> Box -> Box)
-> Ord Box
Box -> Box -> Bool
Box -> Box -> Ordering
Box -> Box -> Box
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Box -> Box -> Ordering
compare :: Box -> Box -> Ordering
$c< :: Box -> Box -> Bool
< :: Box -> Box -> Bool
$c<= :: Box -> Box -> Bool
<= :: Box -> Box -> Bool
$c> :: Box -> Box -> Bool
> :: Box -> Box -> Bool
$c>= :: Box -> Box -> Bool
>= :: Box -> Box -> Bool
$cmax :: Box -> Box -> Box
max :: Box -> Box -> Box
$cmin :: Box -> Box -> Box
min :: Box -> Box -> Box
Ord, (forall x. Box -> Rep Box x)
-> (forall x. Rep Box x -> Box) -> Generic Box
forall x. Rep Box x -> Box
forall x. Box -> Rep Box x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Box -> Rep Box x
from :: forall x. Box -> Rep Box x
$cto :: forall x. Rep Box x -> Box
to :: forall x. Rep Box x -> Box
Generic)
type Transform = Viewport
data CoordinateExtent = CoordinateExtent
{ CoordinateExtent -> Double
extentMinX :: !Double
, CoordinateExtent -> Double
extentMinY :: !Double
, CoordinateExtent -> Double
extentMaxX :: !Double
, CoordinateExtent -> Double
extentMaxY :: !Double
} deriving (Int -> CoordinateExtent -> ShowS
[CoordinateExtent] -> ShowS
CoordinateExtent -> String
(Int -> CoordinateExtent -> ShowS)
-> (CoordinateExtent -> String)
-> ([CoordinateExtent] -> ShowS)
-> Show CoordinateExtent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CoordinateExtent -> ShowS
showsPrec :: Int -> CoordinateExtent -> ShowS
$cshow :: CoordinateExtent -> String
show :: CoordinateExtent -> String
$cshowList :: [CoordinateExtent] -> ShowS
showList :: [CoordinateExtent] -> ShowS
Show, CoordinateExtent -> CoordinateExtent -> Bool
(CoordinateExtent -> CoordinateExtent -> Bool)
-> (CoordinateExtent -> CoordinateExtent -> Bool)
-> Eq CoordinateExtent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CoordinateExtent -> CoordinateExtent -> Bool
== :: CoordinateExtent -> CoordinateExtent -> Bool
$c/= :: CoordinateExtent -> CoordinateExtent -> Bool
/= :: CoordinateExtent -> CoordinateExtent -> Bool
Eq, Eq CoordinateExtent
Eq CoordinateExtent =>
(CoordinateExtent -> CoordinateExtent -> Ordering)
-> (CoordinateExtent -> CoordinateExtent -> Bool)
-> (CoordinateExtent -> CoordinateExtent -> Bool)
-> (CoordinateExtent -> CoordinateExtent -> Bool)
-> (CoordinateExtent -> CoordinateExtent -> Bool)
-> (CoordinateExtent -> CoordinateExtent -> CoordinateExtent)
-> (CoordinateExtent -> CoordinateExtent -> CoordinateExtent)
-> Ord CoordinateExtent
CoordinateExtent -> CoordinateExtent -> Bool
CoordinateExtent -> CoordinateExtent -> Ordering
CoordinateExtent -> CoordinateExtent -> CoordinateExtent
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: CoordinateExtent -> CoordinateExtent -> Ordering
compare :: CoordinateExtent -> CoordinateExtent -> Ordering
$c< :: CoordinateExtent -> CoordinateExtent -> Bool
< :: CoordinateExtent -> CoordinateExtent -> Bool
$c<= :: CoordinateExtent -> CoordinateExtent -> Bool
<= :: CoordinateExtent -> CoordinateExtent -> Bool
$c> :: CoordinateExtent -> CoordinateExtent -> Bool
> :: CoordinateExtent -> CoordinateExtent -> Bool
$c>= :: CoordinateExtent -> CoordinateExtent -> Bool
>= :: CoordinateExtent -> CoordinateExtent -> Bool
$cmax :: CoordinateExtent -> CoordinateExtent -> CoordinateExtent
max :: CoordinateExtent -> CoordinateExtent -> CoordinateExtent
$cmin :: CoordinateExtent -> CoordinateExtent -> CoordinateExtent
min :: CoordinateExtent -> CoordinateExtent -> CoordinateExtent
Ord, (forall x. CoordinateExtent -> Rep CoordinateExtent x)
-> (forall x. Rep CoordinateExtent x -> CoordinateExtent)
-> Generic CoordinateExtent
forall x. Rep CoordinateExtent x -> CoordinateExtent
forall x. CoordinateExtent -> Rep CoordinateExtent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CoordinateExtent -> Rep CoordinateExtent x
from :: forall x. CoordinateExtent -> Rep CoordinateExtent x
$cto :: forall x. Rep CoordinateExtent x -> CoordinateExtent
to :: forall x. Rep CoordinateExtent x -> CoordinateExtent
Generic)
coordinateExtent :: (Double, Double) -> (Double, Double) -> CoordinateExtent
coordinateExtent :: (Double, Double) -> (Double, Double) -> CoordinateExtent
coordinateExtent (Double
x1, Double
y1) (Double
x2, Double
y2) = Double -> Double -> Double -> Double -> CoordinateExtent
CoordinateExtent Double
x1 Double
y1 Double
x2 Double
y2
data NodeExtent
= ExtentParent
| ExtentCoordinates !CoordinateExtent
deriving (Int -> NodeExtent -> ShowS
[NodeExtent] -> ShowS
NodeExtent -> String
(Int -> NodeExtent -> ShowS)
-> (NodeExtent -> String)
-> ([NodeExtent] -> ShowS)
-> Show NodeExtent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NodeExtent -> ShowS
showsPrec :: Int -> NodeExtent -> ShowS
$cshow :: NodeExtent -> String
show :: NodeExtent -> String
$cshowList :: [NodeExtent] -> ShowS
showList :: [NodeExtent] -> ShowS
Show, NodeExtent -> NodeExtent -> Bool
(NodeExtent -> NodeExtent -> Bool)
-> (NodeExtent -> NodeExtent -> Bool) -> Eq NodeExtent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NodeExtent -> NodeExtent -> Bool
== :: NodeExtent -> NodeExtent -> Bool
$c/= :: NodeExtent -> NodeExtent -> Bool
/= :: NodeExtent -> NodeExtent -> Bool
Eq, Eq NodeExtent
Eq NodeExtent =>
(NodeExtent -> NodeExtent -> Ordering)
-> (NodeExtent -> NodeExtent -> Bool)
-> (NodeExtent -> NodeExtent -> Bool)
-> (NodeExtent -> NodeExtent -> Bool)
-> (NodeExtent -> NodeExtent -> Bool)
-> (NodeExtent -> NodeExtent -> NodeExtent)
-> (NodeExtent -> NodeExtent -> NodeExtent)
-> Ord NodeExtent
NodeExtent -> NodeExtent -> Bool
NodeExtent -> NodeExtent -> Ordering
NodeExtent -> NodeExtent -> NodeExtent
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: NodeExtent -> NodeExtent -> Ordering
compare :: NodeExtent -> NodeExtent -> Ordering
$c< :: NodeExtent -> NodeExtent -> Bool
< :: NodeExtent -> NodeExtent -> Bool
$c<= :: NodeExtent -> NodeExtent -> Bool
<= :: NodeExtent -> NodeExtent -> Bool
$c> :: NodeExtent -> NodeExtent -> Bool
> :: NodeExtent -> NodeExtent -> Bool
$c>= :: NodeExtent -> NodeExtent -> Bool
>= :: NodeExtent -> NodeExtent -> Bool
$cmax :: NodeExtent -> NodeExtent -> NodeExtent
max :: NodeExtent -> NodeExtent -> NodeExtent
$cmin :: NodeExtent -> NodeExtent -> NodeExtent
min :: NodeExtent -> NodeExtent -> NodeExtent
Ord, (forall x. NodeExtent -> Rep NodeExtent x)
-> (forall x. Rep NodeExtent x -> NodeExtent) -> Generic NodeExtent
forall x. Rep NodeExtent x -> NodeExtent
forall x. NodeExtent -> Rep NodeExtent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NodeExtent -> Rep NodeExtent x
from :: forall x. NodeExtent -> Rep NodeExtent x
$cto :: forall x. Rep NodeExtent x -> NodeExtent
to :: forall x. Rep NodeExtent x -> NodeExtent
Generic)
data Viewport = Viewport
{ Viewport -> Double
viewportX :: !Double
, Viewport -> Double
viewportY :: !Double
, Viewport -> Double
viewportZoom :: !Double
} deriving (Int -> Viewport -> ShowS
[Viewport] -> ShowS
Viewport -> String
(Int -> Viewport -> ShowS)
-> (Viewport -> String) -> ([Viewport] -> ShowS) -> Show Viewport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Viewport -> ShowS
showsPrec :: Int -> Viewport -> ShowS
$cshow :: Viewport -> String
show :: Viewport -> String
$cshowList :: [Viewport] -> ShowS
showList :: [Viewport] -> ShowS
Show, Viewport -> Viewport -> Bool
(Viewport -> Viewport -> Bool)
-> (Viewport -> Viewport -> Bool) -> Eq Viewport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Viewport -> Viewport -> Bool
== :: Viewport -> Viewport -> Bool
$c/= :: Viewport -> Viewport -> Bool
/= :: Viewport -> Viewport -> Bool
Eq, Eq Viewport
Eq Viewport =>
(Viewport -> Viewport -> Ordering)
-> (Viewport -> Viewport -> Bool)
-> (Viewport -> Viewport -> Bool)
-> (Viewport -> Viewport -> Bool)
-> (Viewport -> Viewport -> Bool)
-> (Viewport -> Viewport -> Viewport)
-> (Viewport -> Viewport -> Viewport)
-> Ord Viewport
Viewport -> Viewport -> Bool
Viewport -> Viewport -> Ordering
Viewport -> Viewport -> Viewport
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Viewport -> Viewport -> Ordering
compare :: Viewport -> Viewport -> Ordering
$c< :: Viewport -> Viewport -> Bool
< :: Viewport -> Viewport -> Bool
$c<= :: Viewport -> Viewport -> Bool
<= :: Viewport -> Viewport -> Bool
$c> :: Viewport -> Viewport -> Bool
> :: Viewport -> Viewport -> Bool
$c>= :: Viewport -> Viewport -> Bool
>= :: Viewport -> Viewport -> Bool
$cmax :: Viewport -> Viewport -> Viewport
max :: Viewport -> Viewport -> Viewport
$cmin :: Viewport -> Viewport -> Viewport
min :: Viewport -> Viewport -> Viewport
Ord, (forall x. Viewport -> Rep Viewport x)
-> (forall x. Rep Viewport x -> Viewport) -> Generic Viewport
forall x. Rep Viewport x -> Viewport
forall x. Viewport -> Rep Viewport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Viewport -> Rep Viewport x
from :: forall x. Viewport -> Rep Viewport x
$cto :: forall x. Rep Viewport x -> Viewport
to :: forall x. Rep Viewport x -> Viewport
Generic)
defaultViewport :: Viewport
defaultViewport :: Viewport
defaultViewport = Double -> Double -> Double -> Viewport
Viewport Double
0 Double
0 Double
1
viewportToTransform :: Viewport -> Transform
viewportToTransform :: Viewport -> Viewport
viewportToTransform = Viewport -> Viewport
forall a. a -> a
id
transformToViewport :: Transform -> Viewport
transformToViewport :: Viewport -> Viewport
transformToViewport = Viewport -> Viewport
forall a. a -> a
id
data SnapGrid = SnapGrid
{ SnapGrid -> Double
snapGridX :: !Double
, SnapGrid -> Double
snapGridY :: !Double
} deriving (Int -> SnapGrid -> ShowS
[SnapGrid] -> ShowS
SnapGrid -> String
(Int -> SnapGrid -> ShowS)
-> (SnapGrid -> String) -> ([SnapGrid] -> ShowS) -> Show SnapGrid
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SnapGrid -> ShowS
showsPrec :: Int -> SnapGrid -> ShowS
$cshow :: SnapGrid -> String
show :: SnapGrid -> String
$cshowList :: [SnapGrid] -> ShowS
showList :: [SnapGrid] -> ShowS
Show, SnapGrid -> SnapGrid -> Bool
(SnapGrid -> SnapGrid -> Bool)
-> (SnapGrid -> SnapGrid -> Bool) -> Eq SnapGrid
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SnapGrid -> SnapGrid -> Bool
== :: SnapGrid -> SnapGrid -> Bool
$c/= :: SnapGrid -> SnapGrid -> Bool
/= :: SnapGrid -> SnapGrid -> Bool
Eq, Eq SnapGrid
Eq SnapGrid =>
(SnapGrid -> SnapGrid -> Ordering)
-> (SnapGrid -> SnapGrid -> Bool)
-> (SnapGrid -> SnapGrid -> Bool)
-> (SnapGrid -> SnapGrid -> Bool)
-> (SnapGrid -> SnapGrid -> Bool)
-> (SnapGrid -> SnapGrid -> SnapGrid)
-> (SnapGrid -> SnapGrid -> SnapGrid)
-> Ord SnapGrid
SnapGrid -> SnapGrid -> Bool
SnapGrid -> SnapGrid -> Ordering
SnapGrid -> SnapGrid -> SnapGrid
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SnapGrid -> SnapGrid -> Ordering
compare :: SnapGrid -> SnapGrid -> Ordering
$c< :: SnapGrid -> SnapGrid -> Bool
< :: SnapGrid -> SnapGrid -> Bool
$c<= :: SnapGrid -> SnapGrid -> Bool
<= :: SnapGrid -> SnapGrid -> Bool
$c> :: SnapGrid -> SnapGrid -> Bool
> :: SnapGrid -> SnapGrid -> Bool
$c>= :: SnapGrid -> SnapGrid -> Bool
>= :: SnapGrid -> SnapGrid -> Bool
$cmax :: SnapGrid -> SnapGrid -> SnapGrid
max :: SnapGrid -> SnapGrid -> SnapGrid
$cmin :: SnapGrid -> SnapGrid -> SnapGrid
min :: SnapGrid -> SnapGrid -> SnapGrid
Ord, (forall x. SnapGrid -> Rep SnapGrid x)
-> (forall x. Rep SnapGrid x -> SnapGrid) -> Generic SnapGrid
forall x. Rep SnapGrid x -> SnapGrid
forall x. SnapGrid -> Rep SnapGrid x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SnapGrid -> Rep SnapGrid x
from :: forall x. SnapGrid -> Rep SnapGrid x
$cto :: forall x. Rep SnapGrid x -> SnapGrid
to :: forall x. Rep SnapGrid x -> SnapGrid
Generic)
data PanelPosition
= TopLeft | TopCenter | TopRight
| BottomLeft | BottomCenter | BottomRight
| CenterLeft | CenterRight
deriving (Int -> PanelPosition -> ShowS
[PanelPosition] -> ShowS
PanelPosition -> String
(Int -> PanelPosition -> ShowS)
-> (PanelPosition -> String)
-> ([PanelPosition] -> ShowS)
-> Show PanelPosition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PanelPosition -> ShowS
showsPrec :: Int -> PanelPosition -> ShowS
$cshow :: PanelPosition -> String
show :: PanelPosition -> String
$cshowList :: [PanelPosition] -> ShowS
showList :: [PanelPosition] -> ShowS
Show, PanelPosition -> PanelPosition -> Bool
(PanelPosition -> PanelPosition -> Bool)
-> (PanelPosition -> PanelPosition -> Bool) -> Eq PanelPosition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PanelPosition -> PanelPosition -> Bool
== :: PanelPosition -> PanelPosition -> Bool
$c/= :: PanelPosition -> PanelPosition -> Bool
/= :: PanelPosition -> PanelPosition -> Bool
Eq, Eq PanelPosition
Eq PanelPosition =>
(PanelPosition -> PanelPosition -> Ordering)
-> (PanelPosition -> PanelPosition -> Bool)
-> (PanelPosition -> PanelPosition -> Bool)
-> (PanelPosition -> PanelPosition -> Bool)
-> (PanelPosition -> PanelPosition -> Bool)
-> (PanelPosition -> PanelPosition -> PanelPosition)
-> (PanelPosition -> PanelPosition -> PanelPosition)
-> Ord PanelPosition
PanelPosition -> PanelPosition -> Bool
PanelPosition -> PanelPosition -> Ordering
PanelPosition -> PanelPosition -> PanelPosition
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: PanelPosition -> PanelPosition -> Ordering
compare :: PanelPosition -> PanelPosition -> Ordering
$c< :: PanelPosition -> PanelPosition -> Bool
< :: PanelPosition -> PanelPosition -> Bool
$c<= :: PanelPosition -> PanelPosition -> Bool
<= :: PanelPosition -> PanelPosition -> Bool
$c> :: PanelPosition -> PanelPosition -> Bool
> :: PanelPosition -> PanelPosition -> Bool
$c>= :: PanelPosition -> PanelPosition -> Bool
>= :: PanelPosition -> PanelPosition -> Bool
$cmax :: PanelPosition -> PanelPosition -> PanelPosition
max :: PanelPosition -> PanelPosition -> PanelPosition
$cmin :: PanelPosition -> PanelPosition -> PanelPosition
min :: PanelPosition -> PanelPosition -> PanelPosition
Ord, (forall x. PanelPosition -> Rep PanelPosition x)
-> (forall x. Rep PanelPosition x -> PanelPosition)
-> Generic PanelPosition
forall x. Rep PanelPosition x -> PanelPosition
forall x. PanelPosition -> Rep PanelPosition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PanelPosition -> Rep PanelPosition x
from :: forall x. PanelPosition -> Rep PanelPosition x
$cto :: forall x. Rep PanelPosition x -> PanelPosition
to :: forall x. Rep PanelPosition x -> PanelPosition
Generic)
panelPositionToText :: PanelPosition -> MisoString
panelPositionToText :: PanelPosition -> MisoString
panelPositionToText = \case
PanelPosition
TopLeft -> MisoString
"top-left"
PanelPosition
TopCenter -> MisoString
"top-center"
PanelPosition
TopRight -> MisoString
"top-right"
PanelPosition
BottomLeft -> MisoString
"bottom-left"
PanelPosition
BottomCenter -> MisoString
"bottom-center"
PanelPosition
BottomRight -> MisoString
"bottom-right"
PanelPosition
CenterLeft -> MisoString
"center-left"
PanelPosition
CenterRight -> MisoString
"center-right"
data SelectionMode
= SelectionPartial
| SelectionFull
deriving (Int -> SelectionMode -> ShowS
[SelectionMode] -> ShowS
SelectionMode -> String
(Int -> SelectionMode -> ShowS)
-> (SelectionMode -> String)
-> ([SelectionMode] -> ShowS)
-> Show SelectionMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SelectionMode -> ShowS
showsPrec :: Int -> SelectionMode -> ShowS
$cshow :: SelectionMode -> String
show :: SelectionMode -> String
$cshowList :: [SelectionMode] -> ShowS
showList :: [SelectionMode] -> ShowS
Show, SelectionMode -> SelectionMode -> Bool
(SelectionMode -> SelectionMode -> Bool)
-> (SelectionMode -> SelectionMode -> Bool) -> Eq SelectionMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SelectionMode -> SelectionMode -> Bool
== :: SelectionMode -> SelectionMode -> Bool
$c/= :: SelectionMode -> SelectionMode -> Bool
/= :: SelectionMode -> SelectionMode -> Bool
Eq, Eq SelectionMode
Eq SelectionMode =>
(SelectionMode -> SelectionMode -> Ordering)
-> (SelectionMode -> SelectionMode -> Bool)
-> (SelectionMode -> SelectionMode -> Bool)
-> (SelectionMode -> SelectionMode -> Bool)
-> (SelectionMode -> SelectionMode -> Bool)
-> (SelectionMode -> SelectionMode -> SelectionMode)
-> (SelectionMode -> SelectionMode -> SelectionMode)
-> Ord SelectionMode
SelectionMode -> SelectionMode -> Bool
SelectionMode -> SelectionMode -> Ordering
SelectionMode -> SelectionMode -> SelectionMode
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SelectionMode -> SelectionMode -> Ordering
compare :: SelectionMode -> SelectionMode -> Ordering
$c< :: SelectionMode -> SelectionMode -> Bool
< :: SelectionMode -> SelectionMode -> Bool
$c<= :: SelectionMode -> SelectionMode -> Bool
<= :: SelectionMode -> SelectionMode -> Bool
$c> :: SelectionMode -> SelectionMode -> Bool
> :: SelectionMode -> SelectionMode -> Bool
$c>= :: SelectionMode -> SelectionMode -> Bool
>= :: SelectionMode -> SelectionMode -> Bool
$cmax :: SelectionMode -> SelectionMode -> SelectionMode
max :: SelectionMode -> SelectionMode -> SelectionMode
$cmin :: SelectionMode -> SelectionMode -> SelectionMode
min :: SelectionMode -> SelectionMode -> SelectionMode
Ord, (forall x. SelectionMode -> Rep SelectionMode x)
-> (forall x. Rep SelectionMode x -> SelectionMode)
-> Generic SelectionMode
forall x. Rep SelectionMode x -> SelectionMode
forall x. SelectionMode -> Rep SelectionMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SelectionMode -> Rep SelectionMode x
from :: forall x. SelectionMode -> Rep SelectionMode x
$cto :: forall x. Rep SelectionMode x -> SelectionMode
to :: forall x. Rep SelectionMode x -> SelectionMode
Generic)
data SelectionRect = SelectionRect
{ SelectionRect -> Rect
selectionRect :: !Rect
, SelectionRect -> Double
selectionStartX :: !Double
, SelectionRect -> Double
selectionStartY :: !Double
} deriving (Int -> SelectionRect -> ShowS
[SelectionRect] -> ShowS
SelectionRect -> String
(Int -> SelectionRect -> ShowS)
-> (SelectionRect -> String)
-> ([SelectionRect] -> ShowS)
-> Show SelectionRect
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SelectionRect -> ShowS
showsPrec :: Int -> SelectionRect -> ShowS
$cshow :: SelectionRect -> String
show :: SelectionRect -> String
$cshowList :: [SelectionRect] -> ShowS
showList :: [SelectionRect] -> ShowS
Show, SelectionRect -> SelectionRect -> Bool
(SelectionRect -> SelectionRect -> Bool)
-> (SelectionRect -> SelectionRect -> Bool) -> Eq SelectionRect
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SelectionRect -> SelectionRect -> Bool
== :: SelectionRect -> SelectionRect -> Bool
$c/= :: SelectionRect -> SelectionRect -> Bool
/= :: SelectionRect -> SelectionRect -> Bool
Eq, Eq SelectionRect
Eq SelectionRect =>
(SelectionRect -> SelectionRect -> Ordering)
-> (SelectionRect -> SelectionRect -> Bool)
-> (SelectionRect -> SelectionRect -> Bool)
-> (SelectionRect -> SelectionRect -> Bool)
-> (SelectionRect -> SelectionRect -> Bool)
-> (SelectionRect -> SelectionRect -> SelectionRect)
-> (SelectionRect -> SelectionRect -> SelectionRect)
-> Ord SelectionRect
SelectionRect -> SelectionRect -> Bool
SelectionRect -> SelectionRect -> Ordering
SelectionRect -> SelectionRect -> SelectionRect
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SelectionRect -> SelectionRect -> Ordering
compare :: SelectionRect -> SelectionRect -> Ordering
$c< :: SelectionRect -> SelectionRect -> Bool
< :: SelectionRect -> SelectionRect -> Bool
$c<= :: SelectionRect -> SelectionRect -> Bool
<= :: SelectionRect -> SelectionRect -> Bool
$c> :: SelectionRect -> SelectionRect -> Bool
> :: SelectionRect -> SelectionRect -> Bool
$c>= :: SelectionRect -> SelectionRect -> Bool
>= :: SelectionRect -> SelectionRect -> Bool
$cmax :: SelectionRect -> SelectionRect -> SelectionRect
max :: SelectionRect -> SelectionRect -> SelectionRect
$cmin :: SelectionRect -> SelectionRect -> SelectionRect
min :: SelectionRect -> SelectionRect -> SelectionRect
Ord, (forall x. SelectionRect -> Rep SelectionRect x)
-> (forall x. Rep SelectionRect x -> SelectionRect)
-> Generic SelectionRect
forall x. Rep SelectionRect x -> SelectionRect
forall x. SelectionRect -> Rep SelectionRect x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SelectionRect -> Rep SelectionRect x
from :: forall x. SelectionRect -> Rep SelectionRect x
$cto :: forall x. Rep SelectionRect x -> SelectionRect
to :: forall x. Rep SelectionRect x -> SelectionRect
Generic)
data PanOnScrollMode
= PanOnScrollFree
| PanOnScrollVertical
| PanOnScrollHorizontal
deriving (Int -> PanOnScrollMode -> ShowS
[PanOnScrollMode] -> ShowS
PanOnScrollMode -> String
(Int -> PanOnScrollMode -> ShowS)
-> (PanOnScrollMode -> String)
-> ([PanOnScrollMode] -> ShowS)
-> Show PanOnScrollMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PanOnScrollMode -> ShowS
showsPrec :: Int -> PanOnScrollMode -> ShowS
$cshow :: PanOnScrollMode -> String
show :: PanOnScrollMode -> String
$cshowList :: [PanOnScrollMode] -> ShowS
showList :: [PanOnScrollMode] -> ShowS
Show, PanOnScrollMode -> PanOnScrollMode -> Bool
(PanOnScrollMode -> PanOnScrollMode -> Bool)
-> (PanOnScrollMode -> PanOnScrollMode -> Bool)
-> Eq PanOnScrollMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PanOnScrollMode -> PanOnScrollMode -> Bool
== :: PanOnScrollMode -> PanOnScrollMode -> Bool
$c/= :: PanOnScrollMode -> PanOnScrollMode -> Bool
/= :: PanOnScrollMode -> PanOnScrollMode -> Bool
Eq, Eq PanOnScrollMode
Eq PanOnScrollMode =>
(PanOnScrollMode -> PanOnScrollMode -> Ordering)
-> (PanOnScrollMode -> PanOnScrollMode -> Bool)
-> (PanOnScrollMode -> PanOnScrollMode -> Bool)
-> (PanOnScrollMode -> PanOnScrollMode -> Bool)
-> (PanOnScrollMode -> PanOnScrollMode -> Bool)
-> (PanOnScrollMode -> PanOnScrollMode -> PanOnScrollMode)
-> (PanOnScrollMode -> PanOnScrollMode -> PanOnScrollMode)
-> Ord PanOnScrollMode
PanOnScrollMode -> PanOnScrollMode -> Bool
PanOnScrollMode -> PanOnScrollMode -> Ordering
PanOnScrollMode -> PanOnScrollMode -> PanOnScrollMode
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: PanOnScrollMode -> PanOnScrollMode -> Ordering
compare :: PanOnScrollMode -> PanOnScrollMode -> Ordering
$c< :: PanOnScrollMode -> PanOnScrollMode -> Bool
< :: PanOnScrollMode -> PanOnScrollMode -> Bool
$c<= :: PanOnScrollMode -> PanOnScrollMode -> Bool
<= :: PanOnScrollMode -> PanOnScrollMode -> Bool
$c> :: PanOnScrollMode -> PanOnScrollMode -> Bool
> :: PanOnScrollMode -> PanOnScrollMode -> Bool
$c>= :: PanOnScrollMode -> PanOnScrollMode -> Bool
>= :: PanOnScrollMode -> PanOnScrollMode -> Bool
$cmax :: PanOnScrollMode -> PanOnScrollMode -> PanOnScrollMode
max :: PanOnScrollMode -> PanOnScrollMode -> PanOnScrollMode
$cmin :: PanOnScrollMode -> PanOnScrollMode -> PanOnScrollMode
min :: PanOnScrollMode -> PanOnScrollMode -> PanOnScrollMode
Ord, (forall x. PanOnScrollMode -> Rep PanOnScrollMode x)
-> (forall x. Rep PanOnScrollMode x -> PanOnScrollMode)
-> Generic PanOnScrollMode
forall x. Rep PanOnScrollMode x -> PanOnScrollMode
forall x. PanOnScrollMode -> Rep PanOnScrollMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PanOnScrollMode -> Rep PanOnScrollMode x
from :: forall x. PanOnScrollMode -> Rep PanOnScrollMode x
$cto :: forall x. Rep PanOnScrollMode x -> PanOnScrollMode
to :: forall x. Rep PanOnScrollMode x -> PanOnScrollMode
Generic)
data PanOnDrag
= PanOnDrag !Bool
| PanOnDragButtons ![Int]
deriving (Int -> PanOnDrag -> ShowS
[PanOnDrag] -> ShowS
PanOnDrag -> String
(Int -> PanOnDrag -> ShowS)
-> (PanOnDrag -> String)
-> ([PanOnDrag] -> ShowS)
-> Show PanOnDrag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PanOnDrag -> ShowS
showsPrec :: Int -> PanOnDrag -> ShowS
$cshow :: PanOnDrag -> String
show :: PanOnDrag -> String
$cshowList :: [PanOnDrag] -> ShowS
showList :: [PanOnDrag] -> ShowS
Show, PanOnDrag -> PanOnDrag -> Bool
(PanOnDrag -> PanOnDrag -> Bool)
-> (PanOnDrag -> PanOnDrag -> Bool) -> Eq PanOnDrag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PanOnDrag -> PanOnDrag -> Bool
== :: PanOnDrag -> PanOnDrag -> Bool
$c/= :: PanOnDrag -> PanOnDrag -> Bool
/= :: PanOnDrag -> PanOnDrag -> Bool
Eq, (forall x. PanOnDrag -> Rep PanOnDrag x)
-> (forall x. Rep PanOnDrag x -> PanOnDrag) -> Generic PanOnDrag
forall x. Rep PanOnDrag x -> PanOnDrag
forall x. PanOnDrag -> Rep PanOnDrag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PanOnDrag -> Rep PanOnDrag x
from :: forall x. PanOnDrag -> Rep PanOnDrag x
$cto :: forall x. Rep PanOnDrag x -> PanOnDrag
to :: forall x. Rep PanOnDrag x -> PanOnDrag
Generic)
data ColorMode
= ColorModeLight
| ColorModeDark
| ColorModeSystem
deriving (Int -> ColorMode -> ShowS
[ColorMode] -> ShowS
ColorMode -> String
(Int -> ColorMode -> ShowS)
-> (ColorMode -> String)
-> ([ColorMode] -> ShowS)
-> Show ColorMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ColorMode -> ShowS
showsPrec :: Int -> ColorMode -> ShowS
$cshow :: ColorMode -> String
show :: ColorMode -> String
$cshowList :: [ColorMode] -> ShowS
showList :: [ColorMode] -> ShowS
Show, ColorMode -> ColorMode -> Bool
(ColorMode -> ColorMode -> Bool)
-> (ColorMode -> ColorMode -> Bool) -> Eq ColorMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ColorMode -> ColorMode -> Bool
== :: ColorMode -> ColorMode -> Bool
$c/= :: ColorMode -> ColorMode -> Bool
/= :: ColorMode -> ColorMode -> Bool
Eq, Eq ColorMode
Eq ColorMode =>
(ColorMode -> ColorMode -> Ordering)
-> (ColorMode -> ColorMode -> Bool)
-> (ColorMode -> ColorMode -> Bool)
-> (ColorMode -> ColorMode -> Bool)
-> (ColorMode -> ColorMode -> Bool)
-> (ColorMode -> ColorMode -> ColorMode)
-> (ColorMode -> ColorMode -> ColorMode)
-> Ord ColorMode
ColorMode -> ColorMode -> Bool
ColorMode -> ColorMode -> Ordering
ColorMode -> ColorMode -> ColorMode
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ColorMode -> ColorMode -> Ordering
compare :: ColorMode -> ColorMode -> Ordering
$c< :: ColorMode -> ColorMode -> Bool
< :: ColorMode -> ColorMode -> Bool
$c<= :: ColorMode -> ColorMode -> Bool
<= :: ColorMode -> ColorMode -> Bool
$c> :: ColorMode -> ColorMode -> Bool
> :: ColorMode -> ColorMode -> Bool
$c>= :: ColorMode -> ColorMode -> Bool
>= :: ColorMode -> ColorMode -> Bool
$cmax :: ColorMode -> ColorMode -> ColorMode
max :: ColorMode -> ColorMode -> ColorMode
$cmin :: ColorMode -> ColorMode -> ColorMode
min :: ColorMode -> ColorMode -> ColorMode
Ord, (forall x. ColorMode -> Rep ColorMode x)
-> (forall x. Rep ColorMode x -> ColorMode) -> Generic ColorMode
forall x. Rep ColorMode x -> ColorMode
forall x. ColorMode -> Rep ColorMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ColorMode -> Rep ColorMode x
from :: forall x. ColorMode -> Rep ColorMode x
$cto :: forall x. Rep ColorMode x -> ColorMode
to :: forall x. Rep ColorMode x -> ColorMode
Generic)
data ZIndexMode
= ZIndexAuto
| ZIndexBasic
| ZIndexManual
deriving (Int -> ZIndexMode -> ShowS
[ZIndexMode] -> ShowS
ZIndexMode -> String
(Int -> ZIndexMode -> ShowS)
-> (ZIndexMode -> String)
-> ([ZIndexMode] -> ShowS)
-> Show ZIndexMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ZIndexMode -> ShowS
showsPrec :: Int -> ZIndexMode -> ShowS
$cshow :: ZIndexMode -> String
show :: ZIndexMode -> String
$cshowList :: [ZIndexMode] -> ShowS
showList :: [ZIndexMode] -> ShowS
Show, ZIndexMode -> ZIndexMode -> Bool
(ZIndexMode -> ZIndexMode -> Bool)
-> (ZIndexMode -> ZIndexMode -> Bool) -> Eq ZIndexMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ZIndexMode -> ZIndexMode -> Bool
== :: ZIndexMode -> ZIndexMode -> Bool
$c/= :: ZIndexMode -> ZIndexMode -> Bool
/= :: ZIndexMode -> ZIndexMode -> Bool
Eq, Eq ZIndexMode
Eq ZIndexMode =>
(ZIndexMode -> ZIndexMode -> Ordering)
-> (ZIndexMode -> ZIndexMode -> Bool)
-> (ZIndexMode -> ZIndexMode -> Bool)
-> (ZIndexMode -> ZIndexMode -> Bool)
-> (ZIndexMode -> ZIndexMode -> Bool)
-> (ZIndexMode -> ZIndexMode -> ZIndexMode)
-> (ZIndexMode -> ZIndexMode -> ZIndexMode)
-> Ord ZIndexMode
ZIndexMode -> ZIndexMode -> Bool
ZIndexMode -> ZIndexMode -> Ordering
ZIndexMode -> ZIndexMode -> ZIndexMode
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ZIndexMode -> ZIndexMode -> Ordering
compare :: ZIndexMode -> ZIndexMode -> Ordering
$c< :: ZIndexMode -> ZIndexMode -> Bool
< :: ZIndexMode -> ZIndexMode -> Bool
$c<= :: ZIndexMode -> ZIndexMode -> Bool
<= :: ZIndexMode -> ZIndexMode -> Bool
$c> :: ZIndexMode -> ZIndexMode -> Bool
> :: ZIndexMode -> ZIndexMode -> Bool
$c>= :: ZIndexMode -> ZIndexMode -> Bool
>= :: ZIndexMode -> ZIndexMode -> Bool
$cmax :: ZIndexMode -> ZIndexMode -> ZIndexMode
max :: ZIndexMode -> ZIndexMode -> ZIndexMode
$cmin :: ZIndexMode -> ZIndexMode -> ZIndexMode
min :: ZIndexMode -> ZIndexMode -> ZIndexMode
Ord, (forall x. ZIndexMode -> Rep ZIndexMode x)
-> (forall x. Rep ZIndexMode x -> ZIndexMode) -> Generic ZIndexMode
forall x. Rep ZIndexMode x -> ZIndexMode
forall x. ZIndexMode -> Rep ZIndexMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ZIndexMode -> Rep ZIndexMode x
from :: forall x. ZIndexMode -> Rep ZIndexMode x
$cto :: forall x. Rep ZIndexMode x -> ZIndexMode
to :: forall x. Rep ZIndexMode x -> ZIndexMode
Generic)
data Align
= AlignCenter
| AlignStart
| AlignEnd
deriving (Int -> Align -> ShowS
[Align] -> ShowS
Align -> String
(Int -> Align -> ShowS)
-> (Align -> String) -> ([Align] -> ShowS) -> Show Align
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Align -> ShowS
showsPrec :: Int -> Align -> ShowS
$cshow :: Align -> String
show :: Align -> String
$cshowList :: [Align] -> ShowS
showList :: [Align] -> ShowS
Show, Align -> Align -> Bool
(Align -> Align -> Bool) -> (Align -> Align -> Bool) -> Eq Align
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Align -> Align -> Bool
== :: Align -> Align -> Bool
$c/= :: Align -> Align -> Bool
/= :: Align -> Align -> Bool
Eq, Eq Align
Eq Align =>
(Align -> Align -> Ordering)
-> (Align -> Align -> Bool)
-> (Align -> Align -> Bool)
-> (Align -> Align -> Bool)
-> (Align -> Align -> Bool)
-> (Align -> Align -> Align)
-> (Align -> Align -> Align)
-> Ord Align
Align -> Align -> Bool
Align -> Align -> Ordering
Align -> Align -> Align
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Align -> Align -> Ordering
compare :: Align -> Align -> Ordering
$c< :: Align -> Align -> Bool
< :: Align -> Align -> Bool
$c<= :: Align -> Align -> Bool
<= :: Align -> Align -> Bool
$c> :: Align -> Align -> Bool
> :: Align -> Align -> Bool
$c>= :: Align -> Align -> Bool
>= :: Align -> Align -> Bool
$cmax :: Align -> Align -> Align
max :: Align -> Align -> Align
$cmin :: Align -> Align -> Align
min :: Align -> Align -> Align
Ord, (forall x. Align -> Rep Align x)
-> (forall x. Rep Align x -> Align) -> Generic Align
forall x. Rep Align x -> Align
forall x. Align -> Rep Align x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Align -> Rep Align x
from :: forall x. Align -> Rep Align x
$cto :: forall x. Rep Align x -> Align
to :: forall x. Rep Align x -> Align
Generic)
data Connection = Connection
{ Connection -> MisoString
connectionSource :: !NodeId
, Connection -> MisoString
connectionTarget :: !NodeId
, Connection -> Maybe MisoString
connectionSourceHandle :: !(Maybe MisoString)
, Connection -> Maybe MisoString
connectionTargetHandle :: !(Maybe MisoString)
} deriving (Int -> Connection -> ShowS
[Connection] -> ShowS
Connection -> String
(Int -> Connection -> ShowS)
-> (Connection -> String)
-> ([Connection] -> ShowS)
-> Show Connection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Connection -> ShowS
showsPrec :: Int -> Connection -> ShowS
$cshow :: Connection -> String
show :: Connection -> String
$cshowList :: [Connection] -> ShowS
showList :: [Connection] -> ShowS
Show, Connection -> Connection -> Bool
(Connection -> Connection -> Bool)
-> (Connection -> Connection -> Bool) -> Eq Connection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Connection -> Connection -> Bool
== :: Connection -> Connection -> Bool
$c/= :: Connection -> Connection -> Bool
/= :: Connection -> Connection -> Bool
Eq, Eq Connection
Eq Connection =>
(Connection -> Connection -> Ordering)
-> (Connection -> Connection -> Bool)
-> (Connection -> Connection -> Bool)
-> (Connection -> Connection -> Bool)
-> (Connection -> Connection -> Bool)
-> (Connection -> Connection -> Connection)
-> (Connection -> Connection -> Connection)
-> Ord Connection
Connection -> Connection -> Bool
Connection -> Connection -> Ordering
Connection -> Connection -> Connection
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Connection -> Connection -> Ordering
compare :: Connection -> Connection -> Ordering
$c< :: Connection -> Connection -> Bool
< :: Connection -> Connection -> Bool
$c<= :: Connection -> Connection -> Bool
<= :: Connection -> Connection -> Bool
$c> :: Connection -> Connection -> Bool
> :: Connection -> Connection -> Bool
$c>= :: Connection -> Connection -> Bool
>= :: Connection -> Connection -> Bool
$cmax :: Connection -> Connection -> Connection
max :: Connection -> Connection -> Connection
$cmin :: Connection -> Connection -> Connection
min :: Connection -> Connection -> Connection
Ord, (forall x. Connection -> Rep Connection x)
-> (forall x. Rep Connection x -> Connection) -> Generic Connection
forall x. Rep Connection x -> Connection
forall x. Connection -> Rep Connection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Connection -> Rep Connection x
from :: forall x. Connection -> Rep Connection x
$cto :: forall x. Rep Connection x -> Connection
to :: forall x. Rep Connection x -> Connection
Generic)
connection :: NodeId -> NodeId -> Connection
connection :: MisoString -> MisoString -> Connection
connection MisoString
s MisoString
t = MisoString
-> MisoString -> Maybe MisoString -> Maybe MisoString -> Connection
Connection MisoString
s MisoString
t Maybe MisoString
forall a. Maybe a
Nothing Maybe MisoString
forall a. Maybe a
Nothing
data HandleConnection = HandleConnection
{ HandleConnection -> Connection
handleConnection :: !Connection
, HandleConnection -> MisoString
handleConnectionEdgeId :: !EdgeId
} deriving (Int -> HandleConnection -> ShowS
[HandleConnection] -> ShowS
HandleConnection -> String
(Int -> HandleConnection -> ShowS)
-> (HandleConnection -> String)
-> ([HandleConnection] -> ShowS)
-> Show HandleConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> HandleConnection -> ShowS
showsPrec :: Int -> HandleConnection -> ShowS
$cshow :: HandleConnection -> String
show :: HandleConnection -> String
$cshowList :: [HandleConnection] -> ShowS
showList :: [HandleConnection] -> ShowS
Show, HandleConnection -> HandleConnection -> Bool
(HandleConnection -> HandleConnection -> Bool)
-> (HandleConnection -> HandleConnection -> Bool)
-> Eq HandleConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HandleConnection -> HandleConnection -> Bool
== :: HandleConnection -> HandleConnection -> Bool
$c/= :: HandleConnection -> HandleConnection -> Bool
/= :: HandleConnection -> HandleConnection -> Bool
Eq, Eq HandleConnection
Eq HandleConnection =>
(HandleConnection -> HandleConnection -> Ordering)
-> (HandleConnection -> HandleConnection -> Bool)
-> (HandleConnection -> HandleConnection -> Bool)
-> (HandleConnection -> HandleConnection -> Bool)
-> (HandleConnection -> HandleConnection -> Bool)
-> (HandleConnection -> HandleConnection -> HandleConnection)
-> (HandleConnection -> HandleConnection -> HandleConnection)
-> Ord HandleConnection
HandleConnection -> HandleConnection -> Bool
HandleConnection -> HandleConnection -> Ordering
HandleConnection -> HandleConnection -> HandleConnection
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: HandleConnection -> HandleConnection -> Ordering
compare :: HandleConnection -> HandleConnection -> Ordering
$c< :: HandleConnection -> HandleConnection -> Bool
< :: HandleConnection -> HandleConnection -> Bool
$c<= :: HandleConnection -> HandleConnection -> Bool
<= :: HandleConnection -> HandleConnection -> Bool
$c> :: HandleConnection -> HandleConnection -> Bool
> :: HandleConnection -> HandleConnection -> Bool
$c>= :: HandleConnection -> HandleConnection -> Bool
>= :: HandleConnection -> HandleConnection -> Bool
$cmax :: HandleConnection -> HandleConnection -> HandleConnection
max :: HandleConnection -> HandleConnection -> HandleConnection
$cmin :: HandleConnection -> HandleConnection -> HandleConnection
min :: HandleConnection -> HandleConnection -> HandleConnection
Ord, (forall x. HandleConnection -> Rep HandleConnection x)
-> (forall x. Rep HandleConnection x -> HandleConnection)
-> Generic HandleConnection
forall x. Rep HandleConnection x -> HandleConnection
forall x. HandleConnection -> Rep HandleConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. HandleConnection -> Rep HandleConnection x
from :: forall x. HandleConnection -> Rep HandleConnection x
$cto :: forall x. Rep HandleConnection x -> HandleConnection
to :: forall x. Rep HandleConnection x -> HandleConnection
Generic)
type NodeConnection = HandleConnection
data ConnectionMode
= ConnectionModeStrict
| ConnectionModeLoose
deriving (Int -> ConnectionMode -> ShowS
[ConnectionMode] -> ShowS
ConnectionMode -> String
(Int -> ConnectionMode -> ShowS)
-> (ConnectionMode -> String)
-> ([ConnectionMode] -> ShowS)
-> Show ConnectionMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConnectionMode -> ShowS
showsPrec :: Int -> ConnectionMode -> ShowS
$cshow :: ConnectionMode -> String
show :: ConnectionMode -> String
$cshowList :: [ConnectionMode] -> ShowS
showList :: [ConnectionMode] -> ShowS
Show, ConnectionMode -> ConnectionMode -> Bool
(ConnectionMode -> ConnectionMode -> Bool)
-> (ConnectionMode -> ConnectionMode -> Bool) -> Eq ConnectionMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConnectionMode -> ConnectionMode -> Bool
== :: ConnectionMode -> ConnectionMode -> Bool
$c/= :: ConnectionMode -> ConnectionMode -> Bool
/= :: ConnectionMode -> ConnectionMode -> Bool
Eq, Eq ConnectionMode
Eq ConnectionMode =>
(ConnectionMode -> ConnectionMode -> Ordering)
-> (ConnectionMode -> ConnectionMode -> Bool)
-> (ConnectionMode -> ConnectionMode -> Bool)
-> (ConnectionMode -> ConnectionMode -> Bool)
-> (ConnectionMode -> ConnectionMode -> Bool)
-> (ConnectionMode -> ConnectionMode -> ConnectionMode)
-> (ConnectionMode -> ConnectionMode -> ConnectionMode)
-> Ord ConnectionMode
ConnectionMode -> ConnectionMode -> Bool
ConnectionMode -> ConnectionMode -> Ordering
ConnectionMode -> ConnectionMode -> ConnectionMode
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ConnectionMode -> ConnectionMode -> Ordering
compare :: ConnectionMode -> ConnectionMode -> Ordering
$c< :: ConnectionMode -> ConnectionMode -> Bool
< :: ConnectionMode -> ConnectionMode -> Bool
$c<= :: ConnectionMode -> ConnectionMode -> Bool
<= :: ConnectionMode -> ConnectionMode -> Bool
$c> :: ConnectionMode -> ConnectionMode -> Bool
> :: ConnectionMode -> ConnectionMode -> Bool
$c>= :: ConnectionMode -> ConnectionMode -> Bool
>= :: ConnectionMode -> ConnectionMode -> Bool
$cmax :: ConnectionMode -> ConnectionMode -> ConnectionMode
max :: ConnectionMode -> ConnectionMode -> ConnectionMode
$cmin :: ConnectionMode -> ConnectionMode -> ConnectionMode
min :: ConnectionMode -> ConnectionMode -> ConnectionMode
Ord, (forall x. ConnectionMode -> Rep ConnectionMode x)
-> (forall x. Rep ConnectionMode x -> ConnectionMode)
-> Generic ConnectionMode
forall x. Rep ConnectionMode x -> ConnectionMode
forall x. ConnectionMode -> Rep ConnectionMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ConnectionMode -> Rep ConnectionMode x
from :: forall x. ConnectionMode -> Rep ConnectionMode x
$cto :: forall x. Rep ConnectionMode x -> ConnectionMode
to :: forall x. Rep ConnectionMode x -> ConnectionMode
Generic)
data OnConnectStartParams = OnConnectStartParams
{ OnConnectStartParams -> Maybe MisoString
onConnectStartNodeId :: !(Maybe NodeId)
, OnConnectStartParams -> Maybe MisoString
onConnectStartHandleId :: !(Maybe MisoString)
, OnConnectStartParams -> Maybe HandleType
onConnectStartHandleType :: !(Maybe HandleType)
} deriving (Int -> OnConnectStartParams -> ShowS
[OnConnectStartParams] -> ShowS
OnConnectStartParams -> String
(Int -> OnConnectStartParams -> ShowS)
-> (OnConnectStartParams -> String)
-> ([OnConnectStartParams] -> ShowS)
-> Show OnConnectStartParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OnConnectStartParams -> ShowS
showsPrec :: Int -> OnConnectStartParams -> ShowS
$cshow :: OnConnectStartParams -> String
show :: OnConnectStartParams -> String
$cshowList :: [OnConnectStartParams] -> ShowS
showList :: [OnConnectStartParams] -> ShowS
Show, OnConnectStartParams -> OnConnectStartParams -> Bool
(OnConnectStartParams -> OnConnectStartParams -> Bool)
-> (OnConnectStartParams -> OnConnectStartParams -> Bool)
-> Eq OnConnectStartParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OnConnectStartParams -> OnConnectStartParams -> Bool
== :: OnConnectStartParams -> OnConnectStartParams -> Bool
$c/= :: OnConnectStartParams -> OnConnectStartParams -> Bool
/= :: OnConnectStartParams -> OnConnectStartParams -> Bool
Eq, (forall x. OnConnectStartParams -> Rep OnConnectStartParams x)
-> (forall x. Rep OnConnectStartParams x -> OnConnectStartParams)
-> Generic OnConnectStartParams
forall x. Rep OnConnectStartParams x -> OnConnectStartParams
forall x. OnConnectStartParams -> Rep OnConnectStartParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. OnConnectStartParams -> Rep OnConnectStartParams x
from :: forall x. OnConnectStartParams -> Rep OnConnectStartParams x
$cto :: forall x. Rep OnConnectStartParams x -> OnConnectStartParams
to :: forall x. Rep OnConnectStartParams x -> OnConnectStartParams
Generic)
data ConnectionInProgress n = ConnectionInProgress
{ forall n. ConnectionInProgress n -> Maybe Bool
cipIsValid :: !(Maybe Bool)
, forall n. ConnectionInProgress n -> XYPosition
cipFrom :: !XYPosition
, forall n. ConnectionInProgress n -> Handle
cipFromHandle :: !Handle
, forall n. ConnectionInProgress n -> Position
cipFromPosition :: !Position
, forall n. ConnectionInProgress n -> InternalNode n
cipFromNode :: !(InternalNode n)
, forall n. ConnectionInProgress n -> XYPosition
cipTo :: !XYPosition
, forall n. ConnectionInProgress n -> Maybe Handle
cipToHandle :: !(Maybe Handle)
, forall n. ConnectionInProgress n -> Position
cipToPosition :: !Position
, forall n. ConnectionInProgress n -> Maybe (InternalNode n)
cipToNode :: !(Maybe (InternalNode n))
, forall n. ConnectionInProgress n -> XYPosition
cipPointer :: !XYPosition
} deriving (Int -> ConnectionInProgress n -> ShowS
[ConnectionInProgress n] -> ShowS
ConnectionInProgress n -> String
(Int -> ConnectionInProgress n -> ShowS)
-> (ConnectionInProgress n -> String)
-> ([ConnectionInProgress n] -> ShowS)
-> Show (ConnectionInProgress n)
forall n. Show n => Int -> ConnectionInProgress n -> ShowS
forall n. Show n => [ConnectionInProgress n] -> ShowS
forall n. Show n => ConnectionInProgress n -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall n. Show n => Int -> ConnectionInProgress n -> ShowS
showsPrec :: Int -> ConnectionInProgress n -> ShowS
$cshow :: forall n. Show n => ConnectionInProgress n -> String
show :: ConnectionInProgress n -> String
$cshowList :: forall n. Show n => [ConnectionInProgress n] -> ShowS
showList :: [ConnectionInProgress n] -> ShowS
Show, ConnectionInProgress n -> ConnectionInProgress n -> Bool
(ConnectionInProgress n -> ConnectionInProgress n -> Bool)
-> (ConnectionInProgress n -> ConnectionInProgress n -> Bool)
-> Eq (ConnectionInProgress n)
forall n.
Eq n =>
ConnectionInProgress n -> ConnectionInProgress n -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall n.
Eq n =>
ConnectionInProgress n -> ConnectionInProgress n -> Bool
== :: ConnectionInProgress n -> ConnectionInProgress n -> Bool
$c/= :: forall n.
Eq n =>
ConnectionInProgress n -> ConnectionInProgress n -> Bool
/= :: ConnectionInProgress n -> ConnectionInProgress n -> Bool
Eq, (forall x.
ConnectionInProgress n -> Rep (ConnectionInProgress n) x)
-> (forall x.
Rep (ConnectionInProgress n) x -> ConnectionInProgress n)
-> Generic (ConnectionInProgress n)
forall x. Rep (ConnectionInProgress n) x -> ConnectionInProgress n
forall x. ConnectionInProgress n -> Rep (ConnectionInProgress n) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall n x.
Rep (ConnectionInProgress n) x -> ConnectionInProgress n
forall n x.
ConnectionInProgress n -> Rep (ConnectionInProgress n) x
$cfrom :: forall n x.
ConnectionInProgress n -> Rep (ConnectionInProgress n) x
from :: forall x. ConnectionInProgress n -> Rep (ConnectionInProgress n) x
$cto :: forall n x.
Rep (ConnectionInProgress n) x -> ConnectionInProgress n
to :: forall x. Rep (ConnectionInProgress n) x -> ConnectionInProgress n
Generic, (forall a b.
(a -> b) -> ConnectionInProgress a -> ConnectionInProgress b)
-> (forall a b.
a -> ConnectionInProgress b -> ConnectionInProgress a)
-> Functor ConnectionInProgress
forall a b. a -> ConnectionInProgress b -> ConnectionInProgress a
forall a b.
(a -> b) -> ConnectionInProgress a -> ConnectionInProgress b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b.
(a -> b) -> ConnectionInProgress a -> ConnectionInProgress b
fmap :: forall a b.
(a -> b) -> ConnectionInProgress a -> ConnectionInProgress b
$c<$ :: forall a b. a -> ConnectionInProgress b -> ConnectionInProgress a
<$ :: forall a b. a -> ConnectionInProgress b -> ConnectionInProgress a
Functor)
data ConnectionState n
= NoConnection
| InProgress !(ConnectionInProgress n)
deriving (Int -> ConnectionState n -> ShowS
[ConnectionState n] -> ShowS
ConnectionState n -> String
(Int -> ConnectionState n -> ShowS)
-> (ConnectionState n -> String)
-> ([ConnectionState n] -> ShowS)
-> Show (ConnectionState n)
forall n. Show n => Int -> ConnectionState n -> ShowS
forall n. Show n => [ConnectionState n] -> ShowS
forall n. Show n => ConnectionState n -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall n. Show n => Int -> ConnectionState n -> ShowS
showsPrec :: Int -> ConnectionState n -> ShowS
$cshow :: forall n. Show n => ConnectionState n -> String
show :: ConnectionState n -> String
$cshowList :: forall n. Show n => [ConnectionState n] -> ShowS
showList :: [ConnectionState n] -> ShowS
Show, ConnectionState n -> ConnectionState n -> Bool
(ConnectionState n -> ConnectionState n -> Bool)
-> (ConnectionState n -> ConnectionState n -> Bool)
-> Eq (ConnectionState n)
forall n. Eq n => ConnectionState n -> ConnectionState n -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall n. Eq n => ConnectionState n -> ConnectionState n -> Bool
== :: ConnectionState n -> ConnectionState n -> Bool
$c/= :: forall n. Eq n => ConnectionState n -> ConnectionState n -> Bool
/= :: ConnectionState n -> ConnectionState n -> Bool
Eq, (forall x. ConnectionState n -> Rep (ConnectionState n) x)
-> (forall x. Rep (ConnectionState n) x -> ConnectionState n)
-> Generic (ConnectionState n)
forall x. Rep (ConnectionState n) x -> ConnectionState n
forall x. ConnectionState n -> Rep (ConnectionState n) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall n x. Rep (ConnectionState n) x -> ConnectionState n
forall n x. ConnectionState n -> Rep (ConnectionState n) x
$cfrom :: forall n x. ConnectionState n -> Rep (ConnectionState n) x
from :: forall x. ConnectionState n -> Rep (ConnectionState n) x
$cto :: forall n x. Rep (ConnectionState n) x -> ConnectionState n
to :: forall x. Rep (ConnectionState n) x -> ConnectionState n
Generic, (forall a b. (a -> b) -> ConnectionState a -> ConnectionState b)
-> (forall a b. a -> ConnectionState b -> ConnectionState a)
-> Functor ConnectionState
forall a b. a -> ConnectionState b -> ConnectionState a
forall a b. (a -> b) -> ConnectionState a -> ConnectionState b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> ConnectionState a -> ConnectionState b
fmap :: forall a b. (a -> b) -> ConnectionState a -> ConnectionState b
$c<$ :: forall a b. a -> ConnectionState b -> ConnectionState a
<$ :: forall a b. a -> ConnectionState b -> ConnectionState a
Functor)
noConnection :: ConnectionState n
noConnection :: forall n. ConnectionState n
noConnection = ConnectionState n
forall n. ConnectionState n
NoConnection
connectionInProgress :: ConnectionState n -> Bool
connectionInProgress :: forall n. ConnectionState n -> Bool
connectionInProgress = \case
ConnectionState n
NoConnection -> Bool
False
InProgress {} -> Bool
True
data FinalConnectionState n = FinalConnectionState
{ forall n. FinalConnectionState n -> Maybe Bool
finalIsValid :: !(Maybe Bool)
, forall n. FinalConnectionState n -> Maybe XYPosition
finalFrom :: !(Maybe XYPosition)
, forall n. FinalConnectionState n -> Maybe Handle
finalFromHandle :: !(Maybe Handle)
, forall n. FinalConnectionState n -> Maybe Position
finalFromPosition :: !(Maybe Position)
, forall n. FinalConnectionState n -> Maybe (InternalNode n)
finalFromNode :: !(Maybe (InternalNode n))
, forall n. FinalConnectionState n -> Maybe XYPosition
finalTo :: !(Maybe XYPosition)
, forall n. FinalConnectionState n -> Maybe Handle
finalToHandle :: !(Maybe Handle)
, forall n. FinalConnectionState n -> Maybe Position
finalToPosition :: !(Maybe Position)
, forall n. FinalConnectionState n -> Maybe (InternalNode n)
finalToNode :: !(Maybe (InternalNode n))
} deriving (Int -> FinalConnectionState n -> ShowS
[FinalConnectionState n] -> ShowS
FinalConnectionState n -> String
(Int -> FinalConnectionState n -> ShowS)
-> (FinalConnectionState n -> String)
-> ([FinalConnectionState n] -> ShowS)
-> Show (FinalConnectionState n)
forall n. Show n => Int -> FinalConnectionState n -> ShowS
forall n. Show n => [FinalConnectionState n] -> ShowS
forall n. Show n => FinalConnectionState n -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall n. Show n => Int -> FinalConnectionState n -> ShowS
showsPrec :: Int -> FinalConnectionState n -> ShowS
$cshow :: forall n. Show n => FinalConnectionState n -> String
show :: FinalConnectionState n -> String
$cshowList :: forall n. Show n => [FinalConnectionState n] -> ShowS
showList :: [FinalConnectionState n] -> ShowS
Show, FinalConnectionState n -> FinalConnectionState n -> Bool
(FinalConnectionState n -> FinalConnectionState n -> Bool)
-> (FinalConnectionState n -> FinalConnectionState n -> Bool)
-> Eq (FinalConnectionState n)
forall n.
Eq n =>
FinalConnectionState n -> FinalConnectionState n -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall n.
Eq n =>
FinalConnectionState n -> FinalConnectionState n -> Bool
== :: FinalConnectionState n -> FinalConnectionState n -> Bool
$c/= :: forall n.
Eq n =>
FinalConnectionState n -> FinalConnectionState n -> Bool
/= :: FinalConnectionState n -> FinalConnectionState n -> Bool
Eq, (forall x.
FinalConnectionState n -> Rep (FinalConnectionState n) x)
-> (forall x.
Rep (FinalConnectionState n) x -> FinalConnectionState n)
-> Generic (FinalConnectionState n)
forall x. Rep (FinalConnectionState n) x -> FinalConnectionState n
forall x. FinalConnectionState n -> Rep (FinalConnectionState n) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall n x.
Rep (FinalConnectionState n) x -> FinalConnectionState n
forall n x.
FinalConnectionState n -> Rep (FinalConnectionState n) x
$cfrom :: forall n x.
FinalConnectionState n -> Rep (FinalConnectionState n) x
from :: forall x. FinalConnectionState n -> Rep (FinalConnectionState n) x
$cto :: forall n x.
Rep (FinalConnectionState n) x -> FinalConnectionState n
to :: forall x. Rep (FinalConnectionState n) x -> FinalConnectionState n
Generic, (forall a b.
(a -> b) -> FinalConnectionState a -> FinalConnectionState b)
-> (forall a b.
a -> FinalConnectionState b -> FinalConnectionState a)
-> Functor FinalConnectionState
forall a b. a -> FinalConnectionState b -> FinalConnectionState a
forall a b.
(a -> b) -> FinalConnectionState a -> FinalConnectionState b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b.
(a -> b) -> FinalConnectionState a -> FinalConnectionState b
fmap :: forall a b.
(a -> b) -> FinalConnectionState a -> FinalConnectionState b
$c<$ :: forall a b. a -> FinalConnectionState b -> FinalConnectionState a
<$ :: forall a b. a -> FinalConnectionState b -> FinalConnectionState a
Functor)
data HandleType
= SourceHandle
| TargetHandle
deriving (Int -> HandleType -> ShowS
[HandleType] -> ShowS
HandleType -> String
(Int -> HandleType -> ShowS)
-> (HandleType -> String)
-> ([HandleType] -> ShowS)
-> Show HandleType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> HandleType -> ShowS
showsPrec :: Int -> HandleType -> ShowS
$cshow :: HandleType -> String
show :: HandleType -> String
$cshowList :: [HandleType] -> ShowS
showList :: [HandleType] -> ShowS
Show, HandleType -> HandleType -> Bool
(HandleType -> HandleType -> Bool)
-> (HandleType -> HandleType -> Bool) -> Eq HandleType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HandleType -> HandleType -> Bool
== :: HandleType -> HandleType -> Bool
$c/= :: HandleType -> HandleType -> Bool
/= :: HandleType -> HandleType -> Bool
Eq, Eq HandleType
Eq HandleType =>
(HandleType -> HandleType -> Ordering)
-> (HandleType -> HandleType -> Bool)
-> (HandleType -> HandleType -> Bool)
-> (HandleType -> HandleType -> Bool)
-> (HandleType -> HandleType -> Bool)
-> (HandleType -> HandleType -> HandleType)
-> (HandleType -> HandleType -> HandleType)
-> Ord HandleType
HandleType -> HandleType -> Bool
HandleType -> HandleType -> Ordering
HandleType -> HandleType -> HandleType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: HandleType -> HandleType -> Ordering
compare :: HandleType -> HandleType -> Ordering
$c< :: HandleType -> HandleType -> Bool
< :: HandleType -> HandleType -> Bool
$c<= :: HandleType -> HandleType -> Bool
<= :: HandleType -> HandleType -> Bool
$c> :: HandleType -> HandleType -> Bool
> :: HandleType -> HandleType -> Bool
$c>= :: HandleType -> HandleType -> Bool
>= :: HandleType -> HandleType -> Bool
$cmax :: HandleType -> HandleType -> HandleType
max :: HandleType -> HandleType -> HandleType
$cmin :: HandleType -> HandleType -> HandleType
min :: HandleType -> HandleType -> HandleType
Ord, (forall x. HandleType -> Rep HandleType x)
-> (forall x. Rep HandleType x -> HandleType) -> Generic HandleType
forall x. Rep HandleType x -> HandleType
forall x. HandleType -> Rep HandleType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. HandleType -> Rep HandleType x
from :: forall x. HandleType -> Rep HandleType x
$cto :: forall x. Rep HandleType x -> HandleType
to :: forall x. Rep HandleType x -> HandleType
Generic)
handleTypeToText :: HandleType -> MisoString
handleTypeToText :: HandleType -> MisoString
handleTypeToText = \case
HandleType
SourceHandle -> MisoString
"source"
HandleType
TargetHandle -> MisoString
"target"
handleTypeFromText :: MisoString -> Maybe HandleType
handleTypeFromText :: MisoString -> Maybe HandleType
handleTypeFromText = \case
MisoString
"source" -> HandleType -> Maybe HandleType
forall a. a -> Maybe a
Just HandleType
SourceHandle
MisoString
"target" -> HandleType -> Maybe HandleType
forall a. a -> Maybe a
Just HandleType
TargetHandle
MisoString
_ -> Maybe HandleType
forall a. Maybe a
Nothing
data Handle = Handle
{ Handle -> Maybe MisoString
hId :: !(Maybe MisoString)
, Handle -> MisoString
hNodeId :: !NodeId
, Handle -> Double
hX :: !Double
, Handle -> Double
hY :: !Double
, Handle -> Position
hPosition :: !Position
, Handle -> HandleType
hType :: !HandleType
, Handle -> Double
hWidth :: !Double
, Handle -> Double
hHeight :: !Double
} deriving (Int -> Handle -> ShowS
[Handle] -> ShowS
Handle -> String
(Int -> Handle -> ShowS)
-> (Handle -> String) -> ([Handle] -> ShowS) -> Show Handle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Handle -> ShowS
showsPrec :: Int -> Handle -> ShowS
$cshow :: Handle -> String
show :: Handle -> String
$cshowList :: [Handle] -> ShowS
showList :: [Handle] -> ShowS
Show, Handle -> Handle -> Bool
(Handle -> Handle -> Bool)
-> (Handle -> Handle -> Bool) -> Eq Handle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Handle -> Handle -> Bool
== :: Handle -> Handle -> Bool
$c/= :: Handle -> Handle -> Bool
/= :: Handle -> Handle -> Bool
Eq, Eq Handle
Eq Handle =>
(Handle -> Handle -> Ordering)
-> (Handle -> Handle -> Bool)
-> (Handle -> Handle -> Bool)
-> (Handle -> Handle -> Bool)
-> (Handle -> Handle -> Bool)
-> (Handle -> Handle -> Handle)
-> (Handle -> Handle -> Handle)
-> Ord Handle
Handle -> Handle -> Bool
Handle -> Handle -> Ordering
Handle -> Handle -> Handle
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Handle -> Handle -> Ordering
compare :: Handle -> Handle -> Ordering
$c< :: Handle -> Handle -> Bool
< :: Handle -> Handle -> Bool
$c<= :: Handle -> Handle -> Bool
<= :: Handle -> Handle -> Bool
$c> :: Handle -> Handle -> Bool
> :: Handle -> Handle -> Bool
$c>= :: Handle -> Handle -> Bool
>= :: Handle -> Handle -> Bool
$cmax :: Handle -> Handle -> Handle
max :: Handle -> Handle -> Handle
$cmin :: Handle -> Handle -> Handle
min :: Handle -> Handle -> Handle
Ord, (forall x. Handle -> Rep Handle x)
-> (forall x. Rep Handle x -> Handle) -> Generic Handle
forall x. Rep Handle x -> Handle
forall x. Handle -> Rep Handle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Handle -> Rep Handle x
from :: forall x. Handle -> Rep Handle x
$cto :: forall x. Rep Handle x -> Handle
to :: forall x. Rep Handle x -> Handle
Generic)
data NodeHandle = NodeHandle
{ NodeHandle -> Maybe MisoString
nhId :: !(Maybe MisoString)
, NodeHandle -> Double
nhX :: !Double
, NodeHandle -> Double
nhY :: !Double
, NodeHandle -> Position
nhPosition :: !Position
, NodeHandle -> HandleType
nhType :: !HandleType
, NodeHandle -> Maybe Double
nhWidth :: !(Maybe Double)
, NodeHandle -> Maybe Double
nhHeight :: !(Maybe Double)
} deriving (Int -> NodeHandle -> ShowS
[NodeHandle] -> ShowS
NodeHandle -> String
(Int -> NodeHandle -> ShowS)
-> (NodeHandle -> String)
-> ([NodeHandle] -> ShowS)
-> Show NodeHandle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NodeHandle -> ShowS
showsPrec :: Int -> NodeHandle -> ShowS
$cshow :: NodeHandle -> String
show :: NodeHandle -> String
$cshowList :: [NodeHandle] -> ShowS
showList :: [NodeHandle] -> ShowS
Show, NodeHandle -> NodeHandle -> Bool
(NodeHandle -> NodeHandle -> Bool)
-> (NodeHandle -> NodeHandle -> Bool) -> Eq NodeHandle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NodeHandle -> NodeHandle -> Bool
== :: NodeHandle -> NodeHandle -> Bool
$c/= :: NodeHandle -> NodeHandle -> Bool
/= :: NodeHandle -> NodeHandle -> Bool
Eq, Eq NodeHandle
Eq NodeHandle =>
(NodeHandle -> NodeHandle -> Ordering)
-> (NodeHandle -> NodeHandle -> Bool)
-> (NodeHandle -> NodeHandle -> Bool)
-> (NodeHandle -> NodeHandle -> Bool)
-> (NodeHandle -> NodeHandle -> Bool)
-> (NodeHandle -> NodeHandle -> NodeHandle)
-> (NodeHandle -> NodeHandle -> NodeHandle)
-> Ord NodeHandle
NodeHandle -> NodeHandle -> Bool
NodeHandle -> NodeHandle -> Ordering
NodeHandle -> NodeHandle -> NodeHandle
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: NodeHandle -> NodeHandle -> Ordering
compare :: NodeHandle -> NodeHandle -> Ordering
$c< :: NodeHandle -> NodeHandle -> Bool
< :: NodeHandle -> NodeHandle -> Bool
$c<= :: NodeHandle -> NodeHandle -> Bool
<= :: NodeHandle -> NodeHandle -> Bool
$c> :: NodeHandle -> NodeHandle -> Bool
> :: NodeHandle -> NodeHandle -> Bool
$c>= :: NodeHandle -> NodeHandle -> Bool
>= :: NodeHandle -> NodeHandle -> Bool
$cmax :: NodeHandle -> NodeHandle -> NodeHandle
max :: NodeHandle -> NodeHandle -> NodeHandle
$cmin :: NodeHandle -> NodeHandle -> NodeHandle
min :: NodeHandle -> NodeHandle -> NodeHandle
Ord, (forall x. NodeHandle -> Rep NodeHandle x)
-> (forall x. Rep NodeHandle x -> NodeHandle) -> Generic NodeHandle
forall x. Rep NodeHandle x -> NodeHandle
forall x. NodeHandle -> Rep NodeHandle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NodeHandle -> Rep NodeHandle x
from :: forall x. NodeHandle -> Rep NodeHandle x
$cto :: forall x. Rep NodeHandle x -> NodeHandle
to :: forall x. Rep NodeHandle x -> NodeHandle
Generic)
nodeHandle :: Double -> Double -> Position -> HandleType -> NodeHandle
nodeHandle :: Double -> Double -> Position -> HandleType -> NodeHandle
nodeHandle Double
x Double
y Position
p HandleType
t = Maybe MisoString
-> Double
-> Double
-> Position
-> HandleType
-> Maybe Double
-> Maybe Double
-> NodeHandle
NodeHandle Maybe MisoString
forall a. Maybe a
Nothing Double
x Double
y Position
p HandleType
t Maybe Double
forall a. Maybe a
Nothing Maybe Double
forall a. Maybe a
Nothing
type NodeId = MisoString
data Measured = Measured
{ Measured -> Maybe Double
measuredWidth :: !(Maybe Double)
, Measured -> Maybe Double
measuredHeight :: !(Maybe Double)
} deriving (Int -> Measured -> ShowS
[Measured] -> ShowS
Measured -> String
(Int -> Measured -> ShowS)
-> (Measured -> String) -> ([Measured] -> ShowS) -> Show Measured
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Measured -> ShowS
showsPrec :: Int -> Measured -> ShowS
$cshow :: Measured -> String
show :: Measured -> String
$cshowList :: [Measured] -> ShowS
showList :: [Measured] -> ShowS
Show, Measured -> Measured -> Bool
(Measured -> Measured -> Bool)
-> (Measured -> Measured -> Bool) -> Eq Measured
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Measured -> Measured -> Bool
== :: Measured -> Measured -> Bool
$c/= :: Measured -> Measured -> Bool
/= :: Measured -> Measured -> Bool
Eq, Eq Measured
Eq Measured =>
(Measured -> Measured -> Ordering)
-> (Measured -> Measured -> Bool)
-> (Measured -> Measured -> Bool)
-> (Measured -> Measured -> Bool)
-> (Measured -> Measured -> Bool)
-> (Measured -> Measured -> Measured)
-> (Measured -> Measured -> Measured)
-> Ord Measured
Measured -> Measured -> Bool
Measured -> Measured -> Ordering
Measured -> Measured -> Measured
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Measured -> Measured -> Ordering
compare :: Measured -> Measured -> Ordering
$c< :: Measured -> Measured -> Bool
< :: Measured -> Measured -> Bool
$c<= :: Measured -> Measured -> Bool
<= :: Measured -> Measured -> Bool
$c> :: Measured -> Measured -> Bool
> :: Measured -> Measured -> Bool
$c>= :: Measured -> Measured -> Bool
>= :: Measured -> Measured -> Bool
$cmax :: Measured -> Measured -> Measured
max :: Measured -> Measured -> Measured
$cmin :: Measured -> Measured -> Measured
min :: Measured -> Measured -> Measured
Ord, (forall x. Measured -> Rep Measured x)
-> (forall x. Rep Measured x -> Measured) -> Generic Measured
forall x. Rep Measured x -> Measured
forall x. Measured -> Rep Measured x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Measured -> Rep Measured x
from :: forall x. Measured -> Rep Measured x
$cto :: forall x. Rep Measured x -> Measured
to :: forall x. Rep Measured x -> Measured
Generic)
noMeasure :: Measured
noMeasure :: Measured
noMeasure = Maybe Double -> Maybe Double -> Measured
Measured Maybe Double
forall a. Maybe a
Nothing Maybe Double
forall a. Maybe a
Nothing
measuredToDimensions :: Measured -> Maybe Dimensions
measuredToDimensions :: Measured -> Maybe Dimensions
measuredToDimensions (Measured (Just Double
w) (Just Double
h)) = Dimensions -> Maybe Dimensions
forall a. a -> Maybe a
Just (Double -> Double -> Dimensions
Dimensions Double
w Double
h)
measuredToDimensions Measured
_ = Maybe Dimensions
forall a. Maybe a
Nothing
data NodeOrigin = NodeOrigin
{ NodeOrigin -> Double
originX :: !Double
, NodeOrigin -> Double
originY :: !Double
} deriving (Int -> NodeOrigin -> ShowS
[NodeOrigin] -> ShowS
NodeOrigin -> String
(Int -> NodeOrigin -> ShowS)
-> (NodeOrigin -> String)
-> ([NodeOrigin] -> ShowS)
-> Show NodeOrigin
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NodeOrigin -> ShowS
showsPrec :: Int -> NodeOrigin -> ShowS
$cshow :: NodeOrigin -> String
show :: NodeOrigin -> String
$cshowList :: [NodeOrigin] -> ShowS
showList :: [NodeOrigin] -> ShowS
Show, NodeOrigin -> NodeOrigin -> Bool
(NodeOrigin -> NodeOrigin -> Bool)
-> (NodeOrigin -> NodeOrigin -> Bool) -> Eq NodeOrigin
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NodeOrigin -> NodeOrigin -> Bool
== :: NodeOrigin -> NodeOrigin -> Bool
$c/= :: NodeOrigin -> NodeOrigin -> Bool
/= :: NodeOrigin -> NodeOrigin -> Bool
Eq, Eq NodeOrigin
Eq NodeOrigin =>
(NodeOrigin -> NodeOrigin -> Ordering)
-> (NodeOrigin -> NodeOrigin -> Bool)
-> (NodeOrigin -> NodeOrigin -> Bool)
-> (NodeOrigin -> NodeOrigin -> Bool)
-> (NodeOrigin -> NodeOrigin -> Bool)
-> (NodeOrigin -> NodeOrigin -> NodeOrigin)
-> (NodeOrigin -> NodeOrigin -> NodeOrigin)
-> Ord NodeOrigin
NodeOrigin -> NodeOrigin -> Bool
NodeOrigin -> NodeOrigin -> Ordering
NodeOrigin -> NodeOrigin -> NodeOrigin
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: NodeOrigin -> NodeOrigin -> Ordering
compare :: NodeOrigin -> NodeOrigin -> Ordering
$c< :: NodeOrigin -> NodeOrigin -> Bool
< :: NodeOrigin -> NodeOrigin -> Bool
$c<= :: NodeOrigin -> NodeOrigin -> Bool
<= :: NodeOrigin -> NodeOrigin -> Bool
$c> :: NodeOrigin -> NodeOrigin -> Bool
> :: NodeOrigin -> NodeOrigin -> Bool
$c>= :: NodeOrigin -> NodeOrigin -> Bool
>= :: NodeOrigin -> NodeOrigin -> Bool
$cmax :: NodeOrigin -> NodeOrigin -> NodeOrigin
max :: NodeOrigin -> NodeOrigin -> NodeOrigin
$cmin :: NodeOrigin -> NodeOrigin -> NodeOrigin
min :: NodeOrigin -> NodeOrigin -> NodeOrigin
Ord, (forall x. NodeOrigin -> Rep NodeOrigin x)
-> (forall x. Rep NodeOrigin x -> NodeOrigin) -> Generic NodeOrigin
forall x. Rep NodeOrigin x -> NodeOrigin
forall x. NodeOrigin -> Rep NodeOrigin x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NodeOrigin -> Rep NodeOrigin x
from :: forall x. NodeOrigin -> Rep NodeOrigin x
$cto :: forall x. Rep NodeOrigin x -> NodeOrigin
to :: forall x. Rep NodeOrigin x -> NodeOrigin
Generic)
defaultOrigin :: NodeOrigin
defaultOrigin :: NodeOrigin
defaultOrigin = Double -> Double -> NodeOrigin
NodeOrigin Double
0 Double
0
data Node n = Node
{ forall n. Node n -> MisoString
nodeId :: !NodeId
, forall n. Node n -> XYPosition
nodePosition :: !XYPosition
, forall n. Node n -> n
nodeData :: n
, forall n. Node n -> Maybe MisoString
nodeType :: !(Maybe MisoString)
, forall n. Node n -> Maybe Position
nodeSourcePosition :: !(Maybe Position)
, forall n. Node n -> Maybe Position
nodeTargetPosition :: !(Maybe Position)
, forall n. Node n -> Bool
nodeHidden :: !Bool
, forall n. Node n -> Bool
nodeSelected :: !Bool
, forall n. Node n -> Bool
nodeDragging :: !Bool
, forall n. Node n -> Maybe Bool
nodeDraggable :: !(Maybe Bool)
, forall n. Node n -> Maybe Bool
nodeSelectable :: !(Maybe Bool)
, forall n. Node n -> Maybe Bool
nodeConnectable :: !(Maybe Bool)
, forall n. Node n -> Maybe Bool
nodeDeletable :: !(Maybe Bool)
, forall n. Node n -> Maybe MisoString
nodeDragHandle :: !(Maybe MisoString)
, forall n. Node n -> Maybe Double
nodeWidth :: !(Maybe Double)
, forall n. Node n -> Maybe Double
nodeHeight :: !(Maybe Double)
, forall n. Node n -> Maybe Double
nodeInitialWidth :: !(Maybe Double)
, forall n. Node n -> Maybe Double
nodeInitialHeight :: !(Maybe Double)
, forall n. Node n -> Maybe MisoString
nodeParentId :: !(Maybe NodeId)
, forall n. Node n -> Maybe Double
nodeZIndex :: !(Maybe Double)
, forall n. Node n -> Maybe NodeExtent
nodeExtent :: !(Maybe NodeExtent)
, forall n. Node n -> Bool
nodeExpandParent :: !Bool
, forall n. Node n -> Maybe MisoString
nodeAriaLabel :: !(Maybe MisoString)
, forall n. Node n -> Maybe NodeOrigin
nodeOrigin :: !(Maybe NodeOrigin)
, forall n. Node n -> Maybe [NodeHandle]
nodeHandles :: !(Maybe [NodeHandle])
, forall n. Node n -> Maybe Measured
nodeMeasured :: !(Maybe Measured)
, forall n. Node n -> Bool
nodeResizing :: !Bool
} deriving (Int -> Node n -> ShowS
[Node n] -> ShowS
Node n -> String
(Int -> Node n -> ShowS)
-> (Node n -> String) -> ([Node n] -> ShowS) -> Show (Node n)
forall n. Show n => Int -> Node n -> ShowS
forall n. Show n => [Node n] -> ShowS
forall n. Show n => Node n -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall n. Show n => Int -> Node n -> ShowS
showsPrec :: Int -> Node n -> ShowS
$cshow :: forall n. Show n => Node n -> String
show :: Node n -> String
$cshowList :: forall n. Show n => [Node n] -> ShowS
showList :: [Node n] -> ShowS
Show, Node n -> Node n -> Bool
(Node n -> Node n -> Bool)
-> (Node n -> Node n -> Bool) -> Eq (Node n)
forall n. Eq n => Node n -> Node n -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall n. Eq n => Node n -> Node n -> Bool
== :: Node n -> Node n -> Bool
$c/= :: forall n. Eq n => Node n -> Node n -> Bool
/= :: Node n -> Node n -> Bool
Eq, (forall x. Node n -> Rep (Node n) x)
-> (forall x. Rep (Node n) x -> Node n) -> Generic (Node n)
forall x. Rep (Node n) x -> Node n
forall x. Node n -> Rep (Node n) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall n x. Rep (Node n) x -> Node n
forall n x. Node n -> Rep (Node n) x
$cfrom :: forall n x. Node n -> Rep (Node n) x
from :: forall x. Node n -> Rep (Node n) x
$cto :: forall n x. Rep (Node n) x -> Node n
to :: forall x. Rep (Node n) x -> Node n
Generic, (forall a b. (a -> b) -> Node a -> Node b)
-> (forall a b. a -> Node b -> Node a) -> Functor Node
forall a b. a -> Node b -> Node a
forall a b. (a -> b) -> Node a -> Node b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Node a -> Node b
fmap :: forall a b. (a -> b) -> Node a -> Node b
$c<$ :: forall a b. a -> Node b -> Node a
<$ :: forall a b. a -> Node b -> Node a
Functor)
node :: NodeId -> XYPosition -> n -> Node n
node :: forall n. MisoString -> XYPosition -> n -> Node n
node MisoString
i XYPosition
p n
d = Node
{ nodeId :: MisoString
nodeId = MisoString
i
, nodePosition :: XYPosition
nodePosition = XYPosition
p
, nodeData :: n
nodeData = n
d
, nodeType :: Maybe MisoString
nodeType = Maybe MisoString
forall a. Maybe a
Nothing
, nodeSourcePosition :: Maybe Position
nodeSourcePosition = Maybe Position
forall a. Maybe a
Nothing
, nodeTargetPosition :: Maybe Position
nodeTargetPosition = Maybe Position
forall a. Maybe a
Nothing
, nodeHidden :: Bool
nodeHidden = Bool
False
, nodeSelected :: Bool
nodeSelected = Bool
False
, nodeDragging :: Bool
nodeDragging = Bool
False
, nodeDraggable :: Maybe Bool
nodeDraggable = Maybe Bool
forall a. Maybe a
Nothing
, nodeSelectable :: Maybe Bool
nodeSelectable = Maybe Bool
forall a. Maybe a
Nothing
, nodeConnectable :: Maybe Bool
nodeConnectable = Maybe Bool
forall a. Maybe a
Nothing
, nodeDeletable :: Maybe Bool
nodeDeletable = Maybe Bool
forall a. Maybe a
Nothing
, nodeDragHandle :: Maybe MisoString
nodeDragHandle = Maybe MisoString
forall a. Maybe a
Nothing
, nodeWidth :: Maybe Double
nodeWidth = Maybe Double
forall a. Maybe a
Nothing
, nodeHeight :: Maybe Double
nodeHeight = Maybe Double
forall a. Maybe a
Nothing
, nodeInitialWidth :: Maybe Double
nodeInitialWidth = Maybe Double
forall a. Maybe a
Nothing
, nodeInitialHeight :: Maybe Double
nodeInitialHeight = Maybe Double
forall a. Maybe a
Nothing
, nodeParentId :: Maybe MisoString
nodeParentId = Maybe MisoString
forall a. Maybe a
Nothing
, nodeZIndex :: Maybe Double
nodeZIndex = Maybe Double
forall a. Maybe a
Nothing
, nodeExtent :: Maybe NodeExtent
nodeExtent = Maybe NodeExtent
forall a. Maybe a
Nothing
, nodeExpandParent :: Bool
nodeExpandParent = Bool
False
, nodeAriaLabel :: Maybe MisoString
nodeAriaLabel = Maybe MisoString
forall a. Maybe a
Nothing
, nodeOrigin :: Maybe NodeOrigin
nodeOrigin = Maybe NodeOrigin
forall a. Maybe a
Nothing
, nodeHandles :: Maybe [NodeHandle]
nodeHandles = Maybe [NodeHandle]
forall a. Maybe a
Nothing
, nodeMeasured :: Maybe Measured
nodeMeasured = Maybe Measured
forall a. Maybe a
Nothing
, nodeResizing :: Bool
nodeResizing = Bool
False
}
data NodeHandleBounds = NodeHandleBounds
{ NodeHandleBounds -> Maybe [Handle]
nhbSource :: !(Maybe [Handle])
, NodeHandleBounds -> Maybe [Handle]
nhbTarget :: !(Maybe [Handle])
} deriving (Int -> NodeHandleBounds -> ShowS
[NodeHandleBounds] -> ShowS
NodeHandleBounds -> String
(Int -> NodeHandleBounds -> ShowS)
-> (NodeHandleBounds -> String)
-> ([NodeHandleBounds] -> ShowS)
-> Show NodeHandleBounds
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NodeHandleBounds -> ShowS
showsPrec :: Int -> NodeHandleBounds -> ShowS
$cshow :: NodeHandleBounds -> String
show :: NodeHandleBounds -> String
$cshowList :: [NodeHandleBounds] -> ShowS
showList :: [NodeHandleBounds] -> ShowS
Show, NodeHandleBounds -> NodeHandleBounds -> Bool
(NodeHandleBounds -> NodeHandleBounds -> Bool)
-> (NodeHandleBounds -> NodeHandleBounds -> Bool)
-> Eq NodeHandleBounds
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NodeHandleBounds -> NodeHandleBounds -> Bool
== :: NodeHandleBounds -> NodeHandleBounds -> Bool
$c/= :: NodeHandleBounds -> NodeHandleBounds -> Bool
/= :: NodeHandleBounds -> NodeHandleBounds -> Bool
Eq, (forall x. NodeHandleBounds -> Rep NodeHandleBounds x)
-> (forall x. Rep NodeHandleBounds x -> NodeHandleBounds)
-> Generic NodeHandleBounds
forall x. Rep NodeHandleBounds x -> NodeHandleBounds
forall x. NodeHandleBounds -> Rep NodeHandleBounds x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NodeHandleBounds -> Rep NodeHandleBounds x
from :: forall x. NodeHandleBounds -> Rep NodeHandleBounds x
$cto :: forall x. Rep NodeHandleBounds x -> NodeHandleBounds
to :: forall x. Rep NodeHandleBounds x -> NodeHandleBounds
Generic)
data NodeBounds = NodeBounds
{ NodeBounds -> Double
nbX :: !Double
, NodeBounds -> Double
nbY :: !Double
, NodeBounds -> Maybe Double
nbWidth :: !(Maybe Double)
, NodeBounds -> Maybe Double
nbHeight :: !(Maybe Double)
} deriving (Int -> NodeBounds -> ShowS
[NodeBounds] -> ShowS
NodeBounds -> String
(Int -> NodeBounds -> ShowS)
-> (NodeBounds -> String)
-> ([NodeBounds] -> ShowS)
-> Show NodeBounds
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NodeBounds -> ShowS
showsPrec :: Int -> NodeBounds -> ShowS
$cshow :: NodeBounds -> String
show :: NodeBounds -> String
$cshowList :: [NodeBounds] -> ShowS
showList :: [NodeBounds] -> ShowS
Show, NodeBounds -> NodeBounds -> Bool
(NodeBounds -> NodeBounds -> Bool)
-> (NodeBounds -> NodeBounds -> Bool) -> Eq NodeBounds
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NodeBounds -> NodeBounds -> Bool
== :: NodeBounds -> NodeBounds -> Bool
$c/= :: NodeBounds -> NodeBounds -> Bool
/= :: NodeBounds -> NodeBounds -> Bool
Eq, (forall x. NodeBounds -> Rep NodeBounds x)
-> (forall x. Rep NodeBounds x -> NodeBounds) -> Generic NodeBounds
forall x. Rep NodeBounds x -> NodeBounds
forall x. NodeBounds -> Rep NodeBounds x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NodeBounds -> Rep NodeBounds x
from :: forall x. NodeBounds -> Rep NodeBounds x
$cto :: forall x. Rep NodeBounds x -> NodeBounds
to :: forall x. Rep NodeBounds x -> NodeBounds
Generic)
data InternalNode n = InternalNode
{ forall n. InternalNode n -> Node n
internalUser :: !(Node n)
, forall n. InternalNode n -> Measured
internalMeasured :: !Measured
, forall n. InternalNode n -> XYPosition
internalPositionAbsolute :: !XYPosition
, forall n. InternalNode n -> Double
internalZ :: !Double
, forall n. InternalNode n -> Maybe Int
internalRootParentIndex :: !(Maybe Int)
, forall n. InternalNode n -> Maybe NodeHandleBounds
internalHandleBounds :: !(Maybe NodeHandleBounds)
, forall n. InternalNode n -> Maybe NodeBounds
internalBounds :: !(Maybe NodeBounds)
} deriving (Int -> InternalNode n -> ShowS
[InternalNode n] -> ShowS
InternalNode n -> String
(Int -> InternalNode n -> ShowS)
-> (InternalNode n -> String)
-> ([InternalNode n] -> ShowS)
-> Show (InternalNode n)
forall n. Show n => Int -> InternalNode n -> ShowS
forall n. Show n => [InternalNode n] -> ShowS
forall n. Show n => InternalNode n -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall n. Show n => Int -> InternalNode n -> ShowS
showsPrec :: Int -> InternalNode n -> ShowS
$cshow :: forall n. Show n => InternalNode n -> String
show :: InternalNode n -> String
$cshowList :: forall n. Show n => [InternalNode n] -> ShowS
showList :: [InternalNode n] -> ShowS
Show, InternalNode n -> InternalNode n -> Bool
(InternalNode n -> InternalNode n -> Bool)
-> (InternalNode n -> InternalNode n -> Bool)
-> Eq (InternalNode n)
forall n. Eq n => InternalNode n -> InternalNode n -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall n. Eq n => InternalNode n -> InternalNode n -> Bool
== :: InternalNode n -> InternalNode n -> Bool
$c/= :: forall n. Eq n => InternalNode n -> InternalNode n -> Bool
/= :: InternalNode n -> InternalNode n -> Bool
Eq, (forall x. InternalNode n -> Rep (InternalNode n) x)
-> (forall x. Rep (InternalNode n) x -> InternalNode n)
-> Generic (InternalNode n)
forall x. Rep (InternalNode n) x -> InternalNode n
forall x. InternalNode n -> Rep (InternalNode n) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall n x. Rep (InternalNode n) x -> InternalNode n
forall n x. InternalNode n -> Rep (InternalNode n) x
$cfrom :: forall n x. InternalNode n -> Rep (InternalNode n) x
from :: forall x. InternalNode n -> Rep (InternalNode n) x
$cto :: forall n x. Rep (InternalNode n) x -> InternalNode n
to :: forall x. Rep (InternalNode n) x -> InternalNode n
Generic, (forall a b. (a -> b) -> InternalNode a -> InternalNode b)
-> (forall a b. a -> InternalNode b -> InternalNode a)
-> Functor InternalNode
forall a b. a -> InternalNode b -> InternalNode a
forall a b. (a -> b) -> InternalNode a -> InternalNode b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> InternalNode a -> InternalNode b
fmap :: forall a b. (a -> b) -> InternalNode a -> InternalNode b
$c<$ :: forall a b. a -> InternalNode b -> InternalNode a
<$ :: forall a b. a -> InternalNode b -> InternalNode a
Functor)
internalUserNode :: InternalNode n -> Node n
internalUserNode :: forall n. InternalNode n -> Node n
internalUserNode = InternalNode n -> Node n
forall n. InternalNode n -> Node n
internalUser
data NodeDragItem = NodeDragItem
{ NodeDragItem -> MisoString
dragItemId :: !NodeId
, NodeDragItem -> XYPosition
dragItemPosition :: !XYPosition
, NodeDragItem -> XYPosition
dragItemDistance :: !XYPosition
, NodeDragItem -> Dimensions
dragItemMeasured :: !Dimensions
, NodeDragItem -> XYPosition
dragItemPositionAbsolute :: !XYPosition
, NodeDragItem -> Maybe NodeExtent
dragItemExtent :: !(Maybe NodeExtent)
, NodeDragItem -> Maybe MisoString
dragItemParentId :: !(Maybe NodeId)
, NodeDragItem -> Maybe NodeOrigin
dragItemOrigin :: !(Maybe NodeOrigin)
, NodeDragItem -> Bool
dragItemExpandParent :: !Bool
, NodeDragItem -> Bool
dragItemDragging :: !Bool
} deriving (Int -> NodeDragItem -> ShowS
[NodeDragItem] -> ShowS
NodeDragItem -> String
(Int -> NodeDragItem -> ShowS)
-> (NodeDragItem -> String)
-> ([NodeDragItem] -> ShowS)
-> Show NodeDragItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NodeDragItem -> ShowS
showsPrec :: Int -> NodeDragItem -> ShowS
$cshow :: NodeDragItem -> String
show :: NodeDragItem -> String
$cshowList :: [NodeDragItem] -> ShowS
showList :: [NodeDragItem] -> ShowS
Show, NodeDragItem -> NodeDragItem -> Bool
(NodeDragItem -> NodeDragItem -> Bool)
-> (NodeDragItem -> NodeDragItem -> Bool) -> Eq NodeDragItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NodeDragItem -> NodeDragItem -> Bool
== :: NodeDragItem -> NodeDragItem -> Bool
$c/= :: NodeDragItem -> NodeDragItem -> Bool
/= :: NodeDragItem -> NodeDragItem -> Bool
Eq, (forall x. NodeDragItem -> Rep NodeDragItem x)
-> (forall x. Rep NodeDragItem x -> NodeDragItem)
-> Generic NodeDragItem
forall x. Rep NodeDragItem x -> NodeDragItem
forall x. NodeDragItem -> Rep NodeDragItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NodeDragItem -> Rep NodeDragItem x
from :: forall x. NodeDragItem -> Rep NodeDragItem x
$cto :: forall x. Rep NodeDragItem x -> NodeDragItem
to :: forall x. Rep NodeDragItem x -> NodeDragItem
Generic)
type NodeLookup n = Map NodeId (InternalNode n)
type ParentLookup n = Map NodeId (Map NodeId (InternalNode n))
data InternalNodeUpdate = InternalNodeUpdate
{ InternalNodeUpdate -> MisoString
internalUpdateId :: !NodeId
, InternalNodeUpdate -> Bool
internalUpdateForce :: !Bool
} deriving (Int -> InternalNodeUpdate -> ShowS
[InternalNodeUpdate] -> ShowS
InternalNodeUpdate -> String
(Int -> InternalNodeUpdate -> ShowS)
-> (InternalNodeUpdate -> String)
-> ([InternalNodeUpdate] -> ShowS)
-> Show InternalNodeUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InternalNodeUpdate -> ShowS
showsPrec :: Int -> InternalNodeUpdate -> ShowS
$cshow :: InternalNodeUpdate -> String
show :: InternalNodeUpdate -> String
$cshowList :: [InternalNodeUpdate] -> ShowS
showList :: [InternalNodeUpdate] -> ShowS
Show, InternalNodeUpdate -> InternalNodeUpdate -> Bool
(InternalNodeUpdate -> InternalNodeUpdate -> Bool)
-> (InternalNodeUpdate -> InternalNodeUpdate -> Bool)
-> Eq InternalNodeUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InternalNodeUpdate -> InternalNodeUpdate -> Bool
== :: InternalNodeUpdate -> InternalNodeUpdate -> Bool
$c/= :: InternalNodeUpdate -> InternalNodeUpdate -> Bool
/= :: InternalNodeUpdate -> InternalNodeUpdate -> Bool
Eq, (forall x. InternalNodeUpdate -> Rep InternalNodeUpdate x)
-> (forall x. Rep InternalNodeUpdate x -> InternalNodeUpdate)
-> Generic InternalNodeUpdate
forall x. Rep InternalNodeUpdate x -> InternalNodeUpdate
forall x. InternalNodeUpdate -> Rep InternalNodeUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. InternalNodeUpdate -> Rep InternalNodeUpdate x
from :: forall x. InternalNodeUpdate -> Rep InternalNodeUpdate x
$cto :: forall x. Rep InternalNodeUpdate x -> InternalNodeUpdate
to :: forall x. Rep InternalNodeUpdate x -> InternalNodeUpdate
Generic)
type EdgeId = MisoString
data Edge e = Edge
{ forall e. Edge e -> MisoString
edgeId :: !EdgeId
, forall e. Edge e -> MisoString
edgeSource :: !NodeId
, forall e. Edge e -> MisoString
edgeTarget :: !NodeId
, forall e. Edge e -> Maybe MisoString
edgeType :: !(Maybe MisoString)
, forall e. Edge e -> Maybe MisoString
edgeSourceHandle :: !(Maybe MisoString)
, forall e. Edge e -> Maybe MisoString
edgeTargetHandle :: !(Maybe MisoString)
, forall e. Edge e -> Bool
edgeAnimated :: !Bool
, forall e. Edge e -> Bool
edgeHidden :: !Bool
, forall e. Edge e -> Maybe Bool
edgeDeletable :: !(Maybe Bool)
, forall e. Edge e -> Maybe Bool
edgeSelectable :: !(Maybe Bool)
, forall e. Edge e -> Maybe e
edgeData :: !(Maybe e)
, forall e. Edge e -> Bool
edgeSelected :: !Bool
, forall e. Edge e -> Maybe EdgeMarkerType
edgeMarkerStart :: !(Maybe EdgeMarkerType)
, forall e. Edge e -> Maybe EdgeMarkerType
edgeMarkerEnd :: !(Maybe EdgeMarkerType)
, forall e. Edge e -> Maybe Double
edgeZIndex :: !(Maybe Double)
, forall e. Edge e -> Maybe MisoString
edgeAriaLabel :: !(Maybe MisoString)
, forall e. Edge e -> Maybe Double
edgeInteractionWidth :: !(Maybe Double)
} deriving (Int -> Edge e -> ShowS
[Edge e] -> ShowS
Edge e -> String
(Int -> Edge e -> ShowS)
-> (Edge e -> String) -> ([Edge e] -> ShowS) -> Show (Edge e)
forall e. Show e => Int -> Edge e -> ShowS
forall e. Show e => [Edge e] -> ShowS
forall e. Show e => Edge e -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall e. Show e => Int -> Edge e -> ShowS
showsPrec :: Int -> Edge e -> ShowS
$cshow :: forall e. Show e => Edge e -> String
show :: Edge e -> String
$cshowList :: forall e. Show e => [Edge e] -> ShowS
showList :: [Edge e] -> ShowS
Show, Edge e -> Edge e -> Bool
(Edge e -> Edge e -> Bool)
-> (Edge e -> Edge e -> Bool) -> Eq (Edge e)
forall e. Eq e => Edge e -> Edge e -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall e. Eq e => Edge e -> Edge e -> Bool
== :: Edge e -> Edge e -> Bool
$c/= :: forall e. Eq e => Edge e -> Edge e -> Bool
/= :: Edge e -> Edge e -> Bool
Eq, (forall x. Edge e -> Rep (Edge e) x)
-> (forall x. Rep (Edge e) x -> Edge e) -> Generic (Edge e)
forall x. Rep (Edge e) x -> Edge e
forall x. Edge e -> Rep (Edge e) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall e x. Rep (Edge e) x -> Edge e
forall e x. Edge e -> Rep (Edge e) x
$cfrom :: forall e x. Edge e -> Rep (Edge e) x
from :: forall x. Edge e -> Rep (Edge e) x
$cto :: forall e x. Rep (Edge e) x -> Edge e
to :: forall x. Rep (Edge e) x -> Edge e
Generic, (forall a b. (a -> b) -> Edge a -> Edge b)
-> (forall a b. a -> Edge b -> Edge a) -> Functor Edge
forall a b. a -> Edge b -> Edge a
forall a b. (a -> b) -> Edge a -> Edge b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Edge a -> Edge b
fmap :: forall a b. (a -> b) -> Edge a -> Edge b
$c<$ :: forall a b. a -> Edge b -> Edge a
<$ :: forall a b. a -> Edge b -> Edge a
Functor)
edge :: EdgeId -> NodeId -> NodeId -> Edge e
edge :: forall e. MisoString -> MisoString -> MisoString -> Edge e
edge MisoString
i MisoString
s MisoString
t = Edge
{ edgeId :: MisoString
edgeId = MisoString
i
, edgeSource :: MisoString
edgeSource = MisoString
s
, edgeTarget :: MisoString
edgeTarget = MisoString
t
, edgeType :: Maybe MisoString
edgeType = Maybe MisoString
forall a. Maybe a
Nothing
, edgeSourceHandle :: Maybe MisoString
edgeSourceHandle = Maybe MisoString
forall a. Maybe a
Nothing
, edgeTargetHandle :: Maybe MisoString
edgeTargetHandle = Maybe MisoString
forall a. Maybe a
Nothing
, edgeAnimated :: Bool
edgeAnimated = Bool
False
, edgeHidden :: Bool
edgeHidden = Bool
False
, edgeDeletable :: Maybe Bool
edgeDeletable = Maybe Bool
forall a. Maybe a
Nothing
, edgeSelectable :: Maybe Bool
edgeSelectable = Maybe Bool
forall a. Maybe a
Nothing
, edgeData :: Maybe e
edgeData = Maybe e
forall a. Maybe a
Nothing
, edgeSelected :: Bool
edgeSelected = Bool
False
, edgeMarkerStart :: Maybe EdgeMarkerType
edgeMarkerStart = Maybe EdgeMarkerType
forall a. Maybe a
Nothing
, edgeMarkerEnd :: Maybe EdgeMarkerType
edgeMarkerEnd = Maybe EdgeMarkerType
forall a. Maybe a
Nothing
, edgeZIndex :: Maybe Double
edgeZIndex = Maybe Double
forall a. Maybe a
Nothing
, edgeAriaLabel :: Maybe MisoString
edgeAriaLabel = Maybe MisoString
forall a. Maybe a
Nothing
, edgeInteractionWidth :: Maybe Double
edgeInteractionWidth = Maybe Double
forall a. Maybe a
Nothing
}
data ConnectionLineType
= ConnectionLineBezier
| ConnectionLineStraight
| ConnectionLineStep
| ConnectionLineSmoothStep
| ConnectionLineSimpleBezier
deriving (Int -> ConnectionLineType -> ShowS
[ConnectionLineType] -> ShowS
ConnectionLineType -> String
(Int -> ConnectionLineType -> ShowS)
-> (ConnectionLineType -> String)
-> ([ConnectionLineType] -> ShowS)
-> Show ConnectionLineType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConnectionLineType -> ShowS
showsPrec :: Int -> ConnectionLineType -> ShowS
$cshow :: ConnectionLineType -> String
show :: ConnectionLineType -> String
$cshowList :: [ConnectionLineType] -> ShowS
showList :: [ConnectionLineType] -> ShowS
Show, ConnectionLineType -> ConnectionLineType -> Bool
(ConnectionLineType -> ConnectionLineType -> Bool)
-> (ConnectionLineType -> ConnectionLineType -> Bool)
-> Eq ConnectionLineType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConnectionLineType -> ConnectionLineType -> Bool
== :: ConnectionLineType -> ConnectionLineType -> Bool
$c/= :: ConnectionLineType -> ConnectionLineType -> Bool
/= :: ConnectionLineType -> ConnectionLineType -> Bool
Eq, Eq ConnectionLineType
Eq ConnectionLineType =>
(ConnectionLineType -> ConnectionLineType -> Ordering)
-> (ConnectionLineType -> ConnectionLineType -> Bool)
-> (ConnectionLineType -> ConnectionLineType -> Bool)
-> (ConnectionLineType -> ConnectionLineType -> Bool)
-> (ConnectionLineType -> ConnectionLineType -> Bool)
-> (ConnectionLineType -> ConnectionLineType -> ConnectionLineType)
-> (ConnectionLineType -> ConnectionLineType -> ConnectionLineType)
-> Ord ConnectionLineType
ConnectionLineType -> ConnectionLineType -> Bool
ConnectionLineType -> ConnectionLineType -> Ordering
ConnectionLineType -> ConnectionLineType -> ConnectionLineType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ConnectionLineType -> ConnectionLineType -> Ordering
compare :: ConnectionLineType -> ConnectionLineType -> Ordering
$c< :: ConnectionLineType -> ConnectionLineType -> Bool
< :: ConnectionLineType -> ConnectionLineType -> Bool
$c<= :: ConnectionLineType -> ConnectionLineType -> Bool
<= :: ConnectionLineType -> ConnectionLineType -> Bool
$c> :: ConnectionLineType -> ConnectionLineType -> Bool
> :: ConnectionLineType -> ConnectionLineType -> Bool
$c>= :: ConnectionLineType -> ConnectionLineType -> Bool
>= :: ConnectionLineType -> ConnectionLineType -> Bool
$cmax :: ConnectionLineType -> ConnectionLineType -> ConnectionLineType
max :: ConnectionLineType -> ConnectionLineType -> ConnectionLineType
$cmin :: ConnectionLineType -> ConnectionLineType -> ConnectionLineType
min :: ConnectionLineType -> ConnectionLineType -> ConnectionLineType
Ord, (forall x. ConnectionLineType -> Rep ConnectionLineType x)
-> (forall x. Rep ConnectionLineType x -> ConnectionLineType)
-> Generic ConnectionLineType
forall x. Rep ConnectionLineType x -> ConnectionLineType
forall x. ConnectionLineType -> Rep ConnectionLineType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ConnectionLineType -> Rep ConnectionLineType x
from :: forall x. ConnectionLineType -> Rep ConnectionLineType x
$cto :: forall x. Rep ConnectionLineType x -> ConnectionLineType
to :: forall x. Rep ConnectionLineType x -> ConnectionLineType
Generic)
data MarkerType
= MarkerArrow
| MarkerArrowClosed
deriving (Int -> MarkerType -> ShowS
[MarkerType] -> ShowS
MarkerType -> String
(Int -> MarkerType -> ShowS)
-> (MarkerType -> String)
-> ([MarkerType] -> ShowS)
-> Show MarkerType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MarkerType -> ShowS
showsPrec :: Int -> MarkerType -> ShowS
$cshow :: MarkerType -> String
show :: MarkerType -> String
$cshowList :: [MarkerType] -> ShowS
showList :: [MarkerType] -> ShowS
Show, MarkerType -> MarkerType -> Bool
(MarkerType -> MarkerType -> Bool)
-> (MarkerType -> MarkerType -> Bool) -> Eq MarkerType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MarkerType -> MarkerType -> Bool
== :: MarkerType -> MarkerType -> Bool
$c/= :: MarkerType -> MarkerType -> Bool
/= :: MarkerType -> MarkerType -> Bool
Eq, Eq MarkerType
Eq MarkerType =>
(MarkerType -> MarkerType -> Ordering)
-> (MarkerType -> MarkerType -> Bool)
-> (MarkerType -> MarkerType -> Bool)
-> (MarkerType -> MarkerType -> Bool)
-> (MarkerType -> MarkerType -> Bool)
-> (MarkerType -> MarkerType -> MarkerType)
-> (MarkerType -> MarkerType -> MarkerType)
-> Ord MarkerType
MarkerType -> MarkerType -> Bool
MarkerType -> MarkerType -> Ordering
MarkerType -> MarkerType -> MarkerType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: MarkerType -> MarkerType -> Ordering
compare :: MarkerType -> MarkerType -> Ordering
$c< :: MarkerType -> MarkerType -> Bool
< :: MarkerType -> MarkerType -> Bool
$c<= :: MarkerType -> MarkerType -> Bool
<= :: MarkerType -> MarkerType -> Bool
$c> :: MarkerType -> MarkerType -> Bool
> :: MarkerType -> MarkerType -> Bool
$c>= :: MarkerType -> MarkerType -> Bool
>= :: MarkerType -> MarkerType -> Bool
$cmax :: MarkerType -> MarkerType -> MarkerType
max :: MarkerType -> MarkerType -> MarkerType
$cmin :: MarkerType -> MarkerType -> MarkerType
min :: MarkerType -> MarkerType -> MarkerType
Ord, (forall x. MarkerType -> Rep MarkerType x)
-> (forall x. Rep MarkerType x -> MarkerType) -> Generic MarkerType
forall x. Rep MarkerType x -> MarkerType
forall x. MarkerType -> Rep MarkerType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. MarkerType -> Rep MarkerType x
from :: forall x. MarkerType -> Rep MarkerType x
$cto :: forall x. Rep MarkerType x -> MarkerType
to :: forall x. Rep MarkerType x -> MarkerType
Generic)
markerTypeToText :: MarkerType -> MisoString
markerTypeToText :: MarkerType -> MisoString
markerTypeToText = \case
MarkerType
MarkerArrow -> MisoString
"arrow"
MarkerType
MarkerArrowClosed -> MisoString
"arrowclosed"
data EdgeMarker = EdgeMarker
{ EdgeMarker -> MarkerType
markerType :: !MarkerType
, EdgeMarker -> Maybe MisoString
markerColor :: !(Maybe MisoString)
, EdgeMarker -> Maybe Double
markerWidth :: !(Maybe Double)
, EdgeMarker -> Maybe Double
markerHeight :: !(Maybe Double)
, EdgeMarker -> Maybe MisoString
markerUnits :: !(Maybe MisoString)
, EdgeMarker -> Maybe MisoString
markerOrient :: !(Maybe MisoString)
, EdgeMarker -> Maybe Double
markerStrokeWidth :: !(Maybe Double)
} deriving (Int -> EdgeMarker -> ShowS
[EdgeMarker] -> ShowS
EdgeMarker -> String
(Int -> EdgeMarker -> ShowS)
-> (EdgeMarker -> String)
-> ([EdgeMarker] -> ShowS)
-> Show EdgeMarker
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EdgeMarker -> ShowS
showsPrec :: Int -> EdgeMarker -> ShowS
$cshow :: EdgeMarker -> String
show :: EdgeMarker -> String
$cshowList :: [EdgeMarker] -> ShowS
showList :: [EdgeMarker] -> ShowS
Show, EdgeMarker -> EdgeMarker -> Bool
(EdgeMarker -> EdgeMarker -> Bool)
-> (EdgeMarker -> EdgeMarker -> Bool) -> Eq EdgeMarker
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EdgeMarker -> EdgeMarker -> Bool
== :: EdgeMarker -> EdgeMarker -> Bool
$c/= :: EdgeMarker -> EdgeMarker -> Bool
/= :: EdgeMarker -> EdgeMarker -> Bool
Eq, Eq EdgeMarker
Eq EdgeMarker =>
(EdgeMarker -> EdgeMarker -> Ordering)
-> (EdgeMarker -> EdgeMarker -> Bool)
-> (EdgeMarker -> EdgeMarker -> Bool)
-> (EdgeMarker -> EdgeMarker -> Bool)
-> (EdgeMarker -> EdgeMarker -> Bool)
-> (EdgeMarker -> EdgeMarker -> EdgeMarker)
-> (EdgeMarker -> EdgeMarker -> EdgeMarker)
-> Ord EdgeMarker
EdgeMarker -> EdgeMarker -> Bool
EdgeMarker -> EdgeMarker -> Ordering
EdgeMarker -> EdgeMarker -> EdgeMarker
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: EdgeMarker -> EdgeMarker -> Ordering
compare :: EdgeMarker -> EdgeMarker -> Ordering
$c< :: EdgeMarker -> EdgeMarker -> Bool
< :: EdgeMarker -> EdgeMarker -> Bool
$c<= :: EdgeMarker -> EdgeMarker -> Bool
<= :: EdgeMarker -> EdgeMarker -> Bool
$c> :: EdgeMarker -> EdgeMarker -> Bool
> :: EdgeMarker -> EdgeMarker -> Bool
$c>= :: EdgeMarker -> EdgeMarker -> Bool
>= :: EdgeMarker -> EdgeMarker -> Bool
$cmax :: EdgeMarker -> EdgeMarker -> EdgeMarker
max :: EdgeMarker -> EdgeMarker -> EdgeMarker
$cmin :: EdgeMarker -> EdgeMarker -> EdgeMarker
min :: EdgeMarker -> EdgeMarker -> EdgeMarker
Ord, (forall x. EdgeMarker -> Rep EdgeMarker x)
-> (forall x. Rep EdgeMarker x -> EdgeMarker) -> Generic EdgeMarker
forall x. Rep EdgeMarker x -> EdgeMarker
forall x. EdgeMarker -> Rep EdgeMarker x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. EdgeMarker -> Rep EdgeMarker x
from :: forall x. EdgeMarker -> Rep EdgeMarker x
$cto :: forall x. Rep EdgeMarker x -> EdgeMarker
to :: forall x. Rep EdgeMarker x -> EdgeMarker
Generic)
edgeMarker :: MarkerType -> EdgeMarker
edgeMarker :: MarkerType -> EdgeMarker
edgeMarker MarkerType
t = MarkerType
-> Maybe MisoString
-> Maybe Double
-> Maybe Double
-> Maybe MisoString
-> Maybe MisoString
-> Maybe Double
-> EdgeMarker
EdgeMarker MarkerType
t Maybe MisoString
forall a. Maybe a
Nothing Maybe Double
forall a. Maybe a
Nothing Maybe Double
forall a. Maybe a
Nothing Maybe MisoString
forall a. Maybe a
Nothing Maybe MisoString
forall a. Maybe a
Nothing Maybe Double
forall a. Maybe a
Nothing
data EdgeMarkerType
= MarkerRef !MisoString
| Marker !EdgeMarker
deriving (Int -> EdgeMarkerType -> ShowS
[EdgeMarkerType] -> ShowS
EdgeMarkerType -> String
(Int -> EdgeMarkerType -> ShowS)
-> (EdgeMarkerType -> String)
-> ([EdgeMarkerType] -> ShowS)
-> Show EdgeMarkerType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EdgeMarkerType -> ShowS
showsPrec :: Int -> EdgeMarkerType -> ShowS
$cshow :: EdgeMarkerType -> String
show :: EdgeMarkerType -> String
$cshowList :: [EdgeMarkerType] -> ShowS
showList :: [EdgeMarkerType] -> ShowS
Show, EdgeMarkerType -> EdgeMarkerType -> Bool
(EdgeMarkerType -> EdgeMarkerType -> Bool)
-> (EdgeMarkerType -> EdgeMarkerType -> Bool) -> Eq EdgeMarkerType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EdgeMarkerType -> EdgeMarkerType -> Bool
== :: EdgeMarkerType -> EdgeMarkerType -> Bool
$c/= :: EdgeMarkerType -> EdgeMarkerType -> Bool
/= :: EdgeMarkerType -> EdgeMarkerType -> Bool
Eq, Eq EdgeMarkerType
Eq EdgeMarkerType =>
(EdgeMarkerType -> EdgeMarkerType -> Ordering)
-> (EdgeMarkerType -> EdgeMarkerType -> Bool)
-> (EdgeMarkerType -> EdgeMarkerType -> Bool)
-> (EdgeMarkerType -> EdgeMarkerType -> Bool)
-> (EdgeMarkerType -> EdgeMarkerType -> Bool)
-> (EdgeMarkerType -> EdgeMarkerType -> EdgeMarkerType)
-> (EdgeMarkerType -> EdgeMarkerType -> EdgeMarkerType)
-> Ord EdgeMarkerType
EdgeMarkerType -> EdgeMarkerType -> Bool
EdgeMarkerType -> EdgeMarkerType -> Ordering
EdgeMarkerType -> EdgeMarkerType -> EdgeMarkerType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: EdgeMarkerType -> EdgeMarkerType -> Ordering
compare :: EdgeMarkerType -> EdgeMarkerType -> Ordering
$c< :: EdgeMarkerType -> EdgeMarkerType -> Bool
< :: EdgeMarkerType -> EdgeMarkerType -> Bool
$c<= :: EdgeMarkerType -> EdgeMarkerType -> Bool
<= :: EdgeMarkerType -> EdgeMarkerType -> Bool
$c> :: EdgeMarkerType -> EdgeMarkerType -> Bool
> :: EdgeMarkerType -> EdgeMarkerType -> Bool
$c>= :: EdgeMarkerType -> EdgeMarkerType -> Bool
>= :: EdgeMarkerType -> EdgeMarkerType -> Bool
$cmax :: EdgeMarkerType -> EdgeMarkerType -> EdgeMarkerType
max :: EdgeMarkerType -> EdgeMarkerType -> EdgeMarkerType
$cmin :: EdgeMarkerType -> EdgeMarkerType -> EdgeMarkerType
min :: EdgeMarkerType -> EdgeMarkerType -> EdgeMarkerType
Ord, (forall x. EdgeMarkerType -> Rep EdgeMarkerType x)
-> (forall x. Rep EdgeMarkerType x -> EdgeMarkerType)
-> Generic EdgeMarkerType
forall x. Rep EdgeMarkerType x -> EdgeMarkerType
forall x. EdgeMarkerType -> Rep EdgeMarkerType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. EdgeMarkerType -> Rep EdgeMarkerType x
from :: forall x. EdgeMarkerType -> Rep EdgeMarkerType x
$cto :: forall x. Rep EdgeMarkerType x -> EdgeMarkerType
to :: forall x. Rep EdgeMarkerType x -> EdgeMarkerType
Generic)
data MarkerProps = MarkerProps
{ MarkerProps -> MisoString
markerPropsId :: !MisoString
, MarkerProps -> EdgeMarker
markerPropsMarker :: !EdgeMarker
} deriving (Int -> MarkerProps -> ShowS
[MarkerProps] -> ShowS
MarkerProps -> String
(Int -> MarkerProps -> ShowS)
-> (MarkerProps -> String)
-> ([MarkerProps] -> ShowS)
-> Show MarkerProps
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MarkerProps -> ShowS
showsPrec :: Int -> MarkerProps -> ShowS
$cshow :: MarkerProps -> String
show :: MarkerProps -> String
$cshowList :: [MarkerProps] -> ShowS
showList :: [MarkerProps] -> ShowS
Show, MarkerProps -> MarkerProps -> Bool
(MarkerProps -> MarkerProps -> Bool)
-> (MarkerProps -> MarkerProps -> Bool) -> Eq MarkerProps
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MarkerProps -> MarkerProps -> Bool
== :: MarkerProps -> MarkerProps -> Bool
$c/= :: MarkerProps -> MarkerProps -> Bool
/= :: MarkerProps -> MarkerProps -> Bool
Eq, (forall x. MarkerProps -> Rep MarkerProps x)
-> (forall x. Rep MarkerProps x -> MarkerProps)
-> Generic MarkerProps
forall x. Rep MarkerProps x -> MarkerProps
forall x. MarkerProps -> Rep MarkerProps x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. MarkerProps -> Rep MarkerProps x
from :: forall x. MarkerProps -> Rep MarkerProps x
$cto :: forall x. Rep MarkerProps x -> MarkerProps
to :: forall x. Rep MarkerProps x -> MarkerProps
Generic)
data EdgePosition = EdgePosition
{ EdgePosition -> Double
epSourceX :: !Double
, EdgePosition -> Double
epSourceY :: !Double
, EdgePosition -> Double
epTargetX :: !Double
, EdgePosition -> Double
epTargetY :: !Double
, EdgePosition -> Position
epSourcePosition :: !Position
, EdgePosition -> Position
epTargetPosition :: !Position
} deriving (Int -> EdgePosition -> ShowS
[EdgePosition] -> ShowS
EdgePosition -> String
(Int -> EdgePosition -> ShowS)
-> (EdgePosition -> String)
-> ([EdgePosition] -> ShowS)
-> Show EdgePosition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EdgePosition -> ShowS
showsPrec :: Int -> EdgePosition -> ShowS
$cshow :: EdgePosition -> String
show :: EdgePosition -> String
$cshowList :: [EdgePosition] -> ShowS
showList :: [EdgePosition] -> ShowS
Show, EdgePosition -> EdgePosition -> Bool
(EdgePosition -> EdgePosition -> Bool)
-> (EdgePosition -> EdgePosition -> Bool) -> Eq EdgePosition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EdgePosition -> EdgePosition -> Bool
== :: EdgePosition -> EdgePosition -> Bool
$c/= :: EdgePosition -> EdgePosition -> Bool
/= :: EdgePosition -> EdgePosition -> Bool
Eq, (forall x. EdgePosition -> Rep EdgePosition x)
-> (forall x. Rep EdgePosition x -> EdgePosition)
-> Generic EdgePosition
forall x. Rep EdgePosition x -> EdgePosition
forall x. EdgePosition -> Rep EdgePosition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. EdgePosition -> Rep EdgePosition x
from :: forall x. EdgePosition -> Rep EdgePosition x
$cto :: forall x. Rep EdgePosition x -> EdgePosition
to :: forall x. Rep EdgePosition x -> EdgePosition
Generic)
type EdgeLookup e = Map EdgeId (Edge e)
type ConnectionLookup = Map MisoString (Map MisoString HandleConnection)
newtype BezierPathOptions = BezierPathOptions
{ BezierPathOptions -> Double
bezierCurvature :: Double
} deriving (Int -> BezierPathOptions -> ShowS
[BezierPathOptions] -> ShowS
BezierPathOptions -> String
(Int -> BezierPathOptions -> ShowS)
-> (BezierPathOptions -> String)
-> ([BezierPathOptions] -> ShowS)
-> Show BezierPathOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BezierPathOptions -> ShowS
showsPrec :: Int -> BezierPathOptions -> ShowS
$cshow :: BezierPathOptions -> String
show :: BezierPathOptions -> String
$cshowList :: [BezierPathOptions] -> ShowS
showList :: [BezierPathOptions] -> ShowS
Show, BezierPathOptions -> BezierPathOptions -> Bool
(BezierPathOptions -> BezierPathOptions -> Bool)
-> (BezierPathOptions -> BezierPathOptions -> Bool)
-> Eq BezierPathOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BezierPathOptions -> BezierPathOptions -> Bool
== :: BezierPathOptions -> BezierPathOptions -> Bool
$c/= :: BezierPathOptions -> BezierPathOptions -> Bool
/= :: BezierPathOptions -> BezierPathOptions -> Bool
Eq, (forall x. BezierPathOptions -> Rep BezierPathOptions x)
-> (forall x. Rep BezierPathOptions x -> BezierPathOptions)
-> Generic BezierPathOptions
forall x. Rep BezierPathOptions x -> BezierPathOptions
forall x. BezierPathOptions -> Rep BezierPathOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. BezierPathOptions -> Rep BezierPathOptions x
from :: forall x. BezierPathOptions -> Rep BezierPathOptions x
$cto :: forall x. Rep BezierPathOptions x -> BezierPathOptions
to :: forall x. Rep BezierPathOptions x -> BezierPathOptions
Generic)
defaultBezierPathOptions :: BezierPathOptions
defaultBezierPathOptions :: BezierPathOptions
defaultBezierPathOptions = Double -> BezierPathOptions
BezierPathOptions Double
0.25
data SmoothStepPathOptions = SmoothStepPathOptions
{ SmoothStepPathOptions -> Double
smoothStepOffset :: !Double
, SmoothStepPathOptions -> Double
smoothStepBorderRadius :: !Double
, SmoothStepPathOptions -> Double
smoothStepStepPosition :: !Double
, SmoothStepPathOptions -> Maybe Double
smoothStepCenterX :: !(Maybe Double)
, SmoothStepPathOptions -> Maybe Double
smoothStepCenterY :: !(Maybe Double)
} deriving (Int -> SmoothStepPathOptions -> ShowS
[SmoothStepPathOptions] -> ShowS
SmoothStepPathOptions -> String
(Int -> SmoothStepPathOptions -> ShowS)
-> (SmoothStepPathOptions -> String)
-> ([SmoothStepPathOptions] -> ShowS)
-> Show SmoothStepPathOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SmoothStepPathOptions -> ShowS
showsPrec :: Int -> SmoothStepPathOptions -> ShowS
$cshow :: SmoothStepPathOptions -> String
show :: SmoothStepPathOptions -> String
$cshowList :: [SmoothStepPathOptions] -> ShowS
showList :: [SmoothStepPathOptions] -> ShowS
Show, SmoothStepPathOptions -> SmoothStepPathOptions -> Bool
(SmoothStepPathOptions -> SmoothStepPathOptions -> Bool)
-> (SmoothStepPathOptions -> SmoothStepPathOptions -> Bool)
-> Eq SmoothStepPathOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SmoothStepPathOptions -> SmoothStepPathOptions -> Bool
== :: SmoothStepPathOptions -> SmoothStepPathOptions -> Bool
$c/= :: SmoothStepPathOptions -> SmoothStepPathOptions -> Bool
/= :: SmoothStepPathOptions -> SmoothStepPathOptions -> Bool
Eq, (forall x. SmoothStepPathOptions -> Rep SmoothStepPathOptions x)
-> (forall x. Rep SmoothStepPathOptions x -> SmoothStepPathOptions)
-> Generic SmoothStepPathOptions
forall x. Rep SmoothStepPathOptions x -> SmoothStepPathOptions
forall x. SmoothStepPathOptions -> Rep SmoothStepPathOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SmoothStepPathOptions -> Rep SmoothStepPathOptions x
from :: forall x. SmoothStepPathOptions -> Rep SmoothStepPathOptions x
$cto :: forall x. Rep SmoothStepPathOptions x -> SmoothStepPathOptions
to :: forall x. Rep SmoothStepPathOptions x -> SmoothStepPathOptions
Generic)
defaultSmoothStepPathOptions :: SmoothStepPathOptions
defaultSmoothStepPathOptions :: SmoothStepPathOptions
defaultSmoothStepPathOptions = SmoothStepPathOptions
{ smoothStepOffset :: Double
smoothStepOffset = Double
20
, smoothStepBorderRadius :: Double
smoothStepBorderRadius = Double
5
, smoothStepStepPosition :: Double
smoothStepStepPosition = Double
0.5
, smoothStepCenterX :: Maybe Double
smoothStepCenterX = Maybe Double
forall a. Maybe a
Nothing
, smoothStepCenterY :: Maybe Double
smoothStepCenterY = Maybe Double
forall a. Maybe a
Nothing
}
newtype StepPathOptions = StepPathOptions
{ StepPathOptions -> Double
stepOffset :: Double
} deriving (Int -> StepPathOptions -> ShowS
[StepPathOptions] -> ShowS
StepPathOptions -> String
(Int -> StepPathOptions -> ShowS)
-> (StepPathOptions -> String)
-> ([StepPathOptions] -> ShowS)
-> Show StepPathOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StepPathOptions -> ShowS
showsPrec :: Int -> StepPathOptions -> ShowS
$cshow :: StepPathOptions -> String
show :: StepPathOptions -> String
$cshowList :: [StepPathOptions] -> ShowS
showList :: [StepPathOptions] -> ShowS
Show, StepPathOptions -> StepPathOptions -> Bool
(StepPathOptions -> StepPathOptions -> Bool)
-> (StepPathOptions -> StepPathOptions -> Bool)
-> Eq StepPathOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StepPathOptions -> StepPathOptions -> Bool
== :: StepPathOptions -> StepPathOptions -> Bool
$c/= :: StepPathOptions -> StepPathOptions -> Bool
/= :: StepPathOptions -> StepPathOptions -> Bool
Eq, (forall x. StepPathOptions -> Rep StepPathOptions x)
-> (forall x. Rep StepPathOptions x -> StepPathOptions)
-> Generic StepPathOptions
forall x. Rep StepPathOptions x -> StepPathOptions
forall x. StepPathOptions -> Rep StepPathOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. StepPathOptions -> Rep StepPathOptions x
from :: forall x. StepPathOptions -> Rep StepPathOptions x
$cto :: forall x. Rep StepPathOptions x -> StepPathOptions
to :: forall x. Rep StepPathOptions x -> StepPathOptions
Generic)
data PaddingWithUnit
= PaddingRatio !Double
| PaddingPx !Double
| PaddingPercent !Double
deriving (Int -> PaddingWithUnit -> ShowS
[PaddingWithUnit] -> ShowS
PaddingWithUnit -> String
(Int -> PaddingWithUnit -> ShowS)
-> (PaddingWithUnit -> String)
-> ([PaddingWithUnit] -> ShowS)
-> Show PaddingWithUnit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PaddingWithUnit -> ShowS
showsPrec :: Int -> PaddingWithUnit -> ShowS
$cshow :: PaddingWithUnit -> String
show :: PaddingWithUnit -> String
$cshowList :: [PaddingWithUnit] -> ShowS
showList :: [PaddingWithUnit] -> ShowS
Show, PaddingWithUnit -> PaddingWithUnit -> Bool
(PaddingWithUnit -> PaddingWithUnit -> Bool)
-> (PaddingWithUnit -> PaddingWithUnit -> Bool)
-> Eq PaddingWithUnit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PaddingWithUnit -> PaddingWithUnit -> Bool
== :: PaddingWithUnit -> PaddingWithUnit -> Bool
$c/= :: PaddingWithUnit -> PaddingWithUnit -> Bool
/= :: PaddingWithUnit -> PaddingWithUnit -> Bool
Eq, (forall x. PaddingWithUnit -> Rep PaddingWithUnit x)
-> (forall x. Rep PaddingWithUnit x -> PaddingWithUnit)
-> Generic PaddingWithUnit
forall x. Rep PaddingWithUnit x -> PaddingWithUnit
forall x. PaddingWithUnit -> Rep PaddingWithUnit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PaddingWithUnit -> Rep PaddingWithUnit x
from :: forall x. PaddingWithUnit -> Rep PaddingWithUnit x
$cto :: forall x. Rep PaddingWithUnit x -> PaddingWithUnit
to :: forall x. Rep PaddingWithUnit x -> PaddingWithUnit
Generic)
data Padding
= PaddingUniform !PaddingWithUnit
| PaddingSides
{ Padding -> Maybe PaddingWithUnit
paddingTop :: !(Maybe PaddingWithUnit)
, Padding -> Maybe PaddingWithUnit
paddingRight :: !(Maybe PaddingWithUnit)
, Padding -> Maybe PaddingWithUnit
paddingBottom :: !(Maybe PaddingWithUnit)
, Padding -> Maybe PaddingWithUnit
paddingLeft :: !(Maybe PaddingWithUnit)
, Padding -> Maybe PaddingWithUnit
paddingX :: !(Maybe PaddingWithUnit)
, Padding -> Maybe PaddingWithUnit
paddingY :: !(Maybe PaddingWithUnit)
}
deriving (Int -> Padding -> ShowS
[Padding] -> ShowS
Padding -> String
(Int -> Padding -> ShowS)
-> (Padding -> String) -> ([Padding] -> ShowS) -> Show Padding
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Padding -> ShowS
showsPrec :: Int -> Padding -> ShowS
$cshow :: Padding -> String
show :: Padding -> String
$cshowList :: [Padding] -> ShowS
showList :: [Padding] -> ShowS
Show, Padding -> Padding -> Bool
(Padding -> Padding -> Bool)
-> (Padding -> Padding -> Bool) -> Eq Padding
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Padding -> Padding -> Bool
== :: Padding -> Padding -> Bool
$c/= :: Padding -> Padding -> Bool
/= :: Padding -> Padding -> Bool
Eq, (forall x. Padding -> Rep Padding x)
-> (forall x. Rep Padding x -> Padding) -> Generic Padding
forall x. Rep Padding x -> Padding
forall x. Padding -> Rep Padding x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Padding -> Rep Padding x
from :: forall x. Padding -> Rep Padding x
$cto :: forall x. Rep Padding x -> Padding
to :: forall x. Rep Padding x -> Padding
Generic)
defaultFitViewPadding :: Padding
defaultFitViewPadding :: Padding
defaultFitViewPadding = PaddingWithUnit -> Padding
PaddingUniform (Double -> PaddingWithUnit
PaddingRatio Double
0.1)
data Interpolation
= InterpolateSmooth
| InterpolateLinear
deriving (Int -> Interpolation -> ShowS
[Interpolation] -> ShowS
Interpolation -> String
(Int -> Interpolation -> ShowS)
-> (Interpolation -> String)
-> ([Interpolation] -> ShowS)
-> Show Interpolation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Interpolation -> ShowS
showsPrec :: Int -> Interpolation -> ShowS
$cshow :: Interpolation -> String
show :: Interpolation -> String
$cshowList :: [Interpolation] -> ShowS
showList :: [Interpolation] -> ShowS
Show, Interpolation -> Interpolation -> Bool
(Interpolation -> Interpolation -> Bool)
-> (Interpolation -> Interpolation -> Bool) -> Eq Interpolation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Interpolation -> Interpolation -> Bool
== :: Interpolation -> Interpolation -> Bool
$c/= :: Interpolation -> Interpolation -> Bool
/= :: Interpolation -> Interpolation -> Bool
Eq, (forall x. Interpolation -> Rep Interpolation x)
-> (forall x. Rep Interpolation x -> Interpolation)
-> Generic Interpolation
forall x. Rep Interpolation x -> Interpolation
forall x. Interpolation -> Rep Interpolation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Interpolation -> Rep Interpolation x
from :: forall x. Interpolation -> Rep Interpolation x
$cto :: forall x. Rep Interpolation x -> Interpolation
to :: forall x. Rep Interpolation x -> Interpolation
Generic)
data FitViewOptions = FitViewOptions
{ FitViewOptions -> Padding
fitViewPadding :: !Padding
, FitViewOptions -> Bool
fitViewIncludeHiddenNodes :: !Bool
, FitViewOptions -> Maybe Double
fitViewMinZoom :: !(Maybe Double)
, FitViewOptions -> Maybe Double
fitViewMaxZoom :: !(Maybe Double)
, FitViewOptions -> Maybe Double
fitViewDuration :: !(Maybe Double)
, FitViewOptions -> Interpolation
fitViewInterpolate :: !Interpolation
, FitViewOptions -> Maybe [MisoString]
fitViewNodes :: !(Maybe [NodeId])
} deriving (Int -> FitViewOptions -> ShowS
[FitViewOptions] -> ShowS
FitViewOptions -> String
(Int -> FitViewOptions -> ShowS)
-> (FitViewOptions -> String)
-> ([FitViewOptions] -> ShowS)
-> Show FitViewOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FitViewOptions -> ShowS
showsPrec :: Int -> FitViewOptions -> ShowS
$cshow :: FitViewOptions -> String
show :: FitViewOptions -> String
$cshowList :: [FitViewOptions] -> ShowS
showList :: [FitViewOptions] -> ShowS
Show, FitViewOptions -> FitViewOptions -> Bool
(FitViewOptions -> FitViewOptions -> Bool)
-> (FitViewOptions -> FitViewOptions -> Bool) -> Eq FitViewOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FitViewOptions -> FitViewOptions -> Bool
== :: FitViewOptions -> FitViewOptions -> Bool
$c/= :: FitViewOptions -> FitViewOptions -> Bool
/= :: FitViewOptions -> FitViewOptions -> Bool
Eq, (forall x. FitViewOptions -> Rep FitViewOptions x)
-> (forall x. Rep FitViewOptions x -> FitViewOptions)
-> Generic FitViewOptions
forall x. Rep FitViewOptions x -> FitViewOptions
forall x. FitViewOptions -> Rep FitViewOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. FitViewOptions -> Rep FitViewOptions x
from :: forall x. FitViewOptions -> Rep FitViewOptions x
$cto :: forall x. Rep FitViewOptions x -> FitViewOptions
to :: forall x. Rep FitViewOptions x -> FitViewOptions
Generic)
defaultFitViewOptions :: FitViewOptions
defaultFitViewOptions :: FitViewOptions
defaultFitViewOptions = FitViewOptions
{ fitViewPadding :: Padding
fitViewPadding = Padding
defaultFitViewPadding
, fitViewIncludeHiddenNodes :: Bool
fitViewIncludeHiddenNodes = Bool
False
, fitViewMinZoom :: Maybe Double
fitViewMinZoom = Maybe Double
forall a. Maybe a
Nothing
, fitViewMaxZoom :: Maybe Double
fitViewMaxZoom = Maybe Double
forall a. Maybe a
Nothing
, fitViewDuration :: Maybe Double
fitViewDuration = Maybe Double
forall a. Maybe a
Nothing
, fitViewInterpolate :: Interpolation
fitViewInterpolate = Interpolation
InterpolateSmooth
, fitViewNodes :: Maybe [MisoString]
fitViewNodes = Maybe [MisoString]
forall a. Maybe a
Nothing
}
data ViewportHelperOptions = ViewportHelperOptions
{ ViewportHelperOptions -> Maybe Double
vhoDuration :: !(Maybe Double)
, ViewportHelperOptions -> Interpolation
vhoInterpolate :: !Interpolation
} deriving (Int -> ViewportHelperOptions -> ShowS
[ViewportHelperOptions] -> ShowS
ViewportHelperOptions -> String
(Int -> ViewportHelperOptions -> ShowS)
-> (ViewportHelperOptions -> String)
-> ([ViewportHelperOptions] -> ShowS)
-> Show ViewportHelperOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ViewportHelperOptions -> ShowS
showsPrec :: Int -> ViewportHelperOptions -> ShowS
$cshow :: ViewportHelperOptions -> String
show :: ViewportHelperOptions -> String
$cshowList :: [ViewportHelperOptions] -> ShowS
showList :: [ViewportHelperOptions] -> ShowS
Show, ViewportHelperOptions -> ViewportHelperOptions -> Bool
(ViewportHelperOptions -> ViewportHelperOptions -> Bool)
-> (ViewportHelperOptions -> ViewportHelperOptions -> Bool)
-> Eq ViewportHelperOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ViewportHelperOptions -> ViewportHelperOptions -> Bool
== :: ViewportHelperOptions -> ViewportHelperOptions -> Bool
$c/= :: ViewportHelperOptions -> ViewportHelperOptions -> Bool
/= :: ViewportHelperOptions -> ViewportHelperOptions -> Bool
Eq, (forall x. ViewportHelperOptions -> Rep ViewportHelperOptions x)
-> (forall x. Rep ViewportHelperOptions x -> ViewportHelperOptions)
-> Generic ViewportHelperOptions
forall x. Rep ViewportHelperOptions x -> ViewportHelperOptions
forall x. ViewportHelperOptions -> Rep ViewportHelperOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ViewportHelperOptions -> Rep ViewportHelperOptions x
from :: forall x. ViewportHelperOptions -> Rep ViewportHelperOptions x
$cto :: forall x. Rep ViewportHelperOptions x -> ViewportHelperOptions
to :: forall x. Rep ViewportHelperOptions x -> ViewportHelperOptions
Generic)
defaultViewportHelperOptions :: ViewportHelperOptions
defaultViewportHelperOptions :: ViewportHelperOptions
defaultViewportHelperOptions = Maybe Double -> Interpolation -> ViewportHelperOptions
ViewportHelperOptions Maybe Double
forall a. Maybe a
Nothing Interpolation
InterpolateSmooth
data SetCenterOptions = SetCenterOptions
{ SetCenterOptions -> Maybe Double
setCenterZoom :: !(Maybe Double)
, SetCenterOptions -> ViewportHelperOptions
setCenterOptions :: !ViewportHelperOptions
} deriving (Int -> SetCenterOptions -> ShowS
[SetCenterOptions] -> ShowS
SetCenterOptions -> String
(Int -> SetCenterOptions -> ShowS)
-> (SetCenterOptions -> String)
-> ([SetCenterOptions] -> ShowS)
-> Show SetCenterOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetCenterOptions -> ShowS
showsPrec :: Int -> SetCenterOptions -> ShowS
$cshow :: SetCenterOptions -> String
show :: SetCenterOptions -> String
$cshowList :: [SetCenterOptions] -> ShowS
showList :: [SetCenterOptions] -> ShowS
Show, SetCenterOptions -> SetCenterOptions -> Bool
(SetCenterOptions -> SetCenterOptions -> Bool)
-> (SetCenterOptions -> SetCenterOptions -> Bool)
-> Eq SetCenterOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetCenterOptions -> SetCenterOptions -> Bool
== :: SetCenterOptions -> SetCenterOptions -> Bool
$c/= :: SetCenterOptions -> SetCenterOptions -> Bool
/= :: SetCenterOptions -> SetCenterOptions -> Bool
Eq, (forall x. SetCenterOptions -> Rep SetCenterOptions x)
-> (forall x. Rep SetCenterOptions x -> SetCenterOptions)
-> Generic SetCenterOptions
forall x. Rep SetCenterOptions x -> SetCenterOptions
forall x. SetCenterOptions -> Rep SetCenterOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SetCenterOptions -> Rep SetCenterOptions x
from :: forall x. SetCenterOptions -> Rep SetCenterOptions x
$cto :: forall x. Rep SetCenterOptions x -> SetCenterOptions
to :: forall x. Rep SetCenterOptions x -> SetCenterOptions
Generic)
defaultSetCenterOptions :: SetCenterOptions
defaultSetCenterOptions :: SetCenterOptions
defaultSetCenterOptions = Maybe Double -> ViewportHelperOptions -> SetCenterOptions
SetCenterOptions Maybe Double
forall a. Maybe a
Nothing ViewportHelperOptions
defaultViewportHelperOptions
data FitBoundsOptions = FitBoundsOptions
{ FitBoundsOptions -> Double
fitBoundsPadding :: !Double
, FitBoundsOptions -> ViewportHelperOptions
fitBoundsOptions :: !ViewportHelperOptions
} deriving (Int -> FitBoundsOptions -> ShowS
[FitBoundsOptions] -> ShowS
FitBoundsOptions -> String
(Int -> FitBoundsOptions -> ShowS)
-> (FitBoundsOptions -> String)
-> ([FitBoundsOptions] -> ShowS)
-> Show FitBoundsOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FitBoundsOptions -> ShowS
showsPrec :: Int -> FitBoundsOptions -> ShowS
$cshow :: FitBoundsOptions -> String
show :: FitBoundsOptions -> String
$cshowList :: [FitBoundsOptions] -> ShowS
showList :: [FitBoundsOptions] -> ShowS
Show, FitBoundsOptions -> FitBoundsOptions -> Bool
(FitBoundsOptions -> FitBoundsOptions -> Bool)
-> (FitBoundsOptions -> FitBoundsOptions -> Bool)
-> Eq FitBoundsOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FitBoundsOptions -> FitBoundsOptions -> Bool
== :: FitBoundsOptions -> FitBoundsOptions -> Bool
$c/= :: FitBoundsOptions -> FitBoundsOptions -> Bool
/= :: FitBoundsOptions -> FitBoundsOptions -> Bool
Eq, (forall x. FitBoundsOptions -> Rep FitBoundsOptions x)
-> (forall x. Rep FitBoundsOptions x -> FitBoundsOptions)
-> Generic FitBoundsOptions
forall x. Rep FitBoundsOptions x -> FitBoundsOptions
forall x. FitBoundsOptions -> Rep FitBoundsOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. FitBoundsOptions -> Rep FitBoundsOptions x
from :: forall x. FitBoundsOptions -> Rep FitBoundsOptions x
$cto :: forall x. Rep FitBoundsOptions x -> FitBoundsOptions
to :: forall x. Rep FitBoundsOptions x -> FitBoundsOptions
Generic)
data SetAttributes
= SetAttributesNone
| SetAttributesBoth
| SetAttributesWidth
| SetAttributesHeight
deriving (Int -> SetAttributes -> ShowS
[SetAttributes] -> ShowS
SetAttributes -> String
(Int -> SetAttributes -> ShowS)
-> (SetAttributes -> String)
-> ([SetAttributes] -> ShowS)
-> Show SetAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetAttributes -> ShowS
showsPrec :: Int -> SetAttributes -> ShowS
$cshow :: SetAttributes -> String
show :: SetAttributes -> String
$cshowList :: [SetAttributes] -> ShowS
showList :: [SetAttributes] -> ShowS
Show, SetAttributes -> SetAttributes -> Bool
(SetAttributes -> SetAttributes -> Bool)
-> (SetAttributes -> SetAttributes -> Bool) -> Eq SetAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetAttributes -> SetAttributes -> Bool
== :: SetAttributes -> SetAttributes -> Bool
$c/= :: SetAttributes -> SetAttributes -> Bool
/= :: SetAttributes -> SetAttributes -> Bool
Eq, (forall x. SetAttributes -> Rep SetAttributes x)
-> (forall x. Rep SetAttributes x -> SetAttributes)
-> Generic SetAttributes
forall x. Rep SetAttributes x -> SetAttributes
forall x. SetAttributes -> Rep SetAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SetAttributes -> Rep SetAttributes x
from :: forall x. SetAttributes -> Rep SetAttributes x
$cto :: forall x. Rep SetAttributes x -> SetAttributes
to :: forall x. Rep SetAttributes x -> SetAttributes
Generic)
data NodeChange n
= NodeDimensionChange NodeId (Maybe Dimensions) (Maybe Bool) SetAttributes
| NodePositionChange NodeId (Maybe XYPosition) (Maybe XYPosition) (Maybe Bool)
| NodeSelectionChange NodeId Bool
| NodeRemoveChange NodeId
| NodeAddChange (Node n) (Maybe Int)
| NodeReplaceChange NodeId (Node n)
deriving (Int -> NodeChange n -> ShowS
[NodeChange n] -> ShowS
NodeChange n -> String
(Int -> NodeChange n -> ShowS)
-> (NodeChange n -> String)
-> ([NodeChange n] -> ShowS)
-> Show (NodeChange n)
forall n. Show n => Int -> NodeChange n -> ShowS
forall n. Show n => [NodeChange n] -> ShowS
forall n. Show n => NodeChange n -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall n. Show n => Int -> NodeChange n -> ShowS
showsPrec :: Int -> NodeChange n -> ShowS
$cshow :: forall n. Show n => NodeChange n -> String
show :: NodeChange n -> String
$cshowList :: forall n. Show n => [NodeChange n] -> ShowS
showList :: [NodeChange n] -> ShowS
Show, NodeChange n -> NodeChange n -> Bool
(NodeChange n -> NodeChange n -> Bool)
-> (NodeChange n -> NodeChange n -> Bool) -> Eq (NodeChange n)
forall n. Eq n => NodeChange n -> NodeChange n -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall n. Eq n => NodeChange n -> NodeChange n -> Bool
== :: NodeChange n -> NodeChange n -> Bool
$c/= :: forall n. Eq n => NodeChange n -> NodeChange n -> Bool
/= :: NodeChange n -> NodeChange n -> Bool
Eq, (forall x. NodeChange n -> Rep (NodeChange n) x)
-> (forall x. Rep (NodeChange n) x -> NodeChange n)
-> Generic (NodeChange n)
forall x. Rep (NodeChange n) x -> NodeChange n
forall x. NodeChange n -> Rep (NodeChange n) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall n x. Rep (NodeChange n) x -> NodeChange n
forall n x. NodeChange n -> Rep (NodeChange n) x
$cfrom :: forall n x. NodeChange n -> Rep (NodeChange n) x
from :: forall x. NodeChange n -> Rep (NodeChange n) x
$cto :: forall n x. Rep (NodeChange n) x -> NodeChange n
to :: forall x. Rep (NodeChange n) x -> NodeChange n
Generic, (forall a b. (a -> b) -> NodeChange a -> NodeChange b)
-> (forall a b. a -> NodeChange b -> NodeChange a)
-> Functor NodeChange
forall a b. a -> NodeChange b -> NodeChange a
forall a b. (a -> b) -> NodeChange a -> NodeChange b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> NodeChange a -> NodeChange b
fmap :: forall a b. (a -> b) -> NodeChange a -> NodeChange b
$c<$ :: forall a b. a -> NodeChange b -> NodeChange a
<$ :: forall a b. a -> NodeChange b -> NodeChange a
Functor)
data EdgeChange e
= EdgeSelectionChange EdgeId Bool
| EdgeRemoveChange EdgeId
| EdgeAddChange (Edge e) (Maybe Int)
| EdgeReplaceChange EdgeId (Edge e)
deriving (Int -> EdgeChange e -> ShowS
[EdgeChange e] -> ShowS
EdgeChange e -> String
(Int -> EdgeChange e -> ShowS)
-> (EdgeChange e -> String)
-> ([EdgeChange e] -> ShowS)
-> Show (EdgeChange e)
forall e. Show e => Int -> EdgeChange e -> ShowS
forall e. Show e => [EdgeChange e] -> ShowS
forall e. Show e => EdgeChange e -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall e. Show e => Int -> EdgeChange e -> ShowS
showsPrec :: Int -> EdgeChange e -> ShowS
$cshow :: forall e. Show e => EdgeChange e -> String
show :: EdgeChange e -> String
$cshowList :: forall e. Show e => [EdgeChange e] -> ShowS
showList :: [EdgeChange e] -> ShowS
Show, EdgeChange e -> EdgeChange e -> Bool
(EdgeChange e -> EdgeChange e -> Bool)
-> (EdgeChange e -> EdgeChange e -> Bool) -> Eq (EdgeChange e)
forall e. Eq e => EdgeChange e -> EdgeChange e -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall e. Eq e => EdgeChange e -> EdgeChange e -> Bool
== :: EdgeChange e -> EdgeChange e -> Bool
$c/= :: forall e. Eq e => EdgeChange e -> EdgeChange e -> Bool
/= :: EdgeChange e -> EdgeChange e -> Bool
Eq, (forall x. EdgeChange e -> Rep (EdgeChange e) x)
-> (forall x. Rep (EdgeChange e) x -> EdgeChange e)
-> Generic (EdgeChange e)
forall x. Rep (EdgeChange e) x -> EdgeChange e
forall x. EdgeChange e -> Rep (EdgeChange e) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall e x. Rep (EdgeChange e) x -> EdgeChange e
forall e x. EdgeChange e -> Rep (EdgeChange e) x
$cfrom :: forall e x. EdgeChange e -> Rep (EdgeChange e) x
from :: forall x. EdgeChange e -> Rep (EdgeChange e) x
$cto :: forall e x. Rep (EdgeChange e) x -> EdgeChange e
to :: forall x. Rep (EdgeChange e) x -> EdgeChange e
Generic, (forall a b. (a -> b) -> EdgeChange a -> EdgeChange b)
-> (forall a b. a -> EdgeChange b -> EdgeChange a)
-> Functor EdgeChange
forall a b. a -> EdgeChange b -> EdgeChange a
forall a b. (a -> b) -> EdgeChange a -> EdgeChange b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> EdgeChange a -> EdgeChange b
fmap :: forall a b. (a -> b) -> EdgeChange a -> EdgeChange b
$c<$ :: forall a b. a -> EdgeChange b -> EdgeChange a
<$ :: forall a b. a -> EdgeChange b -> EdgeChange a
Functor)
data ControlLinePosition
= ControlLineTop
| ControlLineBottom
| ControlLineLeft
| ControlLineRight
deriving (Int -> ControlLinePosition -> ShowS
[ControlLinePosition] -> ShowS
ControlLinePosition -> String
(Int -> ControlLinePosition -> ShowS)
-> (ControlLinePosition -> String)
-> ([ControlLinePosition] -> ShowS)
-> Show ControlLinePosition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ControlLinePosition -> ShowS
showsPrec :: Int -> ControlLinePosition -> ShowS
$cshow :: ControlLinePosition -> String
show :: ControlLinePosition -> String
$cshowList :: [ControlLinePosition] -> ShowS
showList :: [ControlLinePosition] -> ShowS
Show, ControlLinePosition -> ControlLinePosition -> Bool
(ControlLinePosition -> ControlLinePosition -> Bool)
-> (ControlLinePosition -> ControlLinePosition -> Bool)
-> Eq ControlLinePosition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ControlLinePosition -> ControlLinePosition -> Bool
== :: ControlLinePosition -> ControlLinePosition -> Bool
$c/= :: ControlLinePosition -> ControlLinePosition -> Bool
/= :: ControlLinePosition -> ControlLinePosition -> Bool
Eq, Eq ControlLinePosition
Eq ControlLinePosition =>
(ControlLinePosition -> ControlLinePosition -> Ordering)
-> (ControlLinePosition -> ControlLinePosition -> Bool)
-> (ControlLinePosition -> ControlLinePosition -> Bool)
-> (ControlLinePosition -> ControlLinePosition -> Bool)
-> (ControlLinePosition -> ControlLinePosition -> Bool)
-> (ControlLinePosition
-> ControlLinePosition -> ControlLinePosition)
-> (ControlLinePosition
-> ControlLinePosition -> ControlLinePosition)
-> Ord ControlLinePosition
ControlLinePosition -> ControlLinePosition -> Bool
ControlLinePosition -> ControlLinePosition -> Ordering
ControlLinePosition -> ControlLinePosition -> ControlLinePosition
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ControlLinePosition -> ControlLinePosition -> Ordering
compare :: ControlLinePosition -> ControlLinePosition -> Ordering
$c< :: ControlLinePosition -> ControlLinePosition -> Bool
< :: ControlLinePosition -> ControlLinePosition -> Bool
$c<= :: ControlLinePosition -> ControlLinePosition -> Bool
<= :: ControlLinePosition -> ControlLinePosition -> Bool
$c> :: ControlLinePosition -> ControlLinePosition -> Bool
> :: ControlLinePosition -> ControlLinePosition -> Bool
$c>= :: ControlLinePosition -> ControlLinePosition -> Bool
>= :: ControlLinePosition -> ControlLinePosition -> Bool
$cmax :: ControlLinePosition -> ControlLinePosition -> ControlLinePosition
max :: ControlLinePosition -> ControlLinePosition -> ControlLinePosition
$cmin :: ControlLinePosition -> ControlLinePosition -> ControlLinePosition
min :: ControlLinePosition -> ControlLinePosition -> ControlLinePosition
Ord, (forall x. ControlLinePosition -> Rep ControlLinePosition x)
-> (forall x. Rep ControlLinePosition x -> ControlLinePosition)
-> Generic ControlLinePosition
forall x. Rep ControlLinePosition x -> ControlLinePosition
forall x. ControlLinePosition -> Rep ControlLinePosition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ControlLinePosition -> Rep ControlLinePosition x
from :: forall x. ControlLinePosition -> Rep ControlLinePosition x
$cto :: forall x. Rep ControlLinePosition x -> ControlLinePosition
to :: forall x. Rep ControlLinePosition x -> ControlLinePosition
Generic)
data ControlPosition
= ControlLine !ControlLinePosition
| ControlTopLeft
| ControlTopRight
| ControlBottomLeft
| ControlBottomRight
deriving (Int -> ControlPosition -> ShowS
[ControlPosition] -> ShowS
ControlPosition -> String
(Int -> ControlPosition -> ShowS)
-> (ControlPosition -> String)
-> ([ControlPosition] -> ShowS)
-> Show ControlPosition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ControlPosition -> ShowS
showsPrec :: Int -> ControlPosition -> ShowS
$cshow :: ControlPosition -> String
show :: ControlPosition -> String
$cshowList :: [ControlPosition] -> ShowS
showList :: [ControlPosition] -> ShowS
Show, ControlPosition -> ControlPosition -> Bool
(ControlPosition -> ControlPosition -> Bool)
-> (ControlPosition -> ControlPosition -> Bool)
-> Eq ControlPosition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ControlPosition -> ControlPosition -> Bool
== :: ControlPosition -> ControlPosition -> Bool
$c/= :: ControlPosition -> ControlPosition -> Bool
/= :: ControlPosition -> ControlPosition -> Bool
Eq, Eq ControlPosition
Eq ControlPosition =>
(ControlPosition -> ControlPosition -> Ordering)
-> (ControlPosition -> ControlPosition -> Bool)
-> (ControlPosition -> ControlPosition -> Bool)
-> (ControlPosition -> ControlPosition -> Bool)
-> (ControlPosition -> ControlPosition -> Bool)
-> (ControlPosition -> ControlPosition -> ControlPosition)
-> (ControlPosition -> ControlPosition -> ControlPosition)
-> Ord ControlPosition
ControlPosition -> ControlPosition -> Bool
ControlPosition -> ControlPosition -> Ordering
ControlPosition -> ControlPosition -> ControlPosition
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ControlPosition -> ControlPosition -> Ordering
compare :: ControlPosition -> ControlPosition -> Ordering
$c< :: ControlPosition -> ControlPosition -> Bool
< :: ControlPosition -> ControlPosition -> Bool
$c<= :: ControlPosition -> ControlPosition -> Bool
<= :: ControlPosition -> ControlPosition -> Bool
$c> :: ControlPosition -> ControlPosition -> Bool
> :: ControlPosition -> ControlPosition -> Bool
$c>= :: ControlPosition -> ControlPosition -> Bool
>= :: ControlPosition -> ControlPosition -> Bool
$cmax :: ControlPosition -> ControlPosition -> ControlPosition
max :: ControlPosition -> ControlPosition -> ControlPosition
$cmin :: ControlPosition -> ControlPosition -> ControlPosition
min :: ControlPosition -> ControlPosition -> ControlPosition
Ord, (forall x. ControlPosition -> Rep ControlPosition x)
-> (forall x. Rep ControlPosition x -> ControlPosition)
-> Generic ControlPosition
forall x. Rep ControlPosition x -> ControlPosition
forall x. ControlPosition -> Rep ControlPosition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ControlPosition -> Rep ControlPosition x
from :: forall x. ControlPosition -> Rep ControlPosition x
$cto :: forall x. Rep ControlPosition x -> ControlPosition
to :: forall x. Rep ControlPosition x -> ControlPosition
Generic)
controlPositionToText :: ControlPosition -> MisoString
controlPositionToText :: ControlPosition -> MisoString
controlPositionToText = \case
ControlLine ControlLinePosition
ControlLineTop -> MisoString
"top"
ControlLine ControlLinePosition
ControlLineBottom -> MisoString
"bottom"
ControlLine ControlLinePosition
ControlLineLeft -> MisoString
"left"
ControlLine ControlLinePosition
ControlLineRight -> MisoString
"right"
ControlPosition
ControlTopLeft -> MisoString
"top-left"
ControlPosition
ControlTopRight -> MisoString
"top-right"
ControlPosition
ControlBottomLeft -> MisoString
"bottom-left"
ControlPosition
ControlBottomRight -> MisoString
"bottom-right"
data ResizeControlVariant
= ResizeControlLine
| ResizeControlHandle
deriving (Int -> ResizeControlVariant -> ShowS
[ResizeControlVariant] -> ShowS
ResizeControlVariant -> String
(Int -> ResizeControlVariant -> ShowS)
-> (ResizeControlVariant -> String)
-> ([ResizeControlVariant] -> ShowS)
-> Show ResizeControlVariant
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ResizeControlVariant -> ShowS
showsPrec :: Int -> ResizeControlVariant -> ShowS
$cshow :: ResizeControlVariant -> String
show :: ResizeControlVariant -> String
$cshowList :: [ResizeControlVariant] -> ShowS
showList :: [ResizeControlVariant] -> ShowS
Show, ResizeControlVariant -> ResizeControlVariant -> Bool
(ResizeControlVariant -> ResizeControlVariant -> Bool)
-> (ResizeControlVariant -> ResizeControlVariant -> Bool)
-> Eq ResizeControlVariant
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ResizeControlVariant -> ResizeControlVariant -> Bool
== :: ResizeControlVariant -> ResizeControlVariant -> Bool
$c/= :: ResizeControlVariant -> ResizeControlVariant -> Bool
/= :: ResizeControlVariant -> ResizeControlVariant -> Bool
Eq, Eq ResizeControlVariant
Eq ResizeControlVariant =>
(ResizeControlVariant -> ResizeControlVariant -> Ordering)
-> (ResizeControlVariant -> ResizeControlVariant -> Bool)
-> (ResizeControlVariant -> ResizeControlVariant -> Bool)
-> (ResizeControlVariant -> ResizeControlVariant -> Bool)
-> (ResizeControlVariant -> ResizeControlVariant -> Bool)
-> (ResizeControlVariant
-> ResizeControlVariant -> ResizeControlVariant)
-> (ResizeControlVariant
-> ResizeControlVariant -> ResizeControlVariant)
-> Ord ResizeControlVariant
ResizeControlVariant -> ResizeControlVariant -> Bool
ResizeControlVariant -> ResizeControlVariant -> Ordering
ResizeControlVariant
-> ResizeControlVariant -> ResizeControlVariant
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ResizeControlVariant -> ResizeControlVariant -> Ordering
compare :: ResizeControlVariant -> ResizeControlVariant -> Ordering
$c< :: ResizeControlVariant -> ResizeControlVariant -> Bool
< :: ResizeControlVariant -> ResizeControlVariant -> Bool
$c<= :: ResizeControlVariant -> ResizeControlVariant -> Bool
<= :: ResizeControlVariant -> ResizeControlVariant -> Bool
$c> :: ResizeControlVariant -> ResizeControlVariant -> Bool
> :: ResizeControlVariant -> ResizeControlVariant -> Bool
$c>= :: ResizeControlVariant -> ResizeControlVariant -> Bool
>= :: ResizeControlVariant -> ResizeControlVariant -> Bool
$cmax :: ResizeControlVariant
-> ResizeControlVariant -> ResizeControlVariant
max :: ResizeControlVariant
-> ResizeControlVariant -> ResizeControlVariant
$cmin :: ResizeControlVariant
-> ResizeControlVariant -> ResizeControlVariant
min :: ResizeControlVariant
-> ResizeControlVariant -> ResizeControlVariant
Ord, (forall x. ResizeControlVariant -> Rep ResizeControlVariant x)
-> (forall x. Rep ResizeControlVariant x -> ResizeControlVariant)
-> Generic ResizeControlVariant
forall x. Rep ResizeControlVariant x -> ResizeControlVariant
forall x. ResizeControlVariant -> Rep ResizeControlVariant x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ResizeControlVariant -> Rep ResizeControlVariant x
from :: forall x. ResizeControlVariant -> Rep ResizeControlVariant x
$cto :: forall x. Rep ResizeControlVariant x -> ResizeControlVariant
to :: forall x. Rep ResizeControlVariant x -> ResizeControlVariant
Generic)
data ResizeControlDirection
= ResizeHorizontal
| ResizeVertical
deriving (Int -> ResizeControlDirection -> ShowS
[ResizeControlDirection] -> ShowS
ResizeControlDirection -> String
(Int -> ResizeControlDirection -> ShowS)
-> (ResizeControlDirection -> String)
-> ([ResizeControlDirection] -> ShowS)
-> Show ResizeControlDirection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ResizeControlDirection -> ShowS
showsPrec :: Int -> ResizeControlDirection -> ShowS
$cshow :: ResizeControlDirection -> String
show :: ResizeControlDirection -> String
$cshowList :: [ResizeControlDirection] -> ShowS
showList :: [ResizeControlDirection] -> ShowS
Show, ResizeControlDirection -> ResizeControlDirection -> Bool
(ResizeControlDirection -> ResizeControlDirection -> Bool)
-> (ResizeControlDirection -> ResizeControlDirection -> Bool)
-> Eq ResizeControlDirection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ResizeControlDirection -> ResizeControlDirection -> Bool
== :: ResizeControlDirection -> ResizeControlDirection -> Bool
$c/= :: ResizeControlDirection -> ResizeControlDirection -> Bool
/= :: ResizeControlDirection -> ResizeControlDirection -> Bool
Eq, Eq ResizeControlDirection
Eq ResizeControlDirection =>
(ResizeControlDirection -> ResizeControlDirection -> Ordering)
-> (ResizeControlDirection -> ResizeControlDirection -> Bool)
-> (ResizeControlDirection -> ResizeControlDirection -> Bool)
-> (ResizeControlDirection -> ResizeControlDirection -> Bool)
-> (ResizeControlDirection -> ResizeControlDirection -> Bool)
-> (ResizeControlDirection
-> ResizeControlDirection -> ResizeControlDirection)
-> (ResizeControlDirection
-> ResizeControlDirection -> ResizeControlDirection)
-> Ord ResizeControlDirection
ResizeControlDirection -> ResizeControlDirection -> Bool
ResizeControlDirection -> ResizeControlDirection -> Ordering
ResizeControlDirection
-> ResizeControlDirection -> ResizeControlDirection
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ResizeControlDirection -> ResizeControlDirection -> Ordering
compare :: ResizeControlDirection -> ResizeControlDirection -> Ordering
$c< :: ResizeControlDirection -> ResizeControlDirection -> Bool
< :: ResizeControlDirection -> ResizeControlDirection -> Bool
$c<= :: ResizeControlDirection -> ResizeControlDirection -> Bool
<= :: ResizeControlDirection -> ResizeControlDirection -> Bool
$c> :: ResizeControlDirection -> ResizeControlDirection -> Bool
> :: ResizeControlDirection -> ResizeControlDirection -> Bool
$c>= :: ResizeControlDirection -> ResizeControlDirection -> Bool
>= :: ResizeControlDirection -> ResizeControlDirection -> Bool
$cmax :: ResizeControlDirection
-> ResizeControlDirection -> ResizeControlDirection
max :: ResizeControlDirection
-> ResizeControlDirection -> ResizeControlDirection
$cmin :: ResizeControlDirection
-> ResizeControlDirection -> ResizeControlDirection
min :: ResizeControlDirection
-> ResizeControlDirection -> ResizeControlDirection
Ord, (forall x. ResizeControlDirection -> Rep ResizeControlDirection x)
-> (forall x.
Rep ResizeControlDirection x -> ResizeControlDirection)
-> Generic ResizeControlDirection
forall x. Rep ResizeControlDirection x -> ResizeControlDirection
forall x. ResizeControlDirection -> Rep ResizeControlDirection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ResizeControlDirection -> Rep ResizeControlDirection x
from :: forall x. ResizeControlDirection -> Rep ResizeControlDirection x
$cto :: forall x. Rep ResizeControlDirection x -> ResizeControlDirection
to :: forall x. Rep ResizeControlDirection x -> ResizeControlDirection
Generic)
data ResizeParams = ResizeParams
{ ResizeParams -> Double
resizeX :: !Double
, ResizeParams -> Double
resizeY :: !Double
, ResizeParams -> Double
resizeWidth :: !Double
, ResizeParams -> Double
resizeHeight :: !Double
} deriving (Int -> ResizeParams -> ShowS
[ResizeParams] -> ShowS
ResizeParams -> String
(Int -> ResizeParams -> ShowS)
-> (ResizeParams -> String)
-> ([ResizeParams] -> ShowS)
-> Show ResizeParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ResizeParams -> ShowS
showsPrec :: Int -> ResizeParams -> ShowS
$cshow :: ResizeParams -> String
show :: ResizeParams -> String
$cshowList :: [ResizeParams] -> ShowS
showList :: [ResizeParams] -> ShowS
Show, ResizeParams -> ResizeParams -> Bool
(ResizeParams -> ResizeParams -> Bool)
-> (ResizeParams -> ResizeParams -> Bool) -> Eq ResizeParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ResizeParams -> ResizeParams -> Bool
== :: ResizeParams -> ResizeParams -> Bool
$c/= :: ResizeParams -> ResizeParams -> Bool
/= :: ResizeParams -> ResizeParams -> Bool
Eq, (forall x. ResizeParams -> Rep ResizeParams x)
-> (forall x. Rep ResizeParams x -> ResizeParams)
-> Generic ResizeParams
forall x. Rep ResizeParams x -> ResizeParams
forall x. ResizeParams -> Rep ResizeParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ResizeParams -> Rep ResizeParams x
from :: forall x. ResizeParams -> Rep ResizeParams x
$cto :: forall x. Rep ResizeParams x -> ResizeParams
to :: forall x. Rep ResizeParams x -> ResizeParams
Generic)
data ResizeParamsWithDirection = ResizeParamsWithDirection
{ ResizeParamsWithDirection -> ResizeParams
resizeParams :: !ResizeParams
, ResizeParamsWithDirection -> Double
resizeDirectionX :: !Double
, ResizeParamsWithDirection -> Double
resizeDirectionY :: !Double
} deriving (Int -> ResizeParamsWithDirection -> ShowS
[ResizeParamsWithDirection] -> ShowS
ResizeParamsWithDirection -> String
(Int -> ResizeParamsWithDirection -> ShowS)
-> (ResizeParamsWithDirection -> String)
-> ([ResizeParamsWithDirection] -> ShowS)
-> Show ResizeParamsWithDirection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ResizeParamsWithDirection -> ShowS
showsPrec :: Int -> ResizeParamsWithDirection -> ShowS
$cshow :: ResizeParamsWithDirection -> String
show :: ResizeParamsWithDirection -> String
$cshowList :: [ResizeParamsWithDirection] -> ShowS
showList :: [ResizeParamsWithDirection] -> ShowS
Show, ResizeParamsWithDirection -> ResizeParamsWithDirection -> Bool
(ResizeParamsWithDirection -> ResizeParamsWithDirection -> Bool)
-> (ResizeParamsWithDirection -> ResizeParamsWithDirection -> Bool)
-> Eq ResizeParamsWithDirection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ResizeParamsWithDirection -> ResizeParamsWithDirection -> Bool
== :: ResizeParamsWithDirection -> ResizeParamsWithDirection -> Bool
$c/= :: ResizeParamsWithDirection -> ResizeParamsWithDirection -> Bool
/= :: ResizeParamsWithDirection -> ResizeParamsWithDirection -> Bool
Eq, (forall x.
ResizeParamsWithDirection -> Rep ResizeParamsWithDirection x)
-> (forall x.
Rep ResizeParamsWithDirection x -> ResizeParamsWithDirection)
-> Generic ResizeParamsWithDirection
forall x.
Rep ResizeParamsWithDirection x -> ResizeParamsWithDirection
forall x.
ResizeParamsWithDirection -> Rep ResizeParamsWithDirection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
ResizeParamsWithDirection -> Rep ResizeParamsWithDirection x
from :: forall x.
ResizeParamsWithDirection -> Rep ResizeParamsWithDirection x
$cto :: forall x.
Rep ResizeParamsWithDirection x -> ResizeParamsWithDirection
to :: forall x.
Rep ResizeParamsWithDirection x -> ResizeParamsWithDirection
Generic)
xyResizerHandlePositions :: [ControlPosition]
xyResizerHandlePositions :: [ControlPosition]
xyResizerHandlePositions =
[ ControlPosition
ControlTopLeft, ControlPosition
ControlTopRight, ControlPosition
ControlBottomLeft, ControlPosition
ControlBottomRight ]
xyResizerLinePositions :: [ControlLinePosition]
xyResizerLinePositions :: [ControlLinePosition]
xyResizerLinePositions =
[ ControlLinePosition
ControlLineTop, ControlLinePosition
ControlLineRight, ControlLinePosition
ControlLineBottom, ControlLinePosition
ControlLineLeft ]
type ErrorCode = MisoString
type OnError = ErrorCode -> MisoString -> IO ()
instance ToJSON XYPosition where
toJSON :: XYPosition -> Value
toJSON (XYPosition Double
x Double
y) = [Pair] -> Value
object [ MisoString
"x" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Double
x, MisoString
"y" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Double
y ]
instance FromJSON XYPosition where
parseJSON :: Value -> Parser XYPosition
parseJSON = MisoString
-> (Object -> Parser XYPosition) -> Value -> Parser XYPosition
forall a. MisoString -> (Object -> Parser a) -> Value -> Parser a
withObject MisoString
"XYPosition" ((Object -> Parser XYPosition) -> Value -> Parser XYPosition)
-> (Object -> Parser XYPosition) -> Value -> Parser XYPosition
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Double -> Double -> XYPosition
XYPosition (Double -> Double -> XYPosition)
-> Parser Double -> Parser (Double -> XYPosition)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"x" Parser (Double -> XYPosition) -> Parser Double -> Parser XYPosition
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"y"
instance ToJSON Dimensions where
toJSON :: Dimensions -> Value
toJSON (Dimensions Double
w Double
h) = [Pair] -> Value
object [ MisoString
"width" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Double
w, MisoString
"height" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Double
h ]
instance FromJSON Dimensions where
parseJSON :: Value -> Parser Dimensions
parseJSON = MisoString
-> (Object -> Parser Dimensions) -> Value -> Parser Dimensions
forall a. MisoString -> (Object -> Parser a) -> Value -> Parser a
withObject MisoString
"Dimensions" ((Object -> Parser Dimensions) -> Value -> Parser Dimensions)
-> (Object -> Parser Dimensions) -> Value -> Parser Dimensions
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Double -> Double -> Dimensions
Dimensions (Double -> Double -> Dimensions)
-> Parser Double -> Parser (Double -> Dimensions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"width" Parser (Double -> Dimensions) -> Parser Double -> Parser Dimensions
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"height"
instance ToJSON Rect where
toJSON :: Rect -> Value
toJSON (Rect Double
x Double
y Double
w Double
h) =
[Pair] -> Value
object [ MisoString
"x" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Double
x, MisoString
"y" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Double
y, MisoString
"width" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Double
w, MisoString
"height" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Double
h ]
instance FromJSON Rect where
parseJSON :: Value -> Parser Rect
parseJSON = MisoString -> (Object -> Parser Rect) -> Value -> Parser Rect
forall a. MisoString -> (Object -> Parser a) -> Value -> Parser a
withObject MisoString
"Rect" ((Object -> Parser Rect) -> Value -> Parser Rect)
-> (Object -> Parser Rect) -> Value -> Parser Rect
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Double -> Double -> Double -> Double -> Rect
Rect (Double -> Double -> Double -> Double -> Rect)
-> Parser Double -> Parser (Double -> Double -> Double -> Rect)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"x" Parser (Double -> Double -> Double -> Rect)
-> Parser Double -> Parser (Double -> Double -> Rect)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"y" Parser (Double -> Double -> Rect)
-> Parser Double -> Parser (Double -> Rect)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"width" Parser (Double -> Rect) -> Parser Double -> Parser Rect
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"height"
instance ToJSON Viewport where
toJSON :: Viewport -> Value
toJSON (Viewport Double
x Double
y Double
zoom) =
[Pair] -> Value
object [ MisoString
"x" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Double
x, MisoString
"y" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Double
y, MisoString
"zoom" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Double
zoom ]
instance FromJSON Viewport where
parseJSON :: Value -> Parser Viewport
parseJSON = MisoString
-> (Object -> Parser Viewport) -> Value -> Parser Viewport
forall a. MisoString -> (Object -> Parser a) -> Value -> Parser a
withObject MisoString
"Viewport" ((Object -> Parser Viewport) -> Value -> Parser Viewport)
-> (Object -> Parser Viewport) -> Value -> Parser Viewport
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Double -> Double -> Double -> Viewport
Viewport (Double -> Double -> Double -> Viewport)
-> Parser Double -> Parser (Double -> Double -> Viewport)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"x" Parser (Double -> Double -> Viewport)
-> Parser Double -> Parser (Double -> Viewport)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"y" Parser (Double -> Viewport) -> Parser Double -> Parser Viewport
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"zoom" Parser Double -> Parser Double -> Parser Double
forall a. Parser a -> Parser a -> Parser a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"k")
instance ToJSON Position where
toJSON :: Position -> Value
toJSON = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString -> Value)
-> (Position -> MisoString) -> Position -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Position -> MisoString
positionToText
instance FromJSON Position where
parseJSON :: Value -> Parser Position
parseJSON = MisoString
-> (MisoString -> Parser Position) -> Value -> Parser Position
forall a.
MisoString -> (MisoString -> Parser a) -> Value -> Parser a
withText MisoString
"Position" ((MisoString -> Parser Position) -> Value -> Parser Position)
-> (MisoString -> Parser Position) -> Value -> Parser Position
forall a b. (a -> b) -> a -> b
$ \MisoString
t ->
Parser Position
-> (Position -> Parser Position)
-> Maybe Position
-> Parser Position
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Parser Position
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"invalid position") Position -> Parser Position
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MisoString -> Maybe Position
positionFromText MisoString
t)
instance ToJSON HandleType where
toJSON :: HandleType -> Value
toJSON = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString -> Value)
-> (HandleType -> MisoString) -> HandleType -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HandleType -> MisoString
handleTypeToText
instance FromJSON HandleType where
parseJSON :: Value -> Parser HandleType
parseJSON = MisoString
-> (MisoString -> Parser HandleType) -> Value -> Parser HandleType
forall a.
MisoString -> (MisoString -> Parser a) -> Value -> Parser a
withText MisoString
"HandleType" ((MisoString -> Parser HandleType) -> Value -> Parser HandleType)
-> (MisoString -> Parser HandleType) -> Value -> Parser HandleType
forall a b. (a -> b) -> a -> b
$ \MisoString
t ->
Parser HandleType
-> (HandleType -> Parser HandleType)
-> Maybe HandleType
-> Parser HandleType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Parser HandleType
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"invalid handle type") HandleType -> Parser HandleType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MisoString -> Maybe HandleType
handleTypeFromText MisoString
t)
instance ToJSON CoordinateExtent where
toJSON :: CoordinateExtent -> Value
toJSON (CoordinateExtent Double
x1 Double
y1 Double
x2 Double
y2) =
[[Double]] -> Value
forall a. ToJSON a => a -> Value
toJSON [ [ Double
x1, Double
y1 ], [ Double
x2, Double
y2 ] ]
instance FromJSON CoordinateExtent where
parseJSON :: Value -> Parser CoordinateExtent
parseJSON Value
v = do
pairs <- Value -> Parser [[Double]]
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v
case pairs of
[ [ Double
x1, Double
y1 ], [ Double
x2, Double
y2 ] ] -> CoordinateExtent -> Parser CoordinateExtent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Double -> Double -> Double -> Double -> CoordinateExtent
CoordinateExtent Double
x1 Double
y1 Double
x2 Double
y2)
[[Double]]
_ -> String -> Parser CoordinateExtent
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"invalid coordinate extent"
instance ToJSON NodeExtent where
toJSON :: NodeExtent -> Value
toJSON NodeExtent
ExtentParent = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"parent" :: MisoString)
toJSON (ExtentCoordinates CoordinateExtent
ce) = CoordinateExtent -> Value
forall a. ToJSON a => a -> Value
toJSON CoordinateExtent
ce
instance FromJSON NodeExtent where
parseJSON :: Value -> Parser NodeExtent
parseJSON Value
v =
(MisoString
-> (MisoString -> Parser NodeExtent) -> Value -> Parser NodeExtent
forall a.
MisoString -> (MisoString -> Parser a) -> Value -> Parser a
withText MisoString
"NodeExtent" ((MisoString -> Parser NodeExtent) -> Value -> Parser NodeExtent)
-> (MisoString -> Parser NodeExtent) -> Value -> Parser NodeExtent
forall a b. (a -> b) -> a -> b
$ \MisoString
t ->
if MisoString
t MisoString -> MisoString -> Bool
forall a. Eq a => a -> a -> Bool
== MisoString
"parent" then NodeExtent -> Parser NodeExtent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure NodeExtent
ExtentParent else String -> Parser NodeExtent
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"invalid extent") Value
v
Parser NodeExtent -> Parser NodeExtent -> Parser NodeExtent
forall a. Parser a -> Parser a -> Parser a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (CoordinateExtent -> NodeExtent
ExtentCoordinates (CoordinateExtent -> NodeExtent)
-> Parser CoordinateExtent -> Parser NodeExtent
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser CoordinateExtent
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v)
instance ToJSON NodeOrigin where
toJSON :: NodeOrigin -> Value
toJSON (NodeOrigin Double
x Double
y) = [Double] -> Value
forall a. ToJSON a => a -> Value
toJSON [ Double
x, Double
y ]
instance FromJSON NodeOrigin where
parseJSON :: Value -> Parser NodeOrigin
parseJSON Value
v = do
xs <- Value -> Parser [Double]
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v
case xs of
[ Double
x, Double
y ] -> NodeOrigin -> Parser NodeOrigin
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Double -> Double -> NodeOrigin
NodeOrigin Double
x Double
y)
[Double]
_ -> String -> Parser NodeOrigin
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"invalid node origin"
instance ToJSON SnapGrid where
toJSON :: SnapGrid -> Value
toJSON (SnapGrid Double
x Double
y) = [Double] -> Value
forall a. ToJSON a => a -> Value
toJSON [ Double
x, Double
y ]
instance FromJSON SnapGrid where
parseJSON :: Value -> Parser SnapGrid
parseJSON Value
v = do
xs <- Value -> Parser [Double]
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v
case xs of
[ Double
x, Double
y ] -> SnapGrid -> Parser SnapGrid
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Double -> Double -> SnapGrid
SnapGrid Double
x Double
y)
[Double]
_ -> String -> Parser SnapGrid
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"invalid snap grid"
instance ToJSON Handle where
toJSON :: Handle -> Value
toJSON Handle
h = [Pair] -> Value
object
[ MisoString
"id" MisoString -> Maybe MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Handle -> Maybe MisoString
hId Handle
h
, MisoString
"nodeId" MisoString -> MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Handle -> MisoString
hNodeId Handle
h
, MisoString
"x" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Handle -> Double
hX Handle
h
, MisoString
"y" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Handle -> Double
hY Handle
h
, MisoString
"position" MisoString -> Position -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Handle -> Position
hPosition Handle
h
, MisoString
"type" MisoString -> HandleType -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Handle -> HandleType
hType Handle
h
, MisoString
"width" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Handle -> Double
hWidth Handle
h
, MisoString
"height" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Handle -> Double
hHeight Handle
h
]
instance FromJSON Handle where
parseJSON :: Value -> Parser Handle
parseJSON = MisoString -> (Object -> Parser Handle) -> Value -> Parser Handle
forall a. MisoString -> (Object -> Parser a) -> Value -> Parser a
withObject MisoString
"Handle" ((Object -> Parser Handle) -> Value -> Parser Handle)
-> (Object -> Parser Handle) -> Value -> Parser Handle
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe MisoString
-> MisoString
-> Double
-> Double
-> Position
-> HandleType
-> Double
-> Double
-> Handle
Handle
(Maybe MisoString
-> MisoString
-> Double
-> Double
-> Position
-> HandleType
-> Double
-> Double
-> Handle)
-> Parser (Maybe MisoString)
-> Parser
(MisoString
-> Double
-> Double
-> Position
-> HandleType
-> Double
-> Double
-> Handle)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> MisoString -> Parser (Maybe MisoString)
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"id"
Parser
(MisoString
-> Double
-> Double
-> Position
-> HandleType
-> Double
-> Double
-> Handle)
-> Parser MisoString
-> Parser
(Double
-> Double -> Position -> HandleType -> Double -> Double -> Handle)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser MisoString
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"nodeId"
Parser
(Double
-> Double -> Position -> HandleType -> Double -> Double -> Handle)
-> Parser Double
-> Parser
(Double -> Position -> HandleType -> Double -> Double -> Handle)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"x"
Parser
(Double -> Position -> HandleType -> Double -> Double -> Handle)
-> Parser Double
-> Parser (Position -> HandleType -> Double -> Double -> Handle)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"y"
Parser (Position -> HandleType -> Double -> Double -> Handle)
-> Parser Position
-> Parser (HandleType -> Double -> Double -> Handle)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Position
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"position"
Parser (HandleType -> Double -> Double -> Handle)
-> Parser HandleType -> Parser (Double -> Double -> Handle)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser HandleType
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"type"
Parser (Double -> Double -> Handle)
-> Parser Double -> Parser (Double -> Handle)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"width"
Parser (Double -> Handle) -> Parser Double -> Parser Handle
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"height"
instance ToJSON NodeHandle where
toJSON :: NodeHandle -> Value
toJSON NodeHandle
h = [Pair] -> Value
object
[ MisoString
"id" MisoString -> Maybe MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= NodeHandle -> Maybe MisoString
nhId NodeHandle
h
, MisoString
"x" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= NodeHandle -> Double
nhX NodeHandle
h
, MisoString
"y" MisoString -> Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= NodeHandle -> Double
nhY NodeHandle
h
, MisoString
"position" MisoString -> Position -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= NodeHandle -> Position
nhPosition NodeHandle
h
, MisoString
"type" MisoString -> HandleType -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= NodeHandle -> HandleType
nhType NodeHandle
h
, MisoString
"width" MisoString -> Maybe Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= NodeHandle -> Maybe Double
nhWidth NodeHandle
h
, MisoString
"height" MisoString -> Maybe Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= NodeHandle -> Maybe Double
nhHeight NodeHandle
h
]
instance FromJSON NodeHandle where
parseJSON :: Value -> Parser NodeHandle
parseJSON = MisoString
-> (Object -> Parser NodeHandle) -> Value -> Parser NodeHandle
forall a. MisoString -> (Object -> Parser a) -> Value -> Parser a
withObject MisoString
"NodeHandle" ((Object -> Parser NodeHandle) -> Value -> Parser NodeHandle)
-> (Object -> Parser NodeHandle) -> Value -> Parser NodeHandle
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe MisoString
-> Double
-> Double
-> Position
-> HandleType
-> Maybe Double
-> Maybe Double
-> NodeHandle
NodeHandle
(Maybe MisoString
-> Double
-> Double
-> Position
-> HandleType
-> Maybe Double
-> Maybe Double
-> NodeHandle)
-> Parser (Maybe MisoString)
-> Parser
(Double
-> Double
-> Position
-> HandleType
-> Maybe Double
-> Maybe Double
-> NodeHandle)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> MisoString -> Parser (Maybe MisoString)
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"id"
Parser
(Double
-> Double
-> Position
-> HandleType
-> Maybe Double
-> Maybe Double
-> NodeHandle)
-> Parser Double
-> Parser
(Double
-> Position
-> HandleType
-> Maybe Double
-> Maybe Double
-> NodeHandle)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"x"
Parser
(Double
-> Position
-> HandleType
-> Maybe Double
-> Maybe Double
-> NodeHandle)
-> Parser Double
-> Parser
(Position
-> HandleType -> Maybe Double -> Maybe Double -> NodeHandle)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Double
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"y"
Parser
(Position
-> HandleType -> Maybe Double -> Maybe Double -> NodeHandle)
-> Parser Position
-> Parser
(HandleType -> Maybe Double -> Maybe Double -> NodeHandle)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser Position
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"position"
Parser (HandleType -> Maybe Double -> Maybe Double -> NodeHandle)
-> Parser HandleType
-> Parser (Maybe Double -> Maybe Double -> NodeHandle)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser HandleType
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"type"
Parser (Maybe Double -> Maybe Double -> NodeHandle)
-> Parser (Maybe Double) -> Parser (Maybe Double -> NodeHandle)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser (Maybe Double)
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"width"
Parser (Maybe Double -> NodeHandle)
-> Parser (Maybe Double) -> Parser NodeHandle
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser (Maybe Double)
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"height"
instance ToJSON NodeHandleBounds where
toJSON :: NodeHandleBounds -> Value
toJSON (NodeHandleBounds Maybe [Handle]
src Maybe [Handle]
tgt) =
[Pair] -> Value
object [ MisoString
"source" MisoString -> Maybe [Handle] -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Maybe [Handle]
src, MisoString
"target" MisoString -> Maybe [Handle] -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Maybe [Handle]
tgt ]
instance FromJSON NodeHandleBounds where
parseJSON :: Value -> Parser NodeHandleBounds
parseJSON = MisoString
-> (Object -> Parser NodeHandleBounds)
-> Value
-> Parser NodeHandleBounds
forall a. MisoString -> (Object -> Parser a) -> Value -> Parser a
withObject MisoString
"NodeHandleBounds" ((Object -> Parser NodeHandleBounds)
-> Value -> Parser NodeHandleBounds)
-> (Object -> Parser NodeHandleBounds)
-> Value
-> Parser NodeHandleBounds
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Handle] -> Maybe [Handle] -> NodeHandleBounds
NodeHandleBounds (Maybe [Handle] -> Maybe [Handle] -> NodeHandleBounds)
-> Parser (Maybe [Handle])
-> Parser (Maybe [Handle] -> NodeHandleBounds)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> MisoString -> Parser (Maybe [Handle])
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"source" Parser (Maybe [Handle] -> NodeHandleBounds)
-> Parser (Maybe [Handle]) -> Parser NodeHandleBounds
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser (Maybe [Handle])
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"target"
instance ToJSON Measured where
toJSON :: Measured -> Value
toJSON (Measured Maybe Double
w Maybe Double
h) = [Pair] -> Value
object [ MisoString
"width" MisoString -> Maybe Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Maybe Double
w, MisoString
"height" MisoString -> Maybe Double -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Maybe Double
h ]
instance FromJSON Measured where
parseJSON :: Value -> Parser Measured
parseJSON = MisoString
-> (Object -> Parser Measured) -> Value -> Parser Measured
forall a. MisoString -> (Object -> Parser a) -> Value -> Parser a
withObject MisoString
"Measured" ((Object -> Parser Measured) -> Value -> Parser Measured)
-> (Object -> Parser Measured) -> Value -> Parser Measured
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Double -> Maybe Double -> Measured
Measured (Maybe Double -> Maybe Double -> Measured)
-> Parser (Maybe Double) -> Parser (Maybe Double -> Measured)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> MisoString -> Parser (Maybe Double)
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"width" Parser (Maybe Double -> Measured)
-> Parser (Maybe Double) -> Parser Measured
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser (Maybe Double)
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"height"
instance ToJSON Connection where
toJSON :: Connection -> Value
toJSON Connection
c = [Pair] -> Value
object
[ MisoString
"source" MisoString -> MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Connection -> MisoString
connectionSource Connection
c
, MisoString
"target" MisoString -> MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Connection -> MisoString
connectionTarget Connection
c
, MisoString
"sourceHandle" MisoString -> Maybe MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Connection -> Maybe MisoString
connectionSourceHandle Connection
c
, MisoString
"targetHandle" MisoString -> Maybe MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Connection -> Maybe MisoString
connectionTargetHandle Connection
c
]
instance FromJSON Connection where
parseJSON :: Value -> Parser Connection
parseJSON = MisoString
-> (Object -> Parser Connection) -> Value -> Parser Connection
forall a. MisoString -> (Object -> Parser a) -> Value -> Parser a
withObject MisoString
"Connection" ((Object -> Parser Connection) -> Value -> Parser Connection)
-> (Object -> Parser Connection) -> Value -> Parser Connection
forall a b. (a -> b) -> a -> b
$ \Object
o ->
MisoString
-> MisoString -> Maybe MisoString -> Maybe MisoString -> Connection
Connection
(MisoString
-> MisoString
-> Maybe MisoString
-> Maybe MisoString
-> Connection)
-> Parser MisoString
-> Parser
(MisoString -> Maybe MisoString -> Maybe MisoString -> Connection)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> MisoString -> Parser MisoString
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"source"
Parser
(MisoString -> Maybe MisoString -> Maybe MisoString -> Connection)
-> Parser MisoString
-> Parser (Maybe MisoString -> Maybe MisoString -> Connection)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser MisoString
forall a. FromJSON a => Object -> MisoString -> Parser a
.: MisoString
"target"
Parser (Maybe MisoString -> Maybe MisoString -> Connection)
-> Parser (Maybe MisoString)
-> Parser (Maybe MisoString -> Connection)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser (Maybe MisoString)
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"sourceHandle"
Parser (Maybe MisoString -> Connection)
-> Parser (Maybe MisoString) -> Parser Connection
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser (Maybe MisoString)
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"targetHandle"
instance ToJSON ConnectionMode where
toJSON :: ConnectionMode -> Value
toJSON ConnectionMode
ConnectionModeStrict = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"strict" :: MisoString)
toJSON ConnectionMode
ConnectionModeLoose = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"loose" :: MisoString)
instance ToJSON PanOnDrag where
toJSON :: PanOnDrag -> Value
toJSON (PanOnDrag Bool
b) = Bool -> Value
forall a. ToJSON a => a -> Value
toJSON Bool
b
toJSON (PanOnDragButtons [Int]
bs) = [Int] -> Value
forall a. ToJSON a => a -> Value
toJSON [Int]
bs
instance ToJSON PanOnScrollMode where
toJSON :: PanOnScrollMode -> Value
toJSON PanOnScrollMode
PanOnScrollFree = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"free" :: MisoString)
toJSON PanOnScrollMode
PanOnScrollVertical = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"vertical" :: MisoString)
toJSON PanOnScrollMode
PanOnScrollHorizontal = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"horizontal" :: MisoString)
instance ToJSON ZIndexMode where
toJSON :: ZIndexMode -> Value
toJSON ZIndexMode
ZIndexAuto = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"auto" :: MisoString)
toJSON ZIndexMode
ZIndexBasic = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"basic" :: MisoString)
toJSON ZIndexMode
ZIndexManual = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"manual" :: MisoString)
instance ToJSON Interpolation where
toJSON :: Interpolation -> Value
toJSON Interpolation
InterpolateSmooth = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"smooth" :: MisoString)
toJSON Interpolation
InterpolateLinear = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"linear" :: MisoString)
instance ToJSON ControlPosition where
toJSON :: ControlPosition -> Value
toJSON = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString -> Value)
-> (ControlPosition -> MisoString) -> ControlPosition -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ControlPosition -> MisoString
controlPositionToText
instance ToJSON ResizeControlDirection where
toJSON :: ResizeControlDirection -> Value
toJSON ResizeControlDirection
ResizeHorizontal = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"horizontal" :: MisoString)
toJSON ResizeControlDirection
ResizeVertical = MisoString -> Value
forall a. ToJSON a => a -> Value
toJSON (MisoString
"vertical" :: MisoString)
instance ToJSON OnConnectStartParams where
toJSON :: OnConnectStartParams -> Value
toJSON OnConnectStartParams
p = [Pair] -> Value
object
[ MisoString
"nodeId" MisoString -> Maybe MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= OnConnectStartParams -> Maybe MisoString
onConnectStartNodeId OnConnectStartParams
p
, MisoString
"handleId" MisoString -> Maybe MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= OnConnectStartParams -> Maybe MisoString
onConnectStartHandleId OnConnectStartParams
p
, MisoString
"handleType" MisoString -> Maybe HandleType -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= OnConnectStartParams -> Maybe HandleType
onConnectStartHandleType OnConnectStartParams
p
]
instance FromJSON OnConnectStartParams where
parseJSON :: Value -> Parser OnConnectStartParams
parseJSON = MisoString
-> (Object -> Parser OnConnectStartParams)
-> Value
-> Parser OnConnectStartParams
forall a. MisoString -> (Object -> Parser a) -> Value -> Parser a
withObject MisoString
"OnConnectStartParams" ((Object -> Parser OnConnectStartParams)
-> Value -> Parser OnConnectStartParams)
-> (Object -> Parser OnConnectStartParams)
-> Value
-> Parser OnConnectStartParams
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe MisoString
-> Maybe MisoString -> Maybe HandleType -> OnConnectStartParams
OnConnectStartParams
(Maybe MisoString
-> Maybe MisoString -> Maybe HandleType -> OnConnectStartParams)
-> Parser (Maybe MisoString)
-> Parser
(Maybe MisoString -> Maybe HandleType -> OnConnectStartParams)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> MisoString -> Parser (Maybe MisoString)
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"nodeId"
Parser
(Maybe MisoString -> Maybe HandleType -> OnConnectStartParams)
-> Parser (Maybe MisoString)
-> Parser (Maybe HandleType -> OnConnectStartParams)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser (Maybe MisoString)
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"handleId"
Parser (Maybe HandleType -> OnConnectStartParams)
-> Parser (Maybe HandleType) -> Parser OnConnectStartParams
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> MisoString -> Parser (Maybe HandleType)
forall a. FromJSON a => Object -> MisoString -> Parser (Maybe a)
.:? MisoString
"handleType"
(.=?) :: ToJSON v => MisoString -> Maybe v -> Maybe (MisoString, Value)
MisoString
k .=? :: forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Maybe v
mv = (MisoString
k MisoString -> v -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.=) (v -> Pair) -> Maybe v -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe v
mv
instance ToJSON (Node n) where
toJSON :: Node n -> Value
toJSON Node n
n = [Pair] -> Value
object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[ MisoString
"id" MisoString -> MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Node n -> MisoString
forall n. Node n -> MisoString
nodeId Node n
n
, MisoString
"position" MisoString -> XYPosition -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Node n -> XYPosition
forall n. Node n -> XYPosition
nodePosition Node n
n
, MisoString
"hidden" MisoString -> Bool -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Node n -> Bool
forall n. Node n -> Bool
nodeHidden Node n
n
, MisoString
"selected" MisoString -> Bool -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Node n -> Bool
forall n. Node n -> Bool
nodeSelected Node n
n
, MisoString
"dragging" MisoString -> Bool -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Node n -> Bool
forall n. Node n -> Bool
nodeDragging Node n
n
, MisoString
"expandParent" MisoString -> Bool -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Node n -> Bool
forall n. Node n -> Bool
nodeExpandParent Node n
n
]
[Pair] -> [Pair] -> [Pair]
forall a. Semigroup a => a -> a -> a
<> [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ MisoString
"sourcePosition" MisoString -> Maybe Position -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Position
forall n. Node n -> Maybe Position
nodeSourcePosition Node n
n
, MisoString
"targetPosition" MisoString -> Maybe Position -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Position
forall n. Node n -> Maybe Position
nodeTargetPosition Node n
n
, MisoString
"draggable" MisoString -> Maybe Bool -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Bool
forall n. Node n -> Maybe Bool
nodeDraggable Node n
n
, MisoString
"selectable" MisoString -> Maybe Bool -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Bool
forall n. Node n -> Maybe Bool
nodeSelectable Node n
n
, MisoString
"connectable" MisoString -> Maybe Bool -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Bool
forall n. Node n -> Maybe Bool
nodeConnectable Node n
n
, MisoString
"deletable" MisoString -> Maybe Bool -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Bool
forall n. Node n -> Maybe Bool
nodeDeletable Node n
n
, MisoString
"dragHandle" MisoString -> Maybe MisoString -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe MisoString
forall n. Node n -> Maybe MisoString
nodeDragHandle Node n
n
, MisoString
"width" MisoString -> Maybe Double -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Double
forall n. Node n -> Maybe Double
nodeWidth Node n
n
, MisoString
"height" MisoString -> Maybe Double -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Double
forall n. Node n -> Maybe Double
nodeHeight Node n
n
, MisoString
"initialWidth" MisoString -> Maybe Double -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Double
forall n. Node n -> Maybe Double
nodeInitialWidth Node n
n
, MisoString
"initialHeight" MisoString -> Maybe Double -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Double
forall n. Node n -> Maybe Double
nodeInitialHeight Node n
n
, MisoString
"parentId" MisoString -> Maybe MisoString -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe MisoString
forall n. Node n -> Maybe MisoString
nodeParentId Node n
n
, MisoString
"zIndex" MisoString -> Maybe Double -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Double
forall n. Node n -> Maybe Double
nodeZIndex Node n
n
, MisoString
"extent" MisoString -> Maybe NodeExtent -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe NodeExtent
forall n. Node n -> Maybe NodeExtent
nodeExtent Node n
n
, MisoString
"origin" MisoString -> Maybe NodeOrigin -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe NodeOrigin
forall n. Node n -> Maybe NodeOrigin
nodeOrigin Node n
n
, MisoString
"handles" MisoString -> Maybe [NodeHandle] -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe [NodeHandle]
forall n. Node n -> Maybe [NodeHandle]
nodeHandles Node n
n
, MisoString
"measured" MisoString -> Maybe Measured -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe Measured
forall n. Node n -> Maybe Measured
nodeMeasured Node n
n
, MisoString
"type" MisoString -> Maybe MisoString -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Node n -> Maybe MisoString
forall n. Node n -> Maybe MisoString
nodeType Node n
n
]
instance ToJSON (Edge e) where
toJSON :: Edge e -> Value
toJSON Edge e
e = [Pair] -> Value
object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[ MisoString
"id" MisoString -> MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Edge e -> MisoString
forall e. Edge e -> MisoString
edgeId Edge e
e
, MisoString
"source" MisoString -> MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Edge e -> MisoString
forall e. Edge e -> MisoString
edgeSource Edge e
e
, MisoString
"target" MisoString -> MisoString -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Edge e -> MisoString
forall e. Edge e -> MisoString
edgeTarget Edge e
e
, MisoString
"selected" MisoString -> Bool -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Edge e -> Bool
forall e. Edge e -> Bool
edgeSelected Edge e
e
, MisoString
"hidden" MisoString -> Bool -> Pair
forall v. ToJSON v => MisoString -> v -> Pair
.= Edge e -> Bool
forall e. Edge e -> Bool
edgeHidden Edge e
e
]
[Pair] -> [Pair] -> [Pair]
forall a. Semigroup a => a -> a -> a
<> [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ MisoString
"sourceHandle" MisoString -> Maybe MisoString -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Edge e -> Maybe MisoString
forall e. Edge e -> Maybe MisoString
edgeSourceHandle Edge e
e
, MisoString
"targetHandle" MisoString -> Maybe MisoString -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Edge e -> Maybe MisoString
forall e. Edge e -> Maybe MisoString
edgeTargetHandle Edge e
e
, MisoString
"deletable" MisoString -> Maybe Bool -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Edge e -> Maybe Bool
forall e. Edge e -> Maybe Bool
edgeDeletable Edge e
e
, MisoString
"selectable" MisoString -> Maybe Bool -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Edge e -> Maybe Bool
forall e. Edge e -> Maybe Bool
edgeSelectable Edge e
e
, MisoString
"zIndex" MisoString -> Maybe Double -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Edge e -> Maybe Double
forall e. Edge e -> Maybe Double
edgeZIndex Edge e
e
, MisoString
"type" MisoString -> Maybe MisoString -> Maybe Pair
forall v. ToJSON v => MisoString -> Maybe v -> Maybe Pair
.=? Edge e -> Maybe MisoString
forall e. Edge e -> Maybe MisoString
edgeType Edge e
e
]