baran
baran
TFDThoughtSpot For Developers
Created by baran on 10/15/2024 in #help
`onParameterChanged` is not called after the user applies a parameter
Background: The React/JavaScript/TypeScript app runs a liveboard embed using the @thoughtspot/[email protected] library.:
import { Action, LiveboardEmbed as LiveboardEmbedRef } from '@thoughtspot/visual-embed-sdk';

const LiveboardVisuals: React.FC<LiveboardProps> = ({
liveboardId,
visualId,
}) => {
const embedRef = useEmbedRef() as React.MutableRefObject<LiveboardEmbedRef>;

return (
<LiveboardEmbed
ref={embedRef}
liveboardId={liveboardId}
vizId={visualId}
onParameterChanged={(e) => {
console.log('onParameterChanged');
console.log(e);
}}
/>
);
};
import { Action, LiveboardEmbed as LiveboardEmbedRef } from '@thoughtspot/visual-embed-sdk';

const LiveboardVisuals: React.FC<LiveboardProps> = ({
liveboardId,
visualId,
}) => {
const embedRef = useEmbedRef() as React.MutableRefObject<LiveboardEmbedRef>;

return (
<LiveboardEmbed
ref={embedRef}
liveboardId={liveboardId}
vizId={visualId}
onParameterChanged={(e) => {
console.log('onParameterChanged');
console.log(e);
}}
/>
);
};
Aim: When the user applies a parameter, the console log should be called.
onParameterChanged={(e) => {
console.log('onParameterChanged');
console.log(e);
}}
onParameterChanged={(e) => {
console.log('onParameterChanged');
console.log(e);
}}
Issue: When the user applies a parameter, the console log is not called. Furthermore, I tested with onFilterChanged:
onFilterChanged={(e) => {
console.log('onFilterChanged');
console.log(e);
}}
onFilterChanged={(e) => {
console.log('onFilterChanged');
console.log(e);
}}
and it logs to the console. So, is onParameterChanged not working in v1.33.3?
44 replies
TFDThoughtSpot For Developers
Created by baran on 10/14/2024 in #help
Un-hide parameter chip when `runtimeParameters` is passed
Background: The React/JavaScript/TypeScript app runs a liveboard embed using the @thoughtspot/visual-embed-sdk library. The code passes a few actions.
import { Action, LiveboardEmbed as LiveboardEmbedRef } from '@thoughtspot/visual-embed-sdk';

const LiveboardVisuals: React.FC<LiveboardProps> = ({
liveboardId,
visualId,
filterByOptions,
filterByParameters,
}) => {
const embedRef = useEmbedRef() as React.MutableRefObject<LiveboardEmbedRef>;

return (
<LiveboardEmbed
frameParams={{
height: '580px',
}}
fullHeight
ref={embedRef}
liveboardId={liveboardId}
runtimeFilters={filterByOptions}
runtimeParameters={filterByParameters} // <--
vizId={visualId}
/>
);
};
import { Action, LiveboardEmbed as LiveboardEmbedRef } from '@thoughtspot/visual-embed-sdk';

const LiveboardVisuals: React.FC<LiveboardProps> = ({
liveboardId,
visualId,
filterByOptions,
filterByParameters,
}) => {
const embedRef = useEmbedRef() as React.MutableRefObject<LiveboardEmbedRef>;

return (
<LiveboardEmbed
frameParams={{
height: '580px',
}}
fullHeight
ref={embedRef}
liveboardId={liveboardId}
runtimeFilters={filterByOptions}
runtimeParameters={filterByParameters} // <--
vizId={visualId}
/>
);
};
Aim: When the developer passes filterByParameters, and the user views the liveboard, then the passed parameter's chip is hidden. Issue: From our understanding, hiding the chip is the default behaviour (mentioned here in the NOTE section https://developers.thoughtspot.com/docs/runtime-params). However, we would like to unhide the parameter chip since the default value should be passed but then the user should be able to change the value. So, how can we unhide the parameter chip when passing a runtime parameter?
3 replies
TFDThoughtSpot For Developers
Created by baran on 9/26/2024 in #help
Can't add "Manage alerts" option to the widget's actions?
No description
3 replies