Permalink
Browse files

Clean up some whitespace, reorder imports, etc.

  • Loading branch information...
1 parent e02036b commit 5b1ad1d1799c0abfb8aeb85a6f2ff1710fe5dcf3 @alang9 committed Oct 20, 2011
Showing with 22 additions and 15 deletions.
  1. +12 −7 Data/ZoomCache/Gnuplot.hs
  2. +10 −8 tools/zoom-cache-gnuplot.hs
@@ -11,21 +11,25 @@
----------------------------------------------------------------------
module Data.ZoomCache.Gnuplot
- ( plotSummaries
- , getStreams
- , candlePlots
- , avgPlots
+ ( getStreams
+ , candlePlotData
+ , candlePlot
+ , avgPlot
) where
import Data.Maybe
-import qualified Data.Iteratee as I
+import qualified Data.Iteratee as I
import qualified Data.Iteratee.ZoomCache as Z
import qualified Data.ZoomCache.Common as Z
import qualified Data.ZoomCache.Read as Z
import qualified Data.ZoomCache.Summary as Z
-import Graphics.Gnuplot.Value.Tuple
+import Graphics.Gnuplot.Advanced
import Graphics.Gnuplot.Simple
+import qualified Graphics.Gnuplot.Graph.TwoDimensional as Graph
+import qualified Graphics.Gnuplot.Plot.TwoDimensional as Plot
+import qualified Graphics.Gnuplot.Value.Atom as Atom
+import qualified Graphics.Gnuplot.Value.Tuple as Tuple
----------------------------------------------------------------------
@@ -78,7 +82,8 @@ maybeSummaryLevel lvl (Z.StreamSummary file tn sum) =
_ -> Nothing
maybeSummaryLevel _ Z.StreamNull = Nothing
-getSummaryCandleVals :: Z.Summary a -> (Z.TimeStamp, (a, a, a, a))
+getSummaryCandleVals :: Z.Summary a -> ( Z.TimeStamp
+ , (a, a, a, a))
getSummaryCandleVals s = ( Z.summaryCloseTime s
, ( Z.summaryOpen s
, Z.summaryMin s
@@ -3,18 +3,20 @@ module Main (
) where
import Data.Maybe (fromMaybe, catMaybes)
+import Data.Monoid
import System.Environment (getArgs)
+import System.Exit (exitWith)
import System.Console.GetOpt
-import Graphics.Gnuplot.Simple
-import Graphics.Gnuplot.Advanced
-
-import Graphics.Gnuplot.Value.Tuple (C(..))
-import Data.ZoomCache.Read (getTrackType, getCacheFile)
import Data.Iteratee.ZoomCache (Stream)
import Data.ZoomCache.Common (TrackType(..), TrackNo, TimeStamp)
-
import Data.ZoomCache.Gnuplot
+import Data.ZoomCache.Read (getTrackType, getCacheFile)
+import qualified Graphics.Gnuplot.Advanced as Plot
+import Graphics.Gnuplot.Simple
+import qualified Graphics.Gnuplot.Terminal.X11 as X11
+import Graphics.Gnuplot.Value.Tuple (C(..))
+import qualified Graphics.Gnuplot.Plot.TwoDimensional as Plot
data ParseError = ParseError
@@ -71,11 +73,11 @@ parseOpts :: [String] -> IO (Options, [String])
parseOpts argv =
case getOpt Permute options argv of
(o, n, []) -> return (foldl (flip id) defaultOptions o, n)
- (_, _, errs) -> ioError (userError (concat errs ++ usageInfo header options))
+ (_, _, errs) -> ioError (userError (concat errs
+ ++ usageInfo header options))
where header = "Usage: zoom-cache-gnuplot ..."
-
main :: IO ()
main = do
args <- getArgs

0 comments on commit 5b1ad1d

Please sign in to comment.