IafViewer
IafViewer overview
The IafViewer is a React component which enables a user to interact with a digital twin model in 3D space using various tools.
This page describes how to install and import the IafViewer component and describes the range of React data props available.
Note: Most applications use
IafViewerDBM, which loads model files and forwards the same mode object props (view3d,view2d,gis,arcgis,ue,photosphere,modelComposition) documented here. For a product introduction and mode guides, see IafViewer Overview and IafViewer Enhanced Viewing Modes.
Install
npm install @dtplatform/iaf-viewer
Import
import { IafViewer } from "@dtplatform/iaf-viewer";
Props
Data props
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
toolbarSize | String | Sets the size of the toolbar. Pass none, small, medium, or large. | medium | No |
showToolTip | Boolean | Enables or disables the tool tip hover-over descriptions. Pass true or false. | true | No |
sidePanelColor | String | Sets the side panel color. You can pass a hex code, RGB value, or a color name. | "#1D1D1D" | No |
onHoverIconColor | String | Sets the icon color during a mouse hover event. | invert(40%) sepia(86%) saturate(6224%) hue-rotate(311deg) brightness(83%) contrast(101%) | No |
onActiveIconColor | String | Sets the color of the active icon. | invert(40%) sepia(86%) saturate(6224%) hue-rotate(311deg) brightness(83%) contrast(101%) | No |
toolbarColor | String | Sets the toolbar color. | "#333333" | No |
isShowNavCube | Boolean | Shows or hides the navigation cube. | true | No |
modelVersionId | String | Pass the model's version id as a string. | No | |
showNotification | Boolean | Show or hide notifications | true | No |
enableFocusMode | Boolean | Enable or disable focus mode | true | No |
enable2DViewer | Boolean | Toggles the display of the 2D viewer | true | No |
enableOptimizedSelection | Boolean | Enables a performance-optimized algorithm that improves 2D and 3D node selection speed and prevents unnecessary rerendering | false | No |
workflow | Object | Animation workflows (markup, sprites, transforms). See IafViewerDBM — Animations. | See PropertyStore defaults | No |
modelComposition | Object | Which models and disciplines load. See modelComposition. | See breakdown | No |
enablePersistence | Boolean | When true, persists viewer state (annotations, GIS, graphics, view settings) to the configured backend. When false, falls back to local browser storage. | false | No |
view3d | Object | 3D view configuration. See View3d. | See breakdown | No |
view2d | Object | 2D view configuration. See View2d. | See breakdown | No |
gis | Object | Mapbox GIS mode. See GIS. | See breakdown | No |
arcgis | Object | ArcGIS SceneView mode. See Arcgis and arcgis overview. | No | |
arcgisOverview | Object | ArcGIS overview / context map. Same prop shape as arcgis with different layout defaults. | No | |
ue | Object | Unreal Engine pixel-stream view. See UE. | No | |
photosphere | Object | 360° panoramic view. See Photosphere. | No | |
aps | Object | Autodesk Platform Services (APS) viewer mode. See APS. | See breakdown | No |
i18n | Object | Language, message overrides, and fonts for the viewer chrome. See i18n. | { locale: 'en', messages: {}, fontFamily: undefined, fonts: [] } | No |
title | String | Unique label for identifying the viewer instance in logs and debugging. | undefined | No |
Callback props
| Prop | Event that triggers callback function | Returns |
|---|---|---|
OnIsolateElementChangeCallback | The user isolates an element in the graphics viewer when they right-click the element, then click Isolate | The ID of the isolated element |
OnSelectedElementChangeCallback | The user selects one or more elements in the graphics viewer | An updated array of the selected elements' IDs |
OnResetCallback | The user clicks the Reset button | true |
OnHiddenElementChangeCallback | The user hides one or more elements in the graphics viewer | An updated array of the hidden elements' IDs |
saveSettings | The user clicks the Save & Close button in the Settings pane. | The IafViewer settings as a JSON object for your function to store in local storage. |
OnNotificationCallback | An info, warning or error notification event occurs. | The notification as a JSON object |
OnViewerReadyCallback | Callback function that triggers when the model's structure is successfully loaded and ready. This is called separately for 3D and 2D viewers. Pass '2d' or '3d' as the parameter. |
Example
import React from "react";
import { IafViewer } from "@dtplatform/iaf-viewer";
const ViewerPage = () => {
const mySaveSettingsFunction = (settings) => {
//your function here
}
return (
<PageTemplate>
<IafViewer
toolbarSize={"large"}
saveSettings={mySaveSettingsFunction}
/>
</PageTemplate>
)
}
export default ViewerPage;
Object prop breakdowns
Defaults below match PropertyStore in @dtplatform/iaf-viewer. Apps usually pass these through IafViewerDBM.
modelComposition
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
modelComposition.defaultFederationType | String | "SingleModel" (one model from model / modelVersionId), "Project" (all workspace models), or "MultiModel" (outlines placed only from the models listed in clusteredModels) | "SingleModel" | No |
modelComposition.clusteredModels | Array | Optional clusters of models (filter + shared map outline / site). Used with Project / MultiModel. Each entry may be a string array or { evmMode?, ids, center?, altitude?, id?, name?, title?, bearing?, zoom? }. | [] | No |
modelComposition.clusteredModels[].evmMode | String | Mode of the cluster's designs. Omit for View3D (ids are model _id values, outline from Graphics Service ViewOutline). Set to 'aps' for APS (ids are design URNs, outline from APS Extra Derivatives GlbDraco). | View3D | No |
modelComposition.clusteredModels[].ids | Array | Model IDs (View3D) or design URNs (APS) in the cluster. modelIds is still accepted as a legacy alias for View3D clusters only. | — | Yes, for object entries |
modelComposition.initial | Object | Per-discipline { load, visible } for Structural, Architectural, Mechanical, Electrical, Plumbing, FireProtection, Infrastructural, default. Architectural defaults to { load: true, visible: true }; others default to { load: false, visible: false }. | See PropertyStore | No |
modelComposition.quality | String | Dynamic-loading eligibility: 'low' (default), 'medium', 'high'. | 'low' | No |
How each federation type treats View3D and APS clusters:
| Federation type | View3D clusters | APS clusters |
|---|---|---|
SingleModel | Unchanged | Ignored |
Project | Unchanged (all project models; clusters act as a filter) | Not seeded or placed |
MultiModel | Outlines only from View3D clusters (no all-project fallback) | Placed as GlbDraco outlines |
Resolution order when merging composition: props.settings → localStorage (iafviewer_settings) → props.modelComposition → PropertyStore default. Integrator guide: Model composition.
View3d
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
view3d.enable | Boolean | Enables or disables the 3D model rendering. | true | No |
view3d.visible | Boolean | Shows or hides the enabled widget without turning it off. | true | No |
view3d.opacity | Number | Model opacity between 0.0 (transparent) and 1.0 (opaque). | 1.0 | No |
view3d.displayMode | Enum | EvmUtils.EVMDisplayMode: DEFAULT, SPLIT, FULLSCREEN, FIXED. | FULLSCREEN | No |
view3d.showToolbar | Boolean | Shows or hides the 3D viewer toolbar. | false | No |
view3d.showLauncher | Boolean | Shows or hides the main-toolbar launcher that opens the 3D viewer. | true | No |
view3d.alignment | Enum | EvmUtils.EVMWidgetAlignment: LEFT_TOP, LEFT_BOTTOM, RIGHT_TOP, RIGHT_BOTTOM (SPLIT / FIXED). | RIGHT_TOP | No |
view3d.order | Number | Layout order among EVM widgets. | 1 | No |
view3d.margin | Number | Layout margin. | 0 | No |
view3d.renderingMode | Enum | Draw mode (for example EvmUtils.EVMDrawMode.Shaded). | Shaded | No |
view3d.onRenderingModeChange | Function | (mode) => void when rendering mode changes. | noop | No |
view3d.camera | Object | Structured camera placement, aligned with aps.camera: enable, mode ('spherical' | 'absolute'), projection, fov, view (named orientation), spherical { bearingDeg, pitchDeg, distance, useModelOriginTarget }, absolute { position, target, up, width, height, nearLimit }. A Communicator.Camera.toJson() object is also accepted and normalized into absolute. To restore a saved camera, assign a stored onCameraUpdate payload back to view3d.camera. | { enable: false } | No |
view3d.onCameraUpdate | Object | { delayInMs, callback } — throttled camera observer. delay is still accepted as an alias for delayInMs. After a named-view apply, the payload may include view. Prefer this over driving Mapbox / View3D cameras from app code when GIS is also enabled. | { delayInMs: 300, callback: undefined } | No |
view3d.rendering.ignoreSpaceTransparencyInGlass | Boolean | In Glass mode, draws isolated spaceElementIds in the XRay Selected overlay, which overrides authored space transparency. Set to false to keep authored space transparency. | true | No |
view3d.keepAlive | Boolean | Keep-alive for the 3D subtree load. | false | No |
When the GIS overlay is on, the GIS tuner can overwrite the camera every frame, so camera pushes from view3d.camera compete with it.
View2d
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
view2d.enable | Boolean | Enables or disables the 2D viewer. | true | No |
view2d.visible | Boolean | Shows or hides the enabled widget without turning it off. | true | No |
view2d.fullscreen | Boolean | When true, the 2D viewer occupies the full screen. | false | No |
view2d.displayMode | Enum | EvmUtils.EVMDisplayMode: DEFAULT, SPLIT, FULLSCREEN, FIXED. | DEFAULT | No |
view2d.showToolbar | Boolean | Display or hide the 2D viewer toolbar. | true | No |
view2d.showLauncher | Boolean | Shows or hides the launcher for the 2D viewer. | true | No |
view2d.alignment | Enum | LEFT_TOP, LEFT_BOTTOM, RIGHT_TOP, RIGHT_BOTTOM. | LEFT_TOP | No |
view2d.order | Number | Layout order. | 2 | No |
view2d.margin | Number | Layout margin. | 10 | No |
view2d.keepAlive | Boolean | Keep-alive for the 2D subtree. | false | No |
GIS
GIS features rely on external GIS services like Mapbox. Applications integrating GIS must:
- Supply a valid Mapbox token (
token) - Handle token lifecycle (generation, refresh, expiration)
- Ensure compliance with Mapbox’s licensing, usage limits, and terms of service.
gis is a top-level prop group — not nested under view3d.
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
gis.enable | Boolean | Enables or disables GIS mode. | false | No |
gis.visible | Boolean | Shows or hides the enabled widget without turning it off. | true | No |
gis.token | String | Mapbox access token (app-managed lifecycle). | undefined | No |
gis.opacity | Number | Map layer opacity (0.0–1.0). | 1.0 | No |
gis.federatedMode | Enum | EvmUtils.EvmFederatedMode: None, Outline, Hybrid (enum; not offered in GIS UI today), Dynamic, Markers. | Outline | No |
gis.primaryModelId | String | Reference model for alignment. | undefined | No |
gis.elevationMode | Enum | EvmUtils.EvmElevationMode (for example None, QuickSurface, Underground). | None | No |
gis.showMapMarkers | Boolean | Show location markers on the map. | true | No |
gis.enableLocationTooltipOnHover | Boolean | When true, marker hover tooltip includes Lat/Lng under the title. | true | No |
gis.initial | Object | Default Mapbox session: zoom, bearing, pitch, center: { lng, lat }, and clusterLoadMode ("Replace" | "Incremental"). Partial gis.initial merges with PropertyStore defaults. | See PropertyStore (clusterLoadMode: "Replace") | No |
gis.initial.enableOverlay | Boolean | Set to false when your application shows the detailed model in a separate widget, such as Geo BIM side by side. It also resolves to false when any APS cluster is present. When it's effectively false: Reference Model, Rendering Distance, and Rendering Zoom stay visible but disabled; the federated-mode dropdown omits None and Dynamic and coerces to Outline; double-click doesn't call setPrimaryModel, but onModelSelect still fires. | true | No |
gis.dynamicRenderingDistance | Number | Scales detailed vs outline switching distance (meters baseline × scale). | 750 | No |
gis.dynamicRenderingZoom | Number | Map zoom offset for the same switching logic. | 14 | No |
gis.onIafMapReady | Function | (mapProxy) => void when the Mapbox instance is ready. | undefined | No |
gis.onFederatedModeChanged | Function | (federatedMode) => void | undefined | No |
gis.onReferenceModelChanged | Function | (modelId) => void | undefined | No |
gis.onElevationModeChanged | Function | (elevationMode) => void | undefined | No |
gis.onModelSelect | Function | (modelId, eventType, modelIds) => void. Fires for both 'click' and 'dblclick', and fires even when View3D is disabled. modelIds lists every marker under the pointer ( IDs and/or APS IDs); filter it in your application. | undefined | No |
gis.onOutlineLoaded | Function | (modelIds) => void | undefined | No |
gis.onLongitudeChange / onLatitudeChange / onBearingChange / onAltitudeChange | Function | (modelIds, value) => void for realignment changes | undefined | No |
gis.displayMode | Enum | DEFAULT, SPLIT, FULLSCREEN, FIXED. | FULLSCREEN | No |
gis.showToolbar | Boolean | GIS toolbar visibility. | false | No |
gis.showLauncher | Boolean | Launcher visibility. | true | No |
gis.alignment | Enum | Widget alignment for SPLIT / FIXED. | RIGHT_TOP | No |
gis.debug.showGisAnchorLabel | Boolean | Diagnostic: shows the GIS anchor label. | false | No |
gis.debug.showOutlineModelOriginLabel | Boolean | Diagnostic: shows the outline model origin label. | false | No |
gis.debug.showAxisOriginLabel | Boolean | Diagnostic: shows the axis origin label. | false | No |
gis.debug.originLabelDisplay | String | What the origin labels show: 'geo', 'model', or 'both'. | 'both' | No |
Integrator UI and camera-sync guidance: IafViewer GIS (Mapbox). Multi-building consumption: Federated View3D Buildings on Gis(Mapbox).
Arcgis and arcgis overview
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
enable | Boolean | Enables or disables the ArcGIS view. | false | No |
visible | Boolean | Shows or hides the enabled widget without turning it off. | true | No |
slicedElements | Array | List of model elements to slice or clip within the scene. | [] | No |
themeElements | Array | Elements with visual themes or highlighting applied. | [] | No |
layers | Array | ArcGIS layers to render. | [] | No |
graphics | Array | Graphic overlays (points, lines, polygons). | [] | No |
zoomElements | Array | Element IDs or references to zoom into on initialization. | [] | No |
camera | Object | Camera configuration (position, tilt, heading). | {} | No |
config | Object | Portal URL, API key, web scene id, WKID, and SceneView options. | undefined | No |
portalUrl | String | ArcGIS portal URL (often under config). | undefined | No |
apiKey | String | ArcGIS portal API key. | undefined | No |
model | String | Web scene ID to load. | undefined | No |
sceneWKID | String | Spatial reference WKID. | undefined | No |
command | Array | Legacy command queue. | [] | No |
eventHandler | Function | Callback for ArcGIS viewer events. | undefined | No |
onIafMapReady | Function | (mapInstance) => void when SceneView / MapView is ready. | undefined | No |
displayMode | Enum | Layout mode. Defaults: arcgis FULLSCREEN; arcgisOverview DEFAULT. | see left | No |
showToolbar | Boolean | Toolbar visibility. | true | No |
alignment | Enum | Widget alignment. Defaults: arcgis LEFT_TOP; arcgisOverview LEFT_BOTTOM. | see left | No |
arcgis={{
enable: true,
slicedElements: ['zone-12'],
themeElements: ['sensor-critical'],
layers: ['base-terrain', 'heatmap-layer'],
graphics: [customLine, customPoint],
zoomElements: ['facility-23'],
camera: { heading: 45, tilt: 30 },
config: {
portalUrl: "https://gis.example.com/arcgis",
apiKey: `#########################################`,
model: "6745f5a0f1df4812a26925c19fdab6f8",
sceneWKID: 102100,
shadows: false,
groundOpacity: 1,
popUpEnabled: false,
highlightOnClick: false,
},
command: [],
displayMode: EvmUtils.EVMDisplayMode.SPLIT,
showToolbar: true,
alignment: EvmUtils.EVMWidgetAlignment.RIGHT_BOTTOM,
eventHandler: (event) => {
console.log('ArcGIS event:', event);
},
onIafMapReady: (mapInstance) => {
mapInstance.setMapStyle("arcgis/light-gray");
}
}}
UE
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
ue.enable | Boolean | Enables or disables the Unreal Engine viewer. | false | No |
ue.visible | Boolean | Shows or hides the enabled widget without turning it off. | true | No |
ue.config | Object | { server, app } for the pixel-stream connector URL. | { server: "", app: "" } | No |
ue.zoomElements | Array | Element IDs to focus on when initializing. | [] | No |
ue.command | Array | Legacy command queue. | [] | No |
ue.eventHandler | Function | (event) => void for UE viewer events. | noop | No |
ue.onUeReady | Function | (viewerInfo) => void when the stream is ready (sendCommand, viewerReady, …). | noop | No |
ue.displayMode | Enum | DEFAULT, SPLIT, FULLSCREEN, FIXED. | DEFAULT | No |
ue.showToolbar | Boolean | Toolbar visibility. | true | No |
ue.showLauncher | Boolean | Launcher visibility. | true | No |
ue.alignment | Enum | Widget alignment. | RIGHT_BOTTOM | No |
ue={{
enable: true,
config: {
server: 'https://connector.example.com',
app: '/v6/eyJ...'
},
zoomElements: ['machine-42'],
command: [],
displayMode: EvmUtils.EVMDisplayMode.FULLSCREEN,
showToolbar: false,
alignment: EvmUtils.EVMWidgetAlignment.LEFT_TOP,
eventHandler: (event) => {
console.log('Unreal Engine event:', event);
},
onUeReady: (viewerInfo) => {
if (viewerInfo.viewerReady) {
// viewerInfo.sendCommand({ commandName, params })
}
}
}}
Integrator guide: IafViewer Unreal Engine.
Photosphere
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
photosphere.enable | Boolean | Enables or disables the Photosphere view. | false | No |
photosphere.visible | Boolean | Shows or hides the enabled widget without turning it off. | true | No |
photosphere.config | Object | { modelUriBase, model: { id, defaultImage, defaultScene, scenes } }. Image URL is modelUriBase + defaultImage. | See PropertyStore | No |
photosphere.eventHandler | Function | Optional callback for scene-change / hotspot events. | undefined | No |
photosphere.displayMode | Enum | DEFAULT, SPLIT, FULLSCREEN, FIXED. | DEFAULT | No |
photosphere.showToolbar | Boolean | Toolbar visibility. | true | No |
photosphere.showLauncher | Boolean | Launcher visibility. | true | No |
photosphere.alignment | Enum | Widget alignment. | RIGHT_TOP | No |
photosphere={{
enable: true,
config: {
modelUriBase: 'https://example.com/panoramas/',
model: {
id: 'lobby-tour',
defaultImage: 'lobby.jpg',
defaultScene: {
id: 'lobby',
type: 'equirectangular',
autoLoad: true,
hfov: 110,
pitch: 0,
yaw: 0,
hotSpots: []
},
scenes: []
}
},
displayMode: EvmUtils.EVMDisplayMode.FULLSCREEN,
showToolbar: true,
alignment: EvmUtils.EVMWidgetAlignment.LEFT_BOTTOM
}}
Integrator guide: IafViewer Photosphere.
APS
Autodesk Platform Services (APS) viewer mode. The IafViewer loads the Autodesk Viewer (LMV) SDK from the Autodesk CDN (default SDK 7.100, configurable with aps.config.sdkVersion) and uses the viewer token your application passes in aps.config.accessToken. APS requires network access to developer.api.autodesk.com. An APS-enabled GraphicsService is optional and provides the APS REST proxy (OSS, Model Derivative, Extra Derivatives).
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
aps.enable | Boolean | Master switch for the APS widget. | false | No |
aps.visible | Boolean | Shows or hides the enabled widget without turning it off. | true | No |
aps.layout | Object | Widget chrome: displayMode, showToolbar, showLauncher, alignment, order, margin. Top-level legacy keys on aps are still read. | displayMode: FULLSCREEN, showToolbar: true, showLauncher: true, alignment: LEFT_TOP, order: 6, margin: 0 | No |
aps.config.urn | String | Array | Design URN, or an ordered set of URNs loaded in one viewer. Element 0 is primary and drives single-design APIs. | undefined | Yes, to load a design |
aps.config.viewableGuid | String | Viewable to load. Takes precedence over viewableName. If no viewable matches, the viewer falls back to {3D}. | undefined | No |
aps.config.viewableName | String | Viewable to load by name. | undefined | No |
aps.config.accessToken | String | APS token that your application supplies. The viewer uses it to load designs and forwards it to GraphicsService as X-Aps-Access-Token. The token's scopes decide which APIs work: for example, a viewables:read token loads and displays designs, but payload.apis.server.fetchModelProperties also needs data:read, and uploadModelFile needs data:write and data:create. For the full scope table, see IafViewer APS — Access token scopes. Legacy top-level aps.accessToken is still accepted. | undefined | Yes |
aps.config.bucketKey | String | OSS bucket, forwarded to GraphicsService as X-Aps-Bucket-Key, for model list and upload. Optional if urn is provided. | undefined | No |
aps.config.sdkVersion | String | LMV SDK version. undefined uses the loader default. | undefined | No |
aps.config.modelOutlineQuality | Object | Mesh quality for GIS outline placement: mode 'source' (original GlbDraco), 'simplify' (meshoptimizer), or 'shell' (voxel outer surface, uses voxelCm); plus ratio, error, voxelCm. | { mode: 'source', ratio: 0.02, error: 0.02, voxelCm: 50 } | No |
aps.config.initial.extensions | Array | Optional LMV extension IDs, such as Autodesk.DocumentBrowser. Prefer dedicated aps.* props where they exist. | [] | No |
aps.config.initial.enableDefaultUi | Boolean | true uses GuiViewer3D; false uses Viewer3D (no LMV toolbar). | true | No |
aps.camera
Pushing a pose doesn't lock the canvas. Orbit, pan, and zoom stay interactive. The camera is Z-up.
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
aps.camera.enable | Boolean | Enables camera placement from mode. | false | No |
aps.camera.mode | String | 'spherical' (bearing and pitch orbit) or 'absolute' (explicit position and target). | 'spherical' | No |
aps.camera.view | String | Named orientation: 'home', 'fit', 'top', 'bottom', 'front', 'back', 'left', 'right'. A non-empty view owns the camera; clear it to hand control back to mode. Applies independently of enable. | undefined | No |
aps.camera.projection | String | 'perspective' or 'orthographic'. undefined leaves LMV alone. Applies even when enable is false. | undefined | No |
aps.camera.fov | Number | Vertical field of view in degrees. Ignored when orthographic. | undefined | No |
aps.camera.showNavCube | Boolean | Shows the LMV navigation cube (ViewCube). | false | No |
aps.camera.spherical | Object | bearingDeg (−180 to 180), pitchDeg (0 to 85), distance (undefined keeps the current distance), useModelOriginTarget (true aims at the model bounding-box center). | { bearingDeg: 0, pitchDeg: 30, distance: undefined, useModelOriginTarget: true } | No |
aps.camera.absolute | Object | position, target, and up vectors. An omitted vector comes from the live camera. | { position: undefined, target: undefined, up: { x: 0, y: 0, z: 1 } } | No |
aps.navigation, aps.rendering, aps.cuttingPlanes, and aps.selection
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
aps.navigation.mode | String | Mouse mapping: undefined or 'pan' (left pan, middle dolly, right orbit), 'orbit', 'zoom', 'walk', 'firstPerson'. Matches View3D navigation. | undefined | No |
aps.rendering.mode | String | 'shaded', 'wireframeOnShaded', 'hiddenLine', 'wireframe', 'glass'. Close to View3D draw modes. An invalid value falls back to 'shaded'. | 'shaded' | No |
aps.rendering.glass | Object | Used when mode is 'glass': mode 'materials' (face opacity) or 'ghosting', and opacity (0 to 1). | { mode: 'materials', opacity: 0.05 } | No |
aps.rendering.slice | Object | Look of sliced elements: mode, opacity. | { mode: 'ghosting', opacity: 1 } | No |
aps.rendering.appearance | Object | antialiasing, ambientShadows, groundShadow, groundReflection. | All false | No |
aps.rendering.display | Object | lines, points, sectionHatches, units, precision. | See PropertyStore | No |
aps.rendering.performance | Object | disableShadowEffect, progressiveDisplay, largeModelExperience. | See PropertyStore | No |
aps.cuttingPlanes.enable | Boolean | Master switch. false clears all cutting planes. Drives LMV only, not HOOPS cutting planes. | false | No |
aps.cuttingPlanes.mode | String | 'named' (uses planes), 'absolute' (uses absolute), or 'box' (uses box). | 'named' | No |
aps.cuttingPlanes.planes | Object | Cut depth from each face, 0 to 1 (0 is off): top, bottom, front, back, left, right. | All 0 | No |
aps.cuttingPlanes.absolute | Array | { x, y, z, w } plane coefficients in model units. For example, { x: 0, y: 0, z: 1, w: -5 } clips above z = 5. Up to about 6 planes. | [] | No |
aps.cuttingPlanes.box | Object | { min: {x,y,z}, max: {x,y,z} } in viewer space. Seed it from onApsReady boundingBoxViewer, then tighten. | Open box (±1e9) | No |
aps.selection.mode | String | Selection mode. | 'lastObject' | No |
aps.selection.selectedElementIds / slicedElementIds / hiddenElementIds | Array of Number | LMV dbId integers. Each array replaces the previous set; [] clears it. There's no ↔ LMV ID mapping, so don't reuse View3D ID arrays. The slice look follows aps.rendering.slice. | [] | No |
The Autodesk.Section gizmo isn't driven by aps.cuttingPlanes. To use it, add it to aps.config.initial.extensions.
aps.callbacks
Use aps.callbacks.* instead of the legacy top-level aps.onApsReady and aps.onApsCameraChange, which are still read.
| Callback | Signature | When it fires |
|---|---|---|
onApsReady | (payload) => void | After the viewer starts and loads the initial document. Payload: urn, error, viewer, document, viewableNode, namespace, viewerState, boundingBox, boundingBoxViewer, globalOffset, unit, models, apis (LMV and GraphicsService APS helper functions). |
onApsModelsChange | ({ urns, primaryUrn, models, added, removed, failed }) => void | After a later change to aps.config.urn (not the initial load). |
onApsCameraChange | { delayInMs: 300, callback({ position, target, up, fov, projection, view? }) } | Once on ready, then debounced on every camera change. Same shape as view3d.onCameraUpdate. view appears only after a named-view apply. |
onCuttingPlanesUpdate | (status) => void | After each cutting-plane apply. status includes enable, mode, unit, appliedCount, cleared, summary, and planes[] with a human-readable meaning. |
onSelectedElementChange | (dbIds: number[]) => void | On canvas selection or prop-driven highlight. |
onSlicedElementChange / onHiddenElementChange | (dbIds: number[]) => void | After each selection apply. |
import { IafViewerDBM, IafEvmUtils } from '@dtplatform/iaf-viewer';
<IafViewerDBM
aps={{
enable: true,
layout: { displayMode: IafEvmUtils.EVMDisplayMode.FULLSCREEN, showToolbar: true },
config: { urn: ['dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6...'] },
camera: { enable: true, view: 'fit' },
rendering: { mode: 'shaded' },
callbacks: {
onApsReady: (payload) => console.log(payload.viewerState, payload.apis),
onSelectedElementChange: (dbIds) => setSelected(dbIds),
},
}}
/>
Integrator guide: IafViewer APS.
i18n
Language and fonts for the viewer chrome. Your application localizes the page around the viewer.
| Prop | Type | Description | Default value | Required |
|---|---|---|---|---|
i18n.locale | String | BCP 47 tag. The language subtag selects one of the 17 shipped catalogs. Unsupported tags and missing keys fall back to English. | 'en' | No |
i18n.messages | Object | Nested overrides deep-merged onto the shipped catalog, using the same tree as IafI18n.catalog. Not a flat dotted map. Keep {placeholders} intact. | {} | No |
i18n.fontFamily | String | CSS font-family stack that replaces the locale-derived stack. Include script coverage (CJK, Devanagari, and so on) yourself. | undefined (derived) | No |
i18n.fonts | Array | Extra { label, value } font choices. The markup Style dropdown is the first consumer. | [] | No |
The IafI18n export exposes IafI18n.catalog, the English message tree, for key discovery.
Integrator guide: IafViewer internationalization.