A bubble chart about "global deaths from natural disasters". This example covers transformation strategies for the layout, axis, legend.

Mobile view
Design specification
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "url": "data/disasters.csv"
  },
  "width": 600,
  "height": 400,
  "transform": [
    {"filter": "datum.Entity !== 'All natural disasters'"}
  ],
  "mark": {
    "type": "circle",
    "opacity": 0.8,
    "stroke": "black",
    "strokeWidth": 1
  },
  "encoding": {
    "x": {
      "field": "Year",
      "type": "temporal",
      "axis": {"grid": false}
    },
    "y": {"field": "Entity", "type": "nominal", "axis": {"title": ""}},
    "size": {
      "field": "Deaths",
      "type": "quantitative",
      "title": "Annual Global Deaths",
      "legend": {"values": [500000, 1000000, 2000000,3000000]},// Legened values are modified for the demonstration purpose.
      "scale": {"rangeMax": 5000}
    },
    "color": {"field": "Entity", "type": "nominal", "legend": null}
  }
}
View
190019101920193019401950196019701980199020002010YearDroughtEarthquakeEpidemicExtreme temperatureExtreme weatherFloodLandslideMass movement (dry)Volcanic activityWildfire500,0001,000,0002,000,0003,000,000Annual Global Deaths
Cicero Specification

Below, we provide one transformation rule at a time, and show the intermediate result on the side.

Specification
{
  "$schema": "../cicero.json",
  "name": "vl-disaster-mobile",
  "description": "This is a Cicero specification for 'Natural Disaster' visualization (using Vega-Lite) from desktop to mobile.",
  "metadata": {
    "condition": "small"
  },
  "transformations": [
  ...
  ]
}
View
Rule: Resize the chart
    {
      "description": "Resize the chart",
      "specifier": {
        "role": "view"
      },
      "action": "modify",
      "option": {
        "size": [
          300,
          500
        ]
      }
    }
View
190019201940196019802000YearDroughtEarthquakeEpidemicExtreme temperatureExtreme weatherFloodLandslideMass movement (dry)Volcanic activityWildfire500,0001,000,0002,000,0003,000,000Annual Global Deaths
Rule: Transpose axes (reuse from US Cabinet–Entire)
    {
      "description": "Transpose axes",
      "specifier": {
        "role": "view"
      },
      "action": "transpose"
    }
View
DroughtEarthquakeEpidemicExtreme temperatureExtreme weatherFloodLandslideMass movement (dry)Volcanic activityWildfire190019101920193019401950196019701980199020002010Year500,0001,000,0002,000,0003,000,000Annual Global Deaths
Rule: Reposition axis labels (reuse and modify from US Cabinet–Entire)
    {
      "description": "Reposition the horizontal axis labels",
      "specifier": {
        "role": "hAxis",
      // Alternative
        "role": "axis",
        "field": "Deaths"
      },
      "action": "reposition",
      "option": {
      // Removed some details
        "orient": "top"// assign new axis orientation
      }
    }
View
DroughtEarthquakeEpidemicExtreme temperatureExtreme weatherFloodLandslideMass movement (dry)Volcanic activityWildfire190019101920193019401950196019701980199020002010Year500,0001,000,0002,000,0003,000,000Annual Global Deaths
Rule: Remove a legend value and reposition the legend (reuse from Oil Spills with detail adjustment)
Remove the legend value of 500000
    {
      "description": "Remove the legend for 500000.",
      "specifier": {
        "role": "legend"
      },
      "action": "remove",
      "option": {
        "values": [
          500000// adjusted 5000 to 500000
        ]
      }
    }
Reposition the legend
    {
      "description": "Move the legend to the topright position",
      "specifier": {
        "role": "legend"
      },
      "action": "reposition",
      "option": {
        "position": "top"// adjusted bottom-right to top
      }
    }
View
DroughtEarthquakeEpidemicExtreme temperatureExtreme weatherFloodLandslideMass movement (dry)Volcanic activityWildfire190019101920193019401950196019701980199020002010Year1,000,0002,000,0003,000,000Annual Global Deaths
Rule: Resize the size mark (reuse from Oil Spills)
    {
      "description": "Resize the size encoding scale with relative value.",
      "specifier": {
        "role": "mark"
      },
      "action": "modify",
      "option": {
        "size": {
          "scale": {
            "range": {
              "prod": 0.4// multiply 0.4 to range values
            }
          }
        }
      }
    }
View
DroughtEarthquakeEpidemicExtreme temperatureExtreme weatherFloodLandslideMass movement (dry)Volcanic activityWildfire190019101920193019401950196019701980199020002010Year1,000,0002,000,0003,000,000Annual Global Deaths