-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Native haskell charts. -- -- See chart-unit for chart bling and usage. -- -- -- These charts are designed to be scale independent and amenable to -- combinatory busywork (hence the unit suffix). @package chart-unit @version 0.4.0 module Chart.Types -- | a Chart has a concrete scale, and combinatory options amount to -- mappend (on top of) and beside type Chart a = (Renderable (Path V2 Double) a) => QDiagram a V2 Double Any -- | an alternative synonym where text is involved. type Chart' a = (Renderable (Path V2 Double) a, Renderable (Text Double) a) => QDiagram a V2 Double Any -- | the rendering aspect (or plane) of the chart. Wrapped to distinguish -- this from a plain XY data Aspect Aspect :: Rect Double -> Aspect [unAspect] :: Aspect -> Rect Double aspect :: Double -> Aspect asquare :: Aspect sixbyfour :: Aspect golden :: Aspect widescreen :: Aspect -- | The concrete nature of a QDiagram, and a desire to scale data and hud -- items naturally, a QChart is mostly a late binding of the Aspect that -- the chart is to be projected on to and the data. data QChart a b QChart :: ((Renderable (Text Double) a, Renderable (Path V2 Double) a) => Aspect -> b -> QDiagram a V2 Double Any) -> Rect Double -> b -> QChart a b [_qChart] :: QChart a b -> (Renderable (Text Double) a, Renderable (Path V2 Double) a) => Aspect -> b -> QDiagram a V2 Double Any [_qXY] :: QChart a b -> Rect Double [_qData] :: QChart a b -> b qXY :: forall a_ahGw b_ahGx. Lens' (QChart a_ahGw b_ahGx) (Rect Double) qChart :: forall a_ahGw b_ahGx. (Renderable (Text Double) a_ahGw, Renderable (Path V2 Double) a_ahGw) => Getter (QChart a_ahGw b_ahGx) (Aspect -> b_ahGx -> QDiagram a_ahGw V2 Double Any) qData :: forall a_ahGw b_ahGx. Lens' (QChart a_ahGw b_ahGx) b_ahGx data Orientation X :: Orientation Y :: Orientation data Placement AxisLeft :: Placement AxisRight :: Placement AxisTop :: Placement AxisBottom :: Placement data TickStyle TickNone :: TickStyle TickLabels :: [Text] -> TickStyle TickRound :: Int -> TickStyle TickExact :: Int -> TickStyle TickPlaced :: [(Double, Text)] -> TickStyle data Color Color :: Double -> Double -> Double -> Double -> Color [_red] :: Color -> Double [_green] :: Color -> Double [_blue] :: Color -> Double [_aaa] :: Color -> Double color :: Color -> AlphaColour Double uncolor :: AlphaColour Double -> Color opac :: Double -> Color -> Color opacs :: Double -> [Color] -> [Color] palette :: [Color] data AxisConfig AxisConfig :: Double -> Orientation -> Placement -> Double -> Color -> Double -> Color -> Double -> Double -> Double -> Color -> TickStyle -> Double -> Double -> AxisConfig [_axisPad] :: AxisConfig -> Double [_axisOrientation] :: AxisConfig -> Orientation [_axisPlacement] :: AxisConfig -> Placement [_axisHeight] :: AxisConfig -> Double [_axisColor] :: AxisConfig -> Color [_axisMarkSize] :: AxisConfig -> Double [_axisMarkColor] :: AxisConfig -> Color [_axisInsideStrut] :: AxisConfig -> Double [_axisLabelStrut] :: AxisConfig -> Double [_axisTextSize] :: AxisConfig -> Double [_axisTextColor] :: AxisConfig -> Color [_axisTickStyle] :: AxisConfig -> TickStyle [_axisAlignedTextRight] :: AxisConfig -> Double [_axisAlignedTextBottom] :: AxisConfig -> Double axisPad :: Lens' AxisConfig Double axisOrientation :: Lens' AxisConfig Orientation axisPlacement :: Lens' AxisConfig Placement axisHeight :: Lens' AxisConfig Double axisColor :: Lens' AxisConfig Color axisMarkSize :: Lens' AxisConfig Double axisMarkColor :: Lens' AxisConfig Color axisInsideStrut :: Lens' AxisConfig Double axisLabelStrut :: Lens' AxisConfig Double axisTextSize :: Lens' AxisConfig Double axisTextColor :: Lens' AxisConfig Color axisTickStyle :: Lens' AxisConfig TickStyle axisAlignedTextRight :: Lens' AxisConfig Double axisAlignedTextBottom :: Lens' AxisConfig Double data ChartConfig ChartConfig :: Double -> [AxisConfig] -> Maybe (Rect Double) -> Aspect -> Color -> ChartConfig [_chartPad] :: ChartConfig -> Double [_chartAxes] :: ChartConfig -> [AxisConfig] [_chartRange] :: ChartConfig -> Maybe (Rect Double) [_chartAspect] :: ChartConfig -> Aspect [_chartCanvasColor] :: ChartConfig -> Color chartPad :: Lens' ChartConfig Double chartAxes :: Lens' ChartConfig [AxisConfig] chartRange :: Lens' ChartConfig (Maybe (Rect Double)) chartAspect :: Lens' ChartConfig Aspect chartCanvasColor :: Lens' ChartConfig Color data LineConfig LineConfig :: Double -> Color -> LineConfig [_lineSize] :: LineConfig -> Double [_lineColor] :: LineConfig -> Color lineSize :: Lens' LineConfig Double lineColor :: Lens' LineConfig Color data ScatterConfig ScatterConfig :: Double -> Color -> ScatterConfig [_scatterSize] :: ScatterConfig -> Double [_scatterColor] :: ScatterConfig -> Color scatterSize :: Lens' ScatterConfig Double scatterColor :: Lens' ScatterConfig Color data RectConfig RectConfig :: Double -> Color -> Color -> RectConfig [_rectBorderWidth] :: RectConfig -> Double [_rectBorderColor] :: RectConfig -> Color [_rectColor] :: RectConfig -> Color rectBorderWidth :: Lens' RectConfig Double rectBorderColor :: Lens' RectConfig Color rectColor :: Lens' RectConfig Color data ArrowConfig a ArrowConfig :: a -> a -> a -> a -> a -> a -> a -> a -> a -> Color -> ArrowConfig a [_arrowMinHeadSize] :: ArrowConfig a -> a [_arrowMaxHeadSize] :: ArrowConfig a -> a [_arrowHeadSize] :: ArrowConfig a -> a [_arrowMinStaffLength] :: ArrowConfig a -> a [_arrowMaxStaffLength] :: ArrowConfig a -> a [_arrowStaffLength] :: ArrowConfig a -> a [_arrowMinStaffWidth] :: ArrowConfig a -> a [_arrowMaxStaffWidth] :: ArrowConfig a -> a [_arrowStaffWidth] :: ArrowConfig a -> a [_arrowColor] :: ArrowConfig a -> Color arrowMinHeadSize :: forall a_am4s. Lens' (ArrowConfig a_am4s) a_am4s arrowMaxHeadSize :: forall a_am4s. Lens' (ArrowConfig a_am4s) a_am4s arrowHeadSize :: forall a_am4s. Lens' (ArrowConfig a_am4s) a_am4s arrowMinStaffLength :: forall a_am4s. Lens' (ArrowConfig a_am4s) a_am4s arrowMaxStaffLength :: forall a_am4s. Lens' (ArrowConfig a_am4s) a_am4s arrowStaffLength :: forall a_am4s. Lens' (ArrowConfig a_am4s) a_am4s arrowMinStaffWidth :: forall a_am4s. Lens' (ArrowConfig a_am4s) a_am4s arrowMaxStaffWidth :: forall a_am4s. Lens' (ArrowConfig a_am4s) a_am4s arrowStaffWidth :: forall a_am4s. Lens' (ArrowConfig a_am4s) a_am4s arrowColor :: forall a_am4s. Lens' (ArrowConfig a_am4s) Color data PixelConfig PixelConfig :: Range Color -> V2 Int -> PixelConfig [_pixelGradient] :: PixelConfig -> Range Color [_pixelGrain] :: PixelConfig -> V2 Int pixelGradient :: Lens' PixelConfig (Range Color) pixelGrain :: Lens' PixelConfig (V2 Int) data TextConfig textPad :: Lens' TextConfig Double textOrientation :: Lens' TextConfig Orientation textPlacement :: Lens' TextConfig Placement textSize :: Lens' TextConfig Double textColor :: Lens' TextConfig Color textRight :: Lens' TextConfig Double textBottom :: Lens' TextConfig Double instance Data.Default.Class.Default Chart.Types.TextConfig instance Data.Default.Class.Default Chart.Types.PixelConfig instance Data.Default.Class.Default (Chart.Types.ArrowConfig GHC.Types.Double) instance Data.Default.Class.Default Chart.Types.RectConfig instance Data.Default.Class.Default Chart.Types.ScatterConfig instance Data.Default.Class.Default Chart.Types.LineConfig instance Data.Default.Class.Default Chart.Types.ChartConfig instance GHC.Show.Show Chart.Types.Color instance GHC.Classes.Eq Chart.Types.Color instance Data.Default.Class.Default Chart.Types.AxisConfig module Chart.Unit scaleX :: Double -> [Point V2 Double] -> [Point V2 Double] scaleY :: Double -> [Point V2 Double] -> [Point V2 Double] blob :: (Floating (N a), Ord (N a), Typeable (N a), HasStyle a, V a ~ V2) => Color -> a -> a line1 :: (Traversable f, R2 r) => LineConfig -> f (r Double) -> Chart b scatter1 :: (Traversable f, R2 r) => ScatterConfig -> f (r Double) -> Chart b -- | rectangles specified using a V4 x y z w where (x,y) is location of -- lower left corner (z,w) is location of upper right corner rect1 :: (Traversable f) => RectConfig -> f (Rect Double) -> Chart b -- | a pixel is a rectangle with a color. pixel1 :: (Traversable f) => f (Rect Double, Color) -> Chart b arrow1 :: (Traversable f) => ArrowConfig Double -> f (V4 Double) -> Chart b -- | convert from an XY to a polymorphic qdiagrams rectangle box :: (Field (N t), N t ~ Double, V t ~ V2, HasOrigin t, Transformable t, TrailLike t) => Rect Double -> t -- | a chart of scattered dot points scaled to its own range scatterChart :: (R2 r, Traversable f) => [ScatterConfig] -> Aspect -> [f (r Double)] -> Chart a -- | a chart of scattered dot points with a specific range scatterChartWithRange :: (R2 r, Traversable f) => Rect Double -> [ScatterConfig] -> Aspect -> [f (r Double)] -> Chart a -- | a chart of lines scaled to its own range lineChart :: (R2 r, Traversable f) => [LineConfig] -> Aspect -> [f (r Double)] -> Chart a -- | a chart of lines with a specific range lineChartWithRange :: (R2 r, Traversable f) => Rect Double -> [LineConfig] -> Aspect -> [f (r Double)] -> Chart a -- | a chart of histograms scaled to its own range histChart :: (Traversable f) => [RectConfig] -> Aspect -> [f (Rect Double)] -> Chart a -- | a chart of histograms with a specific range histChartWithRange :: (Traversable f) => Rect Double -> [RectConfig] -> Aspect -> [f (Rect Double)] -> Chart a arrowChart :: (Traversable f) => ArrowConfig Double -> V4 (Range Double) -> f (V4 Double) -> Chart a -- | arrow lengths and sizes also need to be scaled, and so arrows doesnt -- fit as neatly into the whole scaling idea arrowChartWithRange :: (Traversable f) => V4 (Range Double) -> ArrowConfig Double -> V4 (Range Double) -> f (V4 Double) -> Chart a -- | V4 range of a V4 container rangeV4 :: (Traversable f) => f (V4 Double) -> V4 (Range Double) rangeV42Rect :: V4 (Range Double) -> Rect Double -- | scale a double container of V4s from the current range scaleV4s :: (Traversable f) => V4 (Range Double) -> f (V4 Double) -> f (V4 Double) toPixels :: Rect Double -> (V2 Double -> Double) -> PixelConfig -> [(Rect Double, Color)] rescalePixels :: Rect Double -> [(Rect Double, Color)] -> [(Rect Double, Color)] -- | pixels over an XY plane using a function pixelf :: PixelConfig -> Aspect -> Rect Double -> (V2 Double -> Double) -> Chart a -- | render with a chart configuration withChart :: (Traversable f, R2 r) => ChartConfig -> (Aspect -> [f (r Double)] -> QDiagram a V2 Double Any) -> [f (r Double)] -> Chart' a axes :: ChartConfig -> Chart' a -- | render a list of qcharts using a common scale combine :: Aspect -> [QChart a b] -> Chart' a fileSvg :: FilePath -> (Double, Double) -> Chart SVG -> IO () bubble :: forall a. (FromInteger (N a), MultiplicativeGroup (N a), RealFloat (N a), Traced a, V a ~ V2) => [a] -> Int -> [V a (N a)] histCompare :: DealOvers -> Histogram -> Histogram -> Chart' a module Chart -- | SVG is simply a token used to identify this rendering backend -- (to aid type inference). data SVG :: * -- | A 4-dimensional vector. data V4 a :: * -> * V4 :: ~a -> ~a -> ~a -> ~a -> V4 a -- | The zipWith4 function takes a function which combines four -- elements, as well as four lists and returns a list of their point-wise -- combination, analogous to zipWith. zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]