Open Presentation

Search docs

Loading documentation…
    OpenPresentation/opf
    Browse docs
    On this page
    View source

    Dataset

    One shared data table: named columns (strings or DatasetColumn objects with a number format, a type, a role and a unit) and rows of scalar cells. Column names are unique ('data-column-duplicate' error). Rich text and styling belong in an inline table.

    Metadata

    Definition
    #/$defs/Dataset
    Form
    object
    Source
    spec/schemas/opf.schema.json

    Field index

    FieldTypeReq.Description
    titlestring—Human name of the dataset, shown by editors.
    descriptionstring—What the dataset holds.
    columnsarray<string | ref:DatasetColumn>yesOrdered, uniquely named columns. A column may declare what its cells hold (type), what it is for (role) and a unit label; a string column declares nothing.
    rowsarray<array<ref:ChartDataCell>>yesRows of scalar cells (string, number, boolean, null); each row aligns by index with columns.
    datasourceref:DataSourceChoice—
    queryref:DataQuery—
    retrievedref:DataRetrieved—
    versionref:DataVersion—
    sha256ref:DataSha256—
    generatorref:DataGenerator—

    title

    typestringrequirednodefault—

    Human name of the dataset, shown by editors.

    title.json
    {
      "title": "Revenue by quarter"
    }

    description

    typestringrequirednodefault—

    What the dataset holds.

    description.json
    {
      "description": "Quarterly revenue and costs, in $M."
    }

    columns

    typearray<string | ref:DatasetColumn>requiredyesdefault—

    Ordered, uniquely named columns. A column may declare what its cells hold (type), what it is for (role) and a unit label; a string column declares nothing.

    columns[] (oneOf 2).type · Allowed values
    "text""number""date""boolean"
    columns[] (oneOf 2).role · Allowed values
    "dimension""measure"
    columns.json
    {
      "columns": [
        "Quarter",
        {
          "name": "Revenue",
          "format": "$#,##0.0"
        },
        "Costs"
      ]
    }

    rows

    typearray<array<ref:ChartDataCell>>requiredyesdefault—

    Rows of scalar cells (string, number, boolean, null); each row aligns by index with columns.

    rows.json
    {
      "rows": [
        [
          "Q1",
          12,
          8
        ],
        [
          "Q2",
          18,
          11
        ]
      ]
    }

    datasource

    typeref:DataSourceChoicerequirednodefault—

    query

    typeref:DataQueryrequirednodefault—

    retrieved

    typeref:DataRetrievedrequirednodefault—

    version

    typeref:DataVersionrequirednodefault—

    sha256

    typeref:DataSha256requirednodefault—

    generator

    typeref:DataGeneratorrequirednodefault—

    generator.type · Allowed values
    "human""model"
    Complete definition constraints
    Schema constraints
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "columns",
        "rows"
      ],
      "description": "One shared data table: named columns (strings or DatasetColumn objects with a number format, a type, a role and a unit) and rows of scalar cells. Column names are unique ('data-column-duplicate' error). Rich text and styling belong in an inline table.",
      "properties": {
        "title": {
          "type": "string",
          "description": "Human name of the dataset, shown by editors.",
          "examples": [
            "Revenue by quarter"
          ]
        },
        "description": {
          "type": "string",
          "description": "What the dataset holds.",
          "examples": [
            "Quarterly revenue and costs, in $M."
          ]
        },
        "columns": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/DatasetColumn"
              }
            ]
          },
          "minItems": 1,
          "description": "Ordered, uniquely named columns. A column may declare what its cells hold (type), what it is for (role) and a unit label; a string column declares nothing.",
          "examples": [
            [
              "Quarter",
              {
                "name": "Revenue",
                "format": "$#,##0.0"
              },
              "Costs"
            ],
            [
              {
                "name": "Month",
                "type": "date",
                "role": "dimension"
              },
              {
                "name": "Revenue",
                "format": "$#,##0",
                "type": "number",
                "role": "measure",
                "unit": "USD"
              }
            ]
          ]
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/ChartDataCell"
            }
          },
          "description": "Rows of scalar cells (string, number, boolean, null); each row aligns by index with columns.",
          "examples": [
            [
              [
                "Q1",
                12,
                8
              ],
              [
                "Q2",
                18,
                11
              ]
            ]
          ]
        },
        "datasource": {
          "$ref": "#/$defs/DataSourceChoice"
        },
        "query": {
          "$ref": "#/$defs/DataQuery"
        },
        "retrieved": {
          "$ref": "#/$defs/DataRetrieved"
        },
        "version": {
          "$ref": "#/$defs/DataVersion"
        },
        "sha256": {
          "$ref": "#/$defs/DataSha256"
        },
        "generator": {
          "$ref": "#/$defs/DataGenerator"
        }
      }
    }