Embedded analytics SDK API
    Preparing search index...

    Interface StaticDashboardProps

    interface StaticDashboardProps {
        className?: string;
        dashboardId: SdkDashboardId;
        dataPickerProps?: Pick<SdkQuestionProps, "entityTypes">;
        drillThroughQuestionHeight?: Height<string | number>;
        drillThroughQuestionProps?: DrillThroughQuestionProps;
        hiddenParameters?: string[];
        initialParameters?: ParameterValues;
        onLoad?: (dashboard: null | MetabaseDashboard) => void;
        onLoadWithoutCards?: (dashboard: null | MetabaseDashboard) => void;
        onVisualizationChange?: (
            visualization:
                | "object"
                | "table"
                | "bar"
                | "line"
                | "pie"
                | "scalar"
                | "row"
                | "area"
                | "combo"
                | "pivot"
                | "smartscalar"
                | "gauge"
                | "progress"
                | "funnel"
                | "map"
                | "scatter"
                | "waterfall"
                | "sankey",
        ) => void;
        plugins?: MetabasePluginsConfig;
        renderDrillThroughQuestion?: () => ReactNode;
        style?: CSSProperties;
        withCardTitle?: boolean;
        withDownloads?: boolean;
        withTitle?: boolean;
    }
    Index

    Properties

    className?: string

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

    dashboardId: SdkDashboardId

    The ID of the dashboard.
    This is either:

    • the numerical ID when accessing a dashboard link, i.e. http://localhost:3000/dashboard/1-my-dashboard where the ID is 1
    • the string ID found in the entity_id key of the dashboard object when using the API directly or using the SDK Collection Browser to return data
    dataPickerProps?: Pick<SdkQuestionProps, "entityTypes">

    Additional props to pass to the query builder rendered by InteractiveQuestion when creating a new dashboard question.

    drillThroughQuestionHeight?: Height<string | number>

    Height of a question component when drilled from the dashboard to a question level.

    drillThroughQuestionProps?: DrillThroughQuestionProps

    Props of a question component when drilled from the dashboard to a question level.

    Type declaration

    Props for the drill-through question

    • Optionalchildren?: ReactNode

      The children of the MetabaseProvider component.s

    • 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

    • 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

    • 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

    • 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.

    hiddenParameters?: string[]

    A list of parameters to hide.

    initialParameters?: ParameterValues

    Query parameters for the dashboard. For a single option, use a string value, and use a list of strings for multiple options.

    onLoad?: (dashboard: null | MetabaseDashboard) => void

    Callback that is called when the dashboard is loaded.

    onLoadWithoutCards?: (dashboard: null | MetabaseDashboard) => void

    Callback that is called when the dashboard is loaded without cards.

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

    A callback function that triggers when a question is opened from a dashboard card or when the user changes the visualization type of a question.

    Type declaration

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

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

          the new visualization type

        Returns void

    Additional mapper function to override or add drill-down menu. See the implementing custom actions section for more details.

    renderDrillThroughQuestion?: () => ReactNode

    A custom React component to render the question layout. Use namespaced InteractiveQuestion components to build the layout.

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

    withCardTitle?: boolean

    Whether the dashboard cards should display a title.

    withDownloads?: boolean

    Whether to hide the download button.

    withTitle?: boolean

    Whether the dashboard should display a title.