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

    函数 InteractiveQuestion

    • 一个渲染交互式问题的组件。

      参数

      • props: InteractiveQuestionProps
        • 可选className?: string

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

        • OptionalentityTypes?: EmbeddingEntityType[]

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

        • Optionalheight?: Height<string | number>

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

        • 可选hiddenParameters?: string[]

          要隐藏的参数列表。

        • 可选initialSqlParameters?: SqlParameterValues

          SQL参数的初始值。

        • 可选isSaveEnabled?: boolean

          是否显示保存按钮。

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

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

        • OptionalonNavigateBack?: () => void

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

        • OptionalonRun?: (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

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

        • 可选plugins?: MetabasePluginsConfig
        • questionId: null | SdkQuestionId
        • 可选style?: CSSProperties

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

        • 可选targetCollection?: SdkCollectionId

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

        • 可选title?: SdkQuestionTitleProps

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

        • Optionalwidth?: Width<string | number>

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

        • 可选withChartTypeSelector?: boolean

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

        • 可选withDownloads?: boolean

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

        • 可选withResetButton?: boolean

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

      返回 Element

    索引

    InteractiveQuestion

    BackButton: (props: InteractiveQuestionBackButtonProps) => null | Element

    类型声明

    Breakout: () => null | Element

    类型声明

      • (): null | Element
      • Function

        用于管理数据分组(拆分)的一组徽章。使用问题上下文进行拆分功能。

        Returns null | Element

    BreakoutDropdown: (
        props: InteractiveQuestionBreakoutDropdownProps,
    ) => null | Element

    类型声明

    ChartTypeDropdown: (props: MenuProps) => Element

    类型声明

      • (props: MenuProps): Element
      • Function

        用于选择可视化类型的下拉菜单(条形图、折线图、表格等)。会自动更新以显示当前数据的推荐可视化类型。

        参数

        返回 Element

    ChartTypeSelector: (props: StackProps) => Element

    类型声明

    DownloadWidget: (props: StackProps) => null | Element

    类型声明

      • (props: StackProps): null | Element
      • Function

        提供一个 UI 小部件,用于下载不同格式的数据(根据可视化类型,可以是 CSVXLSXJSONPNG)。

        参数

        Returns null | Element

    DownloadWidgetDropdown: (props: PopoverProps) => Element

    类型声明

    Editor: (props: InteractiveQuestionEditorProps) => undefined | Element

    类型声明

    EditorButton: (
        props: InteractiveQuestionEditorButtonProps,
    ) => undefined | false | Element

    类型声明

    类型声明

    FilterDropdown: (
        props: InteractiveQuestionFilterDropdownProps,
    ) => null | Element

    类型声明

    Notebook: (props: InteractiveQuestionEditorProps) => undefined | Element

    类型声明

    请使用 InteractiveQuestion.Editor

    NotebookButton: (
        props: InteractiveQuestionEditorButtonProps,
    ) => undefined | false | Element

    类型声明

    请使用 InteractiveQuestion.EditorButton

    QuestionSettings: (props: StackProps) => null | Element

    类型声明

      • (props: StackProps): null | Element
      • Function

        用于配置可视化选项(如轴、颜色和格式)的设置面板。使用问题上下文进行设置。

        参数

        Returns null | Element

    QuestionSettingsDropdown: (
        props?: InteractiveQuestionQuestionSettingsDropdownProps,
    ) => Element

    类型声明

    QuestionVisualization: (
        props: { className?: string; style?: CSSProperties } & {
            height?: Height<string | number>;
            width?: Width<string | number>;
        } & {},
    ) => Element

    类型声明

      • (
            props: { className?: string; style?: CSSProperties } & {
                height?: Height<string | number>;
                width?: Width<string | number>;
            } & {},
        ): Element
      • Function

        将问题结果渲染为图表、表格或其他可视化类型的核心可视化组件。

        参数

        • props: { className?: string; style?: CSSProperties } & {
              height?: Height<string | number>;
              width?: Width<string | number>;
          } & {}
          • 可选className?: string

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

          • 可选style?: CSSProperties

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

          • Optionalheight?: Height<string | number>

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

          • Optionalwidth?: Width<string | number>

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

          返回 Element

      ResetButton: (props?: ButtonProps) => null | Element

      类型声明

        • (props?: ButtonProps): null | Element
        • Function

          用于重置问题修改的按钮。仅在问题有未保存的更改时出现。

          参数

          Returns null | Element

      类型声明

      SaveQuestionForm: (
          props: InteractiveQuestionSaveQuestionFormProps,
      ) => null | Element

      类型声明

      SqlParametersList: () => null | Element

      类型声明

        • (): null | Element
        • Function

          SQL 问题的参数列表

          Returns null | Element

      Summarize: () => Element

      类型声明

        • (): Element
        • Function

          用于添加和管理数据摘要(如计数、总计、平均值)的界面。显示为一组徽章。使用问题上下文进行摘要功能。

          返回 Element

      SummarizeDropdown: (props: InteractiveQuestionSummarizeDropdownProps) => Element

      类型声明

      Title: (
          props: { className?: string; style?: CSSProperties },
      ) => undefined | Element

      类型声明

        • (props: { className?: string; style?: CSSProperties }): undefined | Element
        • Function

          显示基于问题状态的标题。如果问题已保存,则显示

          • 问题已保存的显示名称
          • 临时问题的自动生成描述(非原生查询)

          参数

          • props: { className?: string; style?: CSSProperties }
            • 可选className?: string

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

            • 可选style?: CSSProperties

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

          Returns undefined | Element

      VisualizationButton: () => null | Element

      类型声明

        • (): null | Element
        • Function

          触发当前问题可视化的按钮。

          Returns null | Element

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