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 -> Float -> Float -> Float -> Svg
- cleanDecimals :: Int -> String -> String
Documentation
evenOddSplit :: [a] -> ([a], [a]) Source #
Splits a list into two lists:
- The first one contains all the elements in odd positions
- The second one contains all the elements in even positions
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)