packages feed

chart-unit 0.6.0.2 → 0.6.1.0

raw patch · 12 files changed

+52/−55 lines, 12 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Chart.Arrow: [color] :: ArrowOptions -> AlphaColour Double
+ Chart.Arrow: [hStyle] :: ArrowOptions -> ArrowHTStyle Double
+ Chart.Arrow: [maxHeadLength] :: ArrowOptions -> Double
+ Chart.Arrow: [maxLength] :: ArrowOptions -> Double
+ Chart.Arrow: [maxStaffWidth] :: ArrowOptions -> Double
+ Chart.Arrow: [minHeadLength] :: ArrowOptions -> Double
+ Chart.Arrow: [minLength] :: ArrowOptions -> Double
+ Chart.Arrow: [minStaffWidth] :: ArrowOptions -> Double
+ Chart.Bar: [accumulateValues] :: BarOptions -> BarValueAcc
+ Chart.Bar: [displayValues] :: BarOptions -> Bool
+ Chart.Bar: [hudOptions] :: BarOptions -> HudOptions
+ Chart.Bar: [innerGap] :: BarOptions -> Double
+ Chart.Bar: [orientation] :: BarOptions -> Orientation
+ Chart.Bar: [outerGap] :: BarOptions -> Double
+ Chart.Bar: [rectOptions] :: BarOptions -> [RectOptions]
+ Chart.Glyph: [borderColor] :: GlyphOptions -> AlphaColour Double
+ Chart.Glyph: [borderSize] :: GlyphOptions -> Double
+ Chart.Glyph: [color] :: GlyphOptions -> AlphaColour Double
+ Chart.Glyph: [shape] :: GlyphOptions -> GlyphShape
+ Chart.Glyph: [size] :: GlyphOptions -> Double
+ Chart.Hud: [$sel:align:LegendOptions] :: LegendOptions -> AlignH
+ Chart.Hud: [$sel:align:TitleOptions] :: TitleOptions -> AlignH
+ Chart.Hud: [$sel:allowDiagonal:AutoOptions] :: AutoOptions -> Bool
+ Chart.Hud: [$sel:angledRatio:AutoOptions] :: AutoOptions -> Double
+ Chart.Hud: [$sel:axes:HudOptions] :: HudOptions -> [AxisOptions]
+ Chart.Hud: [$sel:canvas:HudOptions] :: HudOptions -> RectOptions
+ Chart.Hud: [$sel:canvasRect:LegendOptions] :: LegendOptions -> RectOptions
+ Chart.Hud: [$sel:chartType:LegendOptions] :: LegendOptions -> [(LegendType, Text)]
+ Chart.Hud: [$sel:gap:AxisOptions] :: AxisOptions -> Double
+ Chart.Hud: [$sel:gap:LegendOptions] :: LegendOptions -> Double
+ Chart.Hud: [$sel:gap:TitleOptions] :: TitleOptions -> Double
+ Chart.Hud: [$sel:gridLine:GridOptions] :: GridOptions -> LineOptions
+ Chart.Hud: [$sel:gridOrientation:GridOptions] :: GridOptions -> Orientation
+ Chart.Hud: [$sel:gridStyle:GridOptions] :: GridOptions -> GridStyle
+ Chart.Hud: [$sel:grids:HudOptions] :: HudOptions -> [GridOptions]
+ Chart.Hud: [$sel:innerPad:LegendOptions] :: LegendOptions -> Double
+ Chart.Hud: [$sel:innerSep:LegendOptions] :: LegendOptions -> Double
+ Chart.Hud: [$sel:label:AxisOptions] :: AxisOptions -> LabelOptions
+ Chart.Hud: [$sel:legends:HudOptions] :: HudOptions -> [LegendOptions]
+ Chart.Hud: [$sel:mark:AxisOptions] :: AxisOptions -> GlyphOptions
+ Chart.Hud: [$sel:markStart:AxisOptions] :: AxisOptions -> Double
+ Chart.Hud: [$sel:maxXRatio:AutoOptions] :: AutoOptions -> Double
+ Chart.Hud: [$sel:maxYRatio:AutoOptions] :: AutoOptions -> Double
+ Chart.Hud: [$sel:orientation:AxisOptions] :: AxisOptions -> Orientation
+ Chart.Hud: [$sel:outerPad:AxisOptions] :: AxisOptions -> Double
+ Chart.Hud: [$sel:outerPad:HudOptions] :: HudOptions -> Double
+ Chart.Hud: [$sel:place:AxisOptions] :: AxisOptions -> Place
+ Chart.Hud: [$sel:place:LegendOptions] :: LegendOptions -> Place
+ Chart.Hud: [$sel:place:TitleOptions] :: TitleOptions -> Place
+ Chart.Hud: [$sel:rect:AxisOptions] :: AxisOptions -> RectOptions
+ Chart.Hud: [$sel:rectHeight:AxisOptions] :: AxisOptions -> Double
+ Chart.Hud: [$sel:rowPad:LegendOptions] :: LegendOptions -> Double
+ Chart.Hud: [$sel:sep:LegendOptions] :: LegendOptions -> Double
+ Chart.Hud: [$sel:text:LegendOptions] :: LegendOptions -> TextOptions
+ Chart.Hud: [$sel:text:TitleOptions] :: TitleOptions -> TextOptions
+ Chart.Hud: [$sel:tickStyle:AxisOptions] :: AxisOptions -> TickStyle
+ Chart.Hud: [$sel:titles:HudOptions] :: HudOptions -> [(TitleOptions, Text)]
+ Chart.Line: [color] :: LineOptions -> AlphaColour Double
+ Chart.Line: [size] :: LineOptions -> Double
+ Chart.Rect: [borderColor] :: RectOptions -> AlphaColour Double
+ Chart.Rect: [borderSize] :: RectOptions -> Double
+ Chart.Rect: [color] :: RectOptions -> AlphaColour Double
+ Chart.Rect: [pixelationGradient] :: PixelationOptions -> Range (AlphaColour Double)
+ Chart.Rect: [pixelationGrain] :: PixelationOptions -> Pair Int
+ Chart.Svg: [$sel:attributes:SvgOptions] :: SvgOptions -> [Attribute]
+ Chart.Svg: [$sel:includeDocType:SvgOptions] :: SvgOptions -> Bool
+ Chart.Svg: [$sel:size:SvgOptions] :: SvgOptions -> Pair Double
+ Chart.Svg: [$sel:svgId:SvgOptions] :: SvgOptions -> Text
+ Chart.Text: [alignH] :: TextOptions -> AlignH
+ Chart.Text: [alignV] :: TextOptions -> AlignV
+ Chart.Text: [color] :: TextOptions -> AlphaColour Double
+ Chart.Text: [font] :: TextPathOptions -> TextFont
+ Chart.Text: [gap] :: LabelOptions -> Double
+ Chart.Text: [nudgeBottom] :: TextSvgOptions -> Double
+ Chart.Text: [nudgeMid] :: TextSvgOptions -> Double
+ Chart.Text: [nudgeSize] :: TextSvgOptions -> Double
+ Chart.Text: [nudgeTop] :: TextSvgOptions -> Double
+ Chart.Text: [orientation] :: LabelOptions -> Pair Double
+ Chart.Text: [rotation] :: TextOptions -> Double
+ Chart.Text: [size] :: TextOptions -> Double
+ Chart.Text: [textFillRule] :: TextOptions -> FillRule
+ Chart.Text: [textType] :: TextOptions -> TextType
+ Chart.Text: [text] :: LabelOptions -> TextOptions

Files

chart-unit.cabal view
@@ -5,10 +5,9 @@ -- hash: c39db1e3a55127346b3e41e1ba315b1d704563184f7b39b9a3885f64e76b4387  name:           chart-unit-version:        0.6.0.2+version:        0.6.1.0 synopsis:       Native haskell charts.-description:    .-                <<https://tonyday567.github.io/other/mainExample.svg>>+description:    <<https://tonyday567.github.io/other/mainExample.svg>>                 .                 chart-unit is a native haskell charting library designed:                 .@@ -16,7 +15,7 @@                 .                 - towards a minimalist look and feel                 .-                - to provide a set of default values that are robust across differet data and physical chart scales+                - to provide a set of default values that are robust across different data and physical chart scales                 .                 - around provision of a small but core set of chart types.                 .
examples/mainExample.hs view
@@ -7,7 +7,6 @@ import Chart import Control.Lens import Data.Generics.Labels()--- import qualified Diagrams.Prelude as D import NumHask.Prelude  ls :: [[Pair Double]]@@ -37,8 +36,8 @@     defYAxis   ]  -titles :: [(TitleOptions, Text)]-titles =+titles' :: [(TitleOptions, Text)]+titles' =   [ (def, "Example Chart")   , ( #align .~ AlignCenter $       #text . #rotation .~ 90 $@@ -54,8 +53,8 @@     , "bottom right, non-essential note")   ] -legends :: [(LegendType, Text)]-legends =+legends' :: [(LegendType, Text)]+legends' =   [(LegendText def, "legend")] <>   [(LegendPixel (blob ublue) 0.05, "pixel")] <>   [(LegendRect def 0.05, "rect")] <>@@ -74,10 +73,10 @@    sixbyfour    [ LineChart (zip lopts ls)    , HudChart $-     #titles .~ titles $+     #titles .~ titles' $      #axes .~ as $      #axes %~ map (#outerPad .~ 1) $-     #legends .~ [#chartType .~ legends $ def] $+     #legends .~ [#chartType .~ legends' $ def] $      def])  main :: IO ()
examples/sourceExamples.hs view
@@ -385,8 +385,8 @@        (#alignH .~ AlignLeft)) $       #gap .~ 0.0001 $ def -legends :: [(LegendType, Text)]-legends =+legends' :: [(LegendType, Text)]+legends' =   [(LegendText def, "legend")] <> [(LegendPixel (blob ublue) 0.05, "pixel")] <>     -- [ (LegendArrow (def & #minStaffWidth .~ 0.01 & #minHeadLength .~ 0.03) 0.05, "arrow")] <>   [(LegendRect def 0.05, "rect")] <>@@ -398,7 +398,7 @@     ["short", "much longer name", "line 3"]  legendExample :: Chart b-legendExample = legend $ #chartType .~ legends $ def+legendExample = legend $ #chartType .~ legends' $ def  -- * Chart.Bar examples barExample :: Chart b
src/Chart.hs view
@@ -77,8 +77,8 @@ -- -- Using data-default, lens and OverloadedLabels tends to encourage a vertical style, which may annoy line counters, but lead to clear code and ease of editing. ----- > titles :: [(TitleOptions, Text)]--- > titles =+-- > titles' :: [(TitleOptions, Text)]+-- > titles' = -- >   [ (def, "Example Chart") -- >   , ( #align .~ AlignCenter $ -- >       #text . #rotation .~ 90 $@@ -94,8 +94,8 @@ -- >     , "bottom right, non-essential note") -- >   ] -- > --- > legends :: [(LegendType, Text)]--- > legends =+-- > legends' :: [(LegendType, Text)]+-- > legends' = -- >   [(LegendText def, "legend")] <> -- >   [(LegendPixel (blob ublue) 0.05, "pixel")] <> -- >   [(LegendRect def 0.05, "rect")] <>@@ -113,10 +113,10 @@ -- > mainExample = withHud_ opts sixbyfour (lineChart lopts) ls -- >   where -- >     opts =--- >       #titles .~ titles $+-- >       #titles .~ titles' $ -- >       #axes .~ as $ -- >       #axes %~ map (#outerPad .~ 1) $--- >       #legends .~ [#chartType .~ legends $ def] $+-- >       #legends .~ [#chartType .~ legends' $ def] $ -- >       def -- >  -- > main :: IO ()@@ -171,17 +171,17 @@   ) where  import Chart.ADT-import Chart.Arrow-import Chart.Bar+import Chart.Arrow hiding (color)+import Chart.Bar hiding (orientation) import Chart.Core import Chart.Data import Chart.Data.Time-import Chart.Glyph+import Chart.Glyph hiding (color, size, borderSize, borderColor) import Chart.Hud-import Chart.Line-import Chart.Rect+import Chart.Line hiding (color)+import Chart.Rect hiding (borderSize, borderColor) import Chart.Svg-import Chart.Text+import Chart.Text hiding (orientation, size, color) import Data.Colour import Data.Colour.Names import Data.Colour.Palette.ColorSet
src/Chart/Arrow.hs view
@@ -4,7 +4,7 @@ module Chart.Arrow   ( Arrow(..)   , ArrowHTStyle(..)-  , ArrowOptions(ArrowOptions)+  , ArrowOptions(..)   , normArrows   , arrows   , arrowChart
src/Chart/Bar.hs view
@@ -10,7 +10,7 @@  -- | bar charts module Chart.Bar-  ( BarOptions(BarOptions)+  ( BarOptions(..)   , BarValueAcc(..)   , BarData(..)   , barDataLowerUpper
src/Chart/Glyph.hs view
@@ -3,7 +3,7 @@  -- | Glyphs are (typically) small shapes symbolically representing a data point. module Chart.Glyph-  ( GlyphOptions(GlyphOptions)+  ( GlyphOptions(..)   , GlyphShape(..)   , glyphShape   , glyph_
src/Chart/Hud.hs view
@@ -11,7 +11,7 @@ -- | Hud (Heads up display) is a collective noun for axes, titles & legends -- module Chart.Hud-  ( HudOptions(HudOptions)+  ( HudOptions(..)   , hud   , withHud   , withHud_@@ -19,21 +19,21 @@   , placeGap   , TickStyle(..)   , precision-  , AxisOptions(AxisOptions)+  , AxisOptions(..)   , defXAxis   , defYAxis   , axis-  , AutoOptions(AutoOptions)+  , AutoOptions(..)   , adjustAxis   , axisSane   , computeTicks-  , TitleOptions(TitleOptions)+  , TitleOptions(..)   , title   , LegendType(..)-  , LegendOptions(LegendOptions)+  , LegendOptions(..)   , legend   , GridStyle(..)-  , GridOptions(GridOptions)+  , GridOptions(..)   , GridPos(..)   , gridPos   , defXGrid@@ -44,7 +44,7 @@ import Chart.Arrow import Chart.Core import Chart.Glyph-import Chart.Line (LineOptions(LineOptions), lines, oneline)+import Chart.Line (LineOptions(..), lines, oneline) import Chart.Rect import Chart.Text import qualified Control.Foldl as L@@ -460,8 +460,8 @@  -- | Create a legend based on a LegendOptions ----- > legends :: [(LegendType, Text)]--- > legends =+-- > legends' :: [(LegendType, Text)]+-- > legends' = -- >   [(LegendText def, "legend")] <> [(LegendPixel (blob ublue) 0.05, "pixel")] <> -- >     -- [ (LegendArrow (def & #minStaffWidth .~ 0.01 & #minHeadLength .~ 0.03) 0.05, "arrow")] <> -- >   [(LegendRect def 0.05, "rect")] <>@@ -473,7 +473,7 @@ -- >     ["short", "much longer name", "line 3"] -- >  -- > legendExample :: Chart b--- > legendExample = legend $ #chartType .~ legends $ def+-- > legendExample = legend $ #chartType .~ legends' $ def -- -- ![legend example](other/legendExample.svg) --
src/Chart/Line.hs view
@@ -7,7 +7,7 @@  -- | Points on a chart connected by lines. module Chart.Line-  ( LineOptions(LineOptions)+  ( LineOptions(..)   , oneline   , lines   , glines
src/Chart/Rect.hs view
@@ -7,7 +7,7 @@  -- | rectangular chart elements module Chart.Rect-  ( RectOptions(RectOptions)+  ( RectOptions(..)   , blob   , box   , clear@@ -21,7 +21,7 @@   , pixels   , pixelChart   , pixelChart_-  , PixelationOptions(PixelationOptions)+  , PixelationOptions(..)   , pixelate   , pixelateChart   ) where
src/Chart/Svg.hs view
@@ -6,7 +6,7 @@  -- | Svg rendering module Chart.Svg-  ( SvgOptions(SvgOptions)+  ( SvgOptions(..)   , renderSvg   , toText   , toFile
src/Chart/Text.hs view
@@ -4,9 +4,9 @@  -- | textual chart elements module Chart.Text-  ( TextOptions(TextOptions)-  , TextPathOptions(TextPathOptions)-  , TextSvgOptions(TextSvgOptions)+  ( TextOptions(..)+  , TextPathOptions(..)+  , TextSvgOptions(..)   , TextType(..)   , TextFont(..)   , textFont@@ -14,7 +14,7 @@   , texts   , textChart   , textChart_-  , LabelOptions(LabelOptions)+  , LabelOptions(..)   , labelled   ) where @@ -29,7 +29,6 @@ import NumHask.Prelude hiding (rotate) import NumHask.Rect - -- | options specific to text as an SVG path newtype TextPathOptions = TextPathOptions   { font :: TextFont@@ -57,13 +56,13 @@  -- | text options data TextOptions = TextOptions-  { size :: Double-  , alignH :: AlignH-  , alignV :: AlignV-  , color :: AlphaColour Double-  , textFillRule :: FillRule-  , rotation :: Double-  , textType :: TextType+  { size :: Double  -- ^ size as ratio to overall chart size (default: 0.08)+  , alignH :: AlignH -- ^ horizontal alignment (default: 'AlignCenter')+  , alignV :: AlignV -- ^ vertical alignment (default: 'AlignMid')+  , color :: AlphaColour Double -- ^ default: greyish+  , textFillRule :: FillRule -- ^ default: 'EvenOdd'+  , rotation :: Double -- ^ in degrees from the horozontal (default: 0 degrees)+  , textType :: TextType -- ^ default: 'TextPath' def   } deriving (Show, Generic)  instance Default TextOptions where