-
Notifications
You must be signed in to change notification settings - Fork 8
Polyline
Christopher Nikkel edited this page Dec 23, 2018
·
9 revisions
type Polyline =
{
Points: seq<Point>
}
Polyline
is used to create a SVG polyline.
Function | Signature | Description |
---|---|---|
Polyline.create |
seq<Point> -> Polyline |
create a Polyline with a sequence of Points |
Polyline.ofSeq |
seq<Point> -> Polyline |
create a Polyline with a sequence of Points |
Polyline.ofList |
Point list -> Polyline |
create a Polyline with a list of Points |
Polyline.ofArray |
Point [] -> Polyline |
create a Polyline with an array of Points |
Polyline.toString |
Polyline -> string |
convert a Polyline to a string |
let points =
seq {
yield Point.ofInts (55, 45);
yield Point.ofInts (45, 45);
yield Point.ofInts (45, 15);
yield Point.ofInts (10, 5);
}
let style = Style.create (Name Colors.Yellow) (Name Colors.Red) (Length.ofInt 3) 1.0 1.0
points
|> Element.createWithStyle style
|> printf "%O"
<polyline stroke="red" stroke-width="3" fill="yellow" opacity="1" points="55,45 45,45 45,15 10,5"/>