    

 ## On this page

  

 

 # Events

 Last update: 17.04.2026 

The component is designed to communicate intrinsic status changes via custom JavaScript events.  
Events are scoped to the  element and handlers should be attached to the viewer element itself. An example of connecting to the partlist changed event assuming instantiation via the previous example code:

```html
<script> 
  function partlistChangedFunc(e) { 
     var obj = document.getElementById("Viewer"); 
     const new_list = obj.parts; 
     // Event handler code goes here...
  } 

  var viewer = document.getElementById("Viewer"); 
  viewer.addEventListener("parts-changed", partlistChangedFunc); 
</script> 

```

In general, events do not contain significant data payloads, relying on properties to contain the changed state values.

## Event details

There are a number of available events. Many are in common over all the renderers, but not all.

EventTriggerRendererDetails**active-changed**'active' changesall{active: bool}**src-changed**'src' changesall{src:url, ext:filename\_ext}**parts-changed**'parts' changeswebgl,envnc{}**proxy-img-changed**'proxy-img' changes  
 Note: not the actual aspect ratio, just the propertyall{proxy\_image:url}**aspect-ratio-changed**'aspect-ratio' changesall{aspect\_ratio: float}**part-attributes-changed**Emitted when setAttributes() is called.SCDOC{parts:\[names\], changed:\[attrnames\]}**gltfviewer-data-probe**The event emits by default and is controlled by the "\_okToSendViewEvent" property, which can be accessed through:   
 viewer\_element.\_render\_instance.\_renderer.scene.navigator (viewer\_element = &lt;ansys-adr-viewer /&gt;)webgl{ emitEle: \[the viewer element that emits this event\], guid: \[viewer guid\], xy: \[x,y coordinate of the current cursor\], syncCursorRay: \[current cursor location's data\] width: \[viewer width\] , height: \[viewer height\]}**gltfviewer-view-change**The event emits by default for non-animated scene and is controlled by the "\_okToSendViewEvent" property, which can be accessed through:   
 viewer\_element.\_render\_instance.\_renderer.scene.navigator (viewer\_element = &lt;ansys-adr-viewer /&gt;)webgl{ proj: \[current viewer's camera projection\], animateSwitch: \[false by default\], guid: \[viewer guid\]}**gltfviewer-spaceclaim-showhover**tooltip changeswebgl  
 SCDOC datafile{tip:tiptext}**gltfviewer-spaceclaim-showfacepoint**a point is picked on a face/edge/bodywebgl  
 SCDOC datafile{x:float,y:float,z:float}**gltfviewer-spaceclaim-pick**new entity is selected (face/edge/body)  
 The viewer must be in picking mode.webgl  
 SCDOC datafile**see below****gltfviewer-spaceclaim-pick** details:

- name: part name
- path: complete "path" to the pick target
- type: SELECTION\_NONE|SELECTION\_EDGE|SELECTION\_FACE|SELECTION\_BODY

Additional fields if type==SELECTION\_EDGE or type==SELECTION\_FACE:

- min: \[xmin, ymin, zmin\]
- max: \[xmax, ymax, zmax\]
- vertices: \[\[x,y,z\], ...\]

Additional fields if type==SELECTION\_BODY:

- min: \[xmin, ymin, zmin\]
- max: \[xmax, ymax, zmax\]