Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,9 @@ export interface RuntimeParameter {
* }));
* ```
*
* If using React components to embed, use `on<EventName>` to register event listeners.
* If you are using React components for embedding, you can register to any
* events from the `EmbedEvent` list by using the `on<EventName>` convention.
* For example,`onAlert`, `onCopyToClipboard` and so on.
*
* @example
* ```js
Expand Down Expand Up @@ -2254,23 +2256,28 @@ export enum EmbedEvent {
* "3f84d633-e325-44b2-be25-c6650e5a49cf"
* ]);
* };
*```
* ```
*
*
* You can also attach an Embed event to a Host event to trigger
* a specific action as shown in this example:
*
* @example
* ```js
* const onLiveboardRendered = () => {
* embedRef.current.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
* };
*
* return (
* <LiveboardEmbed
* ref={embedRef}
* liveboardId="<liveboard-guid>"
* onLiveboardRendered={onLiveboardRendered}
* />
* );
* const EmbeddedComponent = () => {
* const embedRef = useRef(null); // import { useRef } from react
* const onLiveboardRendered = () => {
* embedRef.current.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
* };
*
* return (
* <LiveboardEmbed
* ref={embedRef}
* liveboardId="<liveboard-guid>"
* onLiveboardRendered={onLiveboardRendered}
* />
* );
* }
* ```
*
* @group Events
Expand Down
Loading
Loading