{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "title": "Success rate",
  "background": "transparent",
  "data": {
    "url": "scene_crossing_scalar_summary.csv",
    "format": {
      "type": "csv",
      "parse": {
        "value": "number"
      }
    }
  },
  "config": {
    "font": "Inter",
    "view": {
      "stroke": null
    },
    "axis": {
      "domainColor": "#D1D5DB",
      "gridColor": "#E5E7EB",
      "labelColor": "#4B5563",
      "labelFontSize": 11,
      "tickSize": 0,
      "titleColor": "#4B5563",
      "titleFontSize": 11
    },
    "legend": {
      "labelColor": "#374151",
      "labelFontSize": 10,
      "symbolStrokeWidth": 0,
      "title": null
    },
    "header": {
      "labelColor": "#374151",
      "labelFontSize": 12,
      "labelFontWeight": 600,
      "title": null
    },
    "title": {
      "anchor": "start",
      "color": "#111827",
      "fontSize": 16,
      "fontWeight": 600
    }
  },
  "transform": [
    {
      "filter": "datum.metric === 'success_rate'"
    },
    {
      "calculate": "datum.kinematics_backend_label + ' / ' + datum.eval_group_label",
      "as": "column_label"
    }
  ],
  "width": "container",
  "height": {
    "step": 42
  },
  "layer": [
    {
      "mark": "rect",
      "encoding": {
        "x": {
          "field": "column_label",
          "type": "ordinal",
          "sort": [
            "Pinocchio / S/U",
            "Pinocchio / S/C",
            "Pinocchio / D/U",
            "Pinocchio / D/C",
            "SIMD / S/U",
            "SIMD / S/C",
            "SIMD / D/U",
            "SIMD / D/C"
          ],
          "axis": {
            "title": null,
            "labelAngle": 0
          }
        },
        "y": {
          "field": "planner_label",
          "type": "ordinal",
          "sort": [
            "FACTO",
            "DRAFTO-GN",
            "CHOMP",
            "TrajOpt",
            "GPMP-LM"
          ],
          "axis": {
            "title": null
          }
        },
        "color": {
          "field": "value",
          "type": "quantitative",
          "scale": {
            "domain": [
              0,
              100
            ],
            "range": [
              "#FEF2F2",
              "#FDE68A",
              "#6EE7B7",
              "#047857"
            ]
          },
          "legend": {
            "title": "success (%)"
          }
        },
        "tooltip": [
          {
            "field": "planner_label",
            "title": "Planner"
          },
          {
            "field": "kinematics_backend_label",
            "title": "Backend"
          },
          {
            "field": "eval_group_label",
            "title": "Group"
          },
          {
            "field": "value",
            "title": "Success",
            "format": ".1f"
          }
        ]
      }
    },
    {
      "mark": {
        "type": "text",
        "fontSize": 11
      },
      "encoding": {
        "x": {
          "field": "column_label",
          "type": "ordinal",
          "sort": [
            "Pinocchio / S/U",
            "Pinocchio / S/C",
            "Pinocchio / D/U",
            "Pinocchio / D/C",
            "SIMD / S/U",
            "SIMD / S/C",
            "SIMD / D/U",
            "SIMD / D/C"
          ]
        },
        "y": {
          "field": "planner_label",
          "type": "ordinal",
          "sort": [
            "FACTO",
            "DRAFTO-GN",
            "CHOMP",
            "TrajOpt",
            "GPMP-LM"
          ]
        },
        "text": {
          "field": "display_value"
        },
        "color": {
          "condition": {
            "test": "datum.value >= 68",
            "value": "white"
          },
          "value": "#111827"
        }
      }
    }
  ]
}
