> ## Documentation Index
> Fetch the complete documentation index at: https://lightdash-mintlify-ca973f84.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List charts as code

> Get charts in code representation



## OpenAPI

````yaml https://raw.githubusercontent.com/lightdash/lightdash/refs/heads/main/packages/backend/src/generated/swagger.json get /api/v1/projects/{projectUuid}/charts/code
openapi: 3.0.0
info:
  title: Lightdash API
  version: 0.2897.0
  description: >
    Open API documentation for all public Lightdash API endpoints. #
    Authentication Before you get started, you might need to create a Personal
    Access Token to authenticate via the API. You can create a token by
    following this guide: https://docs.lightdash.com/references/personal_tokens
  license:
    name: MIT
  contact:
    name: Lightdash Support
    email: support@lightdash.com
    url: https://docs.lightdash.com/help-and-contact/contact/contact_info/
servers:
  - url: /
security: []
tags:
  - name: My Account
    description: These routes allow users to manage their own user account.
  - name: Organizations
    description: >-
      Each user is a member of a single organization. These routes allow users
      to manage their organization. Most actions are only available to admin
      users.
  - name: Projects
    description: >-
      Projects belong to a single organization. These routes allow users to
      manage their projects, browse content, and execute queries. Users inside
      an organization might have access to a project from an organization-level
      role or they might be granted access to a project directly.
  - name: Spaces
    description: >-
      Spaces allow you to organize charts and dashboards within a project. They
      also allow granular access to content by allowing you to create private
      spaces, which are only accessible to the creator and admins.
  - name: Roles & Permissions
    description: >-
      These routes allow users to manage roles and permissions for their
      organization.
    externalDocs:
      url: https://docs.lightdash.com/references/roles
  - name: Query
    description: >-
      These routes allow users to execute and manage queries against their data
      warehouse. This includes metric queries, SQL queries, and retrieving query
      results.
paths:
  /api/v1/projects/{projectUuid}/charts/code:
    get:
      tags:
        - Projects
      summary: List charts as code
      description: Get charts in code representation
      operationId: getChartsAsCode
      parameters:
        - in: path
          name: projectUuid
          required: true
          schema:
            type: string
        - in: query
          name: ids
          required: false
          schema:
            items:
              type: string
            type: array
        - in: query
          name: offset
          required: false
          schema:
            type: number
            format: double
        - in: query
          name: languageMap
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiChartAsCodeListResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      security: []
components:
  schemas:
    ApiChartAsCodeListResponse:
      properties:
        results:
          properties:
            offset:
              type: number
              format: double
            total:
              type: number
              format: double
            spaces:
              items:
                $ref: '#/components/schemas/SpaceAsCode'
              type: array
            missingIds:
              items:
                type: string
              type: array
            languageMap:
              items:
                $ref: >-
                  #/components/schemas/PartialDeep_ChartAsCodeLanguageMap._recurseIntoArrays-true__
              type: array
            charts:
              items:
                $ref: '#/components/schemas/ChartAsCode'
              type: array
          required:
            - offset
            - total
            - spaces
            - missingIds
            - charts
          type: object
        status:
          type: string
          enum:
            - ok
          nullable: false
      required:
        - results
        - status
      type: object
    ApiErrorPayload:
      properties:
        error:
          properties:
            data:
              $ref: '#/components/schemas/AnyType'
              description: Optional data containing details of the error
            message:
              type: string
              description: A friendly message summarising the error
            name:
              type: string
              description: Unique name for the type of error
            statusCode:
              type: number
              format: integer
              description: HTTP status code
          required:
            - name
            - statusCode
          type: object
        status:
          type: string
          enum:
            - error
          nullable: false
      required:
        - error
        - status
      type: object
      description: |-
        The Error object is returned from the api any time there is an error.
        The message contains
    SpaceAsCode:
      properties:
        slug:
          type: string
          description: The space slug used for file naming and cross-referencing
        spaceName:
          type: string
          description: >-
            The original human-readable space name (preserves emoji, casing,
            etc.)
        contentType:
          $ref: '#/components/schemas/ContentAsCodeType.SPACE'
      required:
        - slug
        - spaceName
        - contentType
      type: object
    PartialDeep_ChartAsCodeLanguageMap._recurseIntoArrays-true__:
      $ref: >-
        #/components/schemas/PartialObjectDeep__chart_58___91_x-string_93__58__name_63_-string-or-undefined--description_63_-string-or-undefined--chartConfig_63__58__type-ChartType.CARTESIAN--config_63__58__eChartsConfig_58__series_63__58__name_63_-string-or-undefined--markLine_63__58__data_58__name_63_-string-or-undefined_-Array_-or-undefined_-Array-or-undefined--xAxis_63__58__name_63_-string-or-undefined_-Array-or-undefined--yAxis_63__58__name_63_-string-or-undefined_-Array-or-undefined__-or-undefined_-or-_type-ChartType.PIE--config_63__58__groupLabelOverrides_63_-Record_string.string_-or-undefined_-or-undefined_-or-_type-ChartType.FUNNEL--config_63__58__labelOverrides_63_-Record_string.string_-or-undefined_-or-undefined_-or-_type-ChartType.BIG_NUMBER--config_63__58__label_63_-string-or-undefined--comparisonLabel_63_-string-or-undefined--comparisonField_63_-string-or-undefined_-or-undefined_-or-_type-ChartType.TABLE--config_63__58__columns_63_-Record_string._name-string__-or-undefined_-or-undefined_-or-_type-ChartType.CUSTOM--config_63__58__spec_63_-Record_string.unknown_-or-undefined_-or-undefined_-or-undefined___._recurseIntoArrays-true__
      description: >-
        Create a type from another type with all keys and nested keys set to
        optional.


        Use-cases:

        - Merging a default settings/config object with another object, the
        second object would be a deep partial of the default object.

        - Mocking and testing complex entities, where populating an entire
        object with its keys would be redundant in terms of the mock or test.
    ChartAsCode:
      allOf:
        - $ref: >-
            #/components/schemas/Omit_Pick_SavedChart.name-or-description-or-tableName-or-metricQuery-or-chartConfig-or-pivotConfig-or-slug-or-parameters_.metricQuery_
        - properties:
            verification:
              allOf:
                - $ref: '#/components/schemas/ContentVerificationInfo'
              nullable: true
              description: >-
                Detailed verification info (who/when). Read-only; ignored on
                upload.
            verified:
              type: boolean
              description: >-
                Declarative verification state.

                `true` verifies the chart on upload, `false` unverifies it,
                `undefined` leaves the

                current state untouched. Download sets this to `true` when the
                chart is verified.
            downloadedAt:
              type: string
              format: date-time
              description: Timestamp when this chart was downloaded from Lightdash
            spaceSlug:
              type: string
              description: Slug of the space containing this chart
            contentType:
              $ref: '#/components/schemas/ContentAsCodeType.CHART'
              description: Content type discriminator
            version:
              type: number
              format: double
              description: Schema version for this chart configuration
            dashboardSlug:
              type: string
              description: Slug of the dashboard this chart belongs to (if any)
            tableConfig:
              properties:
                columnOrder:
                  items:
                    type: string
                  type: array
              required:
                - columnOrder
              type: object
              description: Table configuration. Defaults to empty column order if omitted.
            updatedAt:
              type: string
              format: date-time
              description: >-
                Not modifiable by user, but useful to know if it has been
                updated. Defaults to now if omitted.
            metricQuery:
              allOf:
                - $ref: '#/components/schemas/Omit_MetricQuery.filters_'
                - properties:
                    filters:
                      $ref: '#/components/schemas/FiltersInput'
                  required:
                    - filters
                  type: object
          required:
            - spaceSlug
            - version
            - metricQuery
          type: object
    AnyType:
      description: |-
        This AnyType is an alias for any
        The goal is to make it easier to identify any type in the codebase
        without having to eslint-disable all the time
        These are only used on legacy `any` types, don't use it for new types.
        This is added on a separate file to avoid circular dependencies.
    ContentAsCodeType.SPACE:
      enum:
        - space
      type: string
    ? PartialObjectDeep__chart_58___91_x-string_93__58__name_63_-string-or-undefined--description_63_-string-or-undefined--chartConfig_63__58__type-ChartType.CARTESIAN--config_63__58__eChartsConfig_58__series_63__58__name_63_-string-or-undefined--markLine_63__58__data_58__name_63_-string-or-undefined_-Array_-or-undefined_-Array-or-undefined--xAxis_63__58__name_63_-string-or-undefined_-Array-or-undefined--yAxis_63__58__name_63_-string-or-undefined_-Array-or-undefined__-or-undefined_-or-_type-ChartType.PIE--config_63__58__groupLabelOverrides_63_-Record_string.string_-or-undefined_-or-undefined_-or-_type-ChartType.FUNNEL--config_63__58__labelOverrides_63_-Record_string.string_-or-undefined_-or-undefined_-or-_type-ChartType.BIG_NUMBER--config_63__58__label_63_-string-or-undefined--comparisonLabel_63_-string-or-undefined--comparisonField_63_-string-or-undefined_-or-undefined_-or-_type-ChartType.TABLE--config_63__58__columns_63_-Record_string._name-string__-or-undefined_-or-undefined_-or-_type-ChartType.CUSTOM--config_63__58__spec_63_-Record_string.unknown_-or-undefined_-or-undefined_-or-undefined___._recurseIntoArrays-true__
    : properties:
        chart:
          $ref: >-
            #/components/schemas/PartialObjectDeep___91_x-string_93__58__name_63_-string-or-undefined--description_63_-string-or-undefined--chartConfig_63__58__type-ChartType.CARTESIAN--config_63__58__eChartsConfig_58__series_63__58__name_63_-string-or-undefined--markLine_63__58__data_58__name_63_-string-or-undefined_-Array_-or-undefined_-Array-or-undefined--xAxis_63__58__name_63_-string-or-undefined_-Array-or-undefined--yAxis_63__58__name_63_-string-or-undefined_-Array-or-undefined__-or-undefined_-or-_type-ChartType.PIE--config_63__58__groupLabelOverrides_63_-Record_string.string_-or-undefined_-or-undefined_-or-_type-ChartType.FUNNEL--config_63__58__labelOverrides_63_-Record_string.string_-or-undefined_-or-undefined_-or-_type-ChartType.BIG_NUMBER--config_63__58__label_63_-string-or-undefined--comparisonLabel_63_-string-or-undefined--comparisonField_63_-string-or-undefined_-or-undefined_-or-_type-ChartType.TABLE--config_63__58__columns_63_-Record_string._name-string__-or-undefined_-or-undefined_-or-_type-ChartType.CUSTOM--config_63__58__spec_63_-Record_string.unknown_-or-undefined_-or-undefined_-or-undefined__._recurseIntoArrays-true__
      type: object
      description: >-
        Same as `PartialDeep`, but accepts only `object`s as inputs. Internal
        helper for `PartialDeep`.
    Omit_Pick_SavedChart.name-or-description-or-tableName-or-metricQuery-or-chartConfig-or-pivotConfig-or-slug-or-parameters_.metricQuery_:
      $ref: >-
        #/components/schemas/Pick_Pick_SavedChart.name-or-description-or-tableName-or-metricQuery-or-chartConfig-or-pivotConfig-or-slug-or-parameters_.Exclude_keyofPick_SavedChart.name-or-description-or-tableName-or-metricQuery-or-chartConfig-or-pivotConfig-or-slug-or-parameters_.metricQuery__
      description: Construct a type with the properties of T except for those in type K.
    ContentVerificationInfo:
      properties:
        verifiedAt:
          type: string
          format: date-time
        verifiedBy:
          properties:
            lastName:
              type: string
            firstName:
              type: string
            userUuid:
              type: string
          required:
            - lastName
            - firstName
            - userUuid
          type: object
      required:
        - verifiedAt
        - verifiedBy
      type: object
    ContentAsCodeType.CHART:
      enum:
        - chart
      type: string
    Omit_MetricQuery.filters_:
      $ref: '#/components/schemas/Pick_MetricQuery.Exclude_keyofMetricQuery.filters__'
      description: Construct a type with the properties of T except for those in type K.
    FiltersInput:
      properties:
        tableCalculations:
          $ref: '#/components/schemas/FilterGroupInput'
        metrics:
          $ref: '#/components/schemas/FilterGroupInput'
        dimensions:
          $ref: '#/components/schemas/FilterGroupInput'
      type: object
    ? PartialObjectDeep___91_x-string_93__58__name_63_-string-or-undefined--description_63_-string-or-undefined--chartConfig_63__58__type-ChartType.CARTESIAN--config_63__58__eChartsConfig_58__series_63__58__name_63_-string-or-undefined--markLine_63__58__data_58__name_63_-string-or-undefined_-Array_-or-undefined_-Array-or-undefined--xAxis_63__58__name_63_-string-or-undefined_-Array-or-undefined--yAxis_63__58__name_63_-string-or-undefined_-Array-or-undefined__-or-undefined_-or-_type-ChartType.PIE--config_63__58__groupLabelOverrides_63_-Record_string.string_-or-undefined_-or-undefined_-or-_type-ChartType.FUNNEL--config_63__58__labelOverrides_63_-Record_string.string_-or-undefined_-or-undefined_-or-_type-ChartType.BIG_NUMBER--config_63__58__label_63_-string-or-undefined--comparisonLabel_63_-string-or-undefined--comparisonField_63_-string-or-undefined_-or-undefined_-or-_type-ChartType.TABLE--config_63__58__columns_63_-Record_string._name-string__-or-undefined_-or-undefined_-or-_type-ChartType.CUSTOM--config_63__58__spec_63_-Record_string.unknown_-or-undefined_-or-undefined_-or-undefined__._recurseIntoArrays-true__
    : properties: {}
      type: object
      description: >-
        Same as `PartialDeep`, but accepts only `object`s as inputs. Internal
        helper for `PartialDeep`.
    Pick_Pick_SavedChart.name-or-description-or-tableName-or-metricQuery-or-chartConfig-or-pivotConfig-or-slug-or-parameters_.Exclude_keyofPick_SavedChart.name-or-description-or-tableName-or-metricQuery-or-chartConfig-or-pivotConfig-or-slug-or-parameters_.metricQuery__:
      properties:
        description:
          type: string
          description: Optional description of what this chart displays
        name:
          type: string
          description: Display name of the chart
        parameters:
          $ref: '#/components/schemas/ParametersValuesMap'
          description: Parameter values for the chart query
        chartConfig:
          $ref: '#/components/schemas/ChartConfig'
          description: Visualization configuration for the chart
        slug:
          type: string
          description: Unique identifier slug for this chart
        tableName:
          type: string
          description: The explore/table name this chart queries from
        pivotConfig:
          properties:
            columns:
              items:
                type: string
              type: array
          required:
            - columns
          type: object
          description: Pivot table configuration
      required:
        - name
        - chartConfig
        - slug
        - tableName
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    Pick_MetricQuery.Exclude_keyofMetricQuery.filters__:
      properties:
        limit:
          type: number
          format: double
          description: Maximum number of rows to return
        timezone:
          type: string
          description: Timezone for date/time values (e.g., 'America/Los_Angeles', 'UTC')
        exploreName:
          type: string
          description: The name of the explore to query
        dimensions:
          items:
            type: string
          type: array
          description: List of dimension field IDs to include
        metrics:
          items:
            type: string
          type: array
          description: List of metric field IDs to include
        sorts:
          items:
            $ref: '#/components/schemas/SortField'
          type: array
          description: Sort configuration for query results
        tableCalculations:
          items:
            $ref: '#/components/schemas/TableCalculation'
          type: array
          description: Custom calculations to perform on query results
        additionalMetrics:
          items:
            $ref: '#/components/schemas/AdditionalMetric'
          type: array
          description: Custom metrics defined inline (ad-hoc metrics not in the dbt model)
        customDimensions:
          items:
            $ref: '#/components/schemas/CustomDimension'
          type: array
          description: Custom dimensions defined inline
        metricOverrides:
          $ref: '#/components/schemas/MetricOverrides'
          description: Override formatting options for existing metrics
        dimensionOverrides:
          $ref: '#/components/schemas/DimensionOverrides'
          description: Override formatting options for existing dimensions
        pivotDimensions:
          items:
            type: string
          type: array
          description: >-
            Dimension field IDs used as pivot columns (from chart's
            pivotConfig.columns).

            Used by row_total() to determine non-pivot dimensions for GROUP BY.
        metadata:
          properties:
            hasADateDimension:
              $ref: >-
                #/components/schemas/Pick_CompiledDimension.name-or-label-or-table_
          required:
            - hasADateDimension
          type: object
      required:
        - limit
        - exploreName
        - dimensions
        - metrics
        - sorts
        - tableCalculations
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    FilterGroupInput:
      anyOf:
        - $ref: '#/components/schemas/OrFilterGroupInput'
        - $ref: '#/components/schemas/AndFilterGroupInput'
    ParametersValuesMap:
      $ref: '#/components/schemas/Record_string.ParameterValue_'
    ChartConfig:
      anyOf:
        - $ref: '#/components/schemas/BigNumberConfig'
        - $ref: '#/components/schemas/CartesianChartConfig'
        - $ref: '#/components/schemas/CustomVisConfig'
        - $ref: '#/components/schemas/PieChartConfig'
        - $ref: '#/components/schemas/FunnelChartConfig'
        - $ref: '#/components/schemas/TableChartConfig'
        - $ref: '#/components/schemas/TreemapChartConfig'
        - $ref: '#/components/schemas/GaugeChartConfig'
        - $ref: '#/components/schemas/MapChartConfig'
        - $ref: '#/components/schemas/SankeyChartConfig'
    SortField:
      properties:
        nullsFirst:
          type: boolean
          description: Sort null values first
        descending:
          type: boolean
          description: Sort in descending order
        fieldId:
          type: string
          description: Field ID to sort by
      required:
        - descending
        - fieldId
      type: object
    TableCalculation:
      anyOf:
        - $ref: '#/components/schemas/SqlTableCalculation'
        - $ref: '#/components/schemas/TemplateTableCalculation'
        - $ref: '#/components/schemas/FormulaTableCalculation'
    AdditionalMetric:
      properties:
        label:
          type: string
          description: Display label for the metric
        type:
          $ref: '#/components/schemas/MetricType'
          description: Aggregation type
        description:
          type: string
          description: Description of what the metric measures
        sql:
          type: string
          description: SQL expression (e.g., ${TABLE}.column_name)
        hidden:
          type: boolean
          description: Whether the metric is hidden from users
        round:
          type: number
          format: double
          description: Number of decimal places
        compact:
          $ref: '#/components/schemas/CompactOrAlias'
          description: Compact format for large numbers
        format:
          anyOf:
            - $ref: '#/components/schemas/Format'
            - type: string
          description: Format string (legacy format specification)
        table:
          type: string
          description: Table name the metric belongs to
        name:
          type: string
          description: Internal name of the metric
        index:
          type: number
          format: double
          description: Display order index
        filters:
          items:
            $ref: '#/components/schemas/MetricFilterRule'
          type: array
          description: Filters to apply to this metric
        baseDimensionName:
          type: string
          description: Name of the base dimension/column this metric aggregates
        uuid:
          type: string
          nullable: true
          description: Unique identifier for the metric
        percentile:
          type: number
          format: double
          description: Percentile value for percentile metrics
        distinctKeys:
          items:
            type: string
          type: array
        formatOptions:
          $ref: '#/components/schemas/CustomFormat'
          description: Formatting configuration
        generationType:
          type: string
          enum:
            - periodOverPeriod
          nullable: false
          description: |-
            Optional marker for metrics generated by the system.
            Currently used for Period-over-Period (PoP) previous-period metrics.
        baseMetricId:
          $ref: '#/components/schemas/FieldId'
          description: >-
            For PoP-generated metrics, the base metric id that this metric is
            derived from.
        timeDimensionId:
          $ref: '#/components/schemas/FieldId'
          description: >-
            For PoP-generated metrics, the time dimension id used for the
            comparison.
        granularity:
          $ref: '#/components/schemas/TimeFrames'
          description: For PoP-generated metrics, the granularity used for the comparison.
        periodOffset:
          type: number
          format: double
          description: >-
            For PoP-generated metrics, the number of periods to offset by (>=
            1).
      required:
        - type
        - sql
        - table
        - name
      type: object
      additionalProperties: true
    CustomDimension:
      anyOf:
        - $ref: '#/components/schemas/CustomBinDimension'
        - $ref: '#/components/schemas/CustomSqlDimension'
    MetricOverrides:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/Pick_Metric.formatOptions_'
      type: object
    DimensionOverrides:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/Pick_Dimension.formatOptions_'
      type: object
    Pick_CompiledDimension.name-or-label-or-table_:
      properties: {}
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    OrFilterGroupInput:
      properties:
        or:
          items:
            $ref: '#/components/schemas/FilterGroupItemInput'
          type: array
        id:
          type: string
      required:
        - or
      type: object
    AndFilterGroupInput:
      properties:
        and:
          items:
            $ref: '#/components/schemas/FilterGroupItemInput'
          type: array
        id:
          type: string
      required:
        - and
      type: object
    Record_string.ParameterValue_:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/ParameterValue'
      type: object
      description: Construct a type with a set of properties K of type T
    BigNumberConfig:
      properties:
        config:
          $ref: '#/components/schemas/BigNumber'
          description: Chart-type-specific configuration
        type:
          $ref: '#/components/schemas/ChartType.BIG_NUMBER'
          description: Type of chart visualization
      required:
        - type
      type: object
    CartesianChartConfig:
      properties:
        config:
          $ref: '#/components/schemas/CartesianChart'
          description: Chart-type-specific configuration
        type:
          $ref: '#/components/schemas/ChartType.CARTESIAN'
          description: Type of chart visualization
      required:
        - type
      type: object
    CustomVisConfig:
      properties:
        config:
          $ref: '#/components/schemas/CustomVis'
          description: Chart-type-specific configuration
        type:
          $ref: '#/components/schemas/ChartType.CUSTOM'
          description: Type of chart visualization
      required:
        - type
      type: object
    PieChartConfig:
      properties:
        config:
          $ref: '#/components/schemas/PieChart'
          description: Chart-type-specific configuration
        type:
          $ref: '#/components/schemas/ChartType.PIE'
          description: Type of chart visualization
      required:
        - type
      type: object
    FunnelChartConfig:
      properties:
        config:
          $ref: '#/components/schemas/FunnelChart'
          description: Chart-type-specific configuration
        type:
          $ref: '#/components/schemas/ChartType.FUNNEL'
          description: Type of chart visualization
      required:
        - type
      type: object
    TableChartConfig:
      properties:
        config:
          $ref: '#/components/schemas/TableChart'
          description: Chart-type-specific configuration
        type:
          $ref: '#/components/schemas/ChartType.TABLE'
          description: Type of chart visualization
      required:
        - type
      type: object
    TreemapChartConfig:
      properties:
        config:
          $ref: '#/components/schemas/TreemapChart'
          description: Chart-type-specific configuration
        type:
          $ref: '#/components/schemas/ChartType.TREEMAP'
          description: Type of chart visualization
      required:
        - type
      type: object
    GaugeChartConfig:
      properties:
        config:
          $ref: '#/components/schemas/GaugeChart'
          description: Chart-type-specific configuration
        type:
          $ref: '#/components/schemas/ChartType.GAUGE'
          description: Type of chart visualization
      required:
        - type
      type: object
    MapChartConfig:
      properties:
        config:
          $ref: '#/components/schemas/MapChart'
          description: Chart-type-specific configuration
        type:
          $ref: '#/components/schemas/ChartType.MAP'
          description: Type of chart visualization
      required:
        - type
      type: object
    SankeyChartConfig:
      properties:
        config:
          $ref: '#/components/schemas/SankeyChart'
          description: Chart-type-specific configuration
        type:
          $ref: '#/components/schemas/ChartType.SANKEY'
          description: Type of chart visualization
      required:
        - type
      type: object
    SqlTableCalculation:
      allOf:
        - $ref: '#/components/schemas/TableCalculationBase'
        - properties:
            sql:
              type: string
              description: >-
                SQL expression for the calculation (can reference fields with
                ${table.field})
          required:
            - sql
          type: object
    TemplateTableCalculation:
      allOf:
        - $ref: '#/components/schemas/TableCalculationBase'
        - properties:
            template:
              $ref: '#/components/schemas/TableCalculationTemplate'
              description: Template-based calculation (alternative to sql)
          required:
            - template
          type: object
    FormulaTableCalculation:
      allOf:
        - $ref: '#/components/schemas/TableCalculationBase'
        - properties:
            formula:
              type: string
              description: Spreadsheet-like formula compiled to SQL at query time
          required:
            - formula
          type: object
    MetricType:
      enum:
        - percentile
        - average
        - count
        - count_distinct
        - sum
        - sum_distinct
        - average_distinct
        - min
        - max
        - percent_of_previous
        - percent_of_total
        - running_total
        - number
        - median
        - string
        - date
        - timestamp
        - boolean
      type: string
    CompactOrAlias:
      anyOf:
        - $ref: '#/components/schemas/Compact'
        - type: string
          enum:
            - K
            - thousand
            - M
            - million
            - B
            - billion
            - T
            - trillion
            - KB
            - kilobyte
            - MB
            - megabyte
            - GB
            - gigabyte
            - TB
            - terabyte
            - PB
            - petabyte
            - KiB
            - kibibyte
            - MiB
            - mebibyte
            - GiB
            - gibibyte
            - TiB
            - tebibyte
            - PiB
            - pebibyte
    Format:
      enum:
        - km
        - mi
        - usd
        - gbp
        - eur
        - jpy
        - dkk
        - id
        - percent
      type: string
    MetricFilterRule:
      description: Filter rule for metrics, targeting fields by reference
      properties:
        values:
          items:
            $ref: '#/components/schemas/AnyType'
          type: array
          description: Values to filter by
        operator:
          $ref: '#/components/schemas/FilterOperator'
          description: Filter operator
        id:
          type: string
          description: Unique identifier for the filter
        target:
          properties:
            fieldRef:
              type: string
              description: Field reference to filter on (e.g., 'table_name.field_name')
          required:
            - fieldRef
          type: object
          description: Target field for the filter
        settings:
          $ref: '#/components/schemas/AnyType'
          description: Additional settings for date/time filters
        disabled:
          type: boolean
          description: Whether this filter is disabled
        required:
          type: boolean
          description: Whether this filter is required
        caseSensitive:
          type: boolean
          description: >-
            Overrides the field/explore case-sensitivity for this rule only.

            Used by internal features like autocomplete search that must always

            match case-insensitively regardless of the field's configured
            setting.
      required:
        - operator
        - id
        - target
      type: object
      additionalProperties: true
    CustomFormat:
      properties:
        type:
          $ref: '#/components/schemas/CustomFormatType'
          description: Format type
        round:
          type: number
          format: double
          description: Number of decimal places
        separator:
          $ref: '#/components/schemas/NumberSeparator'
          description: Number separator style
        currency:
          type: string
          description: Currency code (e.g., USD, GBP, EUR)
        compact:
          $ref: '#/components/schemas/CompactOrAlias'
          description: Compact format for large numbers (K, M, B, T) or byte units
        prefix:
          type: string
          description: Prefix to prepend to formatted values
        suffix:
          type: string
          description: Suffix to append to formatted values
        timeInterval:
          $ref: '#/components/schemas/TimeFrames'
          description: Time interval for date formatting
        custom:
          type: string
          description: Custom format string
      required:
        - type
      type: object
      additionalProperties: true
    FieldId:
      type: string
    TimeFrames:
      enum:
        - RAW
        - YEAR
        - QUARTER
        - MONTH
        - WEEK
        - DAY
        - HOUR
        - MINUTE
        - SECOND
        - MILLISECOND
        - DAY_OF_WEEK_INDEX
        - DAY_OF_MONTH_NUM
        - DAY_OF_YEAR_NUM
        - WEEK_NUM
        - MONTH_NUM
        - QUARTER_NUM
        - YEAR_NUM
        - DAY_OF_WEEK_NAME
        - MONTH_NAME
        - QUARTER_NAME
        - HOUR_OF_DAY_NUM
        - MINUTE_OF_HOUR_NUM
      type: string
    CustomBinDimension:
      anyOf:
        - $ref: '#/components/schemas/FixedNumberBinDimension'
        - $ref: '#/components/schemas/FixedWidthBinDimension'
        - $ref: '#/components/schemas/CustomRangeBinDimension'
        - $ref: '#/components/schemas/CustomGroupBinDimension'
    CustomSqlDimension:
      properties:
        id:
          type: string
          description: Unique identifier for the custom dimension
        name:
          type: string
          description: Display name for the custom dimension
        table:
          type: string
          description: Table this custom dimension belongs to
        type:
          $ref: '#/components/schemas/CustomDimensionType.SQL'
          description: Type of custom dimension (bin or sql)
        sql:
          type: string
          description: SQL expression for the custom dimension
        dimensionType:
          $ref: '#/components/schemas/DimensionType'
          description: Data type of the dimension result
      required:
        - id
        - name
        - table
        - type
        - sql
        - dimensionType
      type: object
      additionalProperties: true
    Pick_Metric.formatOptions_:
      properties:
        formatOptions:
          $ref: '#/components/schemas/CustomFormat'
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    Pick_Dimension.formatOptions_:
      properties:
        formatOptions:
          $ref: '#/components/schemas/CustomFormat'
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    FilterGroupItemInput:
      anyOf:
        - $ref: '#/components/schemas/FilterGroupInput'
        - $ref: '#/components/schemas/FilterRuleInput'
    ParameterValue:
      anyOf:
        - type: string
        - type: number
          format: double
        - items:
            type: string
          type: array
        - items:
            type: number
            format: double
          type: array
    BigNumber:
      properties:
        comparisonField:
          type: string
        conditionalFormattings:
          items:
            $ref: '#/components/schemas/ConditionalFormattingConfig'
          type: array
          description: Conditional formatting rules
        comparisonLabel:
          type: string
          description: Custom label for the comparison value
        flipColors:
          type: boolean
          description: Flip positive/negative colors (red for increase, green for decrease)
        comparisonFormat:
          $ref: '#/components/schemas/ComparisonFormatTypes'
          description: Format for comparison value
        showComparison:
          type: boolean
          description: Show comparison with previous value
        showTableNamesInLabel:
          type: boolean
          description: Include table name in the label
        showBigNumberLabel:
          type: boolean
          description: Show the label above the number
        selectedField:
          type: string
          description: Field ID to display as the big number
        style:
          $ref: '#/components/schemas/CompactOrAlias'
          description: Number formatting style (compact notation)
        label:
          type: string
          description: Custom label for the big number
      type: object
    ChartType.BIG_NUMBER:
      enum:
        - big_number
      type: string
    CartesianChart:
      properties:
        columnLimit:
          type: number
          format: double
          description: Maximum number of pivot columns to display
        rowLimit:
          $ref: '#/components/schemas/RowLimit'
          description: Limit displayed rows to first/last N
        metadata:
          $ref: '#/components/schemas/Record_string.SeriesMetadata_'
          description: Metadata for series (colors, etc.)
        conditionalFormattings:
          items:
            $ref: '#/components/schemas/ConditionalFormattingConfig'
          type: array
          description: Conditional formatting rules
        eChartsConfig:
          $ref: '#/components/schemas/EChartsConfig'
          description: ECharts-specific configuration
        layout:
          $ref: '#/components/schemas/CartesianChartLayout'
          description: Layout configuration for the chart axes and orientation
      required:
        - eChartsConfig
        - layout
      type: object
    ChartType.CARTESIAN:
      enum:
        - cartesian
      type: string
    CustomVis:
      properties:
        spec:
          $ref: '#/components/schemas/Record_string.unknown_'
          description: Custom visualization specification (Vega-Lite or other)
      type: object
    ChartType.CUSTOM:
      enum:
        - custom
      type: string
    PieChart:
      properties:
        metadata:
          $ref: '#/components/schemas/Record_string.SeriesMetadata_'
          description: Metadata for series (colors, etc.)
        legendMaxItemLength:
          type: number
          format: double
          description: Maximum character length for legend items
        legendPosition:
          $ref: '#/components/schemas/PieChartLegendPosition'
          description: Legend position/orientation
        showLegend:
          type: boolean
          description: Show the chart legend
        groupSortOverrides:
          items:
            type: string
          type: array
          description: Custom sort order for groups/slices
        groupValueOptionOverrides:
          $ref: '#/components/schemas/Record_string.Partial_PieChartValueOptions__'
          description: Per-slice value display options
        groupColorOverrides:
          $ref: '#/components/schemas/Record_string.string_'
          description: Custom colors for each group/slice
        groupLabelOverrides:
          $ref: '#/components/schemas/Record_string.string_'
          description: Custom labels for each group/slice
        showPercentage:
          type: boolean
          description: Show percentage on slices
        showValue:
          type: boolean
          description: Show the actual value on slices
        valueLabel:
          $ref: '#/components/schemas/PieChartValueLabel'
          description: Position of value labels on slices
        isDonut:
          type: boolean
          description: Display as donut chart with hole in center
        metricId:
          type: string
          description: Field ID of the metric to display
        groupFieldIds:
          items:
            type: string
          type: array
          description: Field IDs used for grouping/slicing the pie
      type: object
    ChartType.PIE:
      enum:
        - pie
      type: string
    FunnelChart:
      properties:
        legendPosition:
          $ref: '#/components/schemas/FunnelChartLegendPosition'
          description: Legend orientation
        showLegend:
          type: boolean
          description: Show the chart legend
        labels:
          properties:
            showPercentage:
              type: boolean
              description: Show percentage
            showValue:
              type: boolean
              description: Show the actual value
            position:
              $ref: '#/components/schemas/FunnelChartLabelPosition'
              description: Position of labels
          type: object
          description: Label display configuration
        colorOverrides:
          $ref: '#/components/schemas/Record_string.string_'
          description: Custom colors for funnel stages
        labelOverrides:
          $ref: '#/components/schemas/Record_string.string_'
          description: Custom labels for funnel stages
        metadata:
          $ref: '#/components/schemas/Record_string.SeriesMetadata_'
          description: Metadata for series (colors, etc.)
        fieldId:
          type: string
          description: Field ID to display in funnel
        dataInput:
          $ref: '#/components/schemas/FunnelChartDataInput'
          description: How data is structured (row-based or column-based)
      type: object
    ChartType.FUNNEL:
      enum:
        - funnel
      type: string
    TableChart:
      properties:
        rowLimit:
          $ref: '#/components/schemas/RowLimit'
          description: Limit displayed rows to first/last N
        metricsAsRows:
          type: boolean
          description: Display metrics as rows instead of columns
        conditionalFormattings:
          items:
            $ref: '#/components/schemas/ConditionalFormattingConfig'
          type: array
          description: Conditional formatting rules
        columns:
          $ref: '#/components/schemas/Record_string.ColumnProperties_'
          description: Column-specific configuration
        showSubtotals:
          type: boolean
          description: Show subtotal rows
        showResultsTotal:
          type: boolean
          description: Show total results count
        hideRowNumbers:
          type: boolean
          description: Hide row number column
        showTableNames:
          type: boolean
          description: Show table names in column headers
        showRowCalculation:
          type: boolean
          description: Show row totals/calculations
        showColumnCalculation:
          type: boolean
          description: Show column totals/calculations
      type: object
    ChartType.TABLE:
      enum:
        - table
      type: string
    TreemapChart:
      properties:
        endColorThreshold:
          type: number
          format: double
          description: Value threshold for end color
        startColorThreshold:
          type: number
          format: double
          description: Value threshold for start color
        useDynamicColors:
          type: boolean
          description: Use dynamic color scaling based on values
        endColor:
          type: string
          description: End color for color gradient (hex code)
        startColor:
          type: string
          description: Start color for color gradient (hex code)
        colorMetricId:
          type: string
          description: Field ID for node color value
        sizeMetricId:
          type: string
          description: Field ID for node size
        groupFieldIds:
          items:
            type: string
          type: array
          description: Field IDs for hierarchical grouping
        leafDepth:
          type: number
          format: double
          description: Depth of leaf nodes to display
        visibleMin:
          type: number
          format: double
          description: Minimum size for visible nodes
      type: object
    ChartType.TREEMAP:
      enum:
        - treemap
      type: string
    GaugeChart:
      properties:
        customPercentageLabel:
          type: string
          description: Custom label for the percentage display
        showPercentage:
          type: boolean
          description: Show value as percentage
        customLabel:
          type: string
          description: Custom label for the gauge value
        sections:
          items:
            $ref: '#/components/schemas/GaugeSection'
          type: array
          description: Color sections/ranges for the gauge
        showAxisLabels:
          type: boolean
          description: Show min/max labels on the gauge
        maxFieldId:
          type: string
          description: Field ID to use as the max value
        max:
          type: number
          format: double
          description: Maximum value for the gauge
        min:
          type: number
          format: double
          description: Minimum value for the gauge
        selectedField:
          type: string
          description: Field ID for the gauge value
      type: object
    ChartType.GAUGE:
      enum:
        - gauge
      type: string
    MapChart:
      properties:
        saveMapExtent:
          type: boolean
          description: Save the current map zoom/position
        fieldConfig:
          $ref: '#/components/schemas/Record_string.MapFieldConfig_'
          description: Field-specific configuration for tooltips
        noDataColor:
          type: string
          description: Color for regions with no data (hex code)
        backgroundColor:
          type: string
          description: Background color for the map (hex code)
        darkModeTileBackground:
          $ref: '#/components/schemas/MapTileBackground'
          description: >-
            Map tile background style for dark mode (uses dark default when
            undefined)
        tileBackground:
          $ref: '#/components/schemas/MapTileBackground'
          description: Map tile background style
        dataLayerOpacity:
          type: number
          format: double
          description: Data layer opacity (0.1 to 1)
        heatmapConfig:
          properties:
            opacity:
              type: number
              format: double
              description: Opacity of the heatmap layer
            blur:
              type: number
              format: double
              description: Blur amount for heat points
            radius:
              type: number
              format: double
              description: Radius of heat points
          type: object
          description: Configuration for heatmap visualization
        sizeFieldId:
          type: string
          description: Field ID for bubble size (scatter maps)
        maxBubbleSize:
          type: number
          format: double
          description: Maximum bubble size for scatter maps
        minBubbleSize:
          type: number
          format: double
          description: Minimum bubble size for scatter maps
        defaultCenterLon:
          type: number
          format: double
          description: Default center longitude
        defaultCenterLat:
          type: number
          format: double
          description: Default center latitude
        defaultZoom:
          type: number
          format: double
          description: Default zoom level
        colorOverrides:
          $ref: '#/components/schemas/Record_string.string_'
          description: Per-value color overrides for categorical color fields
        colorRange:
          items:
            type: string
          type: array
          description: Array of colors for the value gradient
        showLegend:
          type: boolean
          description: Show the map legend
        valueFieldId:
          type: string
          description: Field ID for the value to display
        geoJsonPropertyKey:
          type: string
          description: Property key in GeoJSON to match against data
        locationFieldId:
          type: string
          description: Field ID for location/region names (area maps)
        longitudeFieldId:
          type: string
          description: Field ID for longitude values
        latitudeFieldId:
          type: string
          description: Field ID for latitude values
        locationType:
          $ref: '#/components/schemas/MapChartType'
          description: How to display location data
        customGeoJsonUrl:
          type: string
          description: URL to custom GeoJSON file
        mapType:
          $ref: '#/components/schemas/MapChartLocation'
          description: Type of map to display
      type: object
    ChartType.MAP:
      enum:
        - map
      type: string
    SankeyChart:
      properties:
        orient:
          type: string
          enum:
            - horizontal
            - vertical
          description: Orientation of the diagram
        nodeAlign:
          type: string
          enum:
            - left
            - right
            - justify
          description: Node alignment
        metricFieldId:
          type: string
          description: Field ID for the link value metric
        targetFieldId:
          type: string
          description: Field ID for the target node dimension
        sourceFieldId:
          type: string
          description: Field ID for the source node dimension
      type: object
    ChartType.SANKEY:
      enum:
        - sankey
      type: string
    TableCalculationBase:
      properties:
        type:
          $ref: '#/components/schemas/TableCalculationType'
          description: Data type of the calculation result
        format:
          $ref: '#/components/schemas/CustomFormat'
          description: Formatting options for the calculation
        displayName:
          type: string
          description: Display name shown in the UI
        name:
          type: string
          description: Internal name of the table calculation
        index:
          type: number
          format: double
          description: Display order index
      required:
        - displayName
        - name
      type: object
    TableCalculationTemplate:
      anyOf:
        - properties:
            partitionBy:
              items:
                type: string
              type: array
            orderBy:
              items:
                properties:
                  order:
                    type: string
                    enum:
                      - asc
                      - desc
                      - null
                    nullable: true
                  fieldId:
                    type: string
                required:
                  - order
                  - fieldId
                type: object
              type: array
              description: Fields to order by for window functions
            fieldId:
              type: string
              description: Field ID to apply the template to
            type:
              $ref: >-
                #/components/schemas/TableCalculationTemplateType.PERCENT_CHANGE_FROM_PREVIOUS
              description: Type of template calculation
          required:
            - orderBy
            - fieldId
            - type
          type: object
        - properties:
            partitionBy:
              items:
                type: string
              type: array
            orderBy:
              items:
                properties:
                  order:
                    type: string
                    enum:
                      - asc
                      - desc
                      - null
                    nullable: true
                  fieldId:
                    type: string
                required:
                  - order
                  - fieldId
                type: object
              type: array
              description: Fields to order by for window functions
            fieldId:
              type: string
              description: Field ID to apply the template to
            type:
              $ref: >-
                #/components/schemas/TableCalculationTemplateType.PERCENT_OF_PREVIOUS_VALUE
              description: Type of template calculation
          required:
            - orderBy
            - fieldId
            - type
          type: object
        - properties:
            partitionBy:
              items:
                type: string
              type: array
              description: Fields to partition by
            fieldId:
              type: string
              description: Field ID to apply the template to
            type:
              $ref: >-
                #/components/schemas/TableCalculationTemplateType.PERCENT_OF_COLUMN_TOTAL
              description: Type of template calculation
          required:
            - fieldId
            - type
          type: object
        - properties:
            fieldId:
              type: string
              description: Field ID to apply the template to
            type:
              $ref: '#/components/schemas/TableCalculationTemplateType.RANK_IN_COLUMN'
              description: Type of template calculation
          required:
            - fieldId
            - type
          type: object
        - properties:
            fieldId:
              type: string
              description: Field ID to apply the template to
            type:
              $ref: '#/components/schemas/TableCalculationTemplateType.RUNNING_TOTAL'
              description: Type of template calculation
          required:
            - fieldId
            - type
          type: object
        - properties:
            frame:
              $ref: '#/components/schemas/FrameClause'
              description: Frame clause for window functions
            partitionBy:
              items:
                type: string
              type: array
              description: Fields to partition by for window functions
            orderBy:
              items:
                properties:
                  order:
                    type: string
                    enum:
                      - asc
                      - desc
                      - null
                    nullable: true
                  fieldId:
                    type: string
                required:
                  - order
                  - fieldId
                type: object
              type: array
              description: Fields to order by for window functions
            fieldId:
              type: string
              nullable: true
              description: Field ID to apply the template to
            windowFunction:
              $ref: '#/components/schemas/WindowFunctionType'
              description: Window function type
            type:
              $ref: >-
                #/components/schemas/TableCalculationTemplateType.WINDOW_FUNCTION
              description: Type of template calculation
          required:
            - partitionBy
            - orderBy
            - fieldId
            - windowFunction
            - type
          type: object
    Compact:
      enum:
        - thousands
        - millions
        - billions
        - trillions
        - kilobytes
        - megabytes
        - gigabytes
        - terabytes
        - petabytes
        - kibibytes
        - mebibytes
        - gibibytes
        - tebibytes
        - pebibytes
      type: string
    FilterOperator:
      enum:
        - isNull
        - notNull
        - equals
        - notEquals
        - startsWith
        - endsWith
        - include
        - doesNotInclude
        - lessThan
        - lessThanOrEqual
        - greaterThan
        - greaterThanOrEqual
        - inThePast
        - notInThePast
        - inTheNext
        - inTheCurrent
        - notInTheCurrent
        - inBetween
        - notInBetween
        - inPeriodToDate
      type: string
    CustomFormatType:
      enum:
        - default
        - percent
        - currency
        - number
        - id
        - date
        - timestamp
        - bytes_si
        - bytes_iec
        - custom
      type: string
    NumberSeparator:
      enum:
        - default
        - commaPeriod
        - spacePeriod
        - periodComma
        - noSeparatorPeriod
      type: string
    FixedNumberBinDimension:
      properties:
        id:
          type: string
          description: Unique identifier for the custom dimension
        name:
          type: string
          description: Display name for the custom dimension
        table:
          type: string
          description: Table this custom dimension belongs to
        type:
          $ref: '#/components/schemas/CustomDimensionType.BIN'
          description: Type of custom dimension (bin or sql)
        dimensionId:
          $ref: '#/components/schemas/FieldId'
          description: Field ID of the parent dimension to bin
        binType:
          $ref: '#/components/schemas/BinType.FIXED_NUMBER'
        binNumber:
          type: number
          format: double
      required:
        - id
        - name
        - table
        - type
        - dimensionId
        - binType
        - binNumber
      type: object
      additionalProperties: true
    FixedWidthBinDimension:
      properties:
        id:
          type: string
          description: Unique identifier for the custom dimension
        name:
          type: string
          description: Display name for the custom dimension
        table:
          type: string
          description: Table this custom dimension belongs to
        type:
          $ref: '#/components/schemas/CustomDimensionType.BIN'
          description: Type of custom dimension (bin or sql)
        dimensionId:
          $ref: '#/components/schemas/FieldId'
          description: Field ID of the parent dimension to bin
        binType:
          $ref: '#/components/schemas/BinType.FIXED_WIDTH'
        binWidth:
          type: number
          format: double
      required:
        - id
        - name
        - table
        - type
        - dimensionId
        - binType
        - binWidth
      type: object
      additionalProperties: true
    CustomRangeBinDimension:
      properties:
        id:
          type: string
          description: Unique identifier for the custom dimension
        name:
          type: string
          description: Display name for the custom dimension
        table:
          type: string
          description: Table this custom dimension belongs to
        type:
          $ref: '#/components/schemas/CustomDimensionType.BIN'
          description: Type of custom dimension (bin or sql)
        dimensionId:
          $ref: '#/components/schemas/FieldId'
          description: Field ID of the parent dimension to bin
        binType:
          $ref: '#/components/schemas/BinType.CUSTOM_RANGE'
        customRange:
          items:
            $ref: '#/components/schemas/BinRange'
          type: array
      required:
        - id
        - name
        - table
        - type
        - dimensionId
        - binType
        - customRange
      type: object
      additionalProperties: true
    CustomGroupBinDimension:
      properties:
        id:
          type: string
          description: Unique identifier for the custom dimension
        name:
          type: string
          description: Display name for the custom dimension
        table:
          type: string
          description: Table this custom dimension belongs to
        type:
          $ref: '#/components/schemas/CustomDimensionType.BIN'
          description: Type of custom dimension (bin or sql)
        dimensionId:
          $ref: '#/components/schemas/FieldId'
          description: Field ID of the parent dimension to bin
        binType:
          $ref: '#/components/schemas/BinType.CUSTOM_GROUP'
        customGroups:
          items:
            $ref: '#/components/schemas/BinGroup'
          type: array
      required:
        - id
        - name
        - table
        - type
        - dimensionId
        - binType
        - customGroups
      type: object
      additionalProperties: true
    CustomDimensionType.SQL:
      enum:
        - sql
      type: string
    DimensionType:
      enum:
        - string
        - number
        - timestamp
        - date
        - boolean
      type: string
    FilterRuleInput:
      allOf:
        - $ref: '#/components/schemas/Omit_FilterRule.id_'
        - properties:
            id:
              type: string
          type: object
      description: >-
        Permissive filter types for chart-as-code uploads where `id` may be
        omitted.

        Filter IDs are auto-generated during upsert if absent.

        After normalization these become the strict runtime types (FilterGroup,
        Filters).
    ConditionalFormattingConfig:
      anyOf:
        - $ref: '#/components/schemas/ConditionalFormattingConfigWithSingleColor'
        - $ref: '#/components/schemas/ConditionalFormattingConfigWithColorRange'
    ComparisonFormatTypes:
      enum:
        - raw
        - percentage
      type: string
    RowLimit:
      properties:
        count:
          type: number
          format: double
          description: Number of rows to show or hide
        direction:
          type: string
          enum:
            - first
            - last
          description: Whether to target the first or last N rows
        mode:
          type: string
          enum:
            - show
            - hide
          description: Whether to show or hide the selected rows
      required:
        - count
        - direction
        - mode
      type: object
    Record_string.SeriesMetadata_:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/SeriesMetadata'
      type: object
      description: Construct a type with a set of properties K of type T
    EChartsConfig:
      $ref: '#/components/schemas/Partial_CompleteEChartsConfig_'
    CartesianChartLayout:
      $ref: '#/components/schemas/Partial_CompleteCartesianChartLayout_'
    Record_string.unknown_:
      properties: {}
      additionalProperties: {}
      type: object
      description: Construct a type with a set of properties K of type T
    PieChartLegendPosition:
      type: string
      enum:
        - horizontal
        - vertical
      nullable: false
    Record_string.Partial_PieChartValueOptions__:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/Partial_PieChartValueOptions_'
      type: object
      description: Construct a type with a set of properties K of type T
    Record_string.string_:
      properties: {}
      additionalProperties:
        type: string
      type: object
      description: Construct a type with a set of properties K of type T
    PieChartValueLabel:
      type: string
      enum:
        - hidden
        - inside
        - outside
      nullable: false
    FunnelChartLegendPosition:
      enum:
        - horizontal
        - vertical
      type: string
    FunnelChartLabelPosition:
      enum:
        - inside
        - left
        - right
        - hidden
      type: string
    FunnelChartDataInput:
      enum:
        - row
        - column
      type: string
    Record_string.ColumnProperties_:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/ColumnProperties'
      type: object
      description: Construct a type with a set of properties K of type T
    GaugeSection:
      properties:
        color:
          type: string
          description: Color for this section (hex code)
        maxFieldId:
          type: string
          description: Field ID to use as max value
        minFieldId:
          type: string
          description: Field ID to use as min value
        max:
          type: number
          format: double
          description: End value for this section
        min:
          type: number
          format: double
          description: Start value for this section
      required:
        - color
        - max
        - min
      type: object
    Record_string.MapFieldConfig_:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/MapFieldConfig'
      type: object
      description: Construct a type with a set of properties K of type T
    MapTileBackground:
      enum:
        - none
        - openstreetmap
        - light
        - dark
        - satellite
        - voyager
      type: string
    MapChartType:
      enum:
        - scatter
        - area
        - heatmap
      type: string
    MapChartLocation:
      enum:
        - USA
        - world
        - europe
        - custom
      type: string
    TableCalculationType:
      enum:
        - number
        - string
        - date
        - timestamp
        - boolean
      type: string
    TableCalculationTemplateType.PERCENT_CHANGE_FROM_PREVIOUS:
      enum:
        - percent_change_from_previous
      type: string
    TableCalculationTemplateType.PERCENT_OF_PREVIOUS_VALUE:
      enum:
        - percent_of_previous_value
      type: string
    TableCalculationTemplateType.PERCENT_OF_COLUMN_TOTAL:
      enum:
        - percent_of_column_total
      type: string
    TableCalculationTemplateType.RANK_IN_COLUMN:
      enum:
        - rank_in_column
      type: string
    TableCalculationTemplateType.RUNNING_TOTAL:
      enum:
        - running_total
      type: string
    FrameClause:
      properties:
        end:
          $ref: '#/components/schemas/FrameBoundary'
          description: End boundary of the frame
        start:
          $ref: '#/components/schemas/FrameBoundary'
          description: Start boundary of the frame
        frameType:
          $ref: '#/components/schemas/FrameType'
          description: Type of frame (ROWS or RANGE)
      required:
        - end
        - frameType
      type: object
    WindowFunctionType:
      enum:
        - row_number
        - percent_rank
        - cume_dist
        - rank
        - sum
        - avg
        - count
        - min
        - max
      type: string
    TableCalculationTemplateType.WINDOW_FUNCTION:
      enum:
        - window_function
      type: string
    CustomDimensionType.BIN:
      enum:
        - bin
      type: string
    BinType.FIXED_NUMBER:
      enum:
        - fixed_number
      type: string
    BinType.FIXED_WIDTH:
      enum:
        - fixed_width
      type: string
    BinType.CUSTOM_RANGE:
      enum:
        - custom_range
      type: string
    BinRange:
      properties:
        to:
          type: number
          format: double
          description: End value for this bin range (undefined for the last range)
        from:
          type: number
          format: double
          description: Start value for this bin range (undefined for the first range)
      type: object
    BinType.CUSTOM_GROUP:
      enum:
        - custom_group
      type: string
    BinGroup:
      properties:
        values:
          items:
            $ref: '#/components/schemas/GroupValueRule'
          type: array
          description: Rules that match values into this group
        name:
          type: string
          description: Display name for this group (e.g. "North America")
      required:
        - values
        - name
      type: object
    Omit_FilterRule.id_:
      $ref: '#/components/schemas/Pick_FilterRule.Exclude_keyofFilterRule.id__'
      description: Construct a type with the properties of T except for those in type K.
    ConditionalFormattingConfigWithSingleColor:
      properties:
        applyTo:
          $ref: '#/components/schemas/ConditionalFormattingColorApplyTo'
          description: Apply formatting to cell background or text
        rules:
          items:
            $ref: '#/components/schemas/ConditionalFormattingWithFilterOperator'
          type: array
          description: Rules for single-color conditional formatting
        darkColor:
          type: string
          description: Color for dark mode
        color:
          type: string
          description: Color for single-color conditional formatting
        target:
          allOf:
            - $ref: '#/components/schemas/FieldTarget'
          nullable: true
          description: Target field for the formatting rule
      required:
        - rules
        - color
        - target
      type: object
    ConditionalFormattingConfigWithColorRange:
      properties:
        applyTo:
          $ref: '#/components/schemas/ConditionalFormattingColorApplyTo'
          description: Apply formatting to cell background or text
        rule:
          $ref: '#/components/schemas/ConditionalFormattingMinMax_number-or-auto_'
          description: Rule for color range formatting (min/max values)
        color:
          $ref: '#/components/schemas/ConditionalFormattingColorRange'
          description: Color range for gradient conditional formatting
        target:
          allOf:
            - $ref: '#/components/schemas/FieldTarget'
          nullable: true
          description: Target field for the formatting rule
      required:
        - rule
        - color
        - target
      type: object
    SeriesMetadata:
      properties:
        color:
          type: string
          description: Color for the series
      required:
        - color
      type: object
    Partial_CompleteEChartsConfig_:
      properties:
        legend:
          $ref: '#/components/schemas/EchartsLegend'
          description: Legend configuration
        grid:
          $ref: '#/components/schemas/EchartsGrid'
          description: Grid (chart area) configuration
        series:
          items:
            $ref: '#/components/schemas/Series'
          type: array
          description: Chart series configuration
        xAxis:
          items:
            $ref: '#/components/schemas/XAxis'
          type: array
          description: X axis configuration
        yAxis:
          items:
            $ref: '#/components/schemas/Axis'
          type: array
          description: Y axis configuration
        tooltip:
          type: string
          description: Tooltip formatter template
        tooltipSort:
          $ref: '#/components/schemas/TooltipSortBy'
          description: How to sort tooltip items
        showAxisTicks:
          type: boolean
          description: Show tick marks on axes
        axisLabelFontSize:
          type: number
          format: double
          description: Font size for axis labels
        axisTitleFontSize:
          type: number
          format: double
          description: Font size for axis titles
      type: object
      description: Make all properties in T optional
    Partial_CompleteCartesianChartLayout_:
      properties:
        xField:
          type: string
          description: Field ID to use for the X axis
        yField:
          items:
            type: string
          type: array
          description: Field IDs to use for the Y axis
        flipAxes:
          type: boolean
          description: Swap X and Y axes (creates horizontal bar charts)
        showGridX:
          type: boolean
          description: Show vertical grid lines
        showGridY:
          type: boolean
          description: Show horizontal grid lines
        showXAxis:
          type: boolean
          description: Show the X axis
        showYAxis:
          type: boolean
          description: Show the Y axis
        showLeftYAxis:
          type: boolean
          description: Controls left/primary Y-axis visibility
        showRightYAxis:
          type: boolean
          description: Controls right/secondary Y-axis visibility
        stack:
          anyOf:
            - type: string
            - type: boolean
          description: >-
            Stack series together (true for default stacking, or string for
            stack group name)
        connectNulls:
          type: boolean
          description: Connect null data points with a line
        colorByCategory:
          type: boolean
          description: >-
            Color each bar by its category value instead of using a single
            series color
        categoryColorOverrides:
          $ref: '#/components/schemas/Record_string.string_'
          description: Per-category color overrides (maps category value to hex color)
      type: object
      description: Make all properties in T optional
    Partial_PieChartValueOptions_:
      properties:
        valueLabel:
          type: string
          enum:
            - hidden
            - inside
            - outside
        showValue:
          type: boolean
        showPercentage:
          type: boolean
      type: object
      description: Make all properties in T optional
    ColumnProperties:
      properties:
        width:
          type: number
          format: double
        color:
          type: string
          description: Color for bar display style (hex code)
        displayStyle:
          type: string
          enum:
            - text
            - bar
          description: How to display the cell value
        frozen:
          type: boolean
          description: Freeze the column (stick to left side)
        name:
          type: string
          description: Custom display name for the column
        visible:
          type: boolean
          description: Whether the column is visible
      type: object
    MapFieldConfig:
      properties:
        label:
          type: string
          description: Custom label for the field
        visible:
          type: boolean
          description: Whether to show this field in tooltips
      type: object
    FrameBoundary:
      properties:
        offset:
          type: number
          format: double
          description: Offset for PRECEDING/FOLLOWING
        type:
          $ref: '#/components/schemas/FrameBoundaryType'
          description: Boundary type
      required:
        - type
      type: object
    FrameType:
      enum:
        - rows
        - range
      type: string
    GroupValueRule:
      properties:
        value:
          type: string
        matchType:
          $ref: '#/components/schemas/GroupValueMatchType'
      required:
        - value
        - matchType
      type: object
    Pick_FilterRule.Exclude_keyofFilterRule.id__:
      properties:
        target:
          $ref: '#/components/schemas/FieldTarget'
          description: Target field for the filter
        settings:
          description: Additional settings for date/time filters
        disabled:
          type: boolean
          description: Whether this filter is disabled
        required:
          type: boolean
          description: Whether this filter is required
        caseSensitive:
          type: boolean
          description: >-
            Overrides the field/explore case-sensitivity for this rule only.

            Used by internal features like autocomplete search that must always

            match case-insensitively regardless of the field's configured
            setting.
        operator:
          $ref: '#/components/schemas/FilterOperator'
          description: Filter operator
        values:
          items: {}
          type: array
          description: Values to filter by
      required:
        - target
        - operator
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    ConditionalFormattingColorApplyTo:
      enum:
        - cell
        - text
      type: string
    ConditionalFormattingWithFilterOperator:
      anyOf:
        - $ref: >-
            #/components/schemas/ConditionalFormattingWithValues_number-or-string_
        - $ref: >-
            #/components/schemas/ConditionalFormattingWithCompareTarget_number-or-string_
    FieldTarget:
      properties:
        fieldId:
          type: string
          description: Field ID to filter on
      required:
        - fieldId
      type: object
    ConditionalFormattingMinMax_number-or-auto_:
      properties:
        max:
          anyOf:
            - type: number
              format: double
            - type: string
              enum:
                - auto
          description: Maximum value (number or 'auto')
        min:
          anyOf:
            - type: number
              format: double
            - type: string
              enum:
                - auto
          description: Minimum value (number or 'auto')
      required:
        - max
        - min
      type: object
    ConditionalFormattingColorRange:
      properties:
        end:
          type: string
          description: End color for gradient
        start:
          type: string
          description: Start color for gradient
      required:
        - end
        - start
      type: object
    EchartsLegend:
      properties:
        icon:
          type: string
          enum:
            - circle
            - rect
            - roundRect
            - triangle
            - diamond
            - pin
            - arrow
            - none
          description: Legend icon shape
        align:
          type: string
          enum:
            - auto
            - left
            - right
          description: Legend alignment
        height:
          type: string
          description: Legend height
        width:
          type: string
          description: Legend width
        left:
          type: string
          description: Left position
        bottom:
          type: string
          description: Bottom position
        right:
          type: string
          description: Right position
        top:
          type: string
          description: Top position
        orient:
          type: string
          enum:
            - horizontal
            - vertical
          description: Legend orientation
        type:
          type: string
          enum:
            - plain
            - scroll
          description: Legend type (plain or scrollable)
        show:
          type: boolean
          description: Show the legend
      type: object
    EchartsGrid:
      properties:
        height:
          type: string
          description: Grid height
        width:
          type: string
          description: Grid width
        left:
          type: string
          description: Left padding
        bottom:
          type: string
          description: Bottom padding
        right:
          type: string
          description: Right padding
        top:
          type: string
          description: Top padding
        containLabel:
          type: boolean
          description: Whether the grid area contains axis labels
      type: object
    Series:
      properties:
        isFilteredOut:
          type: boolean
          description: Whether this series is currently filtered out
        markLine:
          $ref: '#/components/schemas/MarkLine'
          description: Reference line configuration
        smooth:
          type: boolean
          description: Use smooth curves for line/area charts
        showSymbol:
          type: boolean
          description: Show symbols/markers on data points
        areaStyle:
          $ref: '#/components/schemas/Record_string.unknown_'
          description: Area fill style (presence indicates area chart)
        hidden:
          type: boolean
          description: Hide this series from the chart
        label:
          properties:
            showSeriesName:
              type: boolean
              description: Show the metric field name
            showLabel:
              type: boolean
              description: Show the legend/pivot name
            showValue:
              type: boolean
              description: Show the metric value
            showOverlappingLabels:
              type: boolean
              description: Show labels even when they overlap
            position:
              type: string
              enum:
                - left
                - top
                - right
                - bottom
                - inside
              description: Position of data labels
            show:
              type: boolean
              description: Show data labels on points
          type: object
          description: Data label configuration
        yAxisIndex:
          type: number
          format: double
          description: Index of Y axis to use (for dual Y axis charts)
        color:
          type: string
          description: Color for the series (hex code)
        name:
          type: string
          description: Display name for the series
        stackLabel:
          properties:
            show:
              type: boolean
              description: Show stack total labels
          type: object
          description: Stack total label configuration
        stack:
          type: string
          description: Stack group name (series with same stack name are stacked)
        type:
          $ref: '#/components/schemas/CartesianSeriesType'
          description: Series visualization type
        encode:
          properties:
            'y':
              type: string
              description: Hash of yRef (computed)
            x:
              type: string
              description: Hash of xRef (computed)
            yRef:
              $ref: '#/components/schemas/PivotReference'
              description: Y axis field reference
            xRef:
              $ref: '#/components/schemas/PivotReference'
              description: X axis field reference
          required:
            - yRef
            - xRef
          type: object
          description: Field references for this series
      required:
        - type
        - encode
      type: object
    XAxis:
      allOf:
        - $ref: '#/components/schemas/Axis'
        - properties:
            enableDataZoom:
              type: boolean
              description: Enable data zoom slider for this axis
            sortType:
              $ref: '#/components/schemas/XAxisSortType'
              description: How to sort the X axis
          type: object
    Axis:
      properties:
        rotate:
          type: number
          format: double
          description: Rotation angle for axis labels
        inverse:
          type: boolean
          description: Reverse the axis direction
        maxOffset:
          type: string
          description: Offset from maximum value
        minOffset:
          type: string
          description: Offset from minimum value
        max:
          type: string
          description: Maximum value (or 'dataMax' for auto)
        min:
          type: string
          description: Minimum value (or 'dataMin' for auto)
        name:
          type: string
          description: Axis title
      type: object
    TooltipSortBy:
      type: string
      enum:
        - default
        - alphabetical
        - value_ascending
        - value_descending
    FrameBoundaryType:
      enum:
        - unbounded_preceding
        - preceding
        - current_row
        - following
        - unbounded_following
      type: string
    GroupValueMatchType:
      enum:
        - exact
        - startsWith
        - endsWith
        - includes
      type: string
    ConditionalFormattingWithValues_number-or-string_:
      allOf:
        - $ref: '#/components/schemas/BaseFilterRule_FilterOperator.number-or-string_'
        - properties:
            values:
              items:
                anyOf:
                  - type: number
                    format: double
                  - type: string
              type: array
              description: Values to compare against
          required:
            - values
          type: object
    ConditionalFormattingWithCompareTarget_number-or-string_:
      allOf:
        - $ref: '#/components/schemas/BaseFilterRule_FilterOperator.number-or-string_'
        - properties:
            values:
              items:
                anyOf:
                  - type: number
                    format: double
                  - type: string
              type: array
              description: Values to compare against
            compareTarget:
              allOf:
                - $ref: '#/components/schemas/FieldTarget'
              nullable: true
              description: Target field to compare against
          required:
            - compareTarget
          type: object
    MarkLine:
      properties:
        label:
          properties:
            formatter:
              type: string
              description: Label formatter
          type: object
          description: Label configuration
        lineStyle:
          properties:
            type:
              type: string
              description: Line type
            width:
              type: number
              format: double
              description: Line width
            color:
              type: string
              description: Line color
          required:
            - type
            - width
            - color
          type: object
          description: Line style configuration
        symbol:
          type: string
          description: Symbol at line endpoints
        data:
          items:
            $ref: '#/components/schemas/MarkLineData'
          type: array
          description: Reference line data points
      required:
        - data
      type: object
    CartesianSeriesType:
      enum:
        - line
        - bar
        - scatter
        - area
      type: string
    PivotReference:
      properties:
        pivotValues:
          items:
            $ref: '#/components/schemas/PivotValue'
          type: array
          description: Pivot values for this reference (for pivoted data)
        field:
          type: string
          description: Field ID being referenced
      required:
        - field
      type: object
    XAxisSortType:
      enum:
        - default
        - category
        - bar_totals
      type: string
    BaseFilterRule_FilterOperator.number-or-string_:
      properties:
        values:
          items:
            anyOf:
              - type: number
                format: double
              - type: string
          type: array
          description: Values to filter by
        operator:
          $ref: '#/components/schemas/FilterOperator'
          description: Filter operator
        id:
          type: string
          description: Unique identifier for the filter rule
      required:
        - operator
        - id
      type: object
    MarkLineData:
      properties:
        dynamicValue:
          type: string
          enum:
            - average
          nullable: false
          description: Dynamic value type
        label:
          properties:
            position:
              type: string
              enum:
                - start
                - middle
                - end
              description: Label position
            formatter:
              type: string
              description: Label formatter
          type: object
          description: Label configuration for this data point
        lineStyle:
          properties:
            color:
              type: string
              description: Line color
          required:
            - color
          type: object
          description: Line style for this data point
        uuid:
          type: string
          description: Unique identifier for this mark line
        type:
          type: string
          description: Point type (e.g., 'average')
        value:
          type: string
          description: Value to display
        name:
          type: string
          description: Name of the reference line
        xAxis:
          type: string
          description: X axis value for vertical line
        yAxis:
          type: string
          description: Y axis value for horizontal line
      required:
        - uuid
      type: object
    PivotValue:
      properties:
        value:
          description: Pivot value
        field:
          type: string
          description: Pivot field ID
      required:
        - value
        - field
      type: object

````