timeplot 1.0.18 → 1.0.19
raw patch · 3 files changed
+11/−13 lines, 3 files
Files
- Tools/TimePlot/Plots.hs +10/−4
- Tools/TimePlot/Render.hs +0/−8
- timeplot.cabal +1/−1
Tools/TimePlot/Plots.hs view
@@ -122,14 +122,20 @@ (\tfs -> plotTrackBars tfs binTitles name colors) <$> I.collect where - binTitles = [low]++[show v1++".."++show v2 + binTitles = [low]++[showDt v1++".."++showDt v2 | v1 <- valueBinBounds | v2 <- tail valueBinBounds]++ [high] where - low = "<"++show (head valueBinBounds) - high = ">"++show (last valueBinBounds) + low = "<"++showDt (head valueBinBounds) + high = ">"++showDt (last valueBinBounds) +-- 0.1s but 90ms, etc. +showDt t | t < 0.0000001 = show (t*1000000000) ++ "ns" + | t < 0.0001 = show (t*1000000) ++ "us" + | t < 0.1 = show (t*1000) ++ "ms" + | True = show t ++ "s" + genBinHist :: NominalDiffTime -> [Double] -> PlotGen genBinFreqs :: NominalDiffTime -> [Double] -> PlotGen (genBinHist,genBinFreqs) = (genByBins values2binHist, genByBins values2binFreqs) @@ -277,7 +283,7 @@ !m' = fmap (\(_,_,nopen,_) -> (0,t2,nopen,0)) m step ev@(t, s, e) st@(m, t1:t2:ts, r) - | t < t1 = error "Times are not in ascending order" + | t < t1 = error $ "Times are not in ascending order, first violating is " ++ show t | t >= t2 = step ev (flushBin st) | True = step'' ev st
Tools/TimePlot/Render.hs view
@@ -14,14 +14,6 @@ import Tools.TimePlot.Types import Tools.TimePlot.Plots -mapAxisData :: (a -> b) -> (b -> a) -> AxisData b -> AxisData a -mapAxisData f f' (AxisData vp pv ticks labels grid) = AxisData - (\range x -> vp range (f x)) - (\range v -> f' (pv range v)) - (map (\(x,t) -> (f' x, t)) ticks) - (map (map (\(x,lab) -> (f' x, lab))) labels) - (map f' grid) - dataToPlot :: AxisData LocalTime -> (LocalTime,LocalTime) -> PlotData -> AnyLayout1 LocalTime dataToPlot commonTimeAxis tr = dataToPlot' commonTimeAxis . constrainTime tr
timeplot.cabal view
@@ -1,5 +1,5 @@ name: timeplot-version: 1.0.18+version: 1.0.19 cabal-version: >=1.6 build-type: Simple license: BSD3