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

    接口 SdkQuestionProps

    interface SdkQuestionProps {
        className?: string;
        entityTypes?: EmbeddingEntityType[];
        height?: Height<string | number>;
        hiddenParameters?: string[];
        initialSqlParameters?: SqlParameterValues;
        isSaveEnabled?: boolean;
        onBeforeSave?: (
            question: undefined | MetabaseQuestion,
            context: { isNewQuestion: boolean },
        ) => Promise<void>;
        onNavigateBack?: () => void;
        onRun?: (question: undefined | MetabaseQuestion) => void;
        onSave?: (
            question: MetabaseQuestion,
            context: { dashboardTabId?: number; isNewQuestion: boolean },
        ) => void;
        onVisualizationChange?: (
            display:
                | "object"
                | "table"
                | "bar"
                | "line"
                | "pie"
                | "scalar"
                | "row"
                | "area"
                | "combo"
                | "pivot"
                | "smartscalar"
                | "gauge"
                | "progress"
                | "funnel"
                | "map"
                | "scatter"
                | "waterfall"
                | "sankey"
                | "list",
        ) => void;
        plugins?: MetabasePluginsConfig;
        questionId: null
        | SdkQuestionId;
        style?: CSSProperties;
        targetCollection?: SdkCollectionId;
        title?: SdkQuestionTitleProps;
        width?: Width<string | number>;
        withChartTypeSelector?: boolean;
        withDownloads?: boolean;
        withResetButton?: boolean;
    }
    索引

    属性

    className?: string

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

    entityTypes?: EmbeddingEntityType[]

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

    height?: Height<string | number>

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

    hiddenParameters?: string[]

    要隐藏的参数列表。

    initialSqlParameters?: SqlParameterValues

    SQL参数的初始值。

    isSaveEnabled?: boolean

    是否显示保存按钮。

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

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

    onNavigateBack?: () => void

    用户点击返回按钮时触发的回调函数。

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

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

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

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

    onVisualizationChange?: (
        display:
            | "object"
            | "table"
            | "bar"
            | "line"
            | "pie"
            | "scalar"
            | "row"
            | "area"
            | "combo"
            | "pivot"
            | "smartscalar"
            | "gauge"
            | "progress"
            | "funnel"
            | "map"
            | "scatter"
            | "waterfall"
            | "sankey"
            | "list",
    ) => void

    当可视化类型更改时触发的回调函数。

    类型声明

      • (
            display:
                | "object"
                | "table"
                | "bar"
                | "line"
                | "pie"
                | "scalar"
                | "row"
                | "area"
                | "combo"
                | "pivot"
                | "smartscalar"
                | "gauge"
                | "progress"
                | "funnel"
                | "map"
                | "scatter"
                | "waterfall"
                | "sankey"
                | "list",
        ): void
      • 参数

        • display:
              | "object"
              | "table"
              | "bar"
              | "line"
              | "pie"
              | "scalar"
              | "row"
              | "area"
              | "combo"
              | "pivot"
              | "smartscalar"
              | "gauge"
              | "progress"
              | "funnel"
              | "map"
              | "scatter"
              | "waterfall"
              | "sankey"
              | "list"

          新的显示类型

        返回 void

    questionId: null | SdkQuestionId

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

    targetCollection?: SdkCollectionId

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

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

    width?: Width<string | number>

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

    withChartTypeSelector?: boolean

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

    withDownloads?: boolean

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

    withResetButton?: boolean

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

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