An icon node style for use in WebGL2 rendering.
Inheritance Hierarchy
WebGL2IconNodeStyle
Remarks
Note that unlike INodeStyle implementations, this class is immutable and can not be used with setStyle. All properties are read-only and immutable and the class cannot be subclassed, either. Its sole purpose is to be used with the setStyle method of WebGL2GraphModelManager.
Type Details
- yfiles module
- view-webgl
- yfiles-umd modules
- view-webgl, view
- Legacy UMD name
- yfiles.view.WebGL2IconNodeStyle
See Also
WebGL2ShapeNodeStyle,
WebGL2GroupNodeStyle,
ImageNodeStyle and IconLabelStyle are not auto-converted
Constructors
WebGL2IconNodeStyle
(icon: ImageData, iconColor?: Color, preserveAspectRatio?: boolean, shape?: WebGL2ShapeNodeShape, fill?: Color, stroke?: WebGL2Stroke, effect?: WebGL2Effect, textureRendering?: WebGL2TextureRendering)Creates a new icon node style that is rendered with WebGL2.
Remarks
This style can be applied to nodes that are rendered by the WebGL2GraphModelManager.
The preferred way of calling the constructor is using option arguments, as there are many defaults and optional arguments. To use the default value for a color option, set it to null
.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- icon - ImageData
- The mandatory image data for the icon.
- iconColor - Color
- The fill color of the icon, or
null
. If this parameter isnull
, the original color of the icon is used. Otherwise the alpha values of the icon will be combined with the color values from this value. Defaults tonull
. - preserveAspectRatio - boolean
- Whether to preserve the icon aspect ratio. Defaults to
false
. - shape - WebGL2ShapeNodeShape
- The shape of the node. Defaults to ELLIPSE.
- fill - Color
- The background color of the node. Defaults to WHITE.
- stroke - WebGL2Stroke
- The border color of the node. Defaults to BLACK.
- effect - WebGL2Effect
- The effect around the node. Defaults to NONE.
- textureRendering - WebGL2TextureRendering
- Rendering hint on how to resolve blurriness of icon images on large zoom values. Defaults to INTERPOLATED We recommend not using SDF for images that contain gradients.
Properties
Gets the set of applied effects on this style.
Gets the fill color for the shape background.
Gets the shape of the style.
Gets the stroke around the shape.
Gets the rendering hint on how to resolve blurriness of icon images on large zoom values.
Remarks
Default value is INTERPOLATED We recommend not using SDF for images that contain gradients.