chart-svg-0.8.3.2: Charting library targetting SVGs.
Safe HaskellNone
LanguageGHC2021

Chart.Surface

Description

Surface chart combinators.

A common chart is to present a set of rectangles on the XY plane with colour representing values of the underlying data. This library uses the term surface chart but it is often referred to as a heatmap.

Synopsis

Documentation

data SurfaceData Source #

Main surface data elements

Constructors

SurfaceData 

Fields

Instances

Instances details
Data SurfaceData Source # 
Instance details

Defined in Chart.Surface

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SurfaceData -> c SurfaceData #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SurfaceData #

toConstr :: SurfaceData -> Constr #

dataTypeOf :: SurfaceData -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SurfaceData) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SurfaceData) #

gmapT :: (forall b. Data b => b -> b) -> SurfaceData -> SurfaceData #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SurfaceData -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SurfaceData -> r #

gmapQ :: (forall d. Data d => d -> u) -> SurfaceData -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SurfaceData -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SurfaceData -> m SurfaceData #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SurfaceData -> m SurfaceData #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SurfaceData -> m SurfaceData #

Generic SurfaceData Source # 
Instance details

Defined in Chart.Surface

Associated Types

type Rep SurfaceData 
Instance details

Defined in Chart.Surface

type Rep SurfaceData = D1 ('MetaData "SurfaceData" "Chart.Surface" "chart-svg-0.8.3.2-HqC5koQF24PBkrFlIP6qwR" 'False) (C1 ('MetaCons "SurfaceData" 'PrefixI 'True) (S1 ('MetaSel ('Just "surfaceRect") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Rect Double)) :*: S1 ('MetaSel ('Just "surfaceColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Colour)))
Show SurfaceData Source # 
Instance details

Defined in Chart.Surface

Eq SurfaceData Source # 
Instance details

Defined in Chart.Surface

type Rep SurfaceData Source # 
Instance details

Defined in Chart.Surface

type Rep SurfaceData = D1 ('MetaData "SurfaceData" "Chart.Surface" "chart-svg-0.8.3.2-HqC5koQF24PBkrFlIP6qwR" 'False) (C1 ('MetaCons "SurfaceData" 'PrefixI 'True) (S1 ('MetaSel ('Just "surfaceRect") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Rect Double)) :*: S1 ('MetaSel ('Just "surfaceColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Colour)))

data SurfaceOptions Source #

Options for a Surface chart.

Constructors

SurfaceOptions 

Fields

Instances

Instances details
Data SurfaceOptions Source # 
Instance details

Defined in Chart.Surface

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SurfaceOptions -> c SurfaceOptions #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SurfaceOptions #

toConstr :: SurfaceOptions -> Constr #

dataTypeOf :: SurfaceOptions -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SurfaceOptions) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SurfaceOptions) #

gmapT :: (forall b. Data b => b -> b) -> SurfaceOptions -> SurfaceOptions #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SurfaceOptions -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SurfaceOptions -> r #

gmapQ :: (forall d. Data d => d -> u) -> SurfaceOptions -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SurfaceOptions -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SurfaceOptions -> m SurfaceOptions #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SurfaceOptions -> m SurfaceOptions #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SurfaceOptions -> m SurfaceOptions #

Generic SurfaceOptions Source # 
Instance details

Defined in Chart.Surface

Associated Types

type Rep SurfaceOptions 
Instance details

Defined in Chart.Surface

type Rep SurfaceOptions = D1 ('MetaData "SurfaceOptions" "Chart.Surface" "chart-svg-0.8.3.2-HqC5koQF24PBkrFlIP6qwR" 'False) (C1 ('MetaCons "SurfaceOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "soStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SurfaceStyle) :*: (S1 ('MetaSel ('Just "soGrain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Point Int)) :*: S1 ('MetaSel ('Just "soRange") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Rect Double)))))
Show SurfaceOptions Source # 
Instance details

Defined in Chart.Surface

Eq SurfaceOptions Source # 
Instance details

Defined in Chart.Surface

type Rep SurfaceOptions Source # 
Instance details

Defined in Chart.Surface

type Rep SurfaceOptions = D1 ('MetaData "SurfaceOptions" "Chart.Surface" "chart-svg-0.8.3.2-HqC5koQF24PBkrFlIP6qwR" 'False) (C1 ('MetaCons "SurfaceOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "soStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SurfaceStyle) :*: (S1 ('MetaSel ('Just "soGrain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Point Int)) :*: S1 ('MetaSel ('Just "soRange") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Rect Double)))))

data SurfaceStyle Source #

A surface chart is a specialization of a RectChart

>>> defaultSurfaceStyle
SurfaceStyle {surfaceColors = [Colour 0.02 0.73 0.80 1.00,Colour 0.02 0.29 0.48 1.00], surfaceRectStyle = Style {size = 6.0e-2, borderSize = 0.0, color = Colour 0.05 0.05 0.05 1.00, borderColor = Colour 0.00 0.00 0.00 0.00, scaleP = NoScaleP, textAnchor = AnchorMiddle, rotation = Nothing, translate = Nothing, escapeText = EscapeText, frame = Nothing, lineCap = Nothing, lineJoin = Nothing, dasharray = Nothing, dashoffset = Nothing, hsize = 0.6, vsize = 1.1, vshift = -0.25, glyphShape = SquareGlyph}}

Constructors

SurfaceStyle 

Fields

Instances

Instances details
Data SurfaceStyle Source # 
Instance details

Defined in Chart.Surface

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SurfaceStyle -> c SurfaceStyle #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SurfaceStyle #

toConstr :: SurfaceStyle -> Constr #

dataTypeOf :: SurfaceStyle -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SurfaceStyle) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SurfaceStyle) #

gmapT :: (forall b. Data b => b -> b) -> SurfaceStyle -> SurfaceStyle #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SurfaceStyle -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SurfaceStyle -> r #

gmapQ :: (forall d. Data d => d -> u) -> SurfaceStyle -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SurfaceStyle -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SurfaceStyle -> m SurfaceStyle #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SurfaceStyle -> m SurfaceStyle #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SurfaceStyle -> m SurfaceStyle #

Generic SurfaceStyle Source # 
Instance details

Defined in Chart.Surface

Associated Types

type Rep SurfaceStyle 
Instance details

Defined in Chart.Surface

type Rep SurfaceStyle = D1 ('MetaData "SurfaceStyle" "Chart.Surface" "chart-svg-0.8.3.2-HqC5koQF24PBkrFlIP6qwR" 'False) (C1 ('MetaCons "SurfaceStyle" 'PrefixI 'True) (S1 ('MetaSel ('Just "surfaceColors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Colour]) :*: S1 ('MetaSel ('Just "surfaceRectStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style)))
Show SurfaceStyle Source # 
Instance details

Defined in Chart.Surface

Eq SurfaceStyle Source # 
Instance details

Defined in Chart.Surface

type Rep SurfaceStyle Source # 
Instance details

Defined in Chart.Surface

type Rep SurfaceStyle = D1 ('MetaData "SurfaceStyle" "Chart.Surface" "chart-svg-0.8.3.2-HqC5koQF24PBkrFlIP6qwR" 'False) (C1 ('MetaCons "SurfaceStyle" 'PrefixI 'True) (S1 ('MetaSel ('Just "surfaceColors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Colour]) :*: S1 ('MetaSel ('Just "surfaceRectStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style)))

defaultSurfaceStyle :: SurfaceStyle Source #

The official surface style.

mkSurfaceData :: (Point Double -> Double) -> Rect Double -> Grid (Rect Double) -> [Colour] -> ([SurfaceData], Range Double) Source #

Create surface data from a function on a Point

surfaces :: Style -> [SurfaceData] -> [Chart] Source #

surface chart without any hud trimmings

surfacef :: (Point Double -> Double) -> SurfaceOptions -> ([Chart], Range Double) Source #

Create a surface chart from a function.

data SurfaceLegendOptions Source #

Legend specialization for a surface chart.

Constructors

SurfaceLegendOptions 

Fields

Instances

Instances details
Data SurfaceLegendOptions Source # 
Instance details

Defined in Chart.Surface

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SurfaceLegendOptions -> c SurfaceLegendOptions #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SurfaceLegendOptions #

toConstr :: SurfaceLegendOptions -> Constr #

dataTypeOf :: SurfaceLegendOptions -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SurfaceLegendOptions) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SurfaceLegendOptions) #

gmapT :: (forall b. Data b => b -> b) -> SurfaceLegendOptions -> SurfaceLegendOptions #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SurfaceLegendOptions -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SurfaceLegendOptions -> r #

gmapQ :: (forall d. Data d => d -> u) -> SurfaceLegendOptions -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SurfaceLegendOptions -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SurfaceLegendOptions -> m SurfaceLegendOptions #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SurfaceLegendOptions -> m SurfaceLegendOptions #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SurfaceLegendOptions -> m SurfaceLegendOptions #

Generic SurfaceLegendOptions Source # 
Instance details

Defined in Chart.Surface

Associated Types

type Rep SurfaceLegendOptions 
Instance details

Defined in Chart.Surface

type Rep SurfaceLegendOptions = D1 ('MetaData "SurfaceLegendOptions" "Chart.Surface" "chart-svg-0.8.3.2-HqC5koQF24PBkrFlIP6qwR" 'False) (C1 ('MetaCons "SurfaceLegendOptions" 'PrefixI 'True) ((S1 ('MetaSel ('Just "sloAxisOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AxisOptions) :*: (S1 ('MetaSel ('Just "sloWidth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "sloResolution") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :*: (S1 ('MetaSel ('Just "sloDataRange") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Range Double)) :*: (S1 ('MetaSel ('Just "sloRect") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Rect Double)) :*: S1 ('MetaSel ('Just "sloSurfaceStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SurfaceStyle)))))
Show SurfaceLegendOptions Source # 
Instance details

Defined in Chart.Surface

Eq SurfaceLegendOptions Source # 
Instance details

Defined in Chart.Surface

type Rep SurfaceLegendOptions Source # 
Instance details

Defined in Chart.Surface

type Rep SurfaceLegendOptions = D1 ('MetaData "SurfaceLegendOptions" "Chart.Surface" "chart-svg-0.8.3.2-HqC5koQF24PBkrFlIP6qwR" 'False) (C1 ('MetaCons "SurfaceLegendOptions" 'PrefixI 'True) ((S1 ('MetaSel ('Just "sloAxisOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AxisOptions) :*: (S1 ('MetaSel ('Just "sloWidth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "sloResolution") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :*: (S1 ('MetaSel ('Just "sloDataRange") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Range Double)) :*: (S1 ('MetaSel ('Just "sloRect") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Rect Double)) :*: S1 ('MetaSel ('Just "sloSurfaceStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SurfaceStyle)))))

defaultSurfaceLegendOptions :: SurfaceLegendOptions Source #

official surface legend options

gridReferenceChart :: SurfaceLegendOptions -> ChartTree Source #

Chart used as a reference to a surface chart.

addSurfaceLegend :: SurfaceLegendOptions -> ChartTree -> ChartTree Source #

Add a surface legend to a main surface chart.