Chart-1.5.4: A library for generating 2D Charts and Plots

Copyright | (c) Tim Docker 2014
License | BSD-style (see chart/COPYRIGHT)
Safe Haskell | None
Language | Haskell98

Graphics.Rendering.Chart.Backend.Types

Description

Synopsis

- data LineCap
  - = LineCapButt
  - | LineCapRound
  - | LineCapSquare
- data LineJoin
  - = LineJoinMiter
  - | LineJoinRound
  - | LineJoinBevel
- data LineStyle = LineStyle {
  - _line_width :: Double
  - _line_color :: AlphaColour Double
  - _line_dashes :: [Double]
  - _line_cap :: LineCap
  - _line_join :: LineJoin
  }
- data FontSlant
  - = FontSlantNormal
  - | FontSlantItalic
  - | FontSlantOblique
- data FontWeight
  - = FontWeightNormal
  - | FontWeightBold
- data FontStyle = FontStyle {
  - _font_name :: String
  - _font_size :: Double
  - _font_slant :: FontSlant
  - _font_weight :: FontWeight
  - _font_color :: AlphaColour Double
  }
- data HTextAnchor
  - = HTA_Left
  - | HTA_Centre
  - | HTA_Right
- data VTextAnchor
  - = VTA_Top
  - | VTA_Centre
  - | VTA_Bottom
  - | VTA_BaseLine
- data TextSize = TextSize {
  - textSizeWidth :: Double
  - textSizeAscent :: Double
  - textSizeDescent :: Double
  - textSizeYBearing :: Double
  - textSizeHeight :: Double
  }
- newtype FillStyle = FillStyleSolid {
  - _fill_color :: AlphaColour Double
  }
- type AlignmentFn = Point -> Point
- data AlignmentFns = AlignmentFns {
  - afPointAlignFn :: AlignmentFn
  - afCoordAlignFn :: AlignmentFn
  }
- bitmapAlignmentFns :: AlignmentFns
- vectorAlignmentFns :: AlignmentFns
- line_width :: Lens' LineStyle Double
- line_join :: Lens' LineStyle LineJoin
- line_dashes :: Lens' LineStyle [Double]
- line_color :: Lens' LineStyle (AlphaColour Double)
- line_cap :: Lens' LineStyle LineCap
- font_weight :: Lens' FontStyle FontWeight
- font_slant :: Lens' FontStyle FontSlant
- font_size :: Lens' FontStyle Double
- font_name :: Lens' FontStyle String
- font_color :: Lens' FontStyle (AlphaColour Double)
- fill_color :: Iso' FillStyle (AlphaColour Double)

# Documentation

data LineCap Source

The different supported line ends.

Constructors

LineCapButt | Just cut the line straight.
LineCapRound | Make a rounded line end.
LineCapSquare | Make a square that ends the line.

Instances

Eq LineCap Source |
Ord LineCap Source |
Show LineCap Source |

data LineJoin Source

The different supported ways to join line ends.

Constructors

LineJoinMiter | Extends the outline until they meet each other.
LineJoinRound | Draw a circle fragment to connet line end.
LineJoinBevel | Like miter, but cuts it off if a certain threshold is exceeded.

Instances

Eq LineJoin Source |
Ord LineJoin Source |
Show LineJoin Source |

data LineStyle Source

Data type for the style of a line.

Constructors

LineStyle |

Fields

_line_width :: Double

  The thickness of a line in device units.

_line_color :: AlphaColour Double

  The color of a line.

_line_dashes :: [Double]

  The dash pattern. Every value at a even index gives a dash width and every value at a odd index gives a gap width in device units.

_line_cap :: LineCap

  How to end a line.

_line_join :: LineJoin

  How to connect two lines.

Instances

Eq LineStyle Source |
Show LineStyle Source |
Default LineStyle Source | The default line style.

data FontSlant Source

The possible slants of a font.

Constructors

FontSlantNormal | Normal font style without slant.
FontSlantItalic | With a slight slant.
FontSlantOblique | With a greater slant.

Instances

Eq FontSlant Source |
Ord FontSlant Source |
Show FontSlant Source |
Default FontSlant Source | The default font slant.

data FontWeight Source

The possible weights of a font.

Constructors

FontWeightNormal | Normal font style without weight.
FontWeightBold | Bold font.

Instances

Eq FontWeight Source |
Ord FontWeight Source |
Show FontWeight Source |
Default FontWeight Source | The default font weight.

data FontStyle Source

Data type for a font.

Constructors

FontStyle |

Fields

_font_name :: String

  The font family or font face to use.

_font_size :: Double

  The height of the rendered font in device coordinates.

_font_slant :: FontSlant

  The slant to render with.

_font_weight :: FontWeight

  The weight to render with.

_font_color :: AlphaColour Double

  The color to render text with.

Instances

Eq FontStyle Source |
Show FontStyle Source |
Default FontStyle Source | The default font style.

data HTextAnchor Source

Possible horizontal anchor points for text.

Constructors

HTA_Left |
HTA_Centre |
HTA_Right |

Instances

Eq HTextAnchor Source |
Ord HTextAnchor Source |
Show HTextAnchor Source |

data VTextAnchor Source

Possible vertical anchor points for text.

Constructors

VTA_Top |
VTA_Centre |
VTA_Bottom |
VTA_BaseLine |

Instances

Eq VTextAnchor Source |
Ord VTextAnchor Source |
Show VTextAnchor Source |

data TextSize Source

Text metrics returned by `textSize`.

Constructors

TextSize |

Fields

textSizeWidth :: Double

  The total width of the text.

textSizeAscent :: Double

  The ascent or space above the baseline.

textSizeDescent :: Double

  The decent or space below the baseline.

textSizeYBearing :: Double

  The Y bearing.

textSizeHeight :: Double

  The total height of the text.

Instances

Eq TextSize Source |
Show TextSize Source |

newtype FillStyle Source

Abstract data type for a fill style.

The contained action sets the required fill style in the rendering state.

Constructors

FillStyleSolid |

Fields

_fill_color :: AlphaColour Double

Instances

Eq FillStyle Source |
Show FillStyle Source |
Default FillStyle Source | The default fill style.

type AlignmentFn = Point -> Point Source

A function to align points for a certain rendering device.

data AlignmentFns Source

Holds the point and coordinate alignment function.

Constructors

AlignmentFns |

Fields

afPointAlignFn :: AlignmentFn

  An adjustment applied immediately prior to points being displayed in device coordinates.

  When device coordinates correspond to pixels, a cleaner image is created if this transform rounds to the nearest pixel. With higher-resolution output, this transform can just be the identity function.

  This is usually used to align prior to stroking.

afCoordAlignFn :: AlignmentFn

  The adjustment applied immediately prior to coordinates being transformed.

  This is usually used to align prior to filling.

bitmapAlignmentFns :: AlignmentFns Source

Alignment to render on raster based graphics.

vectorAlignmentFns :: AlignmentFns Source

Alignment to render on vector based graphics.

line_width :: Lens' LineStyle Double Source

line_join :: Lens' LineStyle LineJoin Source

line_dashes :: Lens' LineStyle [Double] Source

line_color :: Lens' LineStyle (AlphaColour Double) Source

line_cap :: Lens' LineStyle LineCap Source

font_weight :: Lens' FontStyle FontWeight Source

font_slant :: Lens' FontStyle FontSlant Source

font_size :: Lens' FontStyle Double Source

font_name :: Lens' FontStyle String Source

font_color :: Lens' FontStyle (AlphaColour Double) Source

fill_color :: Iso' FillStyle (AlphaColour Double) Source