bracketDashArray

Bracket
stable

Resolve SVG stroke-dasharray and stroke-linecap attributes from a CSS border-style value. Used by OrigamBracket to render dashed or dotted connector lines.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

borderStyle
requis
string | null | undefined
CSS border-style value: "dashed" → dasharray "8 5", "dotted" → dasharray "1 5" + linecap "round", anything else → empty object.

API

Valeur de retour

La valeur retournée par cet util.

Object with optional dasharray and linecap values ready to spread onto an SVG <line> or <path> element.

Usage

Exemples

Extraits de code prêts à coller.

Map border-style to SVG stroke attributes

typescript