| Copyright | (c) Justin Le 2018 |
|---|---|
| License | BSD3 |
| Maintainer | justin@jle.im |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Interactive.Plot.Run
Description
Run plots interactively in the terminal.
Synopsis
- runPlot :: PlotOpts -> Maybe String -> [Series] -> IO ()
- runPlotAuto :: PlotOpts -> Maybe String -> [AutoSeries] -> IO ()
- animatePlot :: PlotOpts -> Double -> Maybe String -> [[Series]] -> IO ()
- lastForever :: [a] -> [a]
- animatePlotFunc :: PlotOpts -> Maybe String -> (Double -> Maybe [Series]) -> IO ()
- animatePlotMoore :: PlotOpts -> Maybe String -> Moore [Series] -> IO ()
- data Moore a = Moore {}
- runPlotDynamic :: PlotOpts -> (Event -> IO Bool) -> IO (Maybe PlotData) -> IO ()
- data PlotData = PlotData {}
- pdTitle :: Lens' PlotData (Maybe String)
- pdSerieses :: Lens' PlotData [Series]
- pdDesc :: Lens' PlotData (Maybe Image)
Simple
Arguments
| :: PlotOpts | options (can be |
| -> Maybe String | title |
| -> [Series] | series data |
| -> IO () |
Display fixed plot and title interactively.
See runPlotDynamic for more control.
Arguments
| :: PlotOpts | options (can be |
| -> Maybe String | title |
| -> [AutoSeries] | uninitialized series data |
| -> IO () |
Display fixed plot and title interactively, filling in default values.
See runPlotDynamic for more control.
Animated
Arguments
| :: PlotOpts | options (can be |
| -> Double | update rate (frames per second) |
| -> Maybe String | title |
| -> [[Series]] | list of series data (potentially infinite) |
| -> IO () |
Display a series of plots ([) with a time delay between
each one. Will quit when the last plot is displayed. Use SeriesF]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.
lastForever :: [a] -> [a] Source #
Handy function to use with animatePlot to extend the last frame into
eternity.
Arguments
| :: PlotOpts | options (can be |
| -> Maybe String | title |
| -> (Double -> Maybe [Series]) | function from time to plot. will quit as soon as |
| -> IO () |
Animate (according to the framerate in the PlotOpts) a function
, 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 Double -> Maybe [Series]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.
Arguments
| :: PlotOpts | options (can be |
| -> Maybe String | title |
| -> Moore [Series] | moore machine representing progression of plot from an initial state |
| -> 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.
Used for animatePlotMoore to specify how a plot evolves over time
with some initial state.
Constructors
| Moore | |
Custom
Dynamically adjustable plot data.
pdTitle :: Lens' PlotData (Maybe String) Source #
Getter/setter lens to the title field of a PlotData