{
  "$schema": "https://vega.github.io/schema/vega-lite/v6.json",
  "config": {
    "background": "#1c1a1d",
    "font": "Helvetica, Arial, sans-serif",
    "axis": {
      "labelColor": "#aaa",
      "titleColor": "#aaa",
      "domainColor": "#363338",
      "tickColor": "#363338",
      "gridColor": "#363338",
      "gridOpacity": 0.6,
      "labelFontSize": 14,
      "titleFontSize": 14,
      "titleFontWeight": "normal"
    },
    "legend": {
      "labelColor": "#e0e0e0",
      "titleColor": "#aaa",
      "labelFontSize": 14,
      "symbolType": "square",
      "symbolSize": 130
    },
    "title": {
      "color": "#e0e0e0",
      "fontSize": 19,
      "fontWeight": 600,
      "anchor": "start",
      "subtitleColor": "#aaa",
      "subtitleFontSize": 14,
      "subtitleLineHeight": 20,
      "offset": 12
    },
    "header": {
      "labelColor": "#e0e0e0",
      "labelFontSize": 14,
      "labelFontWeight": 600,
      "titleColor": "#aaa"
    },
    "view": {
      "stroke": null
    }
  },
  "title": {
    "text": "Cumulative since day zero",
    "subtitle": "The same 467 days, counted two ways. Separate panels, separate scales."
  },
  "facet": {
    "row": {
      "field": "measure",
      "type": "nominal",
      "sort": [
        "billions of tokens",
        "indicative API cost (US$)"
      ],
      "title": null,
      "header": {
        "labelAngle": 0,
        "labelAlign": "left",
        "labelOrient": "top",
        "labelPadding": 2
      }
    }
  },
  "resolve": {
    "scale": {
      "y": "independent"
    }
  },
  "spec": {
    "width": 856,
    "height": 160,
    "mark": {
      "type": "area",
      "opacity": 0.85,
      "line": {
        "strokeWidth": 2
      }
    },
    "encoding": {
      "x": {
        "field": "date",
        "type": "temporal",
        "axis": {
          "title": null,
          "format": "%b %y",
          "labelAngle": 0,
          "grid": false,
          "tickCount": {
            "interval": "month",
            "step": 2
          }
        }
      },
      "y": {
        "field": "value",
        "type": "quantitative",
        "axis": {
          "title": null,
          "format": "~s"
        }
      },
      "color": {
        "field": "measure",
        "type": "nominal",
        "legend": null,
        "scale": {
          "domain": [
            "billions of tokens",
            "indicative API cost (US$)"
          ],
          "range": [
            "#be2edd",
            "#d97706"
          ]
        }
      },
      "tooltip": [
        {
          "field": "date",
          "type": "temporal",
          "title": "day"
        },
        {
          "field": "value",
          "type": "quantitative",
          "format": ",.0f"
        }
      ]
    }
  },
  "data": {
    "url": "/code/token-charts/cumulative.data.json",
    "format": {
      "type": "json"
    }
  }
}
