hgeometry-svg-0.9.0.0: Writing geometric primitives from HGeometry as SVG Files

Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.Geometry.Svg.MathCoordinateSystem

Description

Description :

Defines functions to make sure we render the coordinate system in svg correctly, i.e. with the origin in the bottom-left instead of top-left.

Synopsis

Documentation

data Canvas r Source #

Svg Canvas that has a "proper" Coordinate system whose origin is in the bottom left.

Constructors

Canvas (Vector 2 Int) (Point 2 r) r 
Instances
Eq r => Eq (Canvas r) Source # 
Instance details

Defined in Data.Geometry.Svg.MathCoordinateSystem

Methods

(==) :: Canvas r -> Canvas r -> Bool #

(/=) :: Canvas r -> Canvas r -> Bool #

Show r => Show (Canvas r) Source # 
Instance details

Defined in Data.Geometry.Svg.MathCoordinateSystem

Methods

showsPrec :: Int -> Canvas r -> ShowS #

show :: Canvas r -> String #

showList :: [Canvas r] -> ShowS #

center :: Lens' (Canvas r) (Point 2 r) Source #

dimensions :: Lens' (Canvas r) (Vector 2 Int) Source #

createCanvas :: Num r => Int -> Int -> Canvas r Source #

Create a canvas

renderCanvas :: RealFrac r => Canvas r -> [Attribute] -> Svg -> Svg Source #

Draws the actual canvas

text_ Source #

Arguments

:: Real r 
=> Point 2 r

position where to draw (in world coordinates)

-> [Attribute] 
-> Text 
-> Svg 

To be used instead of the text_ combinator in Blaze

realWorldCoordinates :: Fractional r => Canvas r -> Point 2 Int -> Point 2 r Source #

Computes the mouse position in terms of real world coordinates. pre: the coordinates given lie on the canvas

showP :: Real a => a -> Pico Source #

show by converting to a Pico