Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- evenOddSplit :: [a] -> ([a], [a])
- addXmlns :: Svg -> Svg
- (.:) :: (AttributeValue -> Attribute) -> Float -> Attribute
- distance :: (Float, Float) -> (Float, Float) -> Float
- horizontalMirrorMatrix :: AttributeValue
- verticalMirrorMatrix :: AttributeValue
- frame :: Float -> String -> Float -> Float -> Float -> Float -> Svg
- rectangleWithRoundCorners :: Float -> (Float, Float) -> (Float, Float) -> Path
Documentation
evenOddSplit :: [a] -> ([a], [a]) Source #
Splits a list xs
into two lists:
- The first one contains all odd positioned elements of
xs
- The second one contains all even positioned elements of
xs
addXmlns :: Svg -> Svg Source #
Takes some Svg
entity and adds two attributes:
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
(.:) :: (AttributeValue -> Attribute) -> Float -> Attribute infixl 5 Source #
Handy operator that converts a Float
number
into an AttributeValue
and feeds it to the Attribute
function.
Example:
S.path ! (A.strokeWidth .: 0.1)
distance :: (Float, Float) -> (Float, Float) -> Float Source #
Euclidian distance between two points.
horizontalMirrorMatrix :: AttributeValue Source #
Matrix for the horizontal symmetry respect to the axis x=0
.
Use it with the transform Attribute
:
S.path ! A.transform horizontalMirrorMatrix
verticalMirrorMatrix :: AttributeValue Source #
Matrix for the vertical symmetry respect to the axis y=0
.
Use it with the transform Attribute
:
S.path ! A.transform (verticalMirrorMatrix <> rotateAround 45 0 0)
:: Float | stroke-width |
-> String | stroke color |
-> Float | x0 |
-> Float | y0 |
-> Float | width |
-> Float | height |
-> Svg | resulting svg |
frame
is mainly used for testing purposes. It draws coordinate axis.
Takes the 4 numbers of the viewbox (x0, y0, width, height)
and returns a path which connects all
consecutive corners of the viewbox and also connects opposite
middle points of the sides of the viewbox.