Skip to content

SlopeChartIndicator JSON

roosit edited this page Oct 16, 2026 · 1 revision

SlopeChartIndicator JSON

Up | Code | Русский

Purpose

This page describes the persisted format of the slopeChart indicator ("Elevation Chart") in a project, in a Mixel and in templates. For the user instructions on a hand-written .vttp, see the page Elevation Chart JSON.

Two save modes

The indicator is saved in two modes:

  • toJSON(false) — the real Mixel state: contains the selected source/sensor, the current property values, and the layer size and position.
  • toJSON(true) — the template state: contains only values that can be carried between projects. For Slope the source and the sensor are not written, and the object stays empty {}; when the indicator is added from a template, the runtime picks the sensor automatically (SensorProperty.applyDefaultSource).

Common indicator wrapper

The layer identifier is built from the plugin uid and the indicator name:

{
  "name": "com.velitask.plagin.official.slopeChart",
  "data": {
    "properties": {}
  }
}

Stable parts:

Part Value
plugin uid com.velitask.plagin.official
indicator name slopeChart

Real mixel state

In a real Mixel the runtime stores the layer geometry next to properties: the size, the position and the binding to the parent. The exact shape of these State fields depends on the current runtime, so they are shown abbreviated.

{
  "name": "com.velitask.plagin.official.slopeChart",
  "data": {
    "size": { "...": "layer size state" },
    "positionInParent": { "...": "layer position state" },
    "properties": {
      "Slope": {
        "sourceId": { "value": 1 },
        "sensorId": { "value": 2 }
      },
      "geoZoom": { "value": 14 },
      "EleChartScale": { "value": 10 },
      "line": {
        "lineColor": { "r": 255, "g": 255, "b": 255, "a": 255 },
        "thickness": { "value": 1 },
        "style": { "value": 0 },
        "dashPattern": { "value": "" }
      },
      "fillPlain": { "r": 255, "g": 255, "b": 255, "a": 255 },
      "fillUp": { "r": 255, "g": 0, "b": 0, "a": 255 },
      "fillDown": { "r": 0, "g": 255, "b": 0, "a": 255 },
      "fillTransparency": { "value": 30 }
    }
  }
}

The sourceId and sensorId values are identifiers from a specific project.

Template state

A template uses maket, and Slope stays empty. Integer properties whose value was not changed are written as {}: the value key is absent because the property state is not set and the default value from the code is used on read (see the table below). This is the real toJSON(true) output of a freshly created indicator.

{
  "name": "com.velitask.plagin.official.slopeChart",
  "data": {
    "maket": { "preset": "auto" },
    "properties": {
      "Slope": {},
      "geoZoom": {},
      "EleChartScale": {},
      "line": {
        "lineColor": { "r": 255, "g": 255, "b": 255, "a": 255 },
        "thickness": {},
        "style": { "value": 0 },
        "dashPattern": { "value": "" }
      },
      "fillPlain": { "r": 255, "g": 255, "b": 255, "a": 255 },
      "fillUp": { "r": 255, "g": 0, "b": 0, "a": 255 },
      "fillDown": { "r": 0, "g": 255, "b": 0, "a": 255 },
      "fillTransparency": {}
    }
  }
}

The indicator declares no figures.

Properties

The row order matches defineProperties().

JSON key Java property SDK type User meaning Default
Slope mSlope SlopeAtomProperty The slope sensor ("Slope"). An empty choice: {} in a template.
geoZoom mGeoZoom GeoZoomProperty The horizontal scale ("Map zoom"). 14, range 8..19.
EleChartScale mEleChartScale IntegerProperty The vertical exaggeration ("Elevation scale"). 10, range 1..50.
line mLine LineProperty The profile line ("Line"). White, thickness 1 (range 0..50), style 0 (solid).
fillPlain mFillPlain ColorProperty The flat fill ("Plain fill color"). 255, 255, 255, 255.
fillUp mFillUp ColorProperty The climb fill ("Uphill fill color"). 255, 0, 0, 255.
fillDown mFillDown ColorProperty The descent fill ("Downhill fill color"). 0, 255, 0, 255.
fillTransparency mFillTransparency IntegerProperty The alpha channel of the fills ("Fill transparency"). 30, range 0..255.

State formats:

  • A color is a flat object r, g, b, a (0..255).
  • An integer is { "value": number }; values out of range are clamped to the range when read through set, but the range is not checked when loading directly from JSON, so it is better not to go outside the bounds.
  • line is a composite property of the children lineColor, thickness, style, dashPattern. style stores the LineStyle index: 0 SOLID, 1 DASH, 2 DOT, 3 DASH_DOT, 4 DASH_DOT_DOT, 5 LONG_DASH, 6 SHORT_DASH, 7 CUSTOM. The indicator uses only the color and thickness from line.
  • The bold skin sets line.lineColor to white and line.thickness to 10. The geoZoom, EleChartScale, fillTransparency properties and the Slope sensor are not part of the skins.

Examples

A profile with a large scale, a bold line and a denser fill:

{
  "name": "com.velitask.plagin.official.slopeChart",
  "data": {
    "maket": { "preset": "auto" },
    "properties": {
      "Slope": {},
      "geoZoom": { "value": 15 },
      "EleChartScale": { "value": 5 },
      "line": {
        "lineColor": { "r": 255, "g": 255, "b": 255, "a": 255 },
        "thickness": { "value": 10 },
        "style": { "value": 0 },
        "dashPattern": { "value": "" }
      },
      "fillPlain": { "r": 200, "g": 200, "b": 200, "a": 255 },
      "fillUp": { "r": 255, "g": 80, "b": 0, "a": 255 },
      "fillDown": { "r": 0, "g": 200, "b": 120, "a": 255 },
      "fillTransparency": { "value": 90 }
    }
  }
}

Compatibility

  • VelitaskPlagin.getUID() (com.velitask.plagin.official) must not be changed without a migration of saved projects.
  • Indicator.getName() (slopeChart) must not be changed without a migration.
  • The property names (Slope, geoZoom, EleChartScale, line, fillPlain, fillUp, fillDown, fillTransparency) must not be renamed without a migration; case matters (EleChartScale is written with a capital letter).
  • The property order mostly affects the UI, while persisted state is loaded by name; renaming is more dangerous than reordering.
  • The plugin table slope_groups (see SlopeGroupAtom) is not part of the indicator JSON: it is computed when a source is imported and belongs to the plugin DB.

Clone this wiki locally