{
  "scriptappy": "1.1.3",
  "info": {
    "name": "@nebula.js/sn-pivot-table:properties",
    "description": "Pivot Table generic object definition",
    "version": "7.22.0",
    "license": "MIT",
    "stability": "experimental",
    "x-qlik-visibility": "public"
  },
  "entries": {
    "properties": {
      "extends": [
        {
          "type": "GenericObjectProperties"
        }
      ],
      "kind": "object",
      "entries": {
        "version": {
          "description": "Current version of this generic object definition",
          "type": "string"
        },
        "qHyperCubeDef": {
          "extends": [
            {
              "type": "HyperCubeDef"
            }
          ],
          "kind": "object",
          "entries": {
            "qAlwaysFullyExpanded": {
              "defaultValue": false,
              "type": "boolean"
            },
            "qDimensions": {
              "kind": "array",
              "items": {
                "type": "#/definitions/DimensionProperties"
              }
            },
            "qMeasures": {
              "kind": "array",
              "items": {
                "type": "#/definitions/MeasureProperties"
              }
            },
            "qSuppressMissing": {
              "defaultValue": true,
              "type": "boolean"
            },
            "qSuppressZero": {
              "defaultValue": false,
              "type": "boolean"
            },
            "qShowTotalsAbove": {
              "defaultValue": true,
              "type": "boolean"
            },
            "qIndentMode": {
              "defaultValue": false,
              "type": "boolean"
            }
          }
        },
        "showTitles": {
          "description": "Show title for the visualization",
          "optional": true,
          "defaultValue": true,
          "type": "boolean"
        },
        "title": {
          "description": "Visualization title",
          "optional": true,
          "defaultValue": "",
          "kind": "union",
          "items": [
            {
              "type": "string"
            },
            {
              "type": "StringExpression"
            }
          ]
        },
        "subtitle": {
          "description": "Visualization subtitle",
          "optional": true,
          "defaultValue": "",
          "kind": "union",
          "items": [
            {
              "type": "string"
            },
            {
              "type": "StringExpression"
            }
          ]
        },
        "footnote": {
          "description": "Visualization footnote",
          "optional": true,
          "defaultValue": "",
          "kind": "union",
          "items": [
            {
              "type": "string"
            },
            {
              "type": "StringExpression"
            }
          ]
        },
        "nullValueRepresentation": {
          "description": "Null value properties",
          "optional": true,
          "entries": {
            "text": {
              "description": "Null value text",
              "optional": true,
              "defaultValue": "-",
              "type": "string"
            }
          },
          "kind": "object"
        },
        "components": {
          "description": "General and chart specific styling",
          "optional": true,
          "kind": "array",
          "items": {
            "type": "#/definitions/Component"
          }
        }
      }
    }
  },
  "definitions": {
    "DimensionProperties": {
      "description": "Extends `NxDimension`, see Engine API: `NxDimension`",
      "extends": [
        {
          "type": "NxDimension"
        }
      ],
      "kind": "object",
      "entries": {
        "qDef": {
          "type": "#/definitions/InlineDimensionDef"
        },
        "qAttributeExpressions": {
          "kind": "array",
          "items": {
            "type": "#/definitions/AttributeExpressionDef"
          }
        }
      }
    },
    "MeasureProperties": {
      "description": "Extends `NxMeasure`, see Engine API: `NxMeasure`",
      "extends": [
        {
          "type": "NxMeasure"
        }
      ],
      "kind": "object",
      "entries": {
        "qDefs": {
          "type": "#/definitions/InlineMeasureDef"
        },
        "qAttributeExpressions": {
          "kind": "array",
          "items": {
            "type": "#/definitions/AttributeExpressionDef"
          }
        }
      }
    },
    "AttributeExpressionDef": {
      "kind": "union",
      "items": [
        {
          "type": "#/definitions/ColorByExpressionDef"
        },
        {
          "type": "NxAttrExprDef"
        }
      ]
    },
    "ColorByExpressionId": {
      "description": "Color by expression identifier",
      "kind": "union",
      "items": [
        {
          "kind": "literal",
          "value": "\"cellBackgroundColor\""
        },
        {
          "kind": "literal",
          "value": "\"cellForegroundColor\""
        }
      ]
    },
    "ColorByExpressionDef": {
      "kind": "object",
      "entries": {
        "qExpression": {
          "type": "StringExpression"
        },
        "id": {
          "type": "#/definitions/ColorByExpressionId"
        }
      },
      "examples": [
        "{ qExpression: \"=if(Sum([Sales Quantity]) > 500, green(), blue())\", id: \"cellBackgroundColor\" }"
      ]
    },
    "InlineDimensionDef": {
      "description": "Extends `NxInlineDimensionDef`, see Engine API: `NxInlineDimensionDef`.",
      "extends": [
        {
          "type": "NxInlineDimensionDef"
        }
      ],
      "kind": "object",
      "entries": {
        "columnWidth": {
          "optional": true,
          "type": "#/definitions/ColumnWidth"
        },
        "textAlign": {
          "optional": true,
          "type": "#/definitions/TextAlign"
        }
      }
    },
    "InlineMeasureDef": {
      "description": "Extends `NxInlineMeasureDef`, see Engine API: `NxInlineMeasureDef`.",
      "extends": [
        {
          "type": "NxInlineMeasureDef"
        }
      ],
      "kind": "object",
      "entries": {
        "columnWidth": {
          "optional": true,
          "type": "#/definitions/ColumnWidth"
        },
        "textAlign": {
          "optional": true,
          "type": "#/definitions/TextAlign"
        }
      }
    },
    "ColumnWidth": {
      "description": "Column width info. For the left grid, the properties are always applied.\nFor the right grid, only the leaf nodes will listen to the properties, and the columns above will get the width of the leaves accumulated",
      "kind": "object",
      "entries": {
        "type": {
          "description": "Defines how the column width is set. For the right grid, `auto` calculates the width(s) so the total width of the columns equals the right grid width. If the width reaches a minimum value, the columns will overflow. For the left grid, `auto` is N/A and defaults to `fitToContent`. `fitToContent` calculates a width based on the column's content. `pixels` uses a specified pixel value. `percentage` sets the column width to specified percentage of the chart/grid width",
          "kind": "union",
          "items": [
            {
              "kind": "literal",
              "value": "'auto'"
            },
            {
              "kind": "literal",
              "value": "'FitToContent'"
            },
            {
              "kind": "literal",
              "value": "'pixels'"
            },
            {
              "kind": "literal",
              "value": "'percentage'"
            }
          ]
        },
        "pixels": {
          "description": "Pixel value used if type is `pixels`",
          "optional": true,
          "type": "number"
        },
        "percentage": {
          "description": "Percentage value used if type is `percentage`. Note that for the left grid columns, this is a percentage of the whole chart width. For the right grid columns, it is a percentage of the right grid width",
          "optional": true,
          "type": "number"
        }
      }
    },
    "TextAlignValues": {
      "description": "Text align values",
      "kind": "union",
      "items": [
        {
          "kind": "literal",
          "value": "\"left\""
        },
        {
          "kind": "literal",
          "value": "\"center\""
        },
        {
          "kind": "literal",
          "value": "\"right\""
        }
      ]
    },
    "TextAlign": {
      "description": "Set the alignment of text in the chart.",
      "kind": "object",
      "entries": {
        "auto": {
          "description": "If true the chart decides text alignment, otherwise the \"align\" value is used.",
          "type": "boolean"
        },
        "align": {
          "description": "Align value",
          "optional": true,
          "type": "#/definitions/TextAlignValues"
        }
      }
    },
    "Component": {
      "description": "Styling defintions",
      "kind": "union",
      "items": [
        {
          "type": "#/definitions/ChartStyling"
        },
        {
          "type": "#/definitions/GeneralStyling"
        }
      ]
    },
    "GeneralStylingKey": {
      "description": "Mandatory key for general styling",
      "kind": "literal",
      "value": "\"general\""
    },
    "FontStyleValues": {
      "description": "Font styling values",
      "kind": "union",
      "items": [
        {
          "kind": "literal",
          "value": "\"bold\""
        },
        {
          "kind": "literal",
          "value": "\"italic\""
        },
        {
          "kind": "literal",
          "value": "\"underline\""
        }
      ]
    },
    "GeneralStyling": {
      "description": "General chart styling",
      "kind": "object",
      "entries": {
        "key": {
          "type": "#/definitions/GeneralStylingKey"
        },
        "title": {
          "type": "#/definitions/TitleStyling"
        },
        "bgColor": {
          "optional": true,
          "kind": "union",
          "items": [
            {
              "type": "#/definitions/BackgroundColor"
            },
            {
              "type": "#/definitions/BackgroundColorExpression"
            }
          ]
        },
        "bgImage": {
          "optional": true,
          "type": "#/definitions/BackgroundImage"
        }
      },
      "examples": [
        "{\n key: \"general\",\n title: {\n   main: {\n     fontSize: \"18px\",\n     fontFamily: \"Arial\",\n     fontStyle: [\"bold\", \"italic\"],\n     color: { color: \"orangered\" },\n   }\n },\n bgColor: {\n   useExpression: true,\n   color: {\n     index: 6,\n     color: \"#006580\"\n   },\n   colorExpression: {\n     qStringExpression: {\n       qExpr: \"red()\"\n     }\n   }\n },\n bgImage: {\n   mode: \"media\",\n   mediaUrl: {\n     qStaticContentUrlDef: {\n       qUrl: \"<path-to-image>\"\n     }\n   }\n }\n}"
      ]
    },
    "BackgroundColor": {
      "description": "Chart background color",
      "kind": "object",
      "entries": {
        "color": {
          "description": "Background color palette",
          "type": "#/definitions/PaletteColor"
        }
      }
    },
    "BackgroundColorExpression": {
      "description": "Chart background color by expression",
      "kind": "object",
      "entries": {
        "useExpression": {
          "description": "Boolean to indicate if color by expression should be used",
          "type": "boolean"
        },
        "colorExpression": {
          "description": "Color expression, \"useExpression\" must also be true",
          "type": "StringExpression"
        }
      }
    },
    "BackgroundImage": {
      "description": "Chart background image.\n\nBackground image takes precedence over background color.",
      "kind": "object",
      "entries": {
        "mode": {
          "description": "Mode",
          "kind": "literal",
          "value": "\"media\""
        },
        "mediaUrl": {
          "description": "Media url",
          "type": "#/definitions/MediaUrl"
        }
      }
    },
    "MediaUrl": {
      "description": "Media url",
      "kind": "object",
      "entries": {
        "qStaticContentUrlDef": {
          "description": "Background image mode",
          "kind": "object",
          "entries": {
            "qUrl": {
              "description": "Relative path of the image",
              "type": "string"
            }
          }
        }
      }
    },
    "TitleOptions": {
      "description": "Title styling options",
      "kind": "object",
      "entries": {
        "fontSize": {
          "description": "Font size in pixel value",
          "optional": true,
          "type": "string"
        },
        "fontFamily": {
          "description": "Font family",
          "optional": true,
          "type": "string"
        },
        "fontStyle": {
          "description": "Font style",
          "optional": true,
          "kind": "array",
          "items": {
            "type": "#/definitions/FontStyleValues"
          }
        },
        "color": {
          "description": "Font color palette",
          "optional": true,
          "type": "#/definitions/PaletteColor"
        }
      }
    },
    "TitleStyling": {
      "description": "Title styling",
      "kind": "object",
      "entries": {
        "main": {
          "description": "Styling for chart title",
          "optional": true,
          "type": "#/definitions/TitleOptions"
        },
        "subTitle": {
          "description": "Styling for chart sub title",
          "optional": true,
          "type": "#/definitions/TitleOptions"
        },
        "footer": {
          "description": "Styling for chart footer",
          "optional": true,
          "type": "#/definitions/TitleOptions"
        }
      }
    },
    "ChartStylingKey": {
      "description": "Mandatory key for chart styling",
      "kind": "literal",
      "value": "\"theme\""
    },
    "ChartStyling": {
      "description": "Custom styling of cells",
      "kind": "object",
      "entries": {
        "key": {
          "type": "#/definitions/ChartStylingKey"
        },
        "header": {
          "description": "Styling for header cells",
          "optional": true,
          "type": "#/definitions/CellStyling"
        },
        "dimensionValues": {
          "description": "Styling for dimension value cells",
          "optional": true,
          "type": "#/definitions/CellStyling"
        },
        "measureValues": {
          "description": "Styling for measure value cells",
          "optional": true,
          "type": "#/definitions/CellStyling"
        },
        "measureLabels": {
          "description": "Styling for measure label cells",
          "optional": true,
          "type": "#/definitions/PartialCellStyling"
        },
        "totalValues": {
          "description": "Styling for total value cells",
          "optional": true,
          "type": "#/definitions/PartialCellStyling"
        },
        "nullValues": {
          "description": "Styling for null values cells",
          "optional": true,
          "type": "#/definitions/PartialCellStyling"
        },
        "grid": {
          "description": "General grid styling",
          "optional": true,
          "type": "#/definitions/GridStyling"
        }
      },
      "examples": [
        "{\n key: \"theme\",\n dimensionValues: {\n   fontSize: \"18px\",\n   fontFamily: \"Arial\",\n   fontStyle: [\"bold\", \"italic\"],\n   fontColor: { color: \"orangered\" },\n   background: { index: 2 }\n }\n}"
      ]
    },
    "CellStyling": {
      "description": "Properties for styling a cell",
      "kind": "object",
      "entries": {
        "fontSize": {
          "description": "Font size in pixel value",
          "optional": true,
          "type": "string"
        },
        "fontFamily": {
          "description": "Font family",
          "optional": true,
          "type": "string"
        },
        "fontStyle": {
          "description": "Font style",
          "optional": true,
          "kind": "array",
          "items": {
            "type": "#/definitions/FontStyleValues"
          }
        },
        "fontColor": {
          "description": "Font color palette",
          "optional": true,
          "type": "#/definitions/PaletteColor"
        },
        "background": {
          "description": "Cell background color palette",
          "optional": true,
          "type": "#/definitions/PaletteColor"
        }
      }
    },
    "PartialCellStyling": {
      "description": "Properties for styling a cell",
      "kind": "object",
      "entries": {
        "fontStyle": {
          "description": "Font style",
          "optional": true,
          "kind": "array",
          "items": {
            "type": "#/definitions/FontStyleValues"
          }
        },
        "fontColor": {
          "description": "Font color palette",
          "optional": true,
          "type": "#/definitions/PaletteColor"
        },
        "background": {
          "description": "Cell background color palette",
          "optional": true,
          "type": "#/definitions/PaletteColor"
        }
      }
    },
    "GridStyling": {
      "description": "General grid styling",
      "kind": "object",
      "entries": {
        "lineClamp": {
          "description": "A numerical value that represents the number of lines a text at most can be splitt into",
          "optional": true,
          "type": "number"
        },
        "border": {
          "description": "Border color between cells",
          "optional": true,
          "type": "#/definitions/PaletteColor"
        },
        "divider": {
          "description": "Border color between row and column dimensions sections",
          "optional": true,
          "type": "#/definitions/PaletteColor"
        },
        "background": {
          "optional": true,
          "type": "#/definitions/PaletteColor"
        }
      }
    },
    "PaletteColor": {
      "description": "Color information structure. Holds the actual color and index in palette",
      "kind": "object",
      "entries": {
        "color": {
          "description": "Color as hex string (mandatory if index: -1)",
          "type": "string"
        },
        "index": {
          "description": "Index in palette",
          "type": "number"
        }
      }
    }
  }
}