|
definition: |
treeSvg :: Int -> Maybe Dimensions -> (Graph, [ChoiceMapping], NodeID) -> XmlExp
treeSvg maxDepth dims (graph, chMap, root) =
let (drawGraph, depth) = constructDGraph maxDepth graph root
calcX = toFloat ((width drawGraph) * 140)
calcY = max (toFloat depth * 80) 400.0
dimX = fromMaybe (max calcX calcY) (fst <$> dims)
dimY = fromMaybe dimX (snd <$> dims)
in XElem "svg" [("viewbox", "0 0 " ++ show dimX ++ " " ++ show dimY),
("xmlns", "http://www.w3.org/2000/svg")]
(treeSvgRek
maxDepth
0
(dimY / (toFloat depth))
(dimX / (toFloat $ width drawGraph))
0
drawGraph
chMap)
|
|
demand: |
argument 3 |
|
deterministic: |
deterministic operation |
|
documentation: |
Draw a svg-tree of a given graph |
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,{(,,)}) |-> {XElem}}
|
|
name: |
treeSvg |
|
precedence: |
no precedence defined |
|
result-values: |
{XElem}
|
|
signature: |
Prelude.Int -> Prelude.Maybe (Prelude.Float, Prelude.Float) -> ([Node], [(Prelude.Int, 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 |