Interface: Actions
Provides methods for manipulating the configurator state and controlling product configurations.
The Actions interface gives you direct control over the product configurator, allowing you to programmatically change options, control the camera, manage the scene, export content, and perform various operations that would normally require user interaction.
Example
// Select a product option
const option = { /* option data */ };
window.mimeeqApp.actions.markOption(option, 'block123', 'colorPicker');
// Zoom out to see the entire product
window.mimeeqApp.actions.zoomOut();
AugmentedReality
generateAR
generateAR:
GenerateAR
Function
Creates an Augmented Reality (AR) version of the current product configuration.
This action processes the current product with all its customizations and generates an AR-ready model that can be viewed on compatible devices. It returns a unique shortcode that can be used to access the AR experience.
Business value:
- Allows customers to visualize products in their actual environment before purchase
- Reduces returns by setting accurate expectations of product size and appearance
- Creates engaging marketing experiences that drive conversion
- Provides sales teams with powerful visualization tools for client meetings
Dispatches mimeeq-generate-ar-short-code
-
- with the AR short code when the model is ready.
Example
// Add a "View in your space" AR button to your product page
document.getElementById('view-in-ar').addEventListener('click', () => {
window.mimeeqApp.actions.generateAR().then(shortcode => {
if (shortcode) {
window.location.href = `/ar-viewer?code=${shortcode}`;
}
});
});
getARShortCodeData
getARShortCodeData:
GetARShortCodeData
Function
Retrieves detailed information about an AR model from its shortcode.
This action looks up an existing AR model using its unique identifier and returns comprehensive information about the model, including file paths, product details, and conversion status. For models still being processed, it can provide a subscription to notify when processing completes.
Business value:
- Supports seamless AR experiences by accessing previously created AR models
- Enables informative loading states when AR models are still processing
- Provides product details for consistent AR experience labeling
- Allows tracking of AR model status for analytics and troubleshooting
Example
// Load AR viewer with proper model information
const arShortcode = getParameterFromUrl('code');
if (arShortcode) {
window.mimeeqApp.actions.getARShortCodeData(arShortcode, true)
.then(arData => {
if (arData) {
if (arData.glbPath && arData.usdzPath) {
// Models are ready, load AR viewer
initializeARViewer(arData);
} else if (arData.completeSubscription) {
// Models are processing, wait for completion
showLoadingIndicator();
arData.completeSubscription.then(result => {
hideLoadingIndicator();
initializeARViewer({...arData, ...result});
});
}
} else {
showErrorMessage("AR model not found");
}
});
}
Param
arShortCode
Unique identifier for the AR model
Param
withSubscription
Whether to include a completion notification for processing models
regenerateAR
regenerateAR:
RegenerateAR
Function
Attempts to recreate an AR model when initial generation fails.
This action tries again to create an AR-compatible version of a product when the first attempt was unsuccessful. It uses existing AR data to ensure consistency and returns a shortcode for accessing the AR experience if successful.
Business value:
- Improves AR reliability by providing automatic recovery from generation failures
- Enhances customer experience by reducing error messages during AR experiences
- Maximizes AR availability for products with complex configurations
- Supports continuous operation of AR features in busy retail environments
Example
// Implement automatic retry when AR generation fails
window.mimeeqApp.actions.generateAR().then(shortcode => {
if (!shortcode && arData) {
// First attempt failed, try again
return window.mimeeqApp.actions.regenerateAR(arData);
}
return shortcode;
}).then(finalShortcode => {
if (finalShortcode) {
window.location.href = `/ar-viewer?code=${finalShortcode}`;
} else {
showErrorMessage("AR currently unavailable for this product");
}
});
Param
arData
Previously generated AR data containing model information
showAR
showAR:
ShowAR
Function
Opens the Augmented Reality (AR) viewing interface.
This method initiates the AR experience for the current product configuration. On desktop devices, it displays a modal with a QR code that mobile users can scan to view the product in AR. On mobile devices, it directly launches the AR viewer.
AR viewing allows customers to visualize products in their actual physical space, providing a powerful tool for evaluating size, fit, and appearance in context.
Example
// Add a custom AR button to your interface
document.getElementById('custom-ar-btn').addEventListener('click', () => {
window.mimeeqApp.actions.showAR();
});
Authentication
havePermissions
havePermissions:
HavePermissions
Function
Checks if the current user has specific permissions.
This method verifies whether the logged-in user has any of the specified permissions, which control access to various features and actions in the system. It's useful for conditionally showing or enabling functionality based on user permissions.
Permission-based UI adaptation ensures users only see and access features they're authorized to use, providing a cleaner and more secure experience.
Example
// Only show the export button if the user has export permissions
window.mimeeqApp.actions.havePermissions(['EXPORT_OBJ', 'EXPORT_STL'])
.then(canExport => {
document.getElementById('export-button').style.display =
canExport ? 'block' : 'none';
});
Param
permissions
Array of permission identifiers to check
Basket
prepareCartImage
prepareCartImage:
PrepareCartImage
Function
Prepares an image for inclusion in a cart item.
This method uploads a product image (provided as a base64 string) to storage and returns a reference path that can be used when adding items to the cart. The image serves as a visual representation of the specific configuration being ordered.
Cart images improve the shopping experience by providing visual confirmation of selected products in the cart, order confirmation emails, and order history.
Example
// Create an image of the current configuration for a cart item
window.mimeeqApp.utils.takeScreenshot('jpg', 800)
.then(async (imageBase64) => {
const imagePath = await window.mimeeqApp.actions.prepareCartImage(
imageBase64,
'cart_123',
'item_456'
);
// Add the item to cart with the prepared image
addToCartWithImage(imagePath);
});
Param
base64
Base64-encoded image data
Param
cartId
ID of the cart the image will be associated with
Param
cartItemId
ID of the specific cart item the image represents
Basket Operations
addItemToCart
addItemToCart:
AddItemToCart
Function
Adds an item to the shopping cart.
This method allows you to programmatically add a configured product to the cart, including all its selected options, pricing information, and quantity. It's the digital equivalent of placing a physical product in a shopping basket, ensuring all the customizations and pricing details are accurately captured.
Business value:
- Enables seamless e-commerce integration with your configurator
- Allows for one-click add-to-cart functionality from custom interfaces
- Supports automated ordering processes or bulk-add operations
- Maintains all configuration details for manufacturing or fulfillment
Example
// Add a configured desk to the cart
const cartItem = {
productId: 'prod_desk_123',
productName: 'Executive Desk',
variantCode: 'Width-a9&Material-b5&Color-c3',
quantity: 2,
companyId: 'company_456',
priceType: 'SALE',
sku: 'DESK-EX-001',
isModular: false,
// other required properties...
};
await window.mimeeqApp.actions.addItemToCart(cartItem);
console.log('Product added to cart successfully');
Param
cartItem
Complete definition of the item to add, including product details, pricing context, and quantity
Throws
Will throw an error if the item cannot be added or if required information is missing
createCart
createCart:
CreateCart
Function
Creates a new empty shopping cart.
This method initializes a new cart in the system, generating a unique identifier that can be used for subsequent cart operations. Creating a new cart is typically the first step in a shopping journey for a new session or after a previous cart has been completed or abandoned.
The created cart will be associated with the current user if they are authenticated, or tracked via session for guest users. Multiple carts can exist simultaneously, allowing for scenarios like saved carts, wish lists, or quote comparisons.
Example
// Create a new empty cart at the beginning of a shopping session
const { cartId } = await window.mimeeqApp.actions.createCart();
console.log(`New cart created with ID: ${cartId}`);
// Store the cart ID for future operations
sessionStorage.setItem('currentCartId', cartId);
getCartForPreview
getCartForPreview:
GetCartForPreview
Function
Retrieves comprehensive cart data formatted for display or email sharing.
This method fetches complete cart information including all items, pricing details, customer contact information, and submission data. The returned data is structured for presentation in review screens, email previews, or order confirmation displays.
The cart preview includes not only the basic product information but also calculates totals, applies any price modifiers or discounts, and formats custom fields for easy reading.
Example
// Retrieve a cart for preview before submission
const cartPreview = await window.mimeeqApp.actions.getCartForPreview('cart_123456');
// Display cart summary information
document.getElementById('cart-total').textContent =
`${cartPreview.totalValue} ${cartPreview.currency}`;
// Display all items in the cart
const itemsList = document.getElementById('cart-items');
cartPreview.cartItems.forEach(item => {
itemsList.innerHTML += `<li>${item.quantity}x ${item.productName}</li>`;
});
Param
cartId
The unique identifier for the cart to retrieve
Throws
Will throw an error if the cart cannot be found or if access is denied
getCartItems
getCartItems:
GetCartItems
Function
Retrieves all items currently in the specified cart.
This method fetches the full list of products that have been added to a cart, including their quantities, configurations, and current prices. It's essential for displaying cart contents, calculating totals, or implementing cart management interfaces.
The response includes complete item details that can be used to render cart items, allow quantity adjustments, show product thumbnails, and display price information.
If the cart is not accessible (e.g., closed, doesn't exist, or forbidden), the method returns an object with a code indicating the specific issue rather than throwing an error.
Example
// Fetch and display all items in the current cart
const cartItems = await window.mimeeqApp.actions.getCartItems('cart_123456');
// Check if we received an error code
if ('code' in cartItems) {
if (cartItems.code === 'CART_CLOSED') {
showMessage('This cart has already been submitted');
} else if (cartItems.code === 'CART_NOT_FOUND') {
showMessage('Cart not found - please create a new one');
}
return;
}
// Display the cart items
cartItems.forEach(item => {
addItemToCartDisplay(item);
});
Param
cartId
The unique identifier for the cart to retrieve items from
getCartSubmissionForm
getCartSubmissionForm:
GetCartSubmissionFormAction
Function
Retrieves the custom fields and form structure required for cart submission.
This method fetches the collection of form fields needed to complete a cart submission, including both standard fields (name, email, etc.) and any custom fields defined for the cart submission process. The returned fields contain all necessary validation rules, display properties, and ordering information.
The form structure is typically used to build a dynamic checkout form that collects the required customer information before finalizing an order. Field types can include text inputs, dropdowns, checkboxes, and more complex components like rich text areas.
Example
// Fetch the submission form structure and build a dynamic form
const formFields = await window.mimeeqApp.actions.getCartSubmissionForm('cart_123456');
// Sort fields by their ordinal position
formFields.sort((a, b) => a.ordinal - b.ordinal);
// Create form elements for each field
const formContainer = document.getElementById('checkout-form');
formFields.forEach(field => {
const formControl = createFormControl(field);
formContainer.appendChild(formControl);
});
Param
cartId
The unique identifier for the cart
Throws
Will throw an error if the cart ID is missing or if form retrieval fails
preSubmitCart
preSubmitCart:
PreSubmitCart
Function
Saves partial contact information without fully submitting the cart.
This method allows for incrementally saving customer information during the checkout process without finalizing the order. It's useful for multi-step checkout flows, saving checkout progress, or preparing a cart for later submission.
When contact information is pre-submitted, it's associated with the cart but doesn't trigger the final submission workflow. This allows for scenarios like saving contact details while continuing to shop, validating information before final submission, or creating a draft order to be finalized later.
The method also returns updated price modifiers which may have changed based on the submitted information (e.g., discount eligibility based on company or region).
Example
// Save contact information from the first checkout step
const contactInfo = {
fullName: 'Jane Smith',
email: '[email protected]',
companyName: 'Acme Corp',
language: 'en',
// Partial data - more fields will be added in subsequent steps
};
const result = await window.mimeeqApp.actions.preSubmitCart('cart_123456', contactInfo);
// Check if any price modifiers were applied based on the contact info
if (result.priceModifiers.length > 0) {
updatePricingDisplay(result.priceModifiers);
}
Param
cartId
The unique identifier for the cart
Param
submitData
Partial contact and submission information to save
Throws
Will throw an error if the cart ID is missing or if pre-submission fails
recalculateCart
recalculateCart:
RecalculateCart
Function
Recalculates all prices in the cart based on specified pricing parameters.
This method updates all item prices in the cart according to the provided pricing context, which can include company-specific pricing, price types (cost, retail, sale), price list groups, and template-specific pricing rules. It's essential for ensuring accurate pricing when the pricing context changes during the shopping process.
Common scenarios for recalculation include:
- When a salesperson switches the company they're ordering on behalf of
- When changing between price types (e.g., from retail to wholesale pricing)
- When specific discount programs or price lists are applied
- When the embedded template context changes, affecting pricing rules
The method returns updated cart items with recalculated prices and any applicable price modifiers (discounts, surcharges, etc.).
Dispatches mimeeq-basket-updated
-
- with the recalculated cart state once prices are updated.
Example
// Recalculate cart prices when switching to wholesale pricing for a dealer
const updatedCart = await window.mimeeqApp.actions.recalculateCart(
'cart_123456', // Cart ID
'company_dealer_789', // Dealer company ID
'WHOLESALE', // Price type
'dealer_program_A' // Price list group
);
// Update the UI with new pricing
updateCartDisplay(updatedCart.cartItems);
// Show any applied discounts or surcharges
if (updatedCart.priceModifiers.length > 0) {
showPriceModifiers(updatedCart.priceModifiers);
}
Param
cartId
The unique identifier for the cart to recalculate
Param
companyId
Optional company ID to use for company-specific pricing
Param
priceType
Optional price type to use (e.g., 'COST', 'RRP', 'SALE')
Param
priceListGroup
Optional price list group to apply for special pricing programs
Param
embedTemplateId
Optional ID of the embed template context
Throws
Will throw an error if recalculation fails or the cart is inaccessible
removeCartItem
removeCartItem:
RemoveCartItem
Function
Removes a specific item from the cart.
This method deletes a single item from the cart based on its unique identifier. It's equivalent to taking a product out of your shopping basket before checkout, and provides immediate feedback to reflect the updated cart state.
Business value:
- Gives customers control to refine their selections before purchase
- Immediately updates pricing totals to reflect removed items
- Supports dynamic cart management in custom interfaces
- Helps prevent order errors by allowing easy removal of unwanted items
Example
// Remove an item when the user clicks a "Remove" button
document.querySelector('.remove-item-btn').addEventListener('click', async (e) => {
const cartId = e.target.dataset.cartId;
const itemId = e.target.dataset.itemId;
try {
await window.mimeeqApp.actions.removeCartItem(cartId, itemId);
// Remove the item from the UI
document.getElementById(`cart-item-${itemId}`).remove();
// Update cart totals
updateCartTotals();
} catch (error) {
showErrorMessage('Could not remove item from cart');
}
});
Param
cartId
The unique identifier for the cart
Param
cartItemId
The unique identifier for the specific item to remove
Throws
Will throw an error if the cart or item ID is missing or if removal fails
submitCart
submitCart:
SubmitCart
Function
Finalizes and submits a cart for processing.
This method completes the checkout process by submitting the cart with all required customer information. It transforms the cart into an order that can be processed through subsequent fulfillment workflows. Once submitted, the cart is typically locked and cannot be modified further.
The submission process:
- Validates all required fields are present and properly formatted
- Finalizes pricing calculations and applies any last-minute price modifiers
- Generates a unique reference code for tracking the submitted order
- Changes the cart status to prevent further modifications
- Triggers any configured notifications (e.g., email confirmations)
This is typically the final step in the purchasing process within the configurator.
Example
// Submit a cart with complete customer information
const customerInfo = {
fullName: 'John Doe',
email: '[email protected]',
phone: '+1 555-123-4567',
companyName: 'Acme Corporation',
address: '123 Main St, Anytown, USA',
language: 'en',
submittedAt: Date.now(),
notes: 'Please deliver to loading dock B',
// Any custom fields collected during checkout
customFields: {
deliveryPreference: 'morning',
specialInstructions: true
},
parameters: [] // Processed custom fields
};
const result = await window.mimeeqApp.actions.submitCart('cart_123456', customerInfo);
// Show confirmation with reference code
showOrderConfirmation(result.referenceCode);
Param
cartId
The unique identifier for the cart to submit
Param
submitData
Complete customer information and submission details
Throws
Will throw an error if submission fails due to missing information or system issues
CameraControl
decreaseZoom
decreaseZoom:
DecreaseZoom
Function
Decreases the camera zoom level to see more of the product and its surroundings.
This action moves the camera farther away from the product, giving viewers a broader perspective. It's ideal for showcasing the product's overall proportions, viewing larger furniture arrangements, or seeing how multiple components fit together.
Business value:
- Helps customers understand the overall size and scale of products
- Shows how products fit within an environment or alongside other pieces
- Provides context for furniture arrangements or room layouts
Example
// Add a "zoom out" button to your product page
document.getElementById('zoom-out-button').addEventListener('click', () => {
window.mimeeqApp.actions.decreaseZoom();
});
// Zoom out by a larger amount for a dramatic wide view
window.mimeeqApp.actions.decreaseZoom(2);
Param
step
How much to zoom out - larger values create a more dramatic change (optional)
freezeCanvasScrolling
freezeCanvasScrolling:
FreezeCanvasScrolling
Function
Disables scrolling and zooming interactions on the 3D view.
This action prevents users from accidentally changing the camera position through scroll or pinch gestures. It's useful when you want to maintain a specific product view or when the 3D model is displayed in a scrollable page where normal scrolling should move the page, not zoom the product.
Business value:
- Maintains consistent product views in presentations or guided experiences
- Prevents accidental zoom changes when scrolling through product pages
- Creates a more controlled viewing experience on touch devices
- Allows for custom zoom controls that match your interface design
Example
// Freeze camera position when entering presentation mode
document.getElementById('enter-presentation').addEventListener('click', () => {
window.mimeeqApp.actions.freezeCanvasScrolling();
});
increaseZoom
increaseZoom:
IncreaseZoom
Function
Increases the camera zoom level to see finer details of the product.
This action brings the camera closer to the product, revealing intricate details and textures. It's perfect for examining specific features, materials, finishes, or connection points that might not be visible from a distance.
Business value:
- Showcases craftsmanship and quality details that differentiate premium products
- Helps customers inspect important functional features before purchase
- Allows salespeople to highlight specific selling points during presentations
Example
// Add a "zoom in" button to focus on product details
document.getElementById('zoom-in-button').addEventListener('click', () => {
window.mimeeqApp.actions.increaseZoom();
});
// Zoom in more dramatically to focus on a specific detail
window.mimeeqApp.actions.increaseZoom(1.5);
Param
step
How much to zoom in - larger values create a more dramatic change (optional)
registerSceneCanvasView
registerSceneCanvasView:
RegisterSceneCanvasView
Function
Adds a new viewing canvas that shows the same 3D product from the same camera angle.
This action creates an additional view of the product that shares the main camera position. It's like adding a second monitor that shows the same content - both views stay synchronized as the camera moves, but they can be displayed in different locations or at different sizes in your interface.
Business value:
- Enables side-by-side comparison views of the same product
- Supports picture-in-picture or detail views alongside the main product view
- Creates synchronized product views for different screen regions or devices
- Allows innovative UI layouts with multiple perspectives on the product
Example
// Create a picture-in-picture thumbnail view of the product
const thumbnailCanvas = document.getElementById('product-thumbnail');
window.mimeeqApp.actions.registerSceneCanvasView(thumbnailCanvas);
Param
canvas
The HTML canvas element where the additional view should appear
restoreCameraPosition
restoreCameraPosition:
RestoreCameraPosition
Function
Resets the camera to the default product view or a specified custom position.
This action returns the camera to its original position, providing a consistent starting point for viewing the product. It's like pressing a "reset view" button that clears any navigation or zoom adjustments made by the user.
Business value:
- Creates a consistent baseline view for product presentations
- Helps disoriented users quickly return to a standard product view
- Ensures specific product features are properly highlighted in the default view
- Supports guided tours that always begin from the same perspective
Example
// Add a "reset view" button to your interface
document.getElementById('reset-view').addEventListener('click', () => {
window.mimeeqApp.actions.restoreCameraPosition();
});
// Jump to a specific predefined camera angle
window.mimeeqApp.actions.restoreCameraPosition(JSON.stringify({
position: {x: -1.5, y: 1.7, z: -5.2},
target: {x: 0, y: 0.6, z: 0}
}));
Param
customCameraPosition
Optional JSON string defining a specific camera position
setSceneInputCanvas
setSceneInputCanvas:
SetSceneInputCanvas
Function
Designates which canvas should receive user interactions like click, drag, and zoom.
This action specifies which of your canvas views should respond to user input for controlling the camera. Only one canvas can accept interactions at a time, so this lets you choose which one should be the "primary" controller when you have multiple views.
Business value:
- Creates intuitive multi-view experiences where users know which view to interact with
- Enables switching between different interaction surfaces in complex interfaces
- Supports responsive designs where the active view might change based on screen size
- Prevents conflicting inputs when multiple product views are displayed
Example
// Switch the active canvas when selecting a different view
document.getElementById('main-view-tab').addEventListener('click', () => {
const mainCanvas = document.getElementById('main-product-view');
window.mimeeqApp.actions.setSceneInputCanvas(mainCanvas);
});
Param
canvas
The HTML canvas element that should receive user interactions
setZoom
setZoom:
SetZoom
Function
Sets a specific zoom level for the camera view.
This action gives you precise control over how close or far the camera is from the product. It's like adjusting a zoom lens on a camera - smaller values bring you closer to examine details, while larger values give you a broader perspective of the whole product.
Business value:
- Creates the perfect framing for product screenshots or presentations
- Helps customers focus on specific details like material textures or connectors
- Provides consistent product views across different devices or screens
Example
// Zoom in close to examine material details
window.mimeeqApp.actions.setZoom(2);
// Zoom out to see the entire product in context
window.mimeeqApp.actions.setZoom(10);
// Create an interactive zoom slider control for your website
const zoomSlider = document.getElementById('zoom-slider');
zoomSlider.addEventListener('input', (e) => {
const zoomLevel = parseFloat(e.target.value);
window.mimeeqApp.actions.setZoom(zoomLevel);
});
Param
zoom
The distance of the camera from the product - smaller numbers zoom in closer, larger numbers zoom out further
unfreezeCanvasScrolling
unfreezeCanvasScrolling:
UnfreezeCanvasScrolling
Function
Re-enables normal scrolling and zooming interactions on the 3D view.
This action restores the standard behavior where mouse wheel, trackpad scrolling, and touch gestures can zoom and adjust the camera. Use this to return to the default interactive viewing experience after previously freezing camera controls.
Business value:
- Returns to natural interaction after guided product experiences
- Allows customers to freely explore products at their own pace
- Re-enables intuitive camera controls for detailed product inspection
- Complements guided tours that temporarily restrict camera movement
Example
// Restore normal camera controls when exiting presentation mode
document.getElementById('exit-presentation').addEventListener('click', () => {
window.mimeeqApp.actions.unfreezeCanvasScrolling();
});
unregisterSceneCanvasView
unregisterSceneCanvasView:
UnregisterSceneCanvasView
Function
Removes a previously registered canvas from the 3D viewing system.
This action stops displaying the 3D product on a specific canvas that was previously added with registerSceneCanvasView. It's like disconnecting a secondary monitor - the main view continues to work, but the specified canvas will no longer show the product.
Business value:
- Conserves processing power by removing unnecessary views
- Supports dynamic interface layouts where product views can be added and removed
- Enables temporary comparison views that can be dismissed when no longer needed
- Prevents memory leaks by properly cleaning up unused canvas resources
Example
// Remove a secondary view when closing a comparison panel
document.getElementById('close-comparison').addEventListener('click', () => {
const comparisonCanvas = document.getElementById('comparison-view');
window.mimeeqApp.actions.unregisterSceneCanvasView(comparisonCanvas);
});
Param
canvas
The HTML canvas element to remove from the viewing system
zoomOut
zoomOut:
ZoomOut
Function
Automatically frames the entire product perfectly in the viewport.
This action intelligently adjusts the camera position and zoom to ensure the complete product is visible and optimally framed. It's like clicking the "fit to screen" button in design software - instantly giving you the ideal overview of the entire product.
Business value:
- Ensures customers can always see the complete product with one click
- Provides a consistent starting view regardless of previous interactions
- Creates a reliable reset point after customers explore detailed views
-
- Dispatches
mimeeq-3d-zoom-out-scene
- Dispatches
-
- when the camera animates to fit the entire product in view.
Example
// Add a "view entire product" button to your interface
document.getElementById('view-all-button').addEventListener('click', () => {
window.mimeeqApp.actions.zoomOut();
});
Canvas
freezeCanvasScrolling
freezeCanvasScrolling:
FreezeCanvasScrolling
Function
Disables scrolling and zooming interactions on the 3D view.
This action prevents users from accidentally changing the camera position through scroll or pinch gestures. It's useful when you want to maintain a specific product view or when the 3D model is displayed in a scrollable page where normal scrolling should move the page, not zoom the product.
Business value:
- Maintains consistent product views in presentations or guided experiences
- Prevents accidental zoom changes when scrolling through product pages
- Creates a more controlled viewing experience on touch devices
- Allows for custom zoom controls that match your interface design
Example
// Freeze camera position when entering presentation mode
document.getElementById('enter-presentation').addEventListener('click', () => {
window.mimeeqApp.actions.freezeCanvasScrolling();
});
registerSceneCanvasView
registerSceneCanvasView:
RegisterSceneCanvasView
Function
Adds a new viewing canvas that shows the same 3D product from the same camera angle.
This action creates an additional view of the product that shares the main camera position. It's like adding a second monitor that shows the same content - both views stay synchronized as the camera moves, but they can be displayed in different locations or at different sizes in your interface.
Business value:
- Enables side-by-side comparison views of the same product
- Supports picture-in-picture or detail views alongside the main product view
- Creates synchronized product views for different screen regions or devices
- Allows innovative UI layouts with multiple perspectives on the product
Example
// Create a picture-in-picture thumbnail view of the product
const thumbnailCanvas = document.getElementById('product-thumbnail');
window.mimeeqApp.actions.registerSceneCanvasView(thumbnailCanvas);
Param
canvas
The HTML canvas element where the additional view should appear
setSceneInputCanvas
setSceneInputCanvas:
SetSceneInputCanvas
Function
Designates which canvas should receive user interactions like click, drag, and zoom.
This action specifies which of your canvas views should respond to user input for controlling the camera. Only one canvas can accept interactions at a time, so this lets you choose which one should be the "primary" controller when you have multiple views.
Business value:
- Creates intuitive multi-view experiences where users know which view to interact with
- Enables switching between different interaction surfaces in complex interfaces
- Supports responsive designs where the active view might change based on screen size
- Prevents conflicting inputs when multiple product views are displayed
Example
// Switch the active canvas when selecting a different view
document.getElementById('main-view-tab').addEventListener('click', () => {
const mainCanvas = document.getElementById('main-product-view');
window.mimeeqApp.actions.setSceneInputCanvas(mainCanvas);
});
Param
canvas
The HTML canvas element that should receive user interactions
unfreezeCanvasScrolling
unfreezeCanvasScrolling:
UnfreezeCanvasScrolling
Function
Re-enables normal scrolling and zooming interactions on the 3D view.
This action restores the standard behavior where mouse wheel, trackpad scrolling, and touch gestures can zoom and adjust the camera. Use this to return to the default interactive viewing experience after previously freezing camera controls.
Business value:
- Returns to natural interaction after guided product experiences
- Allows customers to freely explore products at their own pace
- Re-enables intuitive camera controls for detailed product inspection
- Complements guided tours that temporarily restrict camera movement
Example
// Restore normal camera controls when exiting presentation mode
document.getElementById('exit-presentation').addEventListener('click', () => {
window.mimeeqApp.actions.unfreezeCanvasScrolling();
});
unregisterSceneCanvasView
unregisterSceneCanvasView:
UnregisterSceneCanvasView
Function
Removes a previously registered canvas from the 3D viewing system.
This action stops displaying the 3D product on a specific canvas that was previously added with registerSceneCanvasView. It's like disconnecting a secondary monitor - the main view continues to work, but the specified canvas will no longer show the product.
Business value:
- Conserves processing power by removing unnecessary views
- Supports dynamic interface layouts where product views can be added and removed
- Enables temporary comparison views that can be dismissed when no longer needed
- Prevents memory leaks by properly cleaning up unused canvas resources
Example
// Remove a secondary view when closing a comparison panel
document.getElementById('close-comparison').addEventListener('click', () => {
const comparisonCanvas = document.getElementById('comparison-view');
window.mimeeqApp.actions.unregisterSceneCanvasView(comparisonCanvas);
});
Param
canvas
The HTML canvas element to remove from the viewing system
Configuration Actions
markOptionByBlockNameAndOptionCode
markOptionByBlockNameAndOptionCode:
MarkOptionByBlockNameAndOptionCode
Function
Selects an option using human-readable block name and option code, or sets a value for special widgets.
This convenience function allows for selecting options using their business identifiers rather than internal IDs. It's particularly useful for integrations and automated configurations where human-readable references are preferred over technical identifiers.
For standard option blocks, this method finds the option by its code and selects it. For special widget types (slider, text, number, color, etc.), the second parameter is interpreted as the input value rather than an option code.
Supported Widget Types
| Widget Type | Second Parameter | Description |
|---|---|---|
| Standard (dropdown, swatch, etc.) | optionCode | The code of the option to select |
| Slider | inputValue | Numeric value within the slider's range |
| Text | inputValue | Text string value |
| Number | inputValue | Numeric value |
| Color | colorValue | Hex color value (e.g., "#FF0000") |
For more complex widgets (image, print on demand, engrave) or full control,
use markOption directly. See the Programmatic Configuration Control guide.
Examples
// Select a standard option by code
await markOptionByBlockNameAndOptionCode("TableTop", "FINISH-OAK");
// Set a slider value
await markOptionByBlockNameAndOptionCode("Width", 150);
// Set a text input value
await markOptionByBlockNameAndOptionCode("CustomLabel", "My Product");
// Set a number input value
await markOptionByBlockNameAndOptionCode("Quantity", "25");
// Set a custom color
await markOptionByBlockNameAndOptionCode("CustomColor", "#3498db");
Param
blockName
The display name of the block containing the option
Param
optionCodeOrInputValue
The option code for standard widgets, or the input value for special widgets (slider, text, number, color)
setConfigurationCode
setConfigurationCode:
SetConfigurationCode
Function
Function signature for directly setting the configuration code of a product.
This function allows for setting the complete configuration code at once, which updates all options simultaneously. This is useful for restoring saved configurations, applying presets, or implementing "popular configurations" functionality.
When the code is applied, all options defined in the code will be selected and any options not included will revert to their default values.
Example
// Set a complete configuration for a chair product
setConfigurationCode("Width-a1&Fabric-b3&Color-c2&Legs-a4");
Param
configurationCode
The complete configuration code string