Skip to content

Commit

Permalink
proper module and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mstksg committed Sep 4, 2019
1 parent d321944 commit 9a0b78b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
interactive-plot
================

Simple terminal interactive plotter.
Quick time series terminal plotting for data exploration/in ghci.
9 changes: 4 additions & 5 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ extra-source-files:
- CHANGELOG.md

# Metadata used when publishing your package
synopsis: Quick time series plotting meant to be used interactively in ghci
synopsis: Interactive quick time series plotting
category: Interactive

# To avoid duplicated efforts in documentation and dealing with the
# complications of embedding Haddock markup inside cabal files, it is
# common to point users to the README.md file.
description: Please see the README on GitHub at <https://github.com/mstksg/interactive-plot#readme>
description: |
Quick time series terminal plotting for data exploration/in ghci. See
documentation for "Interactive.Plot".
dependencies:
- base >= 4.7 && < 5
Expand Down
33 changes: 29 additions & 4 deletions src/Interactive/Plot.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE PatternSynonyms #-}

-- |
-- Module : Interative.Plot
Expand All @@ -11,9 +12,33 @@
-- Simple interactive rendering of plots
--
module Interactive.Plot (
module P
-- * Run a Plot
runPlot
, runPlotAuto
, animatePlot
-- ** Options
, PlotOpts(..), poTermRatio, poAspectRatio, poXRange, poYRange, poRange, poAutoMethod, poHelp, poFramerate, poDelay
, defaultPlotOpts
-- * Construct Series
, Auto(..)
, Series, AutoSeries, SeriesF(..), sItems, sStyle
-- ** Making common serieses
, listSeries
, tupleSeries
, funcSeries
, enumRange
, toCoordMap
, fromCoordMap
-- ** Series from AutoSeroes
, fromAutoSeries
, fromAutoSeriesIO
, fromAutoSeries_
-- ** Types
, PointStyle, pattern PointStyle, _psMarker, _psColor, AutoPointStyle, PointStyleF(..), psMarker, psColor
, Coord(..), cX, cY
, Range(..), _rMid, _rSize', rMin, rMax, rSize, rMid, _rSize
) where

import Interactive.Plot.Core as P
import Interactive.Plot.Run as P
import Interactive.Plot.Series as P
import Interactive.Plot.Core
import Interactive.Plot.Run
import Interactive.Plot.Series
4 changes: 4 additions & 0 deletions src/Interactive/Plot/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ pdSerieses :: Lens' PlotData [Series]
pdSerieses f (PlotData x y z) = PlotData x y <$> f z

-- | Display fixed plot and title interactively, filling in default values.
--
-- See 'runPlotDynamic' for more control.
runPlotAuto
:: PlotOpts
-> Maybe String -- ^ title
Expand All @@ -122,6 +124,8 @@ runPlotAuto po t d s = case po ^. poAutoMethod of
Just g -> runPlot po t d $ fromAutoSeries_ g s

-- | Display fixed plot and title interactively.
--
-- See 'runPlotDynamic' for more control.
runPlot
:: PlotOpts
-> Maybe String -- ^ title
Expand Down
4 changes: 2 additions & 2 deletions src/Interactive/Plot/Series.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
--
-- Create common serieses.
module Interactive.Plot.Series (
defaultStyles
-- * Create a 'Series' from an 'AutoSeries'.
, fromAutoSeries
fromAutoSeries
, fromAutoSeriesIO
, fromAutoSeries_
-- * Create common 'Series'
, listSeries
, tupleSeries
, funcSeries
, enumRange
, defaultStyles
) where

import Control.Monad.Random
Expand Down

0 comments on commit 9a0b78b

Please sign in to comment.