Skip to content

Polyline

Christopher Nikkel edited this page Dec 23, 2018 · 9 revisions

Polyline

Definition

type Polyline =
    {
        Points: seq<Point>
    }

Description

Polyline is used to create a SVG polyline.

Functions

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

Usage

Example

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"

Output

<polyline stroke="red" stroke-width="3" fill="yellow" opacity="1" points="55,45 45,45 45,15 10,5"/>

Table of Contents

Getting Started

Fundamentals

Basic SVG Elements

Advanced Elements

Experimental

Clone this wiki locally
You can’t perform that action at this time.