Skip to content

Commit c6f1528

Browse files
SCAL-223259, SCAL-216520 and doc gen for CSS variable update (#26)
1 parent a115125 commit c6f1528

File tree

2 files changed

+2144
-2096
lines changed

2 files changed

+2144
-2096
lines changed

src/types.ts

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,7 +2206,7 @@ export enum EmbedEvent {
22062206

22072207
/**
22082208
* Event types that can be triggered by the host application
2209-
* to the embedded ThoughtSpot app
2209+
* to the embedded ThoughtSpot app.
22102210
*
22112211
* To trigger an event use the corresponding
22122212
* {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link
@@ -2223,6 +2223,35 @@ export enum EmbedEvent {
22232223
* { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
22242224
* ]);
22252225
* ```
2226+
* @example
2227+
* If using React components to embed, use the format shown in this example:
2228+
*
2229+
* ```js
2230+
* const selectVizs = () => {
2231+
* embedRef.current.trigger(HostEvent.SetVisibleVizs, [
2232+
* "715e4613-c891-4884-be44-aa8d13701c06",
2233+
* "3f84d633-e325-44b2-be25-c6650e5a49cf"
2234+
* ]);
2235+
* };
2236+
*```
2237+
* You can also attach an Embed event to a Host event to trigger
2238+
* a specific action as shown in this example:
2239+
*
2240+
* ```js
2241+
* const onLiveboardRendered = () => {
2242+
* embedRef.current.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
2243+
* };
2244+
*
2245+
* return (
2246+
* <LiveboardEmbed
2247+
* ref={embedRef}
2248+
* liveboardId="<liveboard-guid>"
2249+
* onLiveboardRendered={onLiveboardRendered}
2250+
* />
2251+
* );
2252+
*
2253+
* ```
2254+
*
22262255
* @group Events
22272256
*/
22282257
// eslint-disable-next-line no-shadow
@@ -2917,11 +2946,24 @@ export enum HostEvent {
29172946
* filter: {
29182947
* column: "item type",
29192948
* oper: "IN",
2920-
* values: ["bags","shirts"],
2949+
* values: ["bags","shirts"]
29212950
* }
29222951
* });
29232952
* ```
29242953
* @example
2954+
* ```js
2955+
*
2956+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
2957+
* filter: {
2958+
* column: "date",
2959+
* oper: "EQ",
2960+
* values: ["JULY","2023"],
2961+
* type: "MONTH_YEAR"
2962+
* }
2963+
* });
2964+
* ```
2965+
*
2966+
* @example
29252967
*
29262968
* ```js
29272969
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
@@ -2938,7 +2980,8 @@ export enum HostEvent {
29382980
* {
29392981
* column: "Date",
29402982
* oper: 'EQ',
2941-
* values: ["1656680400"]
2983+
* values: ["2023-07-31"],
2984+
* types: "EXACT_DATE"
29422985
* }]
29432986
* });
29442987
* ```

0 commit comments

Comments
 (0)