Skip to content

Commit

Permalink
add(deck) _widget prop
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgervang committed Jul 25, 2023
1 parent f368dea commit fc6be2c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/core/src/lib/deck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ export type DeckProps = {
_pickable?: boolean;
/** (Experimental) Fine-tune attribute memory usage. See documentation for details. */
_typedArrayManagerProps?: TypedArrayManagerOptions;
/** (Experimental) An array of Widget instances to be added to the parent element. */
_widgets?: Widget[];

/** Called once the WebGL context has been initiated. */
onWebGLInitialized?: (gl: WebGLRenderingContext) => void;
Expand Down Expand Up @@ -252,6 +254,7 @@ const defaultProps = {
_pickable: true,
_typedArrayManagerProps: {},
_customRender: null,
_widgets: [],

onWebGLInitialized: noop,
onResize: noop,
Expand Down Expand Up @@ -959,6 +962,9 @@ export default class Deck {
parentElement: this.canvas?.parentElement
});
this.widgetManager.add(new Tooltip(), {placement: 'fill'});
this.props._widgets.forEach(widget => {
this.widgetManager?.add(widget);
});

this.setProps(this.props);

Expand Down

0 comments on commit fc6be2c

Please sign in to comment.