{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "$id": "https://nextstrain.org/schemas/dataset/measurements/collection/config",
    "title": "Collection config file to be supplied to `augur measurements export`",
    "type": "object",
    "additionalProperties": false,
    "required": [],
    "properties": {
        "key": {
            "description": "The short name of the collection that is only used internally within Auspice. Each collection is expected to have a unique key.",
            "type": "string"
        },
        "title": {
            "description": "The title to display in the collections dropdown and panel title. Optional -- if not provided, then `key` will be used",
            "type": "string"
        },
        "fields": {
            "description": "Custom field order and display titles. Order of the fields determines the order they are shown in the measurement hover display. Optional -- if not provided, then the key of the field will be displayed in alphabetical order.",
            "type": "array",
            "minItems": 1,
            "items": {
                "description": "A single field of the measurements",
                "type": "object",
                "additionalProperties": false,
                "required": ["key"],
                "properties": {
                    "key": {
                        "description": "The property name of the field within the measurement object",
                        "type": "string"
                    },
                    "title": {
                        "description": "The display title for the field. Optional -- if not provided, then `key` will be used",
                        "type": "string"
                    }
                }
            }
        },
        "groupings": {
            "description": "The available group by fields for measurements. Order of the group by fields determines the order they are shown in the group by dropdown.",
            "type": "array",
            "minItems": 1,
            "items": {
                "description": "A single group by field for measurements",
                "type": "object",
                "additionalProperties": false,
                "required": ["key"],
                "properties": {
                    "key": {
                        "description": "The property name of the group by field within the measurement object",
                        "type": "string"
                    },
                    "order": {
                        "description": "A custom order of group by values to customize the display order of the subplots when using group by field",
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "description": "A single value of the group by field present in measurements",
                            "type": ["string", "number", "boolean"]
                        }
                    }
                }
            }
        },
        "filters": {
            "description": "The available filter options for measurements. Order of the filter options determines the order they are shown in the filter dropdown. Optional -- if not provided, then all fields will be available as filters.",
            "type": "array",
            "minItems": 1,
            "items": {
                "description": "The property name of the filter field within the measurement object",
                "type": "string"
            }
        },
        "x_axis_label": {
            "description": "The short label to display for the x-axis that describes the `value` of the measurements in a collection",
            "type": "string"
        },
        "thresholds": {
            "description": "Numeric measurement thresholds to be displayed as solid grey lines across subplots. Optional -- if not provided, no threshold will be displayed.",
            "type": "array",
            "minItems": 1,
            "items": {
                "description": "A numeric measurement threshold value.",
                "type": "number"
            }
        },
        "threshold": {
            "deprecated": true,
            "description": "DEPRECATED - A numeric measurement threshold to be displayed as a single grey line shared across subplots. Will be ignored if 'thresholds' is provided.",
            "type": "number"
        },
        "display_defaults": {
            "description": "Default display options of the collection",
            "type": "object",
            "additionalProperties": false,
            "minProperty": 1,
            "properties": {
                "group_by": {
                    "description": "Default group by field name that must be included as a group by option in the groupings array. Optional -- if not provided, first group by option will be used",
                    "type": "string"
                },
                "measurements_display": {
                    "description": "Dictates how the measurements are displayed, either as the raw data points or as the means of values grouped by the tree color-by attribute",
                    "type": "string",
                    "enum": ["raw", "mean"]
                },
                "show_overall_mean": {
                    "description": "Should the overall mean per group be displayed by default?",
                    "type": "boolean"
                },
                "show_threshold": {
                    "description": "Should the threshold line be displayed by default? Ignored if no threshold has been provided for collection",
                    "type": "boolean"
                }
            }
        }
    }
}
