Index
Enumerations
Interfaces
Types
Properties
Methods
Types
EditableProperties
Type declaration
-
description: string
-
label: string
-
media: object
-
src: string
-
type: Mattertag.MediaType
-
GlobalVariableMap
Type declaration
-
Optional off?: undefined | string
-
Optional on?: undefined | string
-
Optional send?: undefined | string
-
Optional tag?: undefined | string
InjectionOptions
Options that can be specified when injection custom HTML into a Mattertag.
Type declaration
-
Optional global
Variable Map?: Mattertag.GlobalVariableMap A map for the global functions and variables we provide in your iframe sandbox. Only needs to be used if scripts you are importing also have a global
send
,on
,off
, ortag
. -
Optional size?: Size
The size of the frame to create
-
Optional window
Path?: undefined | string
MattertagData
Type declaration
-
anchor
Normal: Vector3 -
anchor
Position: Vector3 The world space position of the mattertag anchor within the model
-
color: Color
-
description: string
-
enabled: boolean
-
floor
Id: number -
floor
Index: number -
floor
Info: object -
id: string
-
sequence: number
-
-
label: string
-
media: object
-
src: string
-
type: Mattertag.MediaType
-
-
media
Src: string -
media
Type: Mattertag.MediaType -
parsed
Description: Mattertag.DescriptionChunk[] -
sid: string
-
stem
Height: number -
stem
Vector: Vector3 The world space (non-normal) direction of the mattertag's stem
-
stem
Visible: boolean
ObservableMattertagData
Type declaration
-
anchor
Position: Vector3 The world space position of the mattertag anchor within the model
-
color: Color
-
description: string
-
enabled: boolean
-
floor
Index: number -
floor
Info: object -
id: string
-
sequence: number
-
-
label: string
-
media: object
-
src: string
-
type: Mattertag.MediaType
-
-
sid: string
-
stem
Vector: Vector3 The world space (non-normal) direction of the mattertag's stem
-
stem
Visible: boolean
PreventableActions
Type declaration
-
navigating: boolean
-
opening: boolean
Properties
data
An observable collection of Mattertag data that can be subscribed to.
Methods
add
-
Add one or more Mattertags to Showcase. Each input Mattertag supports setting the label, description, color, anchorPosition, and stemVector.
Two properties are required:
anchorPosition
, the point where the tag connects to the modelstemVector
, the direction, aka normal, and height that the Mattertag stem points
See Pointer.intersection for a way to retrive a new
anchorPosition
andstemVector
.Note: these changes are not persisted between refreshes of Showcase. They are only valid for the current browser session.
Parameters
-
newTagData: Mattertag.MattertagDescriptor | Mattertag.MattertagDescriptor[]
A single or array of Mattertag templates to add.
Returns Promise<string[]>
A promise that resolves with the sids for the newly added Mattertags.
editBillboard
-
Edit the data in a Mattertag billboard.
Note: these changes are not persisted between refreshes of Showcase. They are only valid for the current browser session.
Parameters
-
tagSid: string
the sid of the Mattertag to edit
-
properties: Partial<Mattertag.EditableProperties>
A dictionary of properties to set
Returns Promise<void>
-
editColor
-
Edit the color of a Mattertag
Parameters
-
tagSid: string
The sid of the Mattertag to edit
-
color: Color
The new color to be applied to the Mattertag disc
Returns Promise<void>
-
editIcon
-
Change the icon of the Mattertag disc
Note: these changes are not persisted between refreshes of Showcase. They are only valid for the current browser session.
Parameters
-
tagSid: string
The sid of the Mattertag to edit
-
iconId: string
The id of the icon to apply
Errors
Warns if the provided
iconSrc
is an .svg file which doesn't have a'width'
or'height'
attribute. Defaults to a resolution of 128x128 if neither exist.
Returns Promise<void>
-
editOpacity
-
Edit the opacity of a Mattertag
Parameters
-
tagSid: string
The sid of the Mattertag to edit
-
opacity: number
The target opacity for the Mattertag in the range of [0, 1]
Returns Promise<void>
-
editPosition
-
Move and reorient a Mattertag.
See Pointer.intersection for a way to retrieve a new
anchorPosition
andstemVector
.Note: these changes are not persisted between refreshes of Showcase. They are only valid for the current browser session.
Parameters
-
tagSid: string
The sid of the Mattertag to reposition
-
moveOptions: Partial<Mattertag.PositionOptions>
The new anchorPosition, stemVector and/or floorId.
Returns Promise<void>
-
editStem
-
Introduced 3.1.70.10-0-ge9cb83b28c
Edit the stem of a Mattertag
Parameters
-
tagSid: string
The sid of the Mattertag to edit
-
options: object
-
Optional stem
Height?: undefined | number -
Optional stem
Visible?: undefined | false | true
-
Returns Promise<void>
-
getData
-
This function returns metadata on the collection of Mattertags.
Returns Promise<Mattertag.MattertagData[]>
getDiscPosition
-
Get the disc's (3d) position of a Mattertag.
Parameters
-
tag: Mattertag.MattertagData | Mattertag.ObservableMattertagData
-
Optional result: Vector3
Returns Vector3
-
injectHTML
-
Add a custom frame that can host custom HTML and JavaScript, and communicate bi-directionally with your page.
The frame that contains your custom code will have certain limitations due to being sandboxed by the
sandbox='allow-scripts
attribute. Attempting to access properties of other windows will also be blocked by the browser. (see the MDN pages about iframe sandbox)Currently, the HTML CAN ONLY BE SET ONCE by a call to
injectHTML
. This includes removing or clearing the HTML.Parameters
-
tagSid: string
-
html: string
-
options: Mattertag.InjectionOptions
Returns Promise<Mattertag.IMessenger>
-
navigateToTag
-
This function navigates to the Mattertag disc with the provided sid, opening the billboard on arrival.
mpSdk.Mattertag.navigateToTag(sid, mpSdk.Mattertag.Transition.FLY);
Parameters
-
tagSid: string
The sid of the Mattertag to navigate to
-
transition: Mattertag.Transition
The type of transition to navigate to a sweep where the Mattertag disc is visible
-
Optional force: undefined | false | true
If navigating to the tag is disabled, passing force === true will force the transition to occur
Returns Promise<string>
-
preventAction
-
Prevents the "default" Showcase action on a Mattertag from occurring: hover to open billboard, click to navigate to view.
Parameters
-
tagSid: string
The sid of the Mattertag to remove actions from
-
actions: Partial<Mattertag.PreventableActions>
The set of actions to prevent
Returns Promise<void>
-
registerIcon
-
Register an icon to use with subsequent Mattertag.editIcon calls.
Note: It is recommended to host your own images to mitigate cross origin limitations.
Parameters
-
iconId: string
A user specified string to use as a lookup of this icon
-
iconSrc: string
The src of the icon, like the src of an <img>
Returns Promise<void>
-
remove
-
Removes one or more Mattertags from Showcase.
Note: these changes are not persisted between refreshes of Showcase. They are only valid for the current browser session.
Parameters
-
tagSids: string | string[]
A single Mattertag sid or array of Mattertag sids to remove.
Returns Promise<string[]>
A promise with an array of Mattertag sids that were actually removed.
-
resetIcon
-
Resets the icon of the Mattertag disc back to its original icon.
Parameters
-
tagSid: string
The sid of the Mattertag to reset
Returns Promise<void>
-
Map the globals we provide in your sandbox to other names.