Plot-ho-matic 0.12.2.0 → 0.12.2.1
raw patch · 2 files changed
+8/−2 lines, 2 filesdep +colourPVP ok
version bump matches the API change (PVP)
Dependencies added: colour
API changes (from Hackage documentation)
Files
- Plot-ho-matic.cabal +2/−1
- src/PlotHo/ChartRender.hs +6/−1
Plot-ho-matic.cabal view
@@ -1,5 +1,5 @@ name: Plot-ho-matic-version: 0.12.2.0+version: 0.12.2.1 synopsis: Real-time line plotter for generic data license: BSD3 license-file: LICENSE@@ -42,6 +42,7 @@ , cereal , Chart >= 1.1 , Chart-cairo >= 1.1+ , colour , containers , data-default-class , generic-accessors >= 0.6.2.0
src/PlotHo/ChartRender.hs view
@@ -7,6 +7,8 @@ import Control.Lens ( (.~) ) import Control.Monad ( void )+import qualified Data.Colour as Colour+import Data.Colour.Names as Colour import Data.Default.Class ( def ) import qualified Graphics.Rendering.Chart as Chart import Graphics.Rendering.Chart.Backend.Cairo ( runBackend, defaultEnv )@@ -14,6 +16,9 @@ import PlotHo.PlotTypes (Axes(..), AxisType(..), XY(..)) +colorSeq :: [Colour.AlphaColour Double]+colorSeq = cycle $ map Colour.opaque [Colour.blue, Colour.red, Colour.green, Colour.cyan, Colour.magenta]+ -- take the data and use Chart to make a Renderable () toChartRender :: forall a . (Chart.PlotValue a, Show a, RealFloat a)@@ -39,7 +44,7 @@ $ Chart.plot_lines_title .~ name $ def allLines :: [Chart.PlotLines a a]- allLines = zipWith drawOne namePcs Chart.defaultColorSeq+ allLines = zipWith drawOne namePcs colorSeq xscaleFun :: Chart.Layout a a -> Chart.Layout a a xscaleFun = case xtype of