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

Copyright(c) Tim Docker 2006 2014
LicenseBSD-style (see chart/COPYRIGHT)
Safe HaskellNone
LanguageHaskell98

Graphics.Rendering.Chart.Renderable

Description

This module contains the definition of the Renderable type, which is a composable drawing element, along with assorted functions to them.

Synopsis

Documentation

data Renderable a #

A Renderable is a record of functions required to layout a graphic element.

Constructors

Renderable 

Fields

Instances
Functor Renderable # 
Instance details

Defined in Graphics.Rendering.Chart.Renderable

Methods

fmap :: (a -> b) -> Renderable a -> Renderable b #

(<$) :: a -> Renderable b -> Renderable a #

ToRenderable (Renderable a) # 
Instance details

Defined in Graphics.Rendering.Chart.Renderable

class ToRenderable a where #

A type class abtracting the conversion of a value to a Renderable.

Methods

toRenderable :: a -> Renderable () #

Instances
ToRenderable Rectangle # 
Instance details

Defined in Graphics.Rendering.Chart.Renderable

ToRenderable SparkLine # 
Instance details

Defined in Graphics.Rendering.Chart.SparkLine

ToRenderable PieChart # 
Instance details

Defined in Graphics.Rendering.Chart.Plot.Pie

ToRenderable PieLayout # 
Instance details

Defined in Graphics.Rendering.Chart.Plot.Pie

ToRenderable (Renderable a) # 
Instance details

Defined in Graphics.Rendering.Chart.Renderable

ToRenderable a => ToRenderable (Grid a) # 
Instance details

Defined in Graphics.Rendering.Chart.Grid

Methods

toRenderable :: Grid a -> Renderable () #

Ord x => ToRenderable (StackedLayouts x) # 
Instance details

Defined in Graphics.Rendering.Chart.Layout

ToRenderable (Legend x y) # 
Instance details

Defined in Graphics.Rendering.Chart.Legend

Methods

toRenderable :: Legend x y -> Renderable () #

(Ord x, Ord y) => ToRenderable (Layout x y) # 
Instance details

Defined in Graphics.Rendering.Chart.Layout

Methods

toRenderable :: Layout x y -> Renderable () #

(Default a, ToRenderable a) => ToRenderable (EC a b) # 
Instance details

Defined in Graphics.Rendering.Chart.State

Methods

toRenderable :: EC a b -> Renderable () #

(Ord x, Ord yl, Ord yr) => ToRenderable (LayoutLR x yl yr) # 
Instance details

Defined in Graphics.Rendering.Chart.Layout

Methods

toRenderable :: LayoutLR x yl yr -> Renderable () #

type PickFn a = Point -> Maybe a #

A function that maps a point in device coordinates to some value.

Perhaps it might be generalised from Maybe a to (MonadPlus m ) => m a in the future.

drawRectangle :: Point -> Rectangle -> BackendProgram (PickFn a) #

Draw the specified rectangle such that its top-left vertex is placed at the given position

fillBackground :: FillStyle -> Renderable a -> Renderable a #

Overlay a renderable over a solid background fill.

addMargins #

Arguments

:: (Double, Double, Double, Double)

The spacing to be added.

-> Renderable a

The source renderable.

-> Renderable a 

Add some spacing at the edges of a renderable.

embedRenderable :: BackendProgram (Renderable a) -> Renderable a #

Helper function for using a renderable, when we generate it in the BackendProgram monad.

label :: FontStyle -> HTextAnchor -> VTextAnchor -> String -> Renderable String #

Construct a renderable from a text string, aligned with the axes.

rlabel :: FontStyle -> HTextAnchor -> VTextAnchor -> Double -> String -> Renderable String #

Construct a renderable from a text string, rotated wrt to axes. The angle of rotation is in degrees, measured clockwise from the horizontal.

spacer :: RectSize -> Renderable a #

Create a blank renderable with a specified minimum size.

spacer1 :: Renderable a -> Renderable b #

Create a blank renderable with a minimum size the same as some other renderable.

setPickFn :: PickFn b -> Renderable a -> Renderable b #

Replace the pick function of a renderable with another.

mapMaybePickFn :: (a -> Maybe b) -> Renderable a -> Renderable b #

Map a function over the result of a renderable's pickfunction, keeping only Just results.

mapPickFn :: (a -> b) -> Renderable a -> Renderable b #

Map a function over result of a renderable's pickfunction.