Skip to content

User JSON SlopeTextIndicator

roosit edited this page May 15, 2026 · 3 revisions

Slope Text JSON

Back to list | Indicator page | Russian

Purpose

This page describes the JSON template for the slopeText indicator for manual .vttp editing.

Full Template

{
  "name": "com.velitask.plagin.official.slopeText",
  "data": {
    "maket": { "preset": "auto" },
    "properties": {
      "Slope": {},
      "font": {"name":"Dialog","style":{"value":0},"size":{"value":48},"color":{"r":255,"g":255,"b":255,"a":255}},
      "textAlign": {"value":0},
      "measurement": {"system":{"value":0},"unit":{"value":0},"format":{"value":0}},
      "textTemplate": {"template":"{type} {pc}% ({curr}{currUnit} / {length}{lengthUnit})","vars":{"type":"%s","typec":"%s","pc":"%.1f","curr":"%.3f","currUnit":"%s","length":"%.2f","lengthUnit":"%s","height":"%.0f","heightUnit":"%s","ele":"%.0f","eleUnit":"%s","eleCurr":"%.1f","up":"%.0f","down":"%.0f"}}
    }
  }
}

Settings

Slope

Selects the slope sensor.

{
  "Slope": {}
}
Field Values What it does
sourceId source id in the project In a real Mixel, selects the data source. It may be omitted in a template.
sensorId sensor id in the source In a real Mixel, selects the concrete sensor. It may be omitted in a template.

font

Changes text font and color.

{
  "font": {"name":"Dialog","style":{"value":0},"size":{"value":48},"color":{"r":255,"g":255,"b":255,"a":255}}
}
Field Values What it does
value or nested fields depends on the setting type Stores the setting value.

textAlign

Aligns text inside the layer.

{
  "textAlign": {"value":0}
}
Field Values What it does
value or nested fields depends on the setting type Stores the setting value.

measurement

Selects distance and elevation units.

{
  "measurement": {"system":{"value":0},"unit":{"value":0},"format":{"value":0}}
}
Field Values What it does
value or nested fields depends on the setting type Stores the setting value.

textTemplate

Defines text for the current slope segment. Variables come from the current slope atom and the slope_groups group that contains the current distance.

{
  "textTemplate": {"template":"{type} {pc}% ({curr}{currUnit} / {length}{lengthUnit})","vars":{"type":"%s","typec":"%s","pc":"%.1f","curr":"%.3f","currUnit":"%s","length":"%.2f","lengthUnit":"%s","height":"%.0f","heightUnit":"%s","ele":"%.0f","eleUnit":"%s","eleCurr":"%.1f","up":"%.0f","down":"%.0f"}}
}
Field Values What it does
template string with variables in curly braces Final text.
vars object with variable formats Formats variable values.

Template Variables

Variable Default format What it shows
{type} %s Current segment type: ascent, descent, or flat.
{typec} %s Short segment symbol: ↑, ↓, or an empty string for flat.
{pc} %.1f Slope percentage for the current segment.
{curr} %.3f Distance already traveled inside the current segment, from group start to current point.
{currUnit} %s Measurement unit for {curr}.
{length} %.2f Full length of the current slope segment.
{lengthUnit} %s Measurement unit for {length}.
{height} %.0f Elevation change across the whole current segment.
{heightUnit} %s Measurement unit for {height}.
{ele} %.0f Current absolute elevation at the track point.
{eleUnit} %s Elevation measurement unit.
{eleCurr} %.1f Absolute elevation change from the start of the current segment to the current point.
{up} %.0f Accumulated elevation gain from the current slope atom.
{down} %.0f Accumulated elevation loss from the current slope atom, without the minus sign.

Clone this wiki locally