definition:
|
treeSvgRek :: Int -> Int -> Float -> Float -> Float -> DNode -> [ChoiceMapping]
-> [XmlExp]
treeSvgRek maxDepth level levelHeight leafWidth leftBound currNode chMap =
(nodeSvg currNode (posX,posY)) :
(childrenSvg currChldrn leftBound
(currChldrn !?? ((-1 +) <$> (lookup (nodeID currNode) chMap))))
where
currChldrn = children currNode
posX = leftBound + ((toFloat $ width currNode) * leafWidth / 2)
posY = ((toFloat level) + 0.5) * levelHeight
connectionDashes = if level >= maxDepth - 1 then "5,5" else ""
connectionColour = if level >= maxDepth - 1 then "darkgrey" else "black"
childrenSvg [] _ _ = []
childrenSvg (c:cs) currLeft choiceChld =
(connection c currLeft ((Just c) == choiceChld)) :
(treeSvgRek maxDepth (level + 1) levelHeight leafWidth currLeft c chMap) ++
(childrenSvg cs (currLeft + (toFloat $ width c) * leafWidth) choiceChld)
--draw a connection between the current node and the current child
connection c currLeft thick =
dashedBezierSvg connectionDashes connectionColour
(posX, posY + ((snd nodeSize) / 2))
(currLeft + (toFloat (width c)) * leafWidth / 2,
((toFloat level) + 1.5) * levelHeight - (snd nodeSize) / 2)
(if thick then 3 else 1)
|
demand:
|
no demanded arguments
|
deterministic:
|
deterministic operation
|
failfree:
|
(_, _, _, _, _, _, _)
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{(_,_,_,_,_,_,_) |-> {:}}
|
name:
|
treeSvgRek
|
precedence:
|
no precedence defined
|
result-values:
|
{:}
|
signature:
|
Prelude.Int -> Prelude.Int -> Prelude.Float -> Prelude.Float -> Prelude.Float
-> DNode -> [(Prelude.Int, Prelude.Int)] -> [XML.XmlExp]
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|