← All procedures

statistics.responseCells

This function gives the number of fitted places of a view before the view starts: the product of the lengths of its axes. A level axis counts its levels, and a continuous axis counts `steps`. The field `nearest` reads each point at each place, so the reads of a view are this count times the number of points. The default of `steps` is the default of a view. The function throws a RangeError for an unknown dimension, for one dimension named two times, and for a bad `steps`.

CLI
Package
@procedures/statistics · README
Path
["statistics","responseCells"]
CLI
mark statistics responseCells --record <object> --vary <string | any[]>
As data
{"$proc":["statistics","responseCells"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/statistics/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["statistics","responseCells"], { record: {}, vary: "<vary>" });
console.log(JSON.stringify(result));

From the command line

$ mark statistics responseCells --record <object> --vary <string | any[]>

As data, in a program

{
  "$proc": ["statistics", "responseCells"],
  "input": { "record": {}, "vary": "<vary>" }
}

Input

FieldTypeRequiredDefaultDescription
recordobjectyes
varystring | any[]yes
stepsnumberno

Output

The schema does not list fields (number).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "record": {
        "type": "object",
        "properties": {
          "dimensions": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "categorical"
                    },
                    "levels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "id": {
                      "type": "string",
                      "description": "The key of the dimension in the values of a point."
                    },
                    "label": {
                      "type": "string",
                      "description": "The name that a view shows."
                    },
                    "unit": {
                      "type": "string",
                      "description": "The unit. An empty string means that the dimension has no unit."
                    },
                    "when": {
                      "type": "object",
                      "properties": {
                        "dimension": {
                          "type": "string",
                          "description": "The id of the parent: a categorical or ordinal dimension with no condition."
                        },
                        "levels": {
                          "type": "array",
                          "items": {
                            "type": [
                              "string",
                              "number"
                            ]
                          }
                        }
                      },
                      "required": [
                        "dimension",
                        "levels"
                      ],
                      "additionalProperties": {},
                      "description": "With this field, a point has a value only at the stated levels of the parent. Each other point has `null`."
                    }
                  },
                  "required": [
                    "kind",
                    "levels",
                    "id",
                    "label",
                    "unit"
                  ],
                  "additionalProperties": {}
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "continuous"
                    },
                    "range": {
                      "type": "array",
                      "items": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "number"
                        }
                      ],
                      "additionalItems": {},
                      "minItems": 2,
                      "maxItems": 2,
                      "description": "The smallest and the largest value. The first is less than the second."
                    },
                    "log": {
                      "type": "boolean",
                      "description": "When true, a model and an axis use the base-10 logarithm of the value. All of the range is above 0."
                    },
                    "id": {
                      "type": "string",
                      "description": "The key of the dimension in the values of a point."
                    },
                    "label": {
                      "type": "string",
                      "description": "The name that a view shows."
                    },
                    "unit": {
                      "type": "string",
                      "description": "The unit. An empty string means that the dimension has no unit."
                    },
                    "when": {
                      "type": "object",
                      "properties": {
                        "dimension": {
                          "type": "string",
                          "description": "The id of the parent: a categorical or ordinal dimension with no condition."
                        },
                        "levels": {
                          "type": "array",
                          "items": {
                            "type": [
                              "string",
                              "number"
                            ]
                          }
                        }
                      },
                      "required": [
                        "dimension",
                        "levels"
                      ],
                      "additionalProperties": {},
                      "description": "With this field, a point has a value only at the stated levels of the parent. Each other point has `null`."
                    }
                  },
                  "required": [
                    "kind",
                    "range",
                    "id",
                    "label",
                    "unit"
                  ],
                  "additionalProperties": {}
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "ordinal"
                    },
                    "levels": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      ]
                    },
                    "log": {
                      "type": "boolean",
                      "description": "When true, a model uses the base-10 logarithm of the level. The levels are numbers above 0."
                    },
                    "id": {
                      "type": "string",
                      "description": "The key of the dimension in the values of a point."
                    },
                    "label": {
                      "type": "string",
                      "description": "The name that a view shows."
                    },
                    "unit": {
                      "type": "string",
                      "description": "The unit. An empty string means that the dimension has no unit."
                    },
                    "when": {
                      "type": "object",
                      "properties": {
                        "dimension": {
                          "type": "string",
                          "description": "The id of the parent: a categorical or ordinal dimension with no condition."
                        },
                        "levels": {
                          "type": "array",
                          "items": {
                            "type": [
                              "string",
                              "number"
                            ]
                          }
                        }
                      },
                      "required": [
                        "dimension",
                        "levels"
                      ],
                      "additionalProperties": {},
                      "description": "With this field, a point has a value only at the stated levels of the parent. Each other point has `null`."
                    }
                  },
                  "required": [
                    "kind",
                    "levels",
                    "id",
                    "label",
                    "unit"
                  ],
                  "additionalProperties": {}
                }
              ]
            }
          }
        },
        "required": [
          "dimensions"
        ],
        "additionalProperties": {}
      },
      "vary": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "array",
            "items": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "additionalItems": {},
            "minItems": 2,
            "maxItems": 2
          }
        ]
      },
      "steps": {
        "type": "number"
      }
    },
    "required": [
      "record",
      "vary"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "number"
  }
}