# app.fitsky.trend

> Published by [thatsit.dev](https://lexicon.garden/identity/did:plc:tr7zlhacx3fete5s7cx5tyjd)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:tr7zlhacx3fete5s7cx5tyjd/app.fitsky.trend)
- [Documentation](https://lexicon.garden/lexicon/did:plc:tr7zlhacx3fete5s7cx5tyjd/app.fitsky.trend/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:tr7zlhacx3fete5s7cx5tyjd/app.fitsky.trend/examples)

## Definitions

### `app.fitsky.trend`

**Type**: `record`

A shared fitness trend or dashboard snapshot

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `image` | `blob` | No |  |
| `metric` | `string` | Yes |  |
| `period` | `string` | Yes |  |
| `caption` | `string` | No |  |
| `summary` | `ref` → `#trendSummary` | Yes |  |
| `createdAt` | `string` (datetime) | Yes |  |
| `chartStyle` | `string` | No |  |
| `dataPoints` | `array` | No |  |
| `widgetType` | `string` | Yes |  |

### `app.fitsky.trend#dataPoint`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `date` | `string` (datetime) | Yes |  |
| `value` | `integer` | Yes | Value in base units (meters, seconds, calories, count, bpm) |

### `app.fitsky.trend#trendSummary`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `best` | `integer` | No | Best value in base units |
| `count` | `integer` | No |  |
| `total` | `integer` | No | Total value in base units |
| `worst` | `integer` | No | Worst value in base units |
| `average` | `integer` | No | Average value in base units |

## Raw Schema

```json
{
  "id": "app.fitsky.trend",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "widgetType",
          "metric",
          "period",
          "summary",
          "createdAt"
        ],
        "properties": {
          "image": {
            "type": "blob",
            "accept": [
              "image/png",
              "image/jpeg"
            ],
            "maxSize": 1000000
          },
          "metric": {
            "type": "string",
            "maxLength": 64,
            "knownValues": [
              "distance",
              "duration",
              "pace",
              "steps",
              "calories",
              "heartRate",
              "workoutCount"
            ]
          },
          "period": {
            "type": "string",
            "maxLength": 64,
            "knownValues": [
              "1d",
              "7d",
              "30d",
              "90d",
              "1y"
            ]
          },
          "caption": {
            "type": "string",
            "maxLength": 512
          },
          "summary": {
            "ref": "#trendSummary",
            "type": "ref"
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          },
          "chartStyle": {
            "type": "string",
            "maxLength": 64,
            "knownValues": [
              "line",
              "bar"
            ]
          },
          "dataPoints": {
            "type": "array",
            "items": {
              "ref": "#dataPoint",
              "type": "ref"
            }
          },
          "widgetType": {
            "type": "string",
            "maxLength": 64,
            "knownValues": [
              "today-summary",
              "weekly-progress",
              "goal-progress",
              "recent-workouts",
              "custom-trend"
            ]
          }
        }
      },
      "description": "A shared fitness trend or dashboard snapshot"
    },
    "dataPoint": {
      "type": "object",
      "required": [
        "date",
        "value"
      ],
      "properties": {
        "date": {
          "type": "string",
          "format": "datetime"
        },
        "value": {
          "type": "integer",
          "description": "Value in base units (meters, seconds, calories, count, bpm)"
        }
      }
    },
    "trendSummary": {
      "type": "object",
      "properties": {
        "best": {
          "type": "integer",
          "description": "Best value in base units"
        },
        "count": {
          "type": "integer"
        },
        "total": {
          "type": "integer",
          "description": "Total value in base units"
        },
        "worst": {
          "type": "integer",
          "description": "Worst value in base units"
        },
        "average": {
          "type": "integer",
          "description": "Average value in base units"
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
