Nutrient Web SDK

Variable LINE_CAP_PRESETS

The list of line cap styles available in the start-cap and end-cap dropdowns of the Line and Polyline annotation secondary toolbars. Setting this option controls which caps users can choose. It does not change the default cap applied to new annotations.

The order of values determines the order items appear in the dropdown. Both the start-cap and end-cap dropdowns reflect the same list.

This is a display filter only: annotations already saved with a cap type not present in your preset will still render correctly; the cap simply will not be offered in the toolbar.

Setting this to an empty array ([]) empties the dropdown entirely.

"none" is a toolbar entry, not a NutrientViewer.LineCap value. Choosing it in the dropdown removes the cap on that side. When creating or updating annotations in code, omit that side of lineCaps or set it to null instead of passing "none". The same applies to callout.cap on text annotations.

Valid values:

Value Description
"none" No cap (toolbar entry only)
"square" Filled square
"circle" Filled circle
"diamond" Filled diamond
"openArrow" Open arrowhead (outline only)
"closedArrow" Filled arrowhead
"butt" Perpendicular flat line
"reverseOpenArrow" Open arrowhead pointing inward
"reverseClosedArrow" Filled arrowhead pointing inward
"slash" Diagonal slash
Variable

Example

Arrows and no-cap only
NutrientViewer.Options.LINE_CAP_PRESETS = ["none", "openArrow", "closedArrow"]
Always require a visible cap (omit "none")
NutrientViewer.Options.LINE_CAP_PRESETS = ["square", "circle", "openArrow", "closedArrow"]
Empty the cap dropdown (renders with no options)
NutrientViewer.Options.LINE_CAP_PRESETS = []
Restore the default explicitly
NutrientViewer.Options.LINE_CAP_PRESETS = [
"none", "square", "circle", "diamond",
"openArrow", "closedArrow", "butt",
"reverseOpenArrow", "reverseClosedArrow", "slash"
]

Default Value

["none", "square", "circle", "diamond", "openArrow", "closedArrow", "butt", "reverseOpenArrow", "reverseClosedArrow", "slash"]

See Also

LINE_CAP_PRESETS

(
    | "square"
    | "circle"
    | "diamond"
    | "openArrow"
    | "closedArrow"
    | "butt"
    | "reverseOpenArrow"
    | "reverseClosedArrow"
    | "slash"
    | "none"
)[]

The list of line cap styles available in the start-cap and end-cap dropdowns of the Line and Polyline annotation secondary toolbars. Setting this option controls which caps users can choose. It does not change the default cap applied to new annotations.

The order of values determines the order items appear in the dropdown. Both the start-cap and end-cap dropdowns reflect the same list.

This is a display filter only: annotations already saved with a cap type not present in your preset will still render correctly; the cap simply will not be offered in the toolbar.

Setting this to an empty array ([]) empties the dropdown entirely.

"none" is a toolbar entry, not a NutrientViewer.LineCap value. Choosing it in the dropdown removes the cap on that side. When creating or updating annotations in code, omit that side of lineCaps or set it to null instead of passing "none". The same applies to callout.cap on text annotations.

Valid values:

Value Description
"none" No cap (toolbar entry only)
"square" Filled square
"circle" Filled circle
"diamond" Filled diamond
"openArrow" Open arrowhead (outline only)
"closedArrow" Filled arrowhead
"butt" Perpendicular flat line
"reverseOpenArrow" Open arrowhead pointing inward
"reverseClosedArrow" Filled arrowhead pointing inward
"slash" Diagonal slash

Example

Arrows and no-cap only
NutrientViewer.Options.LINE_CAP_PRESETS = ["none", "openArrow", "closedArrow"]
Always require a visible cap (omit "none")
NutrientViewer.Options.LINE_CAP_PRESETS = ["square", "circle", "openArrow", "closedArrow"]
Empty the cap dropdown (renders with no options)
NutrientViewer.Options.LINE_CAP_PRESETS = []
Restore the default explicitly
NutrientViewer.Options.LINE_CAP_PRESETS = [
"none", "square", "circle", "diamond",
"openArrow", "closedArrow", "butt",
"reverseOpenArrow", "reverseClosedArrow", "slash"
]

Default Value

["none", "square", "circle", "diamond", "openArrow", "closedArrow", "butt", "reverseOpenArrow", "reverseClosedArrow", "slash"]

See Also