{
    "title": "InputData",
    "description": "A simple numeric value display widget for showing key metrics with labels and units. Use this widget to prominently display important numbers like sensor readings, KPIs, counts, or any scalar values. Supports multiple value displays in one widget, each with its own label, unit, and formatting. Features include decimal precision control, data freshness validation via timestamps, averaging over recent values, and automatic pivot/split functionality for showing one value per distinct category. Ideal for dashboard KPI tiles, sensor readouts, counters, or any scenario requiring clean numeric value presentation.",
    "type": "object",
    "properties": {
        "title": {
            "title": "Title",
            "description": "The main heading displayed above the value displays. Use to identify the metric group (e.g., 'Temperature Readings', 'Production Counts').",
            "type": "string",
            "order": 1
        },
        "subTitle": {
            "title": "Subtitle",
            "description": "Secondary text displayed below the title. Use for additional context like location, time period, or data source.",
            "type": "string",
            "order": 2
        },
        "dataseries": {
            "title": "Value Displays",
            "description": "Array of value display configurations. Each entry creates a labeled numeric display with optional unit and styling. Add multiple entries to show several related metrics together.",
            "type": "array",
            "dataDrivenDisabled": true,
            "order": 2,
            "items": {
                "type": "object",
                "properties": {
                    "label": {
                        "title": "Label",
                        "description": "Display text identifying this value. Should clearly describe what the number represents (e.g., 'Current Temperature', 'Total Orders', 'CPU Usage').",
                        "type": "string",
                        "required": true,
                        "order": 1
                    },
                    "unit": {
                        "title": "Unit",
                        "description": "The measurement unit displayed after the value. Examples: '°C', 'km/h', '%', 'kWh', 'pcs'. Can be bound to data for dynamic units.",
                        "type": "string",
                        "dataDrivenDisabled": false,
                        "order": 2
                    },
                    "precision": {
                        "title": "Decimals",
                        "description": "Number of decimal places to display. Default is 0 (whole numbers). Set to 1-3 for measurements requiring decimal precision (e.g., temperature: 2, percentages: 1).",
                        "type": "number",
                        "dataDrivenDisabled": true,
                        "order": 3
                    },
                    "value": {
                        "title": "Value",
                        "description": "The numeric value to display. Bind to a data source column containing the metric. Only shown when Multi Chart mode is disabled.",
                        "type": "number",
                        "condition": {
                            "relativePath": "../multiChart",
                            "showIfValueIn": [false]
                        },
                        "order": 5
                    },
                    "multiChart": {
                        "title": "Multi Chart",
                        "description": "Enable to automatically create one value display per distinct pivot value in the data. When enabled, use the data array with pivot column instead of a single value.",
                        "type": "boolean",
                        "dataDrivenDisabled": true,
                        "order": 6
                    },
                    "data": {
                        "title": "Data",
                        "description": "Data array for Multi Chart mode. Each row should contain a value and optionally a timestamp and pivot column for splitting into multiple displays.",
                        "type": "array",
                        "condition": {
                            "relativePath": "../multiChart",
                            "showIfValueIn": [true]
                        },
                        "order": 7,
                        "items": {
                            "type": "object",
                            "properties": {
                                "tsp": {
                                    "title": "Timestamp",
                                    "description": "ISO 8601 timestamp string (e.g., '2023-11-04T22:47:52.351152+00:00'). Used with Maximum Latency setting to validate data freshness - stale data can be hidden or marked.",
                                    "type": "string",
                                    "order": 1
                                },
                                "value": {
                                    "title": "Value",
                                    "description": "The numeric value from this data row. In Multi Chart mode, the latest value per pivot group is displayed.",
                                    "type": "number",
                                    "required": true,
                                    "order": 1
                                },
                                "pivot": {
                                    "title": "Split Data by",
                                    "description": "Column used to group data into separate value displays. Each unique value creates its own display. Example: with columns [city, timestamp, temperature], setting pivot to 'city' shows one temperature value per city.",
                                    "type": "string",
                                    "order": 2
                                }
                            }
                        }
                    },
                    "styling": {
                        "title": "Styling",
                        "description": "Visual styling options for the label and value text colors.",
                        "type": "object",
                        "order": 8,
                        "properties": {
                            "labelColor": {
                                "title": "Label Color",
                                "description": "Color of the label text above or beside the value.",
                                "type": "color",
                                "color": true,
                                "order": 4
                            },
                            "valueColor": {
                                "title": "Value Color",
                                "description": "Color of the numeric value and unit text.",
                                "type": "color",
                                "color": true,
                                "order": 5
                            }
                        }
                    },
                    "advanced": {
                        "title": "Advanced Settings",
                        "description": "Advanced data processing options for averaging and freshness validation.",
                        "type": "object",
                        "order": 9,
                        "properties": {
                            "averageLatest": {
                                "title": "Average Latest Values",
                                "description": "Calculate and display the average of the N most recent values instead of just the latest. Useful for smoothing noisy sensor data. Leave empty to show the raw latest value. When using pivot/split, averaging is applied per group.",
                                "type": "number",
                                "dataDrivenDisabled": true,
                                "order": 6
                            },
                            "maxLatency": {
                                "title": "Maximum Latency",
                                "description": "Maximum acceptable age of data in seconds. If the timestamp indicates data older than this threshold, the value may be hidden or marked as stale. Requires timestamp data to be provided. Useful for real-time monitoring where outdated values are misleading.",
                                "type": "number",
                                "dataDrivenDisabled": true,
                                "order": 7
                            }
                        }
                    }
                }
            }
        }
    }
}
