InfoPanel | Data Inspector Library API Reference
- Last UpdatedJun 16, 2025
- 6 minute read
Hierarchy
-
InfoWidget<InfoPanelProps>
- InfoPanel
Index
Constructors
Properties
Accessors
Methods
- bubble
Event - component
Did Mount - component
Did Unmount - component
Did Update - create
Element - create
Element Id - destroy
- get
Element - get
Info Content - get
Properties Table - hide
- locale
Changed Handler - mount
Component - render
- reset
Element - sanitizeHTML
- set
State - show
- unmount
Component - update
Component - update
Content - update
Info Element
Constructors
constructor
-
Parameters
-
props: InfoPanelProps
-
container: HTMLElement
-
state: InfoWidgetState = ...
-
autoRender: boolean = true
-
Optional eventListeners: {}
-
[key: string]: (event: THREE.Event) => void
-
-
Parameters
-
event: THREE.Event
Returns void
-
-
-
-
Returns InfoPanel
-
Properties
container
Readonly element
An HTML element rendered by the widget.
Protected m_boundHide
Hides the info widget by updating its visibility in InfoWidgetState. This function is bound to an instance of the widget and can be used in event listeners.
Type declaration
-
-
Hides the info widget by updating its visibility in InfoWidgetState.
Returns void
-
Protected m_boundLocaleChanged
Protected m_element
The HTML element rendered by a widget.
Protected m_infoElement
An HTML element to contain a list of information items.
Protected m_listenerHandlers
An array of created listener handlers that have to be removed by the componentDidUnmount method.
Readonly props
Readonly Static EVENT_AFTER_MOUNT
This event is fired when a component is mounted.
Readonly Static EVENT_AFTER_UPDATE
This event is fired when a component is updated.
Readonly Static EVENT_BEFORE_DESTROY
This event is fired on children when they are replaced.
Accessors
state
-
The current state of a widget.
Returns StateType
Methods
Protected bubbleEvent
-
Bubbles up an event.
Parameters
-
event: Event
An event.
Returns void
-
componentDidMount
-
Returns void
componentDidUnmount
-
Returns void
Protected componentDidUpdate
-
Called after a component is updated. Must only be called once.
Returns void
Protected createElement
-
Creates an HTML element and initializes it with provided properties.
Type parameters
-
K: "object" | "select" | "input" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr"
Parameters
-
tagName: K
The tag name of a new element.
-
Optional elementAttributes: any
An object that contains new element properties.
-
Optional className: string
The CSS class name.
Returns HTMLElementTagNameMap[K]
An HTML element.
-
Protected createElementId
-
Returns a unique identifier used for those DOM elements that don't have a defined
id
property, but which is required to remove event listeners.Returns string
destroy
-
Destroys the info widget and removes all associated event listeners.
Returns void
getElement
-
Returns the HTML element rendered by a widget.
Returns HTMLElement
getInfoContent
-
Parameters
-
event: InteractiveIntersectionEvent
Returns undefined | (string | InfoWidgetContent)[]
-
Protected getPropertiesTable
-
Generates an HTML
<tbody>
element with properties from object.Parameters
-
content: {}
Content object.
-
[key: string]: any
-
-
props: string[]
Properties to enlist in table.
Returns HTMLTableSectionElement
-
hide
-
Hides the info widget by updating its visibility in InfoWidgetState.
Returns void
Protected localeChangedHandler
-
Handler of locale changed event.
Returns void
mountComponent
-
Mounts a component to the DOM.
Returns void
render
-
Returns HTMLElement
Protected resetElement
-
Resets the HTML element to create it from scratch and not to update the existing one.
Returns void
Protected sanitizeHTML
-
Sanitizes an input HTML string by omitting potentially malicious tags and attributes.
Parameters
-
value: string
Source HTML.
Returns string
Sanitized HTML.
-
setState
-
Sets a new state for a component.
Parameters
-
state: InfoWidgetState
Returns void
-
show
-
Shows a widget. It basically adds a class "hidden" to the root element.
Returns void
Protected unmountComponent
-
Unmounts a component.
Returns void
updateComponent
-
Updates a component.
Returns void
updateContent
-
Updates the info widget content and position according to data from an intersection event.
Parameters
-
event: InteractiveIntersectionEvent
The intersection event.
-
position: Vector2
Coordinates to place info widget.
-
Optional content: (string | InfoWidgetContent)[]
Custom content to be shown in the widget. If omitted, content will be retrieved from the event.
Returns void
-
Protected updateInfoElement
-
Updates an HTML element with the information from the current state. If InfoWidgetState.content contains a string with HTML, it is sanitized to have only whitelisted tags and exclude potentially malicious attributes.
Returns HTMLUListElement
An HTML element with information.
In This Article
- Hierarchy
- Index
- Constructors
- Properties
- Accessors
- Methods
- Protected bubbleEvent
- componentDidMount
- componentDidUnmount
- Protected componentDidUpdate
- Protected createElement
- Protected createElementId
- destroy
- getElement
- getInfoContent
- Protected getPropertiesTable
- hide
- Protected localeChangedHandler
- mountComponent
- render
- Protected resetElement
- Protected sanitizeHTML
- setState
- show
- Protected unmountComponent
- updateComponent
- updateContent
- Protected updateInfoElement
- Protected bubbleEvent
- Legend
InfoPanel
is a class to render a panel with full information about the selected feature.