Embedded analytics SDK API
    Preparing search index...

    Function CreateQuestion

    • Parameters

      • props: undefined | CreateQuestionProps
        • undefined
        • CreateQuestionProps
          • OptionalclassName?: string

            A custom class name to be added to the root element.

          • OptionalentityTypes?: EmbeddingEntityType[]

            An array that specifies which entity types are available in the data picker

          • Optionalheight?: Height<string | number>

            A number or string specifying a CSS size value that specifies the height of the component

          • OptionalhiddenParameters?: string[]

            A list of parameters to hide.

          • OptionalinitialSqlParameters?: SqlParameterValues

            Initial values for the SQL parameters.

          • OptionalisSaveEnabled?: boolean

            Whether to show the save button.

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

            A callback function that triggers before saving. Only relevant when isSaveEnabled = true

          • OptionalonNavigateBack?: () => void

            A callback function that triggers when a user clicks the back button.

          • OptionalonRun?: (question: undefined | MetabaseQuestion) => void

            A callback function that triggers when a question is updated, including when a user clicks the Visualize button in the question editor

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

            A callback function that triggers when a user saves the question. Only relevant when isSaveEnabled = true

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

            A callback function that triggers when the visualization type changes.

          • Optionalplugins?: MetabasePluginsConfig
          • Optionalstyle?: CSSProperties

            A custom style object to be added to the root element.

          • OptionaltargetCollection?: SdkCollectionId

            The collection to save the question to. This will hide the collection picker from the save modal. Only applicable to interactive questions.

          • Optionaltitle?: SdkQuestionTitleProps

            Determines whether the question title is displayed, and allows a custom title to be displayed instead of the default question title. Shown by default. Only applicable to interactive questions when using the default layout.

          • Optionalwidth?: Width<string | number>

            A number or string specifying a CSS size value that specifies the width of the component

          • OptionalwithChartTypeSelector?: boolean

            Determines whether the chart type selector and corresponding settings button are shown. Only relevant when using the default layout.

          • OptionalwithDownloads?: boolean

            Enables the ability to download results in the interactive question.

          • OptionalwithResetButton?: boolean

            Determines whether a reset button is displayed. Only relevant when using the default layout.

      Returns Element

      Use <InteractiveQuestion questionId="new" /> instead.