Skip to content

Instantly share code, notes, and snippets.

@aborruso
Last active May 15, 2021 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aborruso/85554d674bfa4a6fd62df1d2eca01b3d to your computer and use it in GitHub Desktop.
Save aborruso/85554d674bfa4a6fd62df1d2eca01b3d to your computer and use it in GitHub Desktop.
Vega Lite Trellis test
{"locale": {
"time": {
"dateTime": "%A %e %B %Y, %X",
"date": "%d/%m/%Y",
"time": "%H:%M:%S",
"periods": ["AM", "PM"],
"days": [
"Domenica",
"Lunedì",
"Martedì",
"Mercoledì",
"Giovedì",
"Venerdì",
"Sabato"
],
"shortDays": ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"],
"months": [
"Gennaio",
"Febbraio",
"Marzo",
"Aprile",
"Maggio",
"Giugno",
"Luglio",
"Agosto",
"Settembre",
"Ottobre",
"Novembre",
"Dicembre"
],
"shortMonths": [
"Gen",
"Feb",
"Mar",
"Apr",
"Mag",
"Giu",
"Lug",
"Ago",
"Set",
"Ott",
"Nov",
"Dic"
]
}
},
"arc": {"fill": "#30a2da"},
"area": {"fill": "#30a2da"},
"axis": {
"domainColor": "#cbcbcb",
"grid": true,
"gridColor": "#cbcbcb",
"gridWidth": 1,
"labelColor": "#999",
"labelFontSize": 10,
"titleColor": "#333",
"tickColor": "#cbcbcb",
"tickSize": 10,
"titleFontSize": 14,
"titlePadding": 10,
"labelPadding": 4
},
"axisBand": {"grid": false},
"background": "#f0f0f0",
"group": {"fill": "#f0f0f0"},
"legend": {
"labelColor": "#333",
"labelFontSize": 11,
"padding": 1,
"symbolSize": 30,
"symbolType": "square",
"titleColor": "#333",
"titleFontSize": 14,
"titlePadding": 10
},
"line": {"stroke": "#30a2da", "strokeWidth": 2},
"path": {"stroke": "#30a2da", "strokeWidth": 0.5},
"rect": {"fill": "#30a2da"},
"range": {
"category": [
"#30a2da",
"#fc4f30",
"#e5ae38",
"#6d904f",
"#8b8b8b",
"#b96db8",
"#ff9e27",
"#56cc60",
"#52d2ca",
"#52689e",
"#545454",
"#9fe4f8"
],
"diverging": [
"#cc0020",
"#e77866",
"#f6e7e1",
"#d6e8ed",
"#91bfd9",
"#1d78b5"
],
"heatmap": ["#d6e8ed", "#cee0e5", "#91bfd9", "#549cc6", "#1d78b5"]
},
"point": {"filled": true, "shape": "circle"},
"shape": {"stroke": "#30a2da"},
"bar": {"binSpacing": 2, "fill": "#30a2da", "stroke": null},
"title": {"anchor": "start", "fontSize": 24, "fontWeight": 600, "offset": 20}
}
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"name": "trellis_barley",
"description": "Trellis",
"title": {
"text": "Ingressi giornalieri in Terapia Intensiva (TI) a confronto con ricoveri totali in TI",
"color": "#168CC7",
"fontSize": 18,
"anchor": "start",
"font": "Montserrat",
"subtitle": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam convallis enim ac fringilla feugiat",
"subtitleFont": "Montserrat"
},
"data": {
"url": "https://gist.githubusercontent.com/aborruso/dbc547582c62ec34e8e1641dcc783caa/raw/7d2eaf2327a9b8756c2d40cdd7418fe3457d24dc/trellis_mm.csv"
},
"mark": "point",
"height": {"step": 12},
"encoding": {
"facet": {
"field": "denominazione_regione",
"type": "ordinal",
"columns": 3,
"title": ""
},
"x": {
"field": "ingressi_terapia_intensiva_mm",
"type": "quantitative",
"title": "Ingressi giornalieri in TI",
"scale": {"zero": false, "padding": 10}
},
"y": {
"field": "terapia_intensiva_mm",
"type": "quantitative",
"title": "Totale ricoveri in TI",
"scale": {"zero": false, "padding": 10}
},
"tooltip": [{"field": "mese", "type": "nominal", "title": "mese"}],
"color": {"field": "mese", "type": "nominal", "legend": {"title": "Mesi"},"scale": {"scheme": "tableau10"}}
},
"resolve": {"scale": {"x": "independent", "y": "independent"}}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment