DIQWidgetConfig
Overview
It allows the host application to configure how the widget starts, customize portions of the user interface, enable optional runtime features, and declare which operations are managed directly by the host application.
- DIQWidgetHost(React)
- DIQWidgetBridge(Vanilla JavaScript)
The widget configuration is supplied when the widget is created and may also be updated at runtime using
import type { DIQWidgetConfig } from 'dimensioniq';
const config: DIQWidgetConfig = {
// Automatically open a project
initialProjectKey: 'project-001',
// Hide the Project menu
showProjectMenu: false,
// Hide the DimensionIQ logo
hideLogo: true,
// Host controls selected workflows
capabilities: {
openProject: true,
createRevision: true
},
// Combine mutation callbacks
enableBatching: true
};
Configuration Properties
| Property | Description |
|---|---|
initialProjectKey | Automatically opens a project when the widget loads |
showProjectMenu | Controls visibility of the Project menu, defaults to true |
hideLogo | Hides the DimensionIQ logo from the toolbar, buttons automatically shift left to occupy the available space |
capabilities | Declares which widget workflows are managed by the host application, see DIQCapabilities for further information |
enableBatching | Combines multiple mutation callbacks generated during batch operations into a single onBatchUpdate callback, defaults to false |
Using initialProjectKey
When
To support this behavior, the host application must implement the
callbacks: {
onProjectGet(projectKey, onResponse) {
const project = myDatabase.getProject(projectKey);
if (project) {
onResponse(
{ ok: true, message: '' },
project
);
}
else {
onResponse(
{ ok: false, message: `Project ${projectKey} not found` },
null
);
}
}
}
Callbacks that receive an
If
onResponse(
{ ok: true, message: '' },
project
);
onResponse(
{ ok: false, message: 'Project not found' },
null
);
Using showProjectMenu
By default, the widget displays a Project menu that provides access to project management functions.
Setting
This is useful when the host application already provides its own project selection or navigation interface.
const config = {
showProjectMenu: false
};
Using hideLogo
Setting
The remaining toolbar buttons automatically shift left to occupy the available space.
This is commonly used when embedding the widget into applications with their own branding.
const config = {
hideLogo: true
};
Using capabilities
The
When a capability is enabled, the corresponding widget user interface is hidden and the host application becomes responsible for initiating that workflow through the widget API.
This prevents duplicate controls when the host application already provides its own project, drawing, or revision management interface.
For the complete list of supported capabilities, see
const config = {
capabilities: {
openProject: true,
newProject: true,
createRevision: true
}
};
Using enableBatching
Normally, every modification made by the widget immediately generates its corresponding callback.
When
This can significantly reduce callback traffic during operations that create, update, or remove many objects.
const config = {
enableBatching: true
};
When batching is enabled, the host application should also implement
If
React - DIQWidgetHost
<DIQWidgetHost
iframeURL="https://..."
callbacks={callbacks}
config={config}
/>
The configuration is transmitted during the initial widget connection handshake.
If the configuration changes after the widget has connected, the updated values are not automatically transmitted. To apply updated configuration values, remount or reconstruct the component.
Vanilla JavaScript - DIQWidgetBridge
const bridge = new DIQWidgetBridge({
container: document.getElementById('widget-container'),
iframeURL: 'https://...',
callbacks,
config
});
The configuration is transmitted once during the initial ready handshake.
Runtime Updates
bridge.sendCommand('applyConfig', updatedConfig);
All configuration properties except
Updating