-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Interactive quick time series plotting -- -- Quick time series terminal plotting for data exploration/in ghci. See -- documentation for Interactive.Plot and README for more -- information. @package interactive-plot @version 0.1.0.0 -- | Core rendering functionality for the library. module Interactive.Plot.Core -- | An ordered pair in a. data Coord a C :: a -> a -> Coord a -- | Access x. [_cX] :: Coord a -> a -- | Access y. [_cY] :: Coord a -> a -- | Getter/setter lens to the x position in a Coord. cX :: Lens' (Coord a) a -- | Getter/setter lens to the x position in a Coord. cY :: Lens' (Coord a) a -- | A specification for a range. Using R, contains the minimum and -- maximum. Using RAbout, contains the midpoint and size. data Range a R :: a -> a -> Range a -- | Minimum of range. [_rMin] :: Range a -> a -- | Maximum of range. [_rMax] :: Range a -> a -- | An alternative "constructor" for R, which takes a midpoint and -- size instead of a min and max. -- -- This comes with record fields, _rMid and _rSize'. pattern RAbout :: Fractional a => a -> a -> Range a _rMid :: () => Range a -> Fractional a -> a _rSize' :: () => Range a -> Fractional a -> a -- | Getter/setter lens to the minimum value in a Range. rMin :: Lens' (Range a) a -- | Getter/setter lens to the maximum value in a Range. rMax :: Lens' (Range a) a -- | Lens into the size of a Range Modifying this size results in a -- scaling about the midpoint of the range. -- --
--   view rSize (R 2 4)
--   -- 2
--   over rSize (* 2) (R 2 4)
--   -- R 1 5
--   
rSize :: Fractional a => Lens' (Range a) a -- | Lens into the midpoint of a Range. Modifying this midpoint -- shifts the range to a new midpoint, preserving the size. -- --
--   view rMid (R 2 4)
--   -- 3
--   over rMid (+ 3) (R 2 4)
--   -- R 5 7
--   
rMid :: Fractional a => Lens' (Range a) a -- | Gets the size of a Range. -- -- A version of _rSize' that works for any instance of Num. _rSize :: Num a => Range a -> a -- | Used to specify fields in PointStyle and SeriesF: Use -- Auto for automatic inference, and Given to provide a -- specific value. -- -- Its Semigroup instance keeps the last Given. data Auto a Auto :: Auto a Given :: a -> Auto a -- | Specification of a style for a point. -- -- Construct this wiht the PointStyle pattern synonym. type PointStyle = PointStyleF Identity -- | Pattern synonym/constructor for PointStyle. -- -- This comes with two record fields, _psMarker and -- _psColor. pattern PointStyle :: Char -> Color -> PointStyle _psMarker :: PointStyle -> Char _psColor :: PointStyle -> Color -- | A parameterized version of PointStyle to unify functions in -- Interactive.Plot.Series. -- -- Mainly you will be using either PointStyle or -- AutoPointStyle. data PointStyleF f PointStyleF :: f Char -> f Color -> PointStyleF f -- | Marker character. [_psMarkerF] :: PointStyleF f -> f Char -- | Marker color. [_psColorF] :: PointStyleF f -> f Color -- | A version of PointStyle where you can leave the marker or color -- blank, to be automatically inferred. -- -- You can construct this with the PointStyleF constructor. -- -- It has a very convenient Monoid instance: mempty gives a -- PointStyle where every field is Auto, and -- <> combines PointStyles field-by-field, keeping -- the last Given. type AutoPointStyle = PointStyleF Auto psMarker :: Lens' PointStyle Char psColor :: Lens' PointStyle Color -- | Data for a single series: contains the coordinate map with the point -- style for the series. type Series = SeriesF Identity -- | A parameterized version of SeriesF to unify functions in -- Interactive.Plot.Series. -- -- Mainly you will be using either SeriesF or AutoSeries. data SeriesF f Series :: Map Double (Set Double) -> PointStyleF f -> SeriesF f -- | A map of x positions to y points at that position [_sItems] :: SeriesF f -> Map Double (Set Double) -- | The style of points. For SeriesF, this is PointStyle; -- for AutoSeries, this is AutoPointStyle. [_sStyle] :: SeriesF f -> PointStyleF f -- | A version of SeriesF where you can leave the marker or color -- blank, to be automatically inferred. type AutoSeries = SeriesF Auto -- | Getter/setter lens to the items field of a SeriesF sItems :: Lens' (SeriesF f) (Map Double (Set Double)) -- | Getter/setter lens to the style field of a SeriesF -- --
--   sStyle :: Lens SeriesF PointStyle
--   sStyle :: Lens AutoSeries AutoPointStyle
--   
sStyle :: Lens' (SeriesF f) (PointStyleF f) -- | Turn a set of coordinates into a map of x's to the y's found in the -- set. -- -- Note that this forms an isomorphism with fromCoordMap. toCoordMap :: Eq a => Set (Coord a) -> Map a (Set a) -- | Convert a map of x's to y's into a set of x-y coordinates. -- -- Note that this forms an isomorphism with toCoordMap. fromCoordMap :: Map a (Set a) -> Set (Coord a) -- | Alignment specification. data Alignment ALeft :: Alignment ACenter :: Alignment ARight :: Alignment -- | Options used for running the plot interactively in a terminal. data PlotOpts PO :: Double -> Maybe Double -> Maybe (Range Double) -> Maybe (Range Double) -> Maybe StdGen -> Bool -> Maybe Double -> Maybe Image -> PlotOpts -- | character width ratio of terminal (H/W). Default is 2.1. [_poTermRatio] :: PlotOpts -> Double -- | plot aspect ratio (H/W). Use Nothing for automatic. Default is -- Just 1. [_poAspectRatio] :: PlotOpts -> Maybe Double -- | X Range. Use Nothing for automatic. Default is Nothing. [_poXRange] :: PlotOpts -> Maybe (Range Double) -- | Y Range. Use Nothing for automatic. Default is Nothing. [_poYRange] :: PlotOpts -> Maybe (Range Double) -- | How to fill in missing values when run using runPlotAuto. -- Nothing for IO, Just for deterministic seed. Ignored -- when using runPlot. Default is an arbitrarily selected seed. [_poAutoMethod] :: PlotOpts -> Maybe StdGen -- | Whether or not to show help box initially. Box can always be toggled -- with ?. (Default is True) [_poHelp] :: PlotOpts -> Bool -- | Updates per second; Nothing for no updates. Use poDelay -- to treat this as a microsecond delay instead. (default: -- Nothing) [_poFramerate] :: PlotOpts -> Maybe Double -- | Initial extra information in description box. Ignored if directly -- using runPlotDynamic. Default is Nothing [_poDescription] :: PlotOpts -> Maybe Image poTermRatio :: Lens' PlotOpts Double poAspectRatio :: Lens' PlotOpts (Maybe Double) poXRange :: Lens' PlotOpts (Maybe (Range Double)) poYRange :: Lens' PlotOpts (Maybe (Range Double)) -- | Lens into a PlotOpts getting its range X and range Y settings. poRange :: Lens' PlotOpts (Maybe (Range Double), Maybe (Range Double)) poAutoMethod :: Lens' PlotOpts (Maybe StdGen) poHelp :: Lens' PlotOpts Bool poFramerate :: Lens' PlotOpts (Maybe Double) -- | Lens into microsecond delay between frames, specified by a -- PlotOpts. poDelay :: Lens' PlotOpts (Maybe Int) poDescription :: Lens' PlotOpts (Maybe Image) -- | Sensible defaults for most terminals. defaultPlotOpts :: PlotOpts -- | Render serieses based on a display region and plot axis ranges. renderPlot :: Coord (Range Int) -> Coord (Range Double) -> [Series] -> [Image] -- | Compute plot axis ranges based on a list of points and the size of the -- display region. plotRange :: PlotOpts -> Coord (Range Int) -> [Series] -> Coord (Range Double) -- | Newtype wrapper providing an Ord instance for Color. newtype OrdColor OC :: Color -> OrdColor [getOC] :: OrdColor -> Color -- | Render a single according to a PointStyle. renderPoint :: PointStyle -> Image -- | Used for poDelay: a lens into a microsecond delay given a -- framerate. Should technically be an isomorphism, but this isn't -- supported by microlens. hzToDelay :: Lens' (Maybe Double) (Maybe Int) instance Data.Default.Class.Default Interactive.Plot.Core.PlotOpts instance GHC.Generics.Generic (Interactive.Plot.Core.PointStyleF f) instance GHC.Base.Functor Interactive.Plot.Core.Auto instance GHC.Generics.Generic (Interactive.Plot.Core.Auto a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Interactive.Plot.Core.Auto a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Interactive.Plot.Core.Auto a) instance GHC.Show.Show a => GHC.Show.Show (Interactive.Plot.Core.Auto a) instance Data.Traversable.Traversable Interactive.Plot.Core.Range instance Data.Foldable.Foldable Interactive.Plot.Core.Range instance GHC.Base.Functor Interactive.Plot.Core.Range instance GHC.Show.Show a => GHC.Show.Show (Interactive.Plot.Core.Range a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Interactive.Plot.Core.Coord a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Interactive.Plot.Core.Coord a) instance Data.Traversable.Traversable Interactive.Plot.Core.Coord instance Data.Foldable.Foldable Interactive.Plot.Core.Coord instance GHC.Base.Functor Interactive.Plot.Core.Coord instance GHC.Show.Show a => GHC.Show.Show (Interactive.Plot.Core.Coord a) instance GHC.Classes.Eq Interactive.Plot.Core.OrdColor instance (GHC.Show.Show (f GHC.Types.Char), GHC.Show.Show (f Graphics.Vty.Attributes.Color.Color)) => GHC.Show.Show (Interactive.Plot.Core.PointStyleF f) instance (GHC.Classes.Eq (f GHC.Types.Char), GHC.Classes.Eq (f Graphics.Vty.Attributes.Color.Color)) => GHC.Classes.Eq (Interactive.Plot.Core.PointStyleF f) instance (GHC.Show.Show (f GHC.Types.Char), GHC.Show.Show (f Graphics.Vty.Attributes.Color.Color)) => GHC.Show.Show (Interactive.Plot.Core.SeriesF f) instance (GHC.Base.Semigroup (f GHC.Types.Char), GHC.Base.Semigroup (f Graphics.Vty.Attributes.Color.Color)) => GHC.Base.Semigroup (Interactive.Plot.Core.PointStyleF f) instance (GHC.Base.Monoid (f GHC.Types.Char), GHC.Base.Monoid (f Graphics.Vty.Attributes.Color.Color)) => GHC.Base.Monoid (Interactive.Plot.Core.PointStyleF f) instance (GHC.Classes.Ord (f GHC.Types.Char), GHC.Classes.Ord (f Interactive.Plot.Core.OrdColor), GHC.Base.Functor f, GHC.Classes.Eq (f Graphics.Vty.Attributes.Color.Color)) => GHC.Classes.Ord (Interactive.Plot.Core.PointStyleF f) instance GHC.Base.Semigroup (Interactive.Plot.Core.Auto a) instance GHC.Base.Monoid (Interactive.Plot.Core.Auto a) instance GHC.Base.Applicative Interactive.Plot.Core.Auto instance GHC.Base.Monad Interactive.Plot.Core.Auto instance GHC.Base.Alternative Interactive.Plot.Core.Auto instance GHC.Base.MonadPlus Interactive.Plot.Core.Auto instance GHC.Base.Applicative Interactive.Plot.Core.Range instance GHC.Base.Monad Interactive.Plot.Core.Range instance GHC.Num.Num a => GHC.Num.Num (Interactive.Plot.Core.Coord a) instance GHC.Base.Applicative Interactive.Plot.Core.Coord instance GHC.Base.Monad Interactive.Plot.Core.Coord instance GHC.Classes.Ord Interactive.Plot.Core.OrdColor -- | Create common serieses. module Interactive.Plot.Series -- | Data for a single series: contains the coordinate map with the point -- style for the series. type Series = SeriesF Identity -- | A version of SeriesF where you can leave the marker or color -- blank, to be automatically inferred. type AutoSeries = SeriesF Auto -- | A parameterized version of SeriesF to unify functions in -- Interactive.Plot.Series. -- -- Mainly you will be using either SeriesF or AutoSeries. data SeriesF f Series :: Map Double (Set Double) -> PointStyleF f -> SeriesF f -- | A map of x positions to y points at that position [_sItems] :: SeriesF f -> Map Double (Set Double) -- | The style of points. For SeriesF, this is PointStyle; -- for AutoSeries, this is AutoPointStyle. [_sStyle] :: SeriesF f -> PointStyleF f -- | Specification of a style for a point. -- -- Construct this wiht the PointStyle pattern synonym. type PointStyle = PointStyleF Identity -- | A version of PointStyle where you can leave the marker or color -- blank, to be automatically inferred. -- -- You can construct this with the PointStyleF constructor. -- -- It has a very convenient Monoid instance: mempty gives a -- PointStyle where every field is Auto, and -- <> combines PointStyles field-by-field, keeping -- the last Given. type AutoPointStyle = PointStyleF Auto -- | A parameterized version of PointStyle to unify functions in -- Interactive.Plot.Series. -- -- Mainly you will be using either PointStyle or -- AutoPointStyle. data PointStyleF f PointStyleF :: f Char -> f Color -> PointStyleF f -- | Marker character. [_psMarkerF] :: PointStyleF f -> f Char -- | Marker color. [_psColorF] :: PointStyleF f -> f Color -- | Construct a series from any foldable container of y-values. The -- x-values are automatically assigned to 0, 1, 2, 3 ... etc. -- -- Note that this is polymorphic over both PointStyle and -- AutoPointStyle: -- --
--   listSeries :: Foldable t => t Double -> PointStyle -> SeriesF
--   listSeries :: Foldable t => t Double -> AutoPointStyle -> AutoSeries
--   
listSeries :: Foldable t => t Double -> PointStyleF f -> SeriesF f -- | Construct a series from any foldable container of x-y tuples. -- -- Note that this is polymorphic over both PointStyle and -- AutoPointStyle: -- --
--   tupleSeries :: Foldable t => t (Double, Double) -> PointStyle -> SeriesF
--   tupleSeries :: Foldable t => t (Double, Double) -> AutoPointStyle -> AutoSeries
--   
tupleSeries :: Foldable t => t (Double, Double) -> PointStyleF f -> SeriesF f -- | Construct a series from a function x to y, given a foldable container -- of x values. -- -- Note that this is polymorphic over both PointStyle and -- AutoPointStyle: -- --
--   funcSeries :: Foldable t => (Double -> Double) -> t Double -> PointStyle -> SeriesF
--   funcSeries :: Foldable t => (Double -> Double) -> t Double -> AutoPointStyle -> AutoSeries
--   
funcSeries :: Foldable t => (Double -> Double) -> t Double -> PointStyleF f -> SeriesF f -- | enumRange n (R a b) generates a list of -- n equally spaced values between a and b. enumRange :: Fractional a => Int -> Range a -> [a] -- | Turn an AutoSeries into a SeriesF, assigning styles from -- a pre-specified "shuffled" order. fromAutoSeries :: [AutoSeries] -> [Series] -- | Turn an AutoSeries into a SeriesF, drawing styles -- randomly in IO. fromAutoSeriesIO :: [AutoSeries] -> IO [Series] -- | Turn an AutoSeries into a SeriesF, shuffling the default -- styles in a deterministic way from a given seed. fromAutoSeries_ :: StdGen -> [AutoSeries] -> [Series] -- | A set of default point styles defaultStyles :: Set PointStyle -- | Run plots interactively in the terminal. module Interactive.Plot.Run -- | Display fixed plot and title interactively. -- -- See runPlotDynamic for more control. runPlot :: PlotOpts -> Maybe String -> [Series] -> IO () -- | Display fixed plot and title interactively, filling in default values. -- -- See runPlotDynamic for more control. runPlotAuto :: PlotOpts -> Maybe String -> [AutoSeries] -> IO () -- | Display a series of plots ([SeriesF]) with a time -- delay between each one. Will quit when the last plot is displayed. Use -- lastForever on the input list to repeat the last item -- indefinitely, or cycle to cycle through the list forever. -- -- Note that this behavior is pretty simple; more advanced functionality -- can be achieved with runPlotDynamic directly. animatePlot :: PlotOpts -> Double -> Maybe String -> [[Series]] -> IO () -- | Handy function to use with animatePlot to extend the last frame -- into eternity. lastForever :: [a] -> [a] -- | Animate (according to the framerate in the PlotOpts) a function -- Double -> Maybe [Series], where the input is -- the current time in seconds and the output is the plot to display at -- that time. Will quit as soon as Nothing is given. -- -- Remember to give a PlotOpts with a Just framerate. -- -- This is a simple wrapper over animatePlotMoore with a stateless -- function. For more advanced functionality, use animatePlotMoore -- or runPlotDynamic directly. animatePlotFunc :: PlotOpts -> Maybe String -> (Double -> Maybe [Series]) -> IO () -- | Animate (according to the framerate in the PlotOpts) a "Moore -- machine" description of a plot evolving over time with some initial -- state. -- -- Remember to give a PlotOpts with a Just framerate. -- -- For a simplified version of a stateless function, see -- animatePlotFunc. This is implemented in terms of -- runPlotDynamic, but the representation of an animation in terms -- of a moore machine is powerful enough to represent a very general -- class of animations. animatePlotMoore :: PlotOpts -> Maybe String -> Moore [Series] -> IO () -- | Used for animatePlotMoore to specify how a plot evolves over -- time with some initial state. data Moore a Moore :: Maybe a -> s -> (Double -> s -> IO (Maybe (a, s))) -> Moore a -- | initial value of plot. Nothing for a non-starter. [moInitVal] :: Moore a -> Maybe a -- | initial state of plot [moInitState] :: Moore a -> s -- | Given change in time since last render and old state, return new plot -- and state. Return Nothing to quit. [moUpdate] :: Moore a -> Double -> s -> IO (Maybe (a, s)) -- | Version of runPlot that allows you to vary the plotted data and -- the title. It will execute the IO PlotData to get the -- current plot data; you can use this with i.e. an IORef to -- adjust the data in real-time. runPlotDynamic :: PlotOpts -> (Event -> IO Bool) -> IO (Maybe PlotData) -> IO () -- | Dynamically adjustable plot data. data PlotData PlotData :: Maybe String -> Maybe Image -> [Series] -> PlotData [_pdTitle] :: PlotData -> Maybe String [_pdDesc] :: PlotData -> Maybe Image [_pdSerieses] :: PlotData -> [Series] -- | Getter/setter lens to the title field of a PlotData pdTitle :: Lens' PlotData (Maybe String) -- | Getter/setter lens to the serieses field of a PlotData pdSerieses :: Lens' PlotData [Series] -- | Getter/setter lens to the description box field of a PlotData pdDesc :: Lens' PlotData (Maybe Image) instance GHC.Base.Functor Interactive.Plot.Run.Moore instance Interactive.Plot.Run.HasPlotState Interactive.Plot.Run.PlotState -- | Simple interactive rendering of plots. See README for information on -- usage. -- -- The main way to use this library is to use runPlotAuto or -- runPlot on some series you make using the series constructors -- (listSeries, funcSeries, etc.) module Interactive.Plot -- | Used to specify fields in PointStyle and SeriesF: Use -- Auto for automatic inference, and Given to provide a -- specific value. -- -- Its Semigroup instance keeps the last Given. data Auto a Auto :: Auto a Given :: a -> Auto a -- | Data for a single series: contains the coordinate map with the point -- style for the series. type Series = SeriesF Identity -- | A version of SeriesF where you can leave the marker or color -- blank, to be automatically inferred. type AutoSeries = SeriesF Auto -- | A parameterized version of SeriesF to unify functions in -- Interactive.Plot.Series. -- -- Mainly you will be using either SeriesF or AutoSeries. data SeriesF f Series :: Map Double (Set Double) -> PointStyleF f -> SeriesF f -- | A map of x positions to y points at that position [_sItems] :: SeriesF f -> Map Double (Set Double) -- | The style of points. For SeriesF, this is PointStyle; -- for AutoSeries, this is AutoPointStyle. [_sStyle] :: SeriesF f -> PointStyleF f -- | Getter/setter lens to the items field of a SeriesF sItems :: Lens' (SeriesF f) (Map Double (Set Double)) -- | Getter/setter lens to the style field of a SeriesF -- --
--   sStyle :: Lens SeriesF PointStyle
--   sStyle :: Lens AutoSeries AutoPointStyle
--   
sStyle :: Lens' (SeriesF f) (PointStyleF f) -- | Construct a series from any foldable container of y-values. The -- x-values are automatically assigned to 0, 1, 2, 3 ... etc. -- -- Note that this is polymorphic over both PointStyle and -- AutoPointStyle: -- --
--   listSeries :: Foldable t => t Double -> PointStyle -> SeriesF
--   listSeries :: Foldable t => t Double -> AutoPointStyle -> AutoSeries
--   
listSeries :: Foldable t => t Double -> PointStyleF f -> SeriesF f -- | Construct a series from any foldable container of x-y tuples. -- -- Note that this is polymorphic over both PointStyle and -- AutoPointStyle: -- --
--   tupleSeries :: Foldable t => t (Double, Double) -> PointStyle -> SeriesF
--   tupleSeries :: Foldable t => t (Double, Double) -> AutoPointStyle -> AutoSeries
--   
tupleSeries :: Foldable t => t (Double, Double) -> PointStyleF f -> SeriesF f -- | Construct a series from a function x to y, given a foldable container -- of x values. -- -- Note that this is polymorphic over both PointStyle and -- AutoPointStyle: -- --
--   funcSeries :: Foldable t => (Double -> Double) -> t Double -> PointStyle -> SeriesF
--   funcSeries :: Foldable t => (Double -> Double) -> t Double -> AutoPointStyle -> AutoSeries
--   
funcSeries :: Foldable t => (Double -> Double) -> t Double -> PointStyleF f -> SeriesF f -- | enumRange n (R a b) generates a list of -- n equally spaced values between a and b. enumRange :: Fractional a => Int -> Range a -> [a] -- | Turn a set of coordinates into a map of x's to the y's found in the -- set. -- -- Note that this forms an isomorphism with fromCoordMap. toCoordMap :: Eq a => Set (Coord a) -> Map a (Set a) -- | Convert a map of x's to y's into a set of x-y coordinates. -- -- Note that this forms an isomorphism with toCoordMap. fromCoordMap :: Map a (Set a) -> Set (Coord a) -- | Turn an AutoSeries into a SeriesF, assigning styles from -- a pre-specified "shuffled" order. fromAutoSeries :: [AutoSeries] -> [Series] -- | Turn an AutoSeries into a SeriesF, drawing styles -- randomly in IO. fromAutoSeriesIO :: [AutoSeries] -> IO [Series] -- | Turn an AutoSeries into a SeriesF, shuffling the default -- styles in a deterministic way from a given seed. fromAutoSeries_ :: StdGen -> [AutoSeries] -> [Series] -- | Specification of a style for a point. -- -- Construct this wiht the PointStyle pattern synonym. type PointStyle = PointStyleF Identity -- | Pattern synonym/constructor for PointStyle. -- -- This comes with two record fields, _psMarker and -- _psColor. pattern PointStyle :: Char -> Color -> PointStyle _psMarker :: PointStyle -> Char _psColor :: PointStyle -> Color -- | A version of PointStyle where you can leave the marker or color -- blank, to be automatically inferred. -- -- You can construct this with the PointStyleF constructor. -- -- It has a very convenient Monoid instance: mempty gives a -- PointStyle where every field is Auto, and -- <> combines PointStyles field-by-field, keeping -- the last Given. type AutoPointStyle = PointStyleF Auto -- | A parameterized version of PointStyle to unify functions in -- Interactive.Plot.Series. -- -- Mainly you will be using either PointStyle or -- AutoPointStyle. data PointStyleF f PointStyleF :: f Char -> f Color -> PointStyleF f -- | Marker character. [_psMarkerF] :: PointStyleF f -> f Char -- | Marker color. [_psColorF] :: PointStyleF f -> f Color psMarker :: Lens' PointStyle Char psColor :: Lens' PointStyle Color -- | An ordered pair in a. data Coord a C :: a -> a -> Coord a -- | Access x. [_cX] :: Coord a -> a -- | Access y. [_cY] :: Coord a -> a -- | Getter/setter lens to the x position in a Coord. cX :: Lens' (Coord a) a -- | Getter/setter lens to the x position in a Coord. cY :: Lens' (Coord a) a -- | A specification for a range. Using R, contains the minimum and -- maximum. Using RAbout, contains the midpoint and size. data Range a R :: a -> a -> Range a -- | Minimum of range. [_rMin] :: Range a -> a -- | Maximum of range. [_rMax] :: Range a -> a -- | An alternative "constructor" for R, which takes a midpoint and -- size instead of a min and max. -- -- This comes with record fields, _rMid and _rSize'. pattern RAbout :: Fractional a => a -> a -> Range a _rMid :: () => Range a -> Fractional a -> a _rSize' :: () => Range a -> Fractional a -> a -- | Getter/setter lens to the minimum value in a Range. rMin :: Lens' (Range a) a -- | Getter/setter lens to the maximum value in a Range. rMax :: Lens' (Range a) a -- | Lens into the size of a Range Modifying this size results in a -- scaling about the midpoint of the range. -- --
--   view rSize (R 2 4)
--   -- 2
--   over rSize (* 2) (R 2 4)
--   -- R 1 5
--   
rSize :: Fractional a => Lens' (Range a) a -- | Lens into the midpoint of a Range. Modifying this midpoint -- shifts the range to a new midpoint, preserving the size. -- --
--   view rMid (R 2 4)
--   -- 3
--   over rMid (+ 3) (R 2 4)
--   -- R 5 7
--   
rMid :: Fractional a => Lens' (Range a) a -- | Gets the size of a Range. -- -- A version of _rSize' that works for any instance of Num. _rSize :: Num a => Range a -> a -- | Display fixed plot and title interactively. -- -- See runPlotDynamic for more control. runPlot :: PlotOpts -> Maybe String -> [Series] -> IO () -- | Display fixed plot and title interactively, filling in default values. -- -- See runPlotDynamic for more control. runPlotAuto :: PlotOpts -> Maybe String -> [AutoSeries] -> IO () -- | Display a series of plots ([SeriesF]) with a time -- delay between each one. Will quit when the last plot is displayed. Use -- lastForever on the input list to repeat the last item -- indefinitely, or cycle to cycle through the list forever. -- -- Note that this behavior is pretty simple; more advanced functionality -- can be achieved with runPlotDynamic directly. animatePlot :: PlotOpts -> Double -> Maybe String -> [[Series]] -> IO () -- | Handy function to use with animatePlot to extend the last frame -- into eternity. lastForever :: [a] -> [a] -- | Animate (according to the framerate in the PlotOpts) a function -- Double -> Maybe [Series], where the input is -- the current time in seconds and the output is the plot to display at -- that time. Will quit as soon as Nothing is given. -- -- Remember to give a PlotOpts with a Just framerate. -- -- This is a simple wrapper over animatePlotMoore with a stateless -- function. For more advanced functionality, use animatePlotMoore -- or runPlotDynamic directly. animatePlotFunc :: PlotOpts -> Maybe String -> (Double -> Maybe [Series]) -> IO () -- | Options used for running the plot interactively in a terminal. data PlotOpts PO :: Double -> Maybe Double -> Maybe (Range Double) -> Maybe (Range Double) -> Maybe StdGen -> Bool -> Maybe Double -> Maybe Image -> PlotOpts -- | character width ratio of terminal (H/W). Default is 2.1. [_poTermRatio] :: PlotOpts -> Double -- | plot aspect ratio (H/W). Use Nothing for automatic. Default is -- Just 1. [_poAspectRatio] :: PlotOpts -> Maybe Double -- | X Range. Use Nothing for automatic. Default is Nothing. [_poXRange] :: PlotOpts -> Maybe (Range Double) -- | Y Range. Use Nothing for automatic. Default is Nothing. [_poYRange] :: PlotOpts -> Maybe (Range Double) -- | How to fill in missing values when run using runPlotAuto. -- Nothing for IO, Just for deterministic seed. Ignored -- when using runPlot. Default is an arbitrarily selected seed. [_poAutoMethod] :: PlotOpts -> Maybe StdGen -- | Whether or not to show help box initially. Box can always be toggled -- with ?. (Default is True) [_poHelp] :: PlotOpts -> Bool -- | Updates per second; Nothing for no updates. Use poDelay -- to treat this as a microsecond delay instead. (default: -- Nothing) [_poFramerate] :: PlotOpts -> Maybe Double -- | Initial extra information in description box. Ignored if directly -- using runPlotDynamic. Default is Nothing [_poDescription] :: PlotOpts -> Maybe Image poTermRatio :: Lens' PlotOpts Double poAspectRatio :: Lens' PlotOpts (Maybe Double) poXRange :: Lens' PlotOpts (Maybe (Range Double)) poYRange :: Lens' PlotOpts (Maybe (Range Double)) -- | Lens into a PlotOpts getting its range X and range Y settings. poRange :: Lens' PlotOpts (Maybe (Range Double), Maybe (Range Double)) poAutoMethod :: Lens' PlotOpts (Maybe StdGen) poHelp :: Lens' PlotOpts Bool poFramerate :: Lens' PlotOpts (Maybe Double) -- | Lens into microsecond delay between frames, specified by a -- PlotOpts. poDelay :: Lens' PlotOpts (Maybe Int) -- | Sensible defaults for most terminals. defaultPlotOpts :: PlotOpts