Nutrient Web SDK

ReferenceCustomRenderers

Type Alias CustomRenderers

This object can include functions to be called when specific entities, like annotations, are being rendered in the viewport, and return additional or replacement DOM content for the entity instance.

Currently only annotation's rendering can be customized using the Annotation key.

If the callback returns null, the instance will be rendered normally.

Type Alias

Example

NutrientViewer.load({
customRenderers: {
Annotation: ({ annotation }) => ({
node: document.createElement("div").appendChild(document.createTextNode("Custom rendered!")),
append: true,
})
}
});

See Also

Properties

Annotation

Optional
(
    options: { annotation: AnnotationsUnion },
) => RendererConfiguration | null | undefined

This user defined function receives the AnnotationsUnion to be rendered as argument.

It must return a RendererConfiguration object or null.

(
    options: { comment: NutrientViewer.Comment },
) => RendererConfiguration | null | undefined