Trellis Dot Plot

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "usermeta": {
    "deneb": {
      "build": "1.2.0.1",
      "metaVersion": 1,
      "provider": "vegaLite",
      "providerVersion": "5.2.0"
    },
    "interactivity": {
      "tooltip": true,
      "contextMenu": true,
      "selection": false,
      "highlight": false,
      "dataPointLimit": 50
    },
    "information": {
      "name": "Trellis Dot Plot",
      "description": "[No Description Provided]",
      "author": "Kerry Kolosko",
      "uuid": "717f00a9-cc5e-4268-b89c-430c2cf4e709",
      "generated": "2022-05-15T06:37:38.933Z"
    },
    "dataset": [
      {
        "key": "__0__",
        "name": "X-Labels",
        "description": "",
        "type": "text",
        "kind": "column"
      },
      {
        "key": "__1__",
        "name": "Group",
        "description": "",
        "type": "text",
        "kind": "column"
      },
      {
        "key": "__2__",
        "name": "Y-Labels",
        "description": "",
        "type": "text",
        "kind": "column"
      },
      {
        "key": "__3__",
        "name": "values per group",
        "description": "",
        "type": "text",
        "kind": "column"
      },
      {
        "key": "__4__",
        "name": "colour",
        "description": "",
        "type": "numeric",
        "kind": "measure"
      }
    ]
  },
  "config": {
    "autosize": {
      "type": "fit",
      "contains": "padding"
    },
    "view": {"stroke": "transparent"},
    "font": "xkcd",
    "arc": {},
    "area": {
      "line": true,
      "opacity": 0.6
    },
    "bar": {},
    "line": {
      "strokeWidth": 3,
      "strokeCap": "round",
      "strokeJoin": "round"
    },
    "path": {},
    "point": {
      "filled": true,
      "size": 75
    },
    "rect": {},
    "shape": {},
    "symbol": {
      "strokeWidth": 1.5,
      "size": 50
    },
    "text": {
      "font": "xkcd",
      "fontSize": 12,
      "fill": "#605E5C"
    },
    "axis": {
      "ticks": false,
      "grid": false,
      "domain": false,
      "labelColor": "#605E5C",
      "labelFontSize": 12,
      "titleFont": "xkcd",
      "titleColor": "#252423",
      "titleFontSize": 16,
      "titleFontWeight": "normal"
    },
    "axisQuantitative": {
      "tickCount": 3,
      "grid": true,
      "gridColor": "#C8C6C4",
      "gridDash": [1, 5],
      "labelFlush": false
    },
    "axisBand": {"tickExtra": true},
    "axisX": {"labelPadding": 5},
    "axisY": {"labelPadding": 10},
    "header": {
      "titleFont": "xkcd",
      "titleFontSize": 16,
      "titleColor": "#252423",
      "labelFont": "xkcd",
      "labelFontSize": 13.333333333333332,
      "labelColor": "#605E5C"
    },
    "legend": {
      "titleFont": "xkcd",
      "titleFontWeight": "bold",
      "titleColor": "#605E5C",
      "labelFont": "xkcd",
      "labelFontSize": 12,
      "labelColor": "#605E5C",
      "symbolType": "circle",
      "symbolStrokeColor": "transparent",
      "format": ".0%"
    }
  },
  "data": {"name": "dataset"},
  "view": {"stroke": null},
  "facet": {
    "column": {"field": "__1__"}
  },
  "spec": {
    "height": {"step": 20},
    "width": {"step": 40},
    "mark": {
      "type": "circle",
      "tooltip": true,
      "stroke": "grey",
      "strokeWidth": 0.2,
      "opacity": 0.8
    },
    "encoding": {
      "x": {
        "field": "__0__",
        "type": "nominal",
        "axis": {
          "domain": false,
          "offset": 5,
          "labelFontWeight": "normal",
          "labelAngle": 0,
          "ticks": true,
          "grid": false,
          "title": ""
        }
      },
      "y": {
        "field": "__2__",
        "type": "ordinal",
        "sort": "descending",
        "axis": {
          "domain": false,
          "offset": 20,
          "labelFontWeight": "light",
          "labelAngle": 0,
          "ticks": false,
          "grid": true,
          "title": ""
        }
      },
      "size": {
        "aggregate": "sum",
        "field": "__3__",
        "type": "quantitative",
        "title": "Percentage",
        "legend": {"offset": 50},
        "scale": {"range": [0, 500]}
      },
      "color": {
        "field": "__4__",
        "type": "quantitative",
        "scale": {
          "range": ["pink", "red"]
        },
        "legend": null
      }
    }
  }
}

Leave a comment

Your email address will not be published.