Safe Haskell | None |
---|---|
Language | GHC2024 |
Prettychart.Charts
Description
Various common (& pretty) chart patterns.
Synopsis
- data UtcAxisStyle = UtcAxisStyle {}
- defaultUtcAxisStyle :: UtcAxisStyle
- utcAxis :: UtcAxisStyle -> [UTCTime] -> AxisOptions
- data DecileAxisStyle = DecileAxisStyle {}
- defaultDecileAxisStyle :: DecileAxisStyle
- qsAxisStyle :: [Double] -> DecileAxisStyle
- decileAxis :: DecileAxisStyle -> AxisOptions
- data DigitChartStyle = DigitChartStyle {}
- defaultDigitChartStyle :: DigitChartStyle
- digitChart :: DigitChartStyle -> [UTCTime] -> [Int] -> ChartOptions
- data UtcLineChartStyle = UtcLineChartStyle {}
- defaultUtcLineChartStyle :: UtcLineChartStyle
- utcLineChart :: UtcLineChartStyle -> [Text] -> [(UTCTime, [Double])] -> ChartOptions
- data CountChartStyle = CountChartStyle {}
- defaultCountChartStyle :: CountChartStyle
- countChart :: CountChartStyle -> [Text] -> [Int] -> ChartOptions
- simpleRectChart :: [Double] -> Style -> ChartOptions
- simpleLineChart :: Double -> Colour -> [Double] -> Chart
- simpleScatterChart :: Double -> Colour -> [Double] -> Chart
- xify :: [Double] -> [Point Double]
- yify :: [Double] -> [Point Double]
- titles3 :: Double -> (Text, Text, Text) -> [Priority TitleOptions]
- histChart :: Range Double -> Int -> [Double] -> ChartOptions
- hhistChart :: Range Double -> Int -> [Double] -> ChartOptions
- hhistCharts :: Range Double -> Int -> [(Style, [Double])] -> ChartOptions
- scatterChart :: [[Point Double]] -> [Chart]
- blendMidLineStyles :: Int -> Double -> (Colour, Colour) -> [Style]
- quantileNames :: Functor f => f Double -> f Text
- quantileChart :: [Text] -> [Style] -> [[Double]] -> ChartOptions
- quantileHistChart :: Maybe [Text] -> [Double] -> [Double] -> ChartOptions
- digitSurfaceChart :: SurfaceStyle -> SurfaceLegendOptions -> (Text, Text, Text) -> [Text] -> [(Int, Int)] -> ChartTree
Documentation
data UtcAxisStyle Source #
UTC (time) axis style
Constructors
UtcAxisStyle | |
Instances
defaultUtcAxisStyle :: UtcAxisStyle Source #
default UTC (time) axis style
utcAxis :: UtcAxisStyle -> [UTCTime] -> AxisOptions Source #
Create a hud that has time as the x-axis based on supplied UTCTime list.
data DecileAxisStyle Source #
Decile (quantile) axis style
Constructors
DecileAxisStyle | |
Instances
Generic DecileAxisStyle Source # | |||||
Defined in Prettychart.Charts Associated Types
Methods from :: DecileAxisStyle -> Rep DecileAxisStyle x # to :: Rep DecileAxisStyle x -> DecileAxisStyle # | |||||
type Rep DecileAxisStyle Source # | |||||
Defined in Prettychart.Charts type Rep DecileAxisStyle = D1 ('MetaData "DecileAxisStyle" "Prettychart.Charts" "prettychart-0.3.0.2-3z77oWwHmNC4t46yDJCipA" 'False) (C1 ('MetaCons "DecileAxisStyle" 'PrefixI 'True) (S1 ('MetaSel ('Just "size") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "labels") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text]))) |
defaultDecileAxisStyle :: DecileAxisStyle Source #
Default decile (quantile) axis style
qsAxisStyle :: [Double] -> DecileAxisStyle Source #
Convert a list of quantiles to DecileAxisStyle
decileAxis :: DecileAxisStyle -> AxisOptions Source #
Create an axis from a style.
data DigitChartStyle Source #
Chart style for a digit chart
Constructors
DigitChartStyle | |
Fields |
Instances
Generic DigitChartStyle Source # | |||||
Defined in Prettychart.Charts Associated Types
Methods from :: DigitChartStyle -> Rep DigitChartStyle x # to :: Rep DigitChartStyle x -> DigitChartStyle # | |||||
type Rep DigitChartStyle Source # | |||||
Defined in Prettychart.Charts type Rep DigitChartStyle = D1 ('MetaData "DigitChartStyle" "Prettychart.Charts" "prettychart-0.3.0.2-3z77oWwHmNC4t46yDJCipA" 'False) (C1 ('MetaCons "DigitChartStyle" 'PrefixI 'True) ((S1 ('MetaSel ('Just "utcAxisStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe UtcAxisStyle)) :*: S1 ('MetaSel ('Just "decileAxisStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe DecileAxisStyle))) :*: (S1 ('MetaSel ('Just "glyphStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Just "hasLegend") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) |
defaultDigitChartStyle :: DigitChartStyle Source #
Default chart style for a digit chart
digitChart :: DigitChartStyle -> [UTCTime] -> [Int] -> ChartOptions Source #
A chart drawing a (quantiled or digitized) time series
data UtcLineChartStyle Source #
Style of a UTC line chart.
Constructors
UtcLineChartStyle | |
Fields |
Instances
Generic UtcLineChartStyle Source # | |||||
Defined in Prettychart.Charts Associated Types
Methods from :: UtcLineChartStyle -> Rep UtcLineChartStyle x # to :: Rep UtcLineChartStyle x -> UtcLineChartStyle # | |||||
type Rep UtcLineChartStyle Source # | |||||
Defined in Prettychart.Charts type Rep UtcLineChartStyle = D1 ('MetaData "UtcLineChartStyle" "Prettychart.Charts" "prettychart-0.3.0.2-3z77oWwHmNC4t46yDJCipA" 'False) (C1 ('MetaCons "UtcLineChartStyle" 'PrefixI 'True) ((S1 ('MetaSel ('Just "lineStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Just "utcAxisStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe UtcAxisStyle))) :*: (S1 ('MetaSel ('Just "yAxisStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AxisOptions)) :*: S1 ('MetaSel ('Just "legendStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe LegendOptions))))) |
defaultUtcLineChartStyle :: UtcLineChartStyle Source #
Default style of a UTC line chart.
utcLineChart :: UtcLineChartStyle -> [Text] -> [(UTCTime, [Double])] -> ChartOptions Source #
Line chart for a UTC time series.
data CountChartStyle Source #
countChart style
Constructors
CountChartStyle | |
Fields
|
Instances
Generic CountChartStyle Source # | |||||
Defined in Prettychart.Charts Associated Types
Methods from :: CountChartStyle -> Rep CountChartStyle x # to :: Rep CountChartStyle x -> CountChartStyle # | |||||
type Rep CountChartStyle Source # | |||||
Defined in Prettychart.Charts type Rep CountChartStyle = D1 ('MetaData "CountChartStyle" "Prettychart.Charts" "prettychart-0.3.0.2-3z77oWwHmNC4t46yDJCipA" 'False) (C1 ('MetaCons "CountChartStyle" 'PrefixI 'True) (S1 ('MetaSel ('Just "title") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "titleColour") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Colour) :*: S1 ('MetaSel ('Just "legendStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe LegendOptions))))) |
defaultCountChartStyle :: CountChartStyle Source #
Default CountChart style
countChart :: CountChartStyle -> [Text] -> [Int] -> ChartOptions Source #
Count chart
simpleRectChart :: [Double] -> Style -> ChartOptions Source #
Simple Rect chart
simpleLineChart :: Double -> Colour -> [Double] -> Chart Source #
interpret a [Double] as a line with x coordinates of [0..]
simpleScatterChart :: Double -> Colour -> [Double] -> Chart Source #
interpret a [Double] as a scatter chart with x coordinates of [0..]
xify :: [Double] -> [Point Double] Source #
convert from [a] to [Point a], by adding the index as the x axis
>>>
xify [1..3]
[Point 0.0 1.0,Point 1.0 2.0,Point 2.0 3.0]
yify :: [Double] -> [Point Double] Source #
convert from [a] to [Point a], by adding the index as the y axis
>>>
yify [1..3]
[Point 1.0 0.0,Point 2.0 1.0,Point 3.0 2.0]
titles3 :: Double -> (Text, Text, Text) -> [Priority TitleOptions] Source #
common pattern of chart title, x-axis title and y-axis title
hhistChart :: Range Double -> Int -> [Double] -> ChartOptions Source #
horizontal histogram chart
hhistCharts :: Range Double -> Int -> [(Style, [Double])] -> ChartOptions Source #
horizontal histogram chart
blendMidLineStyles :: Int -> Double -> (Colour, Colour) -> [Style] Source #
blendMidLineStyle n w
produces n lines of width w interpolated between two colors.
quantileNames :: Functor f => f Double -> f Text Source #
Format quantile-style numbers
>>>
quantileNames [0.01, 0.5, 0.99]
["1.0%","50%","99%"]
quantileChart :: [Text] -> [Style] -> [[Double]] -> ChartOptions Source #
Chart template for quantiles.
Arguments
:: Maybe [Text] | quantile names |
-> [Double] | quantiles |
-> [Double] | quantile values |
-> ChartOptions |
A histogram based on quantile information
digitSurfaceChart :: SurfaceStyle -> SurfaceLegendOptions -> (Text, Text, Text) -> [Text] -> [(Int, Int)] -> ChartTree Source #
Surface chart of quantile vs quantile counts