Safe Haskell | None |
---|---|
Language | Haskell2010 |
Charts that depict gradients and similar data, using arrows in positions
- data Arrow = Arrow {}
- data ArrowOptions a = ArrowOptions {
- arrowMinLength :: a
- arrowMaxLength :: a
- arrowMinHeadLength :: a
- arrowMaxHeadLength :: a
- arrowMinStaffWidth :: a
- arrowMaxStaffWidth :: a
- arrowColor :: AlphaColour Double
- arrowHeadStyle :: ArrowHT a
- normArrows :: [Arrow] -> [Arrow]
- arrows :: Traversable f => ArrowOptions Double -> f Arrow -> Chart b
- arrowChart :: Traversable f => [ArrowOptions Double] -> Aspect -> Rect Double -> [f Arrow] -> Chart b
- arrowChart_ :: Traversable f => [ArrowOptions Double] -> Aspect -> [f Arrow] -> Chart b
Documentation
An arrow structure contains position, direction and size information
data ArrowOptions a Source #
todo: quite a clunky specification of what an arrow is (or could be)
ArrowOptions | |
|
normArrows :: [Arrow] -> [Arrow] Source #
Equalize the arrow space width with the data space one. this creates the right arrow sizing in physical chart space
arrows :: Traversable f => ArrowOptions Double -> f Arrow -> Chart b Source #
Rescale data across position, and between position and arrow direction.
note that, due to this auto-scaling, there is no such thing as a single arrow_ chart
arrows (def {arrowMaxLength=0.5,arrowMaxHeadLength=0.2,arrowMaxStaffWidth=0.01}) [Arrow (Pair x (sin (5*x))) (Pair x (cos x)) | x<-grid MidPos (one::Range Double) 100]
arrowChart :: Traversable f => [ArrowOptions Double] -> Aspect -> Rect Double -> [f Arrow] -> Chart b Source #
A chart of arrows
arrowChart_ :: Traversable f => [ArrowOptions Double] -> Aspect -> [f Arrow] -> Chart b Source #
An arrow chart scaled to its own range
let as = normArrows [Arrow (Pair x y) (Pair (sin 1/x+0.0001) (cos 1/y+0.0001)) | x<-grid MidPos (one::Range Double) 20, y<-grid MidPos (one::Range Double) 20] arrowChart_ [def] asquare [as]