User Color Rules


Users can define Color Coding rules.

Overview

File Format

Item Description
Format JSON
Character encoding UTF-8 (without BOM)
Key names Case-insensitive

Root Structure - JSON Keys (Top Level)

Item Type Required Description
FileType String Yes File type identifier
Version Integer Yes Format version
Name String Yes Rule name
TargetColumn String Yes Column name to evaluate
Bins Array Yes Range definition array
FallbackIndex Integer Yes Index used when no bin matches

Item Specification

Item Type Required Value / Description Notes
FileType String Yes "TurboGPX.ColorRule" Fixed value
Version Integer Yes 1
Name String Yes Any rule name For UI display
TargetColumn String Yes Target column name Example: "Gap"
Bins Array Yes Array of range definitions The first element is color index 0
FallbackIndex Integer Yes Index used when no bin matches 0 to Bins.Count - 1

Bins Element Specification

Each element in Bins is an Object.

Item Type Required Description Notes
Min Number Yes Lower bound of the range Included in judgment
Max Number Yes Upper bound of the range Included in judgment

Judgment Conditions

Condition Description
Match condition Min <= value <= Max
Judgment order Evaluate Bins from index 0 in order
Multiple matches Use the first matching Bin
No match Use FallbackIndex

TargetColumn

Item Description
Elevation Elevation
Speed Speed
Distance Distance
Gap Distance gap
Slope Slope

Speed Sample

{
  "FileType": "TurboGPX.ColorRule",
  "Version": 1,
  "Name": "Speed (JSON)",
  "TargetColumn": "Speed",
  "Bins": [
    { "Min": 0.0, "Max": 9.9 },
    { "Min": 10.0, "Max": 19.9 },
    { "Min": 20.0, "Max": 29.9 },
    { "Min": 30.0, "Max": 39.9 },
    { "Min": 40.0, "Max": 49.9 },
    { "Min": 50.0, "Max": 59.9 },
    { "Min": 60.0, "Max": 69.9 },
    { "Min": 70.0, "Max": 79.9 },
    { "Min": 80.0, "Max": 89.9 },
    { "Min": 90.0, "Max": 99.9 }
  ],
  "FallbackIndex": 0
}
inserted by FC2 system