Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Svg exposing (..)
- import Svg.Attributes exposing (..)
- import Html exposing (Html)
- import String
- main =
- svg [ version "1.1", x "0", y "0", viewBox "0 0 323.141 322.95" ]
- [ --polygon [ fill "#F0AD00", points "161.649,152.782 231.514,82.916 91.783,82.916" ] []
- --, polygon [ fill "#7FD13B", points "8.867,0 79.241,70.375 232.213,70.375 161.838,0" ] []
- rect
- [ fill "#7FD13B", x "192.99", y "107.392", width "107.676", height "108.167"
- , transform "matrix(0.7071 0.7071 -0.7071 0.7071 186.4727 -127.2386)"
- ]
- []
- -- , polygon [ fill "#60B5CC", points "323.298,143.724 323.298,0 179.573,0" ] []
- -- , polygon [ fill "#5A6378", points "152.781,161.649 0,8.868 0,314.432" ] []
- -- , polygon [ fill "#F0AD00", points "255.522,246.655 323.298,314.432 323.298,178.879" ] []
- -- , polygon [ fill "#60B5CC", points "161.649,170.517 8.869,323.298 314.43,323.298" ] []
- -- , line [ x1 "0", x2 "150", y1 "0", y2 "150" , stroke "rgb(255,0,0)", strokeWidth "2"] []
- , nodeLine "40"
- , nodeLine "80"
- , nodeLine "120"
- , nodeLine "160"
- , line [ x1 "40", x2 "80", y1 "20", y2 "20" , stroke "rgb(255,0,0)", strokeWidth "0.8"] []
- --, polyline [ points "77,17 80,20 77, 23", stroke "rgb(255,0,0)", fill "rgb(255,0,0)"] []
- , polyline [ points (arrowhead 80 20), stroke "rgb(255,0,0)", fill "rgb(255,0,0)"] []
- , arrow 40 80 120
- ]
- nodeLine vert = line [ x1 vert, x2 vert, y1 "0", y2 "300" , stroke "rgb(0,0,0)", strokeWidth "0.5"] []
- arrow level from to =
- svg [ version "1.1", x "0", y "0", viewBox "0 0 323.141 322.95" ]
- [
- line [ x1 (toString from), x2 (toString to), y1 (toString level), y2 (toString level) , stroke "rgb(255,0,0)", strokeWidth "0.8"] []
- , polyline [ points (arrowhead to level), stroke "rgb(255,0,0)", fill "rgb(255,0,0)"] []
- ]
- arrowhead endX endY =
- let
- topTip = (endX - 3, endY + 3)
- middle = (endX, endY)
- bottomTip = (endX - 3, endY - 3)
- points = [topTip, middle, bottomTip]
- pointToString = \(a,b) -> (toString a) ++ "," ++ (toString b)
- in
- points
- |> List.map pointToString
- |> String.join " "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement