嵌入式分析SDK API
    正在准备搜索索引...

    接口 InteractiveQuestionProps

    interface InteractiveQuestionProps {
        children?: ReactNode;
        className?: string;
        entityTypes?: EmbeddingEntityType[];
        height?: Height<string | number>;
        initialSqlParameters?: SqlParameterValues;
        isSaveEnabled?: boolean;
        onBeforeSave?: (
            question: undefined | MetabaseQuestion,
            context: { isNewQuestion: boolean },
        ) => Promise<void>;
        onRun?: (question: undefined | MetabaseQuestion) => void;
        onSave?: (
            question: undefined | MetabaseQuestion,
            context: { isNewQuestion: boolean },
        ) => void;
        plugins?: MetabasePluginsConfig;
        questionId: null | SdkQuestionId;
        style?: CSSProperties;
        targetCollection?: SdkCollectionId;
        title?: SdkQuestionTitleProps;
        width?: Width<string | number>;
        withChartTypeSelector?: boolean;
        withDownloads?: boolean;
        withResetButton?: boolean;
    }
    索引

    属性

    children?: ReactNode

    MetabaseProvider 组件的子组件。

    className?: string

    要添加到根元素的自定义类名。

    entityTypes?: EmbeddingEntityType[]

    一个数组,指定数据选择器中可用的实体类型。

    height?: Height<string | number>

    一个数字或字符串,指定组件高度的 CSS 大小值。

    initialSqlParameters?: SqlParameterValues

    SQL 参数的初始值。

    isSaveEnabled?: boolean

    是否显示保存按钮。

    onBeforeSave?: (
        question: undefined | MetabaseQuestion,
        context: { isNewQuestion: boolean },
    ) => Promise<void>

    在保存前触发的回调函数。仅在 isSaveEnabled = true 时相关。

    onRun?: (question: undefined | MetabaseQuestion) => void

    当问题更新时触发的回调函数,包括用户在问题编辑器中点击 Visualize 按钮时。

    onSave?: (
        question: undefined | MetabaseQuestion,
        context: { isNewQuestion: boolean },
    ) => void

    当用户保存问题时触发的回调函数。仅在 isSaveEnabled = true 时相关。

    questionId: null | SdkQuestionId

    问题ID。
    这可以是

    • 访问问题链接时的数字ID,例如 http://localhost:3000/question/1-my-question 中 ID 为 1
    • 问题对象的 entity_id 键。您可以在查看问题时在信息面板中找到问题的实体ID
    • new 用于显示笔记本编辑器以创建新问题。isSaveEnabled 必须为 true 才能允许保存问题

    添加到根元素的自定义样式对象。

    targetCollection?: SdkCollectionId

    保存问题的集合。这将从保存模态框中隐藏集合选择器。仅适用于交互式问题。

    确定是否显示问题标题,并允许显示自定义标题而不是默认问题标题。默认显示。仅在使用默认布局时适用于交互式问题。

    width?: Width<string | number>

    一个数字或字符串,指定组件宽度的 CSS 大小值。

    withChartTypeSelector?: boolean

    确定是否显示图表类型选择器和相应的设置按钮。仅在使用默认布局时相关。

    withDownloads?: boolean

    启用在交互式问题中下载结果的功能。

    withResetButton?: boolean

    确定是否显示重置按钮。仅在使用默认布局时相关。

    © . All rights reserved.