timeplot 1.0.6 → 1.0.7
raw patch · 3 files changed
+6/−6 lines, 3 files
Files
- Tools/TimePlot/Plots.hs +4/−5
- Tools/TimePlot/Render.hs +1/−0
- timeplot.cabal +1/−1
Tools/TimePlot/Plots.hs view
@@ -32,9 +32,9 @@ initGen (KindAPercent bs b) = genActivity (\sns n -> 100*n/b) bs initGen (KindAFreq bs) = genActivity (\sns n -> if n == 0 then 0 else (n / sum (M.elems sns))) bs initGen (KindFreq bs k) = genAtoms atoms2freqs bs k - where atoms2freqs as m = let n = length as in [fromIntegral (M.findWithDefault 0 a m)/fromIntegral n | a <- as] + where atoms2freqs as m = let n = length as in 0:[fromIntegral (M.findWithDefault 0 a m)/fromIntegral n | a <- as] initGen (KindHistogram bs k) = genAtoms atoms2hist bs k - where atoms2hist as m = [fromIntegral (M.findWithDefault 0 a m) | a <- as] + where atoms2hist as m = 0:[fromIntegral (M.findWithDefault 0 a m) | a <- as] initGen KindEvent = genEvent initGen (KindQuantile bs vs) = genQuantile bs vs initGen (KindBinFreq bs vs) = genBinFreqs bs vs @@ -58,8 +58,7 @@ plotName = name, barsStyle = BarsStacked, barsValues = vals, - barsStyles = [(solidFillStyle c, Nothing) - |(i,_) <- [0..]`zip`titles + barsStyles = [ (solidFillStyle c, Nothing) | c <- transparent:map opaque colors], barsTitles = titles } @@ -192,7 +191,7 @@ Just !n -> M.insert a (n+1) m h :: [S.ByteString] -> [(LocalTime, M.Map S.ByteString Int)] -> PlotData - h as tfs = plotTrackBars (map (second (f as)) tfs) (map show as) name colors + h as tfs = (plotTrackBars (map (second (f as)) tfs) (map show as) name colors) { barsStyle = k } unique :: (Ord a) => (x -> a) -> I.StreamSummary x [a] unique f = I.stateful M.empty (\a -> M.insert (f a) ()) M.keys
Tools/TimePlot/Render.hs view
@@ -26,6 +26,7 @@ dataToPlot commonTimeAxis p@PlotBarsData{} = withAnyOrdinate $ layoutWithTitle commonTimeAxis [plotBars plot] (plotName p) (length (barsTitles p) > 1) where plot = plot_bars_values ^= barsValues p $ plot_bars_item_styles ^= barsStyles p $ + plot_bars_style ^= barsStyle p $ plot_bars_titles ^= "":barsTitles p $ ourPlotBars dataToPlot commonTimeAxis p@PlotEventData{} = withAnyOrdinate $ layoutWithTitle commonTimeAxis [toPlot plot] (plotName p) False
timeplot.cabal view
@@ -1,5 +1,5 @@ name: timeplot-version: 1.0.6+version: 1.0.7 cabal-version: >=1.6 build-type: Simple license: BSD3