Skip to content

Instantly share code, notes, and snippets.

@Giammaria
Created January 25, 2023 16:14
Show Gist options
  • Save Giammaria/f06fdc60a8d13b7282455767dfef625c to your computer and use it in GitHub Desktop.
Save Giammaria/f06fdc60a8d13b7282455767dfef625c to your computer and use it in GitHub Desktop.
Deneb Have It Your Way
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"name": "dataset",
"values": [
{"beef": "DENEB", "bun": "top"},
{"beef": "DENEB", "bun": "bottom"}
]
},
"width": 260,
"height": 0,
"title": {
"text": "HAVE IT YOUR WAY",
"orient": "bottom",
"align": "center",
"anchor": "middle",
"font": "Segoe UI",
"fontSize": 32,
"fontWeight": 900,
"color": "#B02617"
},
"params": [
{"name": "bunCornerRadius", "value": 10},
{"name": "bunRadius", "expr": "0.465*width"},
{"name": "bunTheta", "expr": "1.57"}
],
"layer": [
{
"mark": {
"type": "arc",
"cornerRadius": 10,
"padAngle": 1,
"radius": {"expr": "bunRadius"},
"theta": {"expr": "-bunTheta"},
"theta2": {"expr": "bunTheta"},
"angle": {"expr": "datum['bun']==='top'?0:180"},
"color": "#f6e9d9"
},
"encoding": {
"y": {
"field": "bun",
"type": "nominal",
"sort": "descending",
"scale": {"paddingInner": 0.5},
"axis": null
},
"stroke": {"value": "#f6e9d9"},
"strokeWidth": {"value": 40}
}
},
{
"mark": {
"type": "arc",
"cornerRadius": {"expr": "bunCornerRadius"},
"padAngle": 1,
"radius": {"expr": "bunRadius"},
"theta": {"expr": "-bunTheta"},
"theta2": {"expr": "bunTheta"},
"angle": {"expr": "datum['bun']==='top'?0:180"},
"color": "#FD873E"
},
"encoding": {
"y": {
"field": "bun",
"type": "nominal",
"sort": "descending",
"scale": {"paddingInner": 0.5},
"axis": null
}
}
},
{
"mark": {
"type": "rect",
"angle": {"expr": "datum['bun']==='top'?0:180"},
"color": "#f6e9d9"
},
"encoding": {
"x": {"value": 8.5},
"x2": {"value": 250.5},
"y": {"value": -43},
"y2": {"value": 84}
}
},
{
"mark": {
"type": "text",
"align": "center",
"fontSize": 74,
"fontWeight": 900,
"color": "#B02617",
"baseline": "middle"
},
"encoding": {
"text": {"field": "beef"},
"x": {"field": "beef", "bandPosition": 0, "axis": null}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment