Graphics.Rendering.Chart.Types
Description
This module contains basic types and functions used for drawing.
Note that template haskell is used to derive accessor functions
(see Data.Accessor
) for each field of the following data types:
These accessors are not shown in this API documentation. They have the same name as the field, but with the trailing underscore dropped. Hence for data field f_::F in type D, they have type
f :: Data.Accessor.Accessor D F
- data Rect = Rect Point Point
- data Point = Point {}
- data Vector = Vector {}
- type RectSize = (Double, Double)
- type Range = (Double, Double)
- mkrect :: Point -> Point -> Point -> Point -> Rect
- pvadd :: Point -> Vector -> Point
- pvsub :: Point -> Vector -> Point
- psub :: Point -> Point -> Vector
- vscale :: Double -> Vector -> Vector
- within :: Point -> Rect -> Bool
- data RectEdge
- type PointMapFn x y = (x, y) -> Point
- preserveCState :: CRender a -> CRender a
- setClipRegion :: Point -> Point -> CRender ()
- strokeLines :: [Point] -> CRender ()
- moveTo :: Point -> CRender ()
- lineTo :: Point -> CRender ()
- rectPath :: Rect -> CRender ()
- isValidNumber :: RealFloat a => a -> Bool
- maybeM :: Monad m => a -> (a1 -> m a) -> Maybe a1 -> m a
- black :: Color
- grey8 :: Color
- white :: Color
- red :: Color
- green :: Color
- blue :: Color
- defaultColorSeq :: [Color]
- data Color = Color {}
- setSourceColor :: Color -> Render ()
- data CairoLineStyle = CairoLineStyle {
- line_width_ :: Double
- line_color_ :: Color
- line_dashes_ :: [Double]
- line_cap_ :: LineCap
- line_join_ :: LineJoin
- solidLine :: Double -> Color -> CairoLineStyle
- dashedLine :: Double -> [Double] -> Color -> CairoLineStyle
- setLineStyle :: CairoLineStyle -> CRender ()
- newtype CairoFillStyle = CairoFillStyle (CRender ())
- defaultPointStyle :: CairoPointStyle
- solidFillStyle :: Color -> CairoFillStyle
- setFillStyle :: CairoFillStyle -> CRender ()
- data CairoFontStyle = CairoFontStyle {}
- defaultFontStyle :: CairoFontStyle
- setFontStyle :: CairoFontStyle -> CRender ()
- newtype CairoPointStyle = CairoPointStyle (Point -> CRender ())
- filledPolygon :: Double -> Int -> Bool -> Color -> CairoPointStyle
- hollowPolygon :: Double -> Double -> Int -> Bool -> Color -> CairoPointStyle
- filledCircles :: Double -> Color -> CairoPointStyle
- hollowCircles :: Double -> Double -> Color -> CairoPointStyle
- plusses :: Double -> Double -> Color -> CairoPointStyle
- exes :: Double -> Double -> Color -> CairoPointStyle
- stars :: Double -> Double -> Color -> CairoPointStyle
- data HTextAnchor
- = HTA_Left
- | HTA_Centre
- | HTA_Right
- data VTextAnchor
- = VTA_Top
- | VTA_Centre
- | VTA_Bottom
- | VTA_BaseLine
- drawText :: HTextAnchor -> VTextAnchor -> Point -> String -> CRender ()
- textSize :: String -> CRender RectSize
- newtype CRender a = DR (ReaderT CEnv Render a)
- data CEnv = CEnv {
- cenv_point_alignfn :: Point -> Point
- runCRender :: CRender a -> CEnv -> Render a
- c :: Render a -> CRender a
- line_width :: T CairoLineStyle Double
- line_color :: T CairoLineStyle Color
- line_dashes :: T CairoLineStyle ([] Double)
- line_cap :: T CairoLineStyle LineCap
- line_join :: T CairoLineStyle LineJoin
- font_name :: T CairoFontStyle String
- font_size :: T CairoFontStyle Double
- font_slant :: T CairoFontStyle FontSlant
- font_weight :: T CairoFontStyle FontWeight
- font_color :: T CairoFontStyle Color
Documentation
A rectangle is defined by two points
A point in two dimensions
mkrect :: Point -> Point -> Point -> Point -> RectSource
Create a rectangle based upon the coordinates of 4 points
type PointMapFn x y = (x, y) -> PointSource
a function mapping between points
preserveCState :: CRender a -> CRender aSource
Execute a rendering action in a saved context (ie bracketed between C.save and C.restore)
setClipRegion :: Point -> Point -> CRender ()Source
strokeLines :: [Point] -> CRender ()Source
stroke the lines between successive points
isValidNumber :: RealFloat a => a -> BoolSource
setSourceColor :: Color -> Render ()Source
data CairoLineStyle Source
Data type for the style of a line
Constructors
CairoLineStyle | |
Fields
|
Arguments
:: Double | width of line |
-> Color | |
-> CairoLineStyle |
Arguments
:: Double | width of line |
-> [Double] | the dash pattern in device coordinates |
-> Color | |
-> CairoLineStyle |
setLineStyle :: CairoLineStyle -> CRender ()Source
newtype CairoFillStyle Source
Abstract data type for a fill style
The contained Cairo action sets the required fill style in the Cairo rendering state.
Constructors
CairoFillStyle (CRender ()) |
setFillStyle :: CairoFillStyle -> CRender ()Source
data CairoFontStyle Source
Data type for a font
Constructors
CairoFontStyle | |
Fields
|
setFontStyle :: CairoFontStyle -> CRender ()Source
newtype CairoPointStyle Source
Abstract data type for the style of a plotted point
The contained Cairo action draws a point in the desired style, at the supplied device coordinates.
Constructors
CairoPointStyle (Point -> CRender ()) |
Arguments
:: Double | radius of circle |
-> Int | Number of vertices |
-> Bool | Is right-side-up? |
-> Color | |
-> CairoPointStyle |
Arguments
:: Double | radius of circle |
-> Color | colour |
-> CairoPointStyle |
Arguments
:: Double | radius of circle |
-> Double | thickness of line |
-> Color | |
-> CairoPointStyle |
Arguments
:: Double | radius of circle |
-> Double | thickness of line |
-> Color | |
-> CairoPointStyle |
Arguments
:: Double | radius of circle |
-> Double | thickness of line |
-> Color | |
-> CairoPointStyle |
data HTextAnchor Source
Constructors
HTA_Left | |
HTA_Centre | |
HTA_Right |
data VTextAnchor Source
Constructors
VTA_Top | |
VTA_Centre | |
VTA_Bottom | |
VTA_BaseLine |
drawText :: HTextAnchor -> VTextAnchor -> Point -> String -> CRender ()Source
Function to draw a textual label anchored by one of it's corners or edges.
textSize :: String -> CRender RectSizeSource
Return the bounding rectancgle for a text string rendered in the current context.
The reader monad containing context information to control the rendering process.
The environment present in the CRender Monad.
Constructors
CEnv | |
Fields
|
Instances
runCRender :: CRender a -> CEnv -> Render aSource
line_dashes :: T CairoLineStyle ([] Double)Source