Skip to content

Gantt settings transforms ​

Use this guide when you need to format values in Gantt hover tooltips through schedule.* settings.

What settings can control ​

For Gantt tooltip fields, settings can define label, template, hidden, and order directly.

transform is different: the settings API stores data, not executable JavaScript. Because of that, the panel resolves only safe declarative descriptors before calling createConfig(...) for @mes/aps.

With @mes/aps@1.23.0, the optional constraint, supply, and dependency-arrow tooltip sections stay empty when settings omit them. The panel preserves that contract. Date formatting is injected only when a supported constraint, supply, or flow-arrow date field is explicitly present in settings; formatter support does not make a field visible by itself.

For example, this configuration enables only the supply date and quantity:

text
schedule.supplyTooltipConfig.date.label = "Дата поставки"
schedule.supplyTooltipConfig.date.order = 1
schedule.supplyTooltipConfig.quantity.label = "Доступно"
schedule.supplyTooltipConfig.quantity.order = 2

The panel adds its date transform to date, preserves the configured metadata, and does not add any omitted supply fields. Constraint fields follow the same rule.

Supported descriptor: valueMap ​

The panel currently supports transform.type = valueMap for:

  • operationTooltipConfig
  • constraintsTooltipConfig
  • supplyTooltipConfig
  • flowArrowTooltipConfig
  • supplyArrowTooltipConfig
  • producerArrowTooltipConfig

Equivalent nested shape after useSettingsFind().mapSettings({ prefix: 'schedule' }):

json
{
  "operationTooltipConfig": {
    "late": {
      "label": "Опаздывает",
      "transform": {
        "type": "valueMap",
        "values": {
          "true": "Да",
          "false": "Нет"
        },
        "fallback": "Не задано"
      }
    }
  }
}

Settings API example:

text
schedule.operationTooltipConfig.late.label = "Опаздывает"
schedule.operationTooltipConfig.late.transform.type = "valueMap"
schedule.operationTooltipConfig.late.transform.values.true = "Да"
schedule.operationTooltipConfig.late.transform.values.false = "Нет"
schedule.operationTooltipConfig.late.transform.fallback = "Не задано"

schedule.operationTooltipConfig.locked.label = "Заблокирована"
schedule.operationTooltipConfig.locked.transform.type = "valueMap"
schedule.operationTooltipConfig.locked.transform.values.true = "Да"
schedule.operationTooltipConfig.locked.transform.values.false = "Нет"

Matching rules ​

  • Mapping keys are matched by the string form of the source value.
  • Boolean values therefore use keys true and false.
  • Date values are matched by their ISO 8601 string form.
  • If no mapping entry matches, the transform returns fallback when it is provided.

Important limitations ​

  • Strings such as (value) => value ? 'Да' : 'Нет' are treated as plain data and are not executed.
  • Unsupported transform descriptor types are ignored.
  • Settings paths containing __proto__, prototype, or constructor segments are rejected before object mapping.
  • Date formatting is still handled separately by the panel date-display layer and only for explicitly configured constraint, supply, and supported fromOp.* / toOp.* flow-arrow fields.

Demo fixture ​

The local fixture application local-gantt-transform-demo demonstrates this behavior for operation hover tooltips.