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

    函数 InteractiveQuestion

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

      参数

      • props: InteractiveQuestionProps
        • 可选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 时相关。

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

          问题的ID。
          这可以是

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

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

        • 可选targetCollection?: SdkCollectionId

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

        • 可选title?: SdkQuestionTitleProps

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

        • 可选width?: Width<string | number>

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

        • 可选withChartTypeSelector?: boolean

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

        • 可选withDownloads?: boolean

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

        • 可选withResetButton?: boolean

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

      返回 null | Element

    索引

    交互式问题

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

    类型声明

    Breakout: () => null | Element

    类型声明

      • (): null | Element
      • 函数

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

        返回 null | Element

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

    类型声明

    ChartTypeDropdown: (props: MenuProps) => Element

    类型声明

      • (props: MenuProps): Element
      • 函数

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

        参数

        返回 Element

    ChartTypeSelector: (props: StackProps) => Element

    类型声明

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

    类型声明

      • (props: StackProps): null | Element
      • 函数

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

        参数

        返回 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
      • 函数

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

        参数

        返回 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
      • 函数

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

        参数

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

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

          • 可选style?: CSSProperties

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

          • 可选height?: Height<string | number>

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

          • 可选width?: Width<string | number>

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

          返回 Element

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

      类型声明

      类型声明

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

      类型声明

      Summarize: () => Element

      类型声明

        • (): Element
        • 函数

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

          返回 Element

      SummarizeDropdown: (props: InteractiveQuestionSummarizeDropdownProps) => Element

      类型声明

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

      类型声明

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

          根据问题的状态显示标题。显示

          • 如果问题已保存,则显示其名称
          • 针对临时问题(非原生查询)自动生成的描述
          • 作为回退或针对新/原生查询显示“新问题”

          参数

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

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

            • 可选style?: CSSProperties

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

          返回 undefined | Element

      其他

      VisualizationButton: () => null | Element
      © . All rights reserved.