{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "title": "Solver ablation success rate",
  "background": "transparent",
  "data": {
    "url": "scene_crossing_solver_ablation.csv",
    "format": {
      "type": "csv",
      "parse": {
        "success_rate": "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
    }
  },
  "width": "container",
  "height": {
    "step": 40
  },
  "layer": [
    {
      "mark": "rect",
      "encoding": {
        "x": {
          "field": "column_label",
          "type": "ordinal",
          "sort": [
            "S/U / PRIM",
            "S/U / CAPT",
            "S/U / SDF",
            "D/U / PRIM",
            "D/U / CAPT",
            "D/U / SDF"
          ],
          "axis": {
            "title": null,
            "labelAngle": 0
          }
        },
        "y": {
          "field": "planner_label",
          "type": "ordinal",
          "sort": [
            "DRAFTO-GN",
            "DRAFTO-LM",
            "DRAFTO-Dogleg",
            "GPMP-GN",
            "GPMP-LM",
            "GPMP-Dogleg"
          ],
          "axis": {
            "title": null
          }
        },
        "color": {
          "field": "success_rate",
          "type": "quantitative",
          "scale": {
            "domain": [
              0,
              100
            ],
            "range": [
              "#FEF2F2",
              "#FDE68A",
              "#6EE7B7",
              "#047857"
            ]
          },
          "legend": {
            "title": "success (%)"
          }
        },
        "tooltip": [
          {
            "field": "planner_label",
            "title": "Planner"
          },
          {
            "field": "eval_group_label",
            "title": "Group"
          },
          {
            "field": "collision_mode_label",
            "title": "Collision"
          },
          {
            "field": "success_rate",
            "title": "Success (%)",
            "format": ".1f"
          },
          {
            "field": "success",
            "title": "Successes"
          },
          {
            "field": "attempted",
            "title": "Attempts"
          }
        ]
      }
    },
    {
      "mark": {
        "type": "text",
        "fontSize": 10
      },
      "encoding": {
        "x": {
          "field": "column_label",
          "type": "ordinal",
          "sort": [
            "S/U / PRIM",
            "S/U / CAPT",
            "S/U / SDF",
            "D/U / PRIM",
            "D/U / CAPT",
            "D/U / SDF"
          ]
        },
        "y": {
          "field": "planner_label",
          "type": "ordinal",
          "sort": [
            "DRAFTO-GN",
            "DRAFTO-LM",
            "DRAFTO-Dogleg",
            "GPMP-GN",
            "GPMP-LM",
            "GPMP-Dogleg"
          ]
        },
        "text": {
          "field": "success_rate",
          "type": "quantitative",
          "format": ".0f"
        },
        "color": {
          "condition": {
            "test": "datum.success_rate >= 68",
            "value": "white"
          },
          "value": "#111827"
        }
      }
    }
  ],
  "transform": [
    {
      "filter": "datum.metric === 'success_rate'"
    }
  ]
}
