timeplot 1.0.22 → 1.0.23
raw patch · 5 files changed
+21/−19 lines, 5 files
Files
- Tools/TimePlot.hs +6/−5
- Tools/TimePlot/Conf.hs +2/−2
- Tools/TimePlot/Render.hs +8/−9
- Tools/TimePlot/Types.hs +4/−2
- timeplot.cabal +1/−1
Tools/TimePlot.hs view
@@ -234,12 +234,13 @@ when (null args || args == ["--version"]) $ do putStrLn ("This is timeplot-" ++ showVersion version ++ " (git " ++ showGitVersion ++ ")") >> exitSuccess let !conf = readConf args- let render = case (outFormat conf) of {- PNG -> \c w h f -> const () `fmap` renderableToPNGFile c w h f;- PDF -> renderableToPDFFile ;- PS -> renderableToPSFile ;- SVG -> renderableToSVGFile ;+ let format = case outFormat conf of {+ OutPNG -> PNG+ ; OutPDF -> PDF+ ; OutPS -> PS+ ; OutSVG -> SVG }+ let render r w h f = renderableToFile (fo_size .~ (w, h) $ fo_format .~ format $ def) r f case conf of ConcreteConf { parseTime=parseTime, inFile=inFile, chartKindF=chartKindF,
Tools/TimePlot/Conf.hs view
@@ -68,8 +68,8 @@ where inFile = single "input file" "-if" (error "No input file (-if) specified") outFile = single "output file" "-o" (error "No output file (-o) specified") - outFormat = maybe PNG id $ lookup (single "output format" "-of" (name2format outFile)) $ - [("png",PNG), ("pdf",PDF), ("ps",PS), ("svg",SVG)] + outFormat = maybe OutPNG id $ lookup (single "output format" "-of" (name2format outFile)) $ + [("png",OutPNG), ("pdf",OutPDF), ("ps",OutPS), ("svg",OutSVG)] where name2format = reverse . takeWhile (/='.') . reverse outRes = parseRes $ single "output resolution" "-or" "640x480"
Tools/TimePlot/Render.hs view
@@ -58,16 +58,15 @@ | color <- dotsColors p | vs <- dotsData p] -layoutWithTitle :: (PlotValue a, Show a) => AxisData LocalTime -> [Plot LocalTime a] -> String -> Bool -> Layout1 LocalTime a +layoutWithTitle :: (PlotValue a, Show a) => AxisData LocalTime -> [Plot LocalTime a] -> String -> Bool -> Layout LocalTime a layoutWithTitle commonTimeAxis plots name showLegend = - layout1_title .~ "" $ - layout1_plots .~ map Left plots $ - (if showLegend then id else (layout1_legend .~ Nothing)) $ - layout1_bottom_axis . laxis_generate .~ (\_ -> commonTimeAxis) $ - layout1_top_axis . laxis_generate .~ (\_ -> commonTimeAxis) $ - layout1_left_axis . laxis_title .~ name $ - layout1_margin .~ 0 $ - layout1_grid_last .~ True $ + layout_title .~ "" $ + layout_plots .~ plots $ + (if showLegend then id else (layout_legend .~ Nothing)) $ + layout_x_axis . laxis_generate .~ (\_ -> commonTimeAxis) $ + layout_y_axis . laxis_title .~ name $ + layout_margin .~ 0 $ + layout_grid_last .~ True $ def ourPlotBars :: (BarsPlotValue a) => PlotBars LocalTime a
Tools/TimePlot/Types.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE CPP, TypeFamilies, BangPatterns #-} module Tools.TimePlot.Types where +import Data.Default import Data.Time hiding (parseTime) import qualified Data.ByteString.Char8 as S import Graphics.Rendering.Chart @@ -20,7 +21,8 @@ _axis_tropweiv = \_ _ -> Status "" "", _axis_ticks = [(Status "" "", 0)], _axis_labels = [[(Status "" "", "")]], - _axis_grid = [] + _axis_grid = [], + _axis_visibility = def } data Edge = Rise | Fall | Pulse Status | SetTo Status deriving (Eq,Show) @@ -30,7 +32,7 @@ | InAtom {evt_track :: S.ByteString, evt_atom :: S.ByteString} deriving (Show) -data OutFormat = PNG | PDF | PS | SVG +data OutFormat = OutPNG | OutPDF | OutPS | OutSVG #ifdef HAVE_GTK | Window #endif
timeplot.cabal view
@@ -1,5 +1,5 @@ name: timeplot-version: 1.0.22+version: 1.0.23 cabal-version: >=1.6 build-type: Simple license: BSD3