Skip to content

Generate

Description

Allow user to create a dynamic tracker metrics within a layout based on configuration.

Attributes

  • tile=generate
  • generate: [Object] Provide details of tracker metrics
    • seed: [Array of String] Based on seed values create a tracker metric or list and also get the capture As details using this.
    • popup: [Object] Indicate the metric Popup
      • $capture: [Object]
        • as: Provide a valid metric name
        • placeholder: Provide a metric placeholder
        • auto: [Array of Object] Provide a list of values
          • rule: Valid condition rule
          • value:
      • $data: [Object] Provide a metric data details
        • source: [Array of Object] Indicate the data source details
          • display: Provide a display value
          • value: Provide a get value against the display value
          • icon: Provide a icon name
          • color: Provide a Color of text
          • description
          • condition: Valid rule condition
          • default: Provide a Default value for metric
          • $template: Provide a template string
          • $suggested: Provide a suggested value for metric.
          • readonly: true | false: Indicate the field is readOnly or not. By default, is false
        • sort: true | false | none
      • title: Provide metric title
      • $api: Provide dynamic metric title path
      • $config: [Object]
        • transform
        • sort
      • $display: Indicate the display as tracker metric
    • title: Provide a title for the generate it's a template string base on configuration
    • template: [Object] Provide a metric details based on seed values
      • [Seed value string] : [Array of Object] Contains the List of metric details
        • $api: Provide a dynamic metric title path
        • type: Provide a metric data type
        • title: Provide a title for the metric also allow a template string
        • $capture: [Object] Provide a Capture metric details
        • $display: [Object] Provide a Display Metric details

Example

{
  "tile": "generate",
  "generate": {
    "title": "{$title} {data.memo}",
    "template": {
      "sleep": [
        {
          "$api": "{metric}_dynamic_{index}",
          "type": "string",
          "title": "{title}",
          "$capture": {
            "as": "clock-range"
          },
          "$display": {
            "as": "clock-range",
            "rule": {
              "setting": "exists"
            }
          }
        },
        {
          "$api": "{metric}_dynamic_{index}_memo",
          "type": "string",
          "title": "Title Test",
          "$capture": {},
          "$display": {
            "as": "block"
          }
        }
      ],
      "base": [
        {
          "$api": "{metric}_dynamic_{index}",
          "type": "string",
          "title": "{title}",
          "$capture": {
            "as": "clock-range"
          },
          "$display": {
            "as": "clock-range",
            "rule": {
              "setting": "exists"
            }
          }
        },
        {
          "$api": "{metric}_dynamic_{index}_memo",
          "type": "string",
          "title": "Title Test",
          "$capture": {},
          "$display": {
            "as": "block"
          }
        },
        {
          "$api": "{metric}_dynamic_{index}_comments",
          "type": "string",
          "title": "Detailed notes section",
          "$capture": {
            "as": "block",
            "rows": "4"
          },
          "$display": {
            "as": "block"
          }
        }
      ]
    },
    "popup": {
      "$capture": {
        "as": "popup",
        "placeholder": "Activities"
      },
      "$display": {
        "as": "popup"
      },
      "$data": {
        "sort": "none",
        "source": [
          {
            "display": "sleep",
            "value": "sleep",
            "icon": "fal fa-bed",
            "color": "#039be5",
            "default": "",
            "$suggested": "23-30",
            "$template": "sleep"
          },
          {
            "display": "breakfast",
            "value": "breakfast",
            "icon": "fal fa-coffee",
            "color": "#d60000",
            "default": "",
            "$suggested": "7-7.5",
            "$template": "base"
          },
          {
            "display": "lunch",
            "value": "lunch",
            "icon": "fal fa-soup",
            "color": "#d60000",
            "default": "",
            "$suggested": "12-12.5",
            "$template": "base"
          },
          {
            "display": "snack",
            "value": "snack",
            "icon": "fal fa-cookie-bite",
            "color": "#d60000",
            "default": "",
            "$suggested": "15-15.5",
            "$template": "base"
          },
          {
            "display": "dinner",
            "value": "dinner",
            "icon": "fal fa-utensils",
            "color": "#d60000",
            "default": "",
            "$suggested": "19-19.5",
            "$template": "base"
          },
          {
            "display": "hobby",
            "value": "hobby",
            "icon": "fal fa-pencil-paintbrush",
            "color": "#0b8042",
            "default": "",
            "$suggested": "14-15",
            "$template": "base"
          },
          {
            "display": "other",
            "value": "other",
            "icon": "fal fa-star",
            "color": "#29b777",
            "chart": "donut",
            "default": "",
            "$suggested": "14-15",
            "$template": "base"
          }
        ]
      }
    },
    "seed": [
      "breakfast",
      "lunch",
      "dinner",
      "sleep"
    ]
  }
}