Stroke

Core::Diagram::Stroke

Overview

Aggregated Data Type

A stroke defines the visual appearance of a line.

(Fullscreen Diagram)

<<datatype>>StrokeColor :ColorDashStyle :DashStyleWidth :Double

Members

Data Properties

Name

Multiplicity

Type

Ordered

Unique

Color

1

Color

no

no

The color of the Stroke.

DashStyle

1

DashStyle

no

no

The dash style of the Stroke.

Width

1

Double

no

no

The width of the Stroke in mm.

Simplified Literals

Within this specification, a simplified type of literal is used to refer to a Stroke. This literal is composed of

The three components are separated by spaces.

For example, a Stroke with

is represented as 2mm #00ff00 Dot.

Mapping to SVG

A Stroke is mapped to a set of XML attributes, which are added to the SVG element (e.g., a svg:polygon or a svg:polyline element) that is drawn with the Stroke.

  • The Color of the Stroke is mapped to the stroke attribute. For the attribute value, see the SVG mapping for Color.

  • The DashStyle of the Stroke is mapped to the stroke-dasharray and stroke-dashoffset attributes as described in the SVG mapping for DashStyle. Note that these attribute values depend on the Width of the Stroke and on the linecap of the GraphicalPrimitive that uses the Stroke.

  • The Width of the Stroke is mapped to the stroke-width attribute. The attribute value is the concatenation of the string representation of the Width and the fixed string mm. That is, in terms of standard-css-values-4 we use an absolute length with the unit millimeters.

Example

For examples, see the SVG mapping sections of those subclasses of GraphicalPrimitive that have a Stroke attribute:

Color

Data Property

The color of the Stroke.

Type: Color

Multiplicity: 1

Ordered: no

Unique: no

Example

Color(

     B = 255,

     G = 0,

     R = 0)

DashStyle

Data Property

The dash style of the Stroke.

Type: DashStyle

Multiplicity: 1

Ordered: no

Unique: no

Example

Solid

Width

Data Property

The width of the Stroke in mm.

Type: Double

Multiplicity: 1

Ordered: no

Unique: no

Example

2.0