-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Plot functions in text.
--
-- Graph plots of y(x), parametric (x(t),y(t)), and polar r(phi)
-- functions with ASCII text.
@package textPlot
@version 1.0
module TextPlot
-- | A function of one variable (x -> y).
type Function = Double -> Double
-- | Range of values (from, to).
type Range = (Double, Double)
-- | Any kind of of plot.
class Plot a
-- | A type class with functional dependency to allow the same editing
-- operations across all plot types.
class Plot plot => EditPlot plot function | plot -> function
thenPlot :: EditPlot plot function => plot -> function -> plot
xlim :: EditPlot plot function => plot -> Range -> plot
ylim :: EditPlot plot function => plot -> Range -> plot
-- | Shortcut to thenPlot. Mnemonics: plus to add another function.
(.+) :: EditPlot p f => p -> f -> p
-- | Shortcut to xlim. Mnemonics: horizontal bar followed by
-- horizontal range.
(.-) :: EditPlot p f => p -> Range -> p
-- | Shortcut to ylim. Mnemonics: vertical bar followed by vertical
-- range.
(.|) :: EditPlot p f => p -> Range -> p
-- | Plot one or more functions (x -> y) in Cartesian
-- coordinates.
data XYPlot
XYPlot :: Range -> Range -> [Function] -> XYPlot
-- | limits of the abscissa (x) axis
[fp'xlim] :: XYPlot -> Range
-- | limits of the ordinate (y) axis
[fp'ylim] :: XYPlot -> Range
-- | functions to plot
[fp'functions] :: XYPlot -> [Function]
-- | A default empty XYPlot with bounds of a unit square.
emptyXYPlot :: XYPlot
-- | Plot one or more parametric functions in Cartesian coordiantes.
data ParamXYPlot
ParamXYPlot :: Range -> Range -> [ParamFunction] -> ParamXYPlot
-- | limits of the abscissa (x) axis
[param'xlim] :: ParamXYPlot -> Range
-- | limits of the ordinate (y) axis
[param'ylim] :: ParamXYPlot -> Range
-- | functions to plot
[param'functions] :: ParamXYPlot -> [ParamFunction]
data ParamFunction
ParamFunction :: Function -> Function -> Range -> ParamFunction
-- | the first parametrized variable (t -> x)
[xfun] :: ParamFunction -> Function
-- | the second parametrized variable (t -> y)
[yfun] :: ParamFunction -> Function
-- | range of the free parameter t
[tlim] :: ParamFunction -> Range
-- | A default empty ParamXYPlot
emptyParamXYPlot :: ParamXYPlot
-- | Plot one or more functions in polar coordinates.
data PolarPlot
PolarPlot :: Range -> Range -> [PolarFunction] -> PolarPlot
-- | limits of the abscissa (x) axis
[polar'xlim] :: PolarPlot -> Range
-- | limits of the ordinate (y) axis
[polar'ylim] :: PolarPlot -> Range
-- | functions to plot
[polar'functions] :: PolarPlot -> [PolarFunction]
data PolarFunction
PolarFunction :: Function -> (Double, Double) -> PolarFunction
-- | radius as a function of angle phi (phi -> r)
[rfun] :: PolarFunction -> Function
-- | range of the angle argument phi
[philim] :: PolarFunction -> (Double, Double)
-- | A default empty PolarPlot
emptyPolarPlot :: PolarPlot
data PlotConfig
PlotConfig :: Int -> Int -> Int -> Bool -> PlotConfig
-- | plot width in characters
[c'width] :: PlotConfig -> Int
-- | plot height in characters
[c'height] :: PlotConfig -> Int
-- | samples per line
[c'samples] :: PlotConfig -> Int
-- | draw axes or not
[c'showAxes] :: PlotConfig -> Bool
-- | Default plot dimensions, suitable for 80x24 terminals.
defaultConfig :: PlotConfig
-- | Convert a plot to a multiline String with default configuration
plot :: Plot p => p -> String
-- | Convert a plot to multiline String with custom configuration
plotWithConfig :: Plot p => PlotConfig -> p -> String
-- | Print a plot with default configuration
printPlot :: Plot p => p -> IO ()
instance GHC.Classes.Eq TextPlot.PlotConfig
instance GHC.Show.Show TextPlot.PlotConfig
instance GHC.Show.Show TextPlot.PolarPlot
instance GHC.Show.Show TextPlot.PolarFunction
instance GHC.Show.Show TextPlot.ParamXYPlot
instance GHC.Show.Show TextPlot.ParamFunction
instance GHC.Show.Show TextPlot.XYPlot
instance GHC.Show.Show TextPlot.Function
instance TextPlot.EditPlot TextPlot.XYPlot TextPlot.Function
instance TextPlot.Dimensions TextPlot.XYPlot
instance TextPlot.EditPlot TextPlot.ParamXYPlot TextPlot.ParamFunction
instance TextPlot.Dimensions TextPlot.ParamXYPlot
instance TextPlot.EditPlot TextPlot.PolarPlot TextPlot.PolarFunction
instance TextPlot.Dimensions TextPlot.PolarPlot
instance TextPlot.Plot TextPlot.XYPlot
instance TextPlot.Plot TextPlot.ParamXYPlot
instance TextPlot.Plot TextPlot.PolarPlot