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

    接口 BaseSdkQuestionProps

    interface BaseSdkQuestionProps {
        children?: ReactNode;
        entityTypes?: EmbeddingEntityType[];
        initialSqlParameters?: SqlParameterValues;
        isSaveEnabled?: boolean;
        onBeforeSave?: (
            question: undefined | MetabaseQuestion,
            context: { isNewQuestion: boolean },
        ) => Promise<void>;
        onRun?: (question: undefined | MetabaseQuestion) => void;
        onSave?: (
            question: MetabaseQuestion,
            context: { dashboardTabId?: number; isNewQuestion: boolean },
        ) => void;
        plugins?: MetabasePluginsConfig;
        questionId: null | SdkQuestionId;
        targetCollection?: SdkCollectionId;
        withDownloads?: boolean;
    }
    索引

    属性

    children?: ReactNode

    MetabaseProvider 组件的子组件。

    entityTypes?: EmbeddingEntityType[]

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

    initialSqlParameters?: SqlParameterValues

    SQL参数的初始值。

    isSaveEnabled?: boolean

    是否显示保存按钮。

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

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

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

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

    onSave?: (
        question: MetabaseQuestion,
        context: { dashboardTabId?: number; isNewQuestion: boolean },
    ) => void

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

    questionId: null | SdkQuestionId

    问题的 ID。
    这可以是

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

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

    withDownloads?: boolean

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

    © . This site is unofficial and not affiliated with Metabase, Inc.