documentationfor yFiles for HTML 2.6

A CanvasComponents theme is used to configure the general look and feel of its interaction visualization.

Inheritance Hierarchy
Theme

Remarks

While there are other means to customize each of those visualizations individually, setting a custom Theme allows you to switch to another visualization style or different color set in a one-liner:

// set a new Theme using the round variant, a scale of two and orange/blue colors
graphComponent.theme = new Theme(
  'simple-round',
  '#ff6c00',
  '#a4f0ff',
  '#242265',
  2
)

The variant defines the general visualization style. While the CLASSIC variant uses the well-known styling of previous yFiles for HTML versions, the SIMPLE_SQUARE and SIMPLE_ROUND variants use a more simplistic approach in a rectangular or round fashion.

The primaryColor, secondaryColor, and backgroundColor are used in different combinations by the interaction visualizations. The usage of each color is explained in its property description.

The scale is a factor used to scale the size of IHandles and IPortCandidates.

Type Details

yfiles module
view-component
yfiles-umd modules
All view modules
Legacy UMD name
yfiles.view.Theme

See Also

Constructors

Properties