packages feed

ploterific 0.2.0.0 → 0.2.1.0

raw patch · 5 files changed

+19/−13 lines, 5 files

Files

app/Main.hs view
@@ -42,6 +42,7 @@                           $ options                   , _height = fmap Height . unHelpful . height $ options                   , _width = fmap Width . unHelpful . width $ options+                  , _defaultTheme = DefaultTheme . unHelpful . defaultTheme $ options                   }    runReaderT plot opts
ploterific.cabal view
@@ -1,5 +1,5 @@ name:                ploterific-version:             0.2.0.0+version:             0.2.1.0 synopsis:            Basic plotting of tabular data for the command line. description:         A quick and easy way to plot tabular data from the command line. Meant for quick visualizations, not too customizable. homepage:            http://github.com/GregorySchwartz/ploterific#readme
src/Ploterific/Plot/Plot.hs view
@@ -189,6 +189,7 @@   facet' <- asks _facet   facetNum' <- asks _facetNum   delimiter' <- asks _delimiter+  defaultTheme' <- asks _defaultTheme    contents <- liftIO input' @@ -213,13 +214,13 @@                  ]       p       = VL.toVegaLite               $   [ dataSet []-                  , VL.theme VL.defaultConfig []                   ]                  <> bool plotSpec [VL.specification . VL.asSpec $ plotSpec] (isJust facet')                  <> maybe [] (\(Height x) -> [VL.height x]) height'                  <> maybe [] (\(Width x) -> [VL.width x]) width'                  <> maybe [] facetSpec facet'                  <> maybe [] (\(FacetNum x) -> [VL.columns $ intToNatural x]) facetNum'+                 <> bool [VL.theme VL.defaultConfig []] [] (unDefaultTheme defaultTheme')    liftIO . output' $ VL.toHtml p 
src/Ploterific/Plot/Types.hs view
@@ -29,6 +29,7 @@ newtype Height = Height { unHeight :: Double } deriving (Read, Show) newtype Width = Width { unWidth :: Double } deriving (Read, Show) newtype ColorLabel = ColorLabel { unColorLabel :: T.Text } deriving (Read, Show)+newtype DefaultTheme = DefaultTheme { unDefaultTheme :: Bool } deriving (Read, Show)  -- Advanced data Opts = Opts { _color :: Maybe Color@@ -41,6 +42,7 @@                  , _mark :: VL.Mark                  , _height :: Maybe Height                  , _width :: Maybe Width+                 , _defaultTheme :: DefaultTheme                  }  deriving instance Read VL.Mark
src/Ploterific/Program/Options.hs view
@@ -32,22 +32,24 @@               , delimiter :: Maybe Char <?> "([,] | CHAR) The delimiter for the table."               , height :: Maybe Double <?> "(Nothing | DOUBLE) The height of the plot."               , width :: Maybe Double <?> "(Nothing | Double) The width of the plot."+              , defaultTheme :: Bool <?> "Whether to use the default theme of vega-lite."               } deriving (Generic)  modifiers :: Modifiers modifiers = lispCaseModifiers { shortNameModifier = short }   where-    short "input"       = Just 'i'-    short "output"      = Just 'o'-    short "feature"     = Just 'f'-    short "facet"       = Just 't'-    short "facet-num"   = Just 'n'-    short "color"       = Just 'c'-    short "mark"        = Just 'm'-    short "delimiter"   = Just 'd'-    short "height"      = Just 'h'-    short "width"       = Just 'w'-    short x             = firstLetter x+    short "input"         = Just 'i'+    short "output"        = Just 'o'+    short "feature"       = Just 'f'+    short "facet"         = Just 't'+    short "facet-num"     = Just 'n'+    short "color"         = Just 'c'+    short "mark"          = Just 'm'+    short "delimiter"     = Just 'd'+    short "height"        = Just 'h'+    short "width"         = Just 'w'+    short "default-theme" = Just 'D'+    short x               = firstLetter x  instance ParseRecord Options where     parseRecord = parseRecordWithModifiers modifiers