packages feed

plot-light 0.1.0.4 → 0.1.0.5

raw patch · 3 files changed

+19/−11 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

README.md view
@@ -1,19 +1,22 @@ # plot-light +A lightweight plotting library, exporting to SVG+ [![Build Status](https://travis-ci.org/ocramz/plot-light.png)](https://travis-ci.org/ocramz/plot-light)+[![Hackage](https://img.shields.io/hackage/v/plot-light.svg)](https://hackage.haskell.org/package/plot-light) -A lightweight plotting library, exporting to SVG+[![plot-light](http://stackage.org/package/plot-light/badge/lts)](http://stackage.org/lts/package/plot-light)+[![plot-light](http://stackage.org/package/plot-light/badge/nightly)](http://stackage.org/nightly/package/plot-light)  -## Usage -Import the user-facing module: `Graphics.Rendering.Plot.Light.Internal`  `plot-light` provides functionality for rendering vector graphics as SVG.-It is geared in particular towards scientific plotting, and it is termed "light" because it only requires native Haskell dependencies.+It is geared in particular towards scientific plotting, and it is termed "light" because it only requires a few common Haskell dependencies and no external libraries.+It builds upon `blaze-svg` by adding type-safe combinators, geometry primitives and functionality. -It builds upon `blaze-svg` by adding type-safe combinators, geometry primitives and functionality+## Usage  To use this project you just need to import this module qualified (to avoid name clashes with any other modules you might have loaded on the side), for example as follows : -@import Graphics.Rendering.Plot.Light as P@+`import Graphics.Rendering.Plot.Light as P`
plot-light.cabal view
@@ -1,5 +1,5 @@ name:                plot-light-version:             0.1.0.4+version:             0.1.0.5 synopsis:            A lightweight plotting library, exporting to SVG description:         A lightweight plotting library, exporting to SVG homepage:            https://github.com/ocramz/plot-light
src/Graphics/Rendering/Plot/Light/Internal.hs view
@@ -49,7 +49,7 @@   ! SA.viewbox (vis [_xmin fd, _ymin fd, _xmax fd, _ymax fd])  --- | A filled rectangle, centered at (x0, y0)+-- | A filled rectangle rectCentered   :: Point Double    -- ^ Center coordinates              -> Double          -- ^ Width@@ -66,7 +66,12 @@ --  -- > > putStrLn $ renderSvg (line 0 0 1 1 0.1 C.blueviolet) -- > <line x1="0.0" y1="0.0" x2="1.0" y2="1.0" stroke="#8a2be2" stroke-width="0.1" />-line :: Point Double -> Point Double -> Double -> C.Colour Double -> Svg+line ::+     Point Double    -- ^ First point+  -> Point Double    -- ^ Second point+  -> Double          -- ^ Stroke width+  -> C.Colour Double -- ^ Stroke colour+  -> Svg line (Point x1 y1) (Point x2 y2) sw col = S.line ! SA.x1 (vd x1) ! SA.y1 (vd y1) ! SA.x2 (vd x2)  ! SA.y2 (vd y2) ! SA.stroke (colourAttr col )! SA.strokeWidth (vd sw)  tick :: Axis -> Double -> Double -> C.Colour Double -> Point Double -> Svg@@ -122,9 +127,9 @@  -- | `text` renders text onto the SVG canvas. It is also possible to rotate and move the text, however the order of these modifiers matters. -- --- NB1: `x` and `y` determine the position of the bottom-left corner of the text box. If a nonzero rotation is applied, the whole text box will move in a circle of radius || x^2 + y^2 ||+-- NB1: The `Point` parameter `p` determines the /initial/ position of the bottom-left corner of the text box. If a nonzero rotation is applied, the whole text box will move on a circle of radius || x^2 + y^2 || centered at `p`. ----- NB2: the `rotate` and `translate` attributes apply to the _center_ of the text box instead+-- NB2: the `rotate` and `translate` attributes apply to the /center/ of the visible text instead. -- -- > > putStrLn $ renderSvg $ text (-45) C.red "hullo!" (V2 (-30) 0) (Point 0 20) -- > <text x="-30" y="0" transform="translate(0 20)rotate(-45)" fill="#ff0000">hullo!</text>