Copyright | (c) 2013-14 Jeffrey Rosenbluth |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | jeffrey.rosenbluth@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Generation of Sunburst Partitions. A radial view of a Treemap.
The partitions are created without examining the contents of the tree nodes
which allows us to create a sunburst for any Tree a
. As a consequence we cannot
base the size or color of the sections on the data in the tree, but only
on depth and number of children. Of course the code could easily be adapted
to handle more specific tree data.
See John Stasko, Richard Catrambone, "An evaluation of space-filling information visualizations for depicting hierarchical structures", 2000. http://www.cc.gatech.edu/~john.stasko/papers/ijhcs00.pdf.
- sunburst' :: (Renderable (Path V2 n) b, TypeableFloat n) => SunburstOpts n -> Tree a -> QDiagram b V2 n Any
- sunburst :: (Renderable (Path V2 n) b, TypeableFloat n) => Tree a -> QDiagram b V2 n Any
- data SunburstOpts n = SunburstOpts {
- _radius :: n
- _sectionWidth :: n
- _colors :: [Colour Double]
- radius :: forall n. Lens' (SunburstOpts n) n
- sectionWidth :: forall n. Lens' (SunburstOpts n) n
- colors :: forall n. Lens' (SunburstOpts n) [Colour Double]
Documentation
sunburst' :: (Renderable (Path V2 n) b, TypeableFloat n) => SunburstOpts n -> Tree a -> QDiagram b V2 n Any Source #
Take any Tree a
and SunburstOpts
and make a sunburst partition.
Basically a treemap with a radial layout.
The root is the center of the sunburst and its circumference is divided
evenly according to the number of child nodes it has. Then each of those
sections is treated the same way.
sunburst :: (Renderable (Path V2 n) b, TypeableFloat n) => Tree a -> QDiagram b V2 n Any Source #
sunburst
with default opts
import Diagrams.TwoD.Sunburst import Data.Tree (unfoldTree) aTree = unfoldTree (\n -> (0, replicate n (n-1))) 6 sunburstEx = sunburst aTree # pad 1.1
data SunburstOpts n Source #
SunburstOpts | Color list one for each ring. |
|
Fractional n => Default (SunburstOpts n) Source # | |
radius :: forall n. Lens' (SunburstOpts n) n Source #
sectionWidth :: forall n. Lens' (SunburstOpts n) n Source #