The Labels class is the parent class to the label type specific classes stored and used in Layers, all of which contain data specifying which points to render labels for, as well as label specific rendering information.
The user is not expected to initialize this class, however this class is likely to be accessed by the user through the Viewport to directly change rendering options, or provide references to Grafer's internal data store for use in animations.
Instance of the PicoGL renderer used by Grafer for rendering.
The instance of the Graph class which the Node class is a child of.
An array holding all the points to render edges between. See EdgesData for more information.
Data mappings are used to compute data properties at runtime using information provided in the data array. The default mappings use property names specified in the PointData datatype. See LabelsData for explanations of properties mapped.
The instance of the picking manager associated with the instance of the graph.
A boolean determining if the labels are rendered or not.
A number taking a range between 0 - 1 setting the label specific near depth. While it is possible to set the near depth using this property, it is not recommended as it is likely to be overwritten by layers. Instead, the near depth should be set using nearDepth and labelsNearDepth.
A number taking a range between 0 - 1 setting the label specific near depth. While it is possible to set the far depth using this property, it is not recommended as it is likely to be overwritten by layers. Instead, the far depth should be set using farDepth and labelsFarDepth.
Determines how overlapping labels are handled by the renderer. Defaults to NORMAL.
See LayerRenderableBlendMode for more information.
A boolean enabling and disabling picking for labels in this class.
A number taking a range between 0 - 1 which determines the transparency of labels in this class. Alpha allows elements under a given label to be rendered.
A number taking a range between 0 - 1 which determines the fade of labels in this class. Fade is similar to alpha except while alpha is true transparency, fade blends the label color with the background color only.
A number taking a range between 0 - 1 which determines the desaturation of labels in this class. Desaturation, which is the opposite of saturation, mutes the colors assigned to a label.
A number taking a range between -1 - 1 which changes the brightness of labels in this class by adding an offset to all components (RGB) of the color value.
A boolean indicating if the labels in this class are opaque, or if they have any level of transparency.
An enum determining the position of the label around its node.
A boolean determining if the label background should be rendered or not. If the background is rendered, the background will take the color assigned to the label, and the text take a contrasting near-black or near-white color. If the background is not rendered, then the text will use the assigned color.
A number determining the minimum distance the camera needs to be from the point associated with the node in order to render the label.
A number determining the offset between the label and the node its attached to.
A number taking a range between 0 - 1. The halo is a border around the glyphs in the label given a contrasting color relative to the color assigned to the glyph. The halo also a the side affect of increasing the character spacing.
Initiates a render of the labels. This method should not be called by the user. Instead if a render is desired the render function in Viewport, which calls this method, should be used instead.
Parameter | Type | Description |
---|---|---|
context | GraferContext | Instance of the PicoGL renderer used by Grafer for rendering. |
mode | RenderMode | An enum specifying the render mode that should be initiated. |
uniforms | RenderUniforms | An object containing the uniforms to call the renderer with. |