{
  "settings": {
    "metadata": {
      "title": "Named Projection P0-P2"
    }
  },
  "datasets": {
    "cash_flow": {
      "fields": [
        { "key": "label", "type": "string" },
        { "key": "value", "type": "number", "nullable": true, "unit": "usd" },
        { "key": "point_kind", "type": "string" }
      ],
      "rows": [
        { "label": "Opening", "value": 120, "point_kind": "total" },
        { "label": "Revenue", "value": 75, "point_kind": "delta" },
        { "label": "Cost", "value": -35, "point_kind": "delta" },
        { "label": "Subtotal", "value": null, "point_kind": "subtotal" },
        { "label": "Closing", "value": 160, "point_kind": "total" }
      ]
    },
    "opportunities": {
      "fields": [
        { "key": "effort", "type": "number" },
        { "key": "impact", "type": "number", "nullable": true },
        { "key": "market_size", "type": "number" }
      ],
      "rows": [
        { "effort": 2, "impact": 7, "market_size": 18 },
        { "effort": 4, "impact": 9, "market_size": 28 },
        { "effort": 6, "impact": 5, "market_size": 32 },
        { "effort": 8, "impact": 3, "market_size": 14 }
      ]
    },
    "activity": {
      "fields": [
        { "key": "hour", "type": "string" },
        { "key": "weekday", "type": "string" },
        { "key": "tickets", "type": "number", "nullable": true }
      ],
      "rows": [
        { "hour": "06:00", "weekday": "Mon", "tickets": 4 },
        { "hour": "12:00", "weekday": "Mon", "tickets": 9 },
        { "hour": "18:00", "weekday": "Mon", "tickets": 6 },
        { "hour": "06:00", "weekday": "Tue", "tickets": 5 },
        { "hour": "12:00", "weekday": "Tue", "tickets": 8 },
        { "hour": "18:00", "weekday": "Tue", "tickets": 7 }
      ]
    }
  },
  "projections": {
    "cash_waterfall": {
      "type": "chart",
      "dataset": "cash_flow",
      "shape": "category",
      "category": { "field": "label" },
      "series": [
        {
          "field": "value",
          "point_kind": { "field": "point_kind" },
          "name": "Cash flow"
        }
      ]
    },
    "opportunity_bubbles": {
      "type": "chart",
      "dataset": "opportunities",
      "shape": "xy",
      "x": { "field": "effort" },
      "series": [
        {
          "field": "impact",
          "size": { "field": "market_size" },
          "name": "Opportunities"
        }
      ]
    },
    "activity_heatmap": {
      "type": "chart",
      "dataset": "activity",
      "shape": "heatmap",
      "x": { "field": "hour" },
      "y": { "field": "weekday" },
      "series": [
        {
          "field": "tickets",
          "name": "Tickets"
        }
      ]
    }
  },
  "pages": [
    {
      "size": "a4",
      "elements": [
        {
          "type": "chart",
          "kind": "waterfall",
          "layout": { "left": 18, "top": 18 },
          "width": 174,
          "height": 70,
          "theme": { "preset": "business_light" },
          "data": { "projection": "cash_waterfall" },
          "options": { "show_connectors": true },
          "legend": { "show": false },
          "alt": "Cash flow projection rendered as a waterfall."
        },
        {
          "type": "chart",
          "kind": "scatter",
          "layout": { "left": 18, "top": 102 },
          "width": 84,
          "height": 78,
          "theme": { "preset": "dashboard_light" },
          "data": { "projection": "opportunity_bubbles" },
          "options": { "bubble_min_size": 1.8, "bubble_max_size": 6 },
          "axes": {
            "x": { "title": "Effort" },
            "values": { "primary": { "title": "Impact" } }
          },
          "grid": { "show": true, "axis": "both" },
          "legend": { "show": false },
          "alt": "Opportunity impact plotted against effort, with market size represented by bubble size."
        },
        {
          "type": "chart",
          "kind": "heatmap",
          "layout": { "left": 108, "top": 102 },
          "width": 84,
          "height": 78,
          "theme": { "preset": "executive_dark" },
          "data": { "projection": "activity_heatmap" },
          "options": { "cell_gap": 0.6 },
          "axes": {
            "category": { "title": "Hour", "position": "bottom" },
            "row": { "title": "Day", "position": "left" }
          },
          "grid": { "show": true, "axis": "both" },
          "legend": { "show": true, "position": "bottom", "align": "center" },
          "alt": "Ticket activity is highest at midday for both weekdays."
        }
      ]
    }
  ]
}
