NPM Package/docs/capabilities/styles/global
Global Styles
Set default appearance properties for all annotations and drawings using the SDK.
Use viewer.styles.setGlobalAppearance(...) to set default appearance values for new annotations, drawings, and measurements created after the command is sent.
Global style commands are available after the viewer is mounted and Canvas is ready.
typescript
Overview
Call the style setup payload programmatically:
setGlobalAppearance(...)returnsvoid. Canvas does not define a result event for this command, so treat it as a fire-and-forget default update.
typescript
Set Defaults
Supported global appearance properties:
- strokeColor: Line or outline color hex string.
- fillColor: Shape interior color hex string.
- textColor: Text or label color hex string.
- lineWidth: Line thickness (1 to 10).
- lineStyle: Line pattern (0 solid, 1 dashed, 2 dotted).
- transparency: Transparency scale (0 opaque to 100 fully transparent).
typescript
Options Configuration
Set global defaults before enabling the tool that creates the new markup:
typescript
Apply Before Tool Activation
Complete integration code setup for Vanilla HTML/JS environments:
Vanilla Example
Broker message mapping for global appearance updates:
viewer.styles.setGlobalAppearance(...)maps tosetGlobalAppearance.
