{
  "id": "consumer-producer-surplus",
  "name": "Consumer and producer surplus",
  "unit": "micro",
  "unitName": "Unit 2 · Microeconomics",
  "topic": "Demand & supply",
  "hl": false,
  "description": "Consumer surplus (above price, below demand) and producer surplus (below price, above supply) at equilibrium.",
  "keywords": [
    "consumer surplus",
    "producer surplus",
    "social surplus",
    "community surplus",
    "welfare"
  ],
  "schemaUrl": "https://graphs.lectere.com/api/v1/templates/consumer-producer-surplus",
  "previewUrl": "https://graphs.lectere.com/thumbs/consumer-producer-surplus.svg",
  "editorUrl": "https://graphs.lectere.com/graph/consumer-producer-surplus/",
  "params": [
    {
      "key": "cs",
      "label": "Shade consumer surplus",
      "default": true,
      "type": "boolean"
    },
    {
      "key": "ps",
      "label": "Shade producer surplus",
      "default": true,
      "type": "boolean"
    },
    {
      "key": "dSlope",
      "label": "Demand steepness",
      "default": 0.8,
      "group": "Shape",
      "type": "number",
      "min": 0.3,
      "max": 2.5,
      "step": 0.05
    },
    {
      "key": "sSlope",
      "label": "Supply steepness",
      "default": 0.8,
      "group": "Shape",
      "type": "number",
      "min": 0.3,
      "max": 2.5,
      "step": 0.05
    },
    {
      "key": "dPos",
      "label": "Demand position",
      "default": 0,
      "group": "Shape",
      "type": "number",
      "min": -3,
      "max": 3,
      "step": 0.1
    },
    {
      "key": "sPos",
      "label": "Supply position",
      "default": 0,
      "group": "Shape",
      "type": "number",
      "min": -3,
      "max": 3,
      "step": 0.1
    }
  ],
  "defaults": {
    "cs": true,
    "ps": true,
    "dSlope": 0.8,
    "sSlope": 0.8,
    "dPos": 0,
    "sPos": 0
  },
  "panels": [
    {
      "id": "main",
      "title": null,
      "xLabel": "Quantity",
      "yLabel": "Price",
      "xRange": [
        0,
        10
      ],
      "yRange": [
        0,
        10
      ],
      "axisKeys": {
        "x": "main:x",
        "y": "main:y"
      }
    }
  ],
  "labels": [
    {
      "key": "main:y",
      "default": "Price",
      "hint": "Vertical axis",
      "panel": "main"
    },
    {
      "key": "main:x",
      "default": "Quantity",
      "hint": "Horizontal axis",
      "panel": "main"
    },
    {
      "key": "main.cs",
      "default": "CS",
      "hint": "Shaded area",
      "panel": "main"
    },
    {
      "key": "main.ps",
      "default": "PS",
      "hint": "Shaded area",
      "panel": "main"
    },
    {
      "key": "main.d",
      "default": "D",
      "hint": "Curve",
      "panel": "main"
    },
    {
      "key": "main.s",
      "default": "S",
      "hint": "Curve",
      "panel": "main"
    },
    {
      "key": "main.e:y",
      "default": "P_e",
      "hint": "Vertical-axis value",
      "panel": "main"
    },
    {
      "key": "main.e:x",
      "default": "Q_e",
      "hint": "Horizontal-axis value",
      "panel": "main"
    }
  ],
  "elements": [
    {
      "key": "main.cs",
      "kind": "area",
      "label": "CS"
    },
    {
      "key": "main.ps",
      "kind": "area",
      "label": "PS"
    },
    {
      "key": "main.d",
      "kind": "curve",
      "label": "D"
    },
    {
      "key": "main.s",
      "kind": "curve",
      "label": "S"
    },
    {
      "key": "main.e",
      "kind": "point"
    }
  ],
  "stats": null,
  "example": {
    "template": "consumer-producer-surplus",
    "params": {
      "cs": true,
      "ps": true,
      "dSlope": 0.8,
      "sSlope": 0.8,
      "dPos": 0,
      "sPos": 0
    }
  }
}