Skip to content

Instantly share code, notes, and snippets.

View woter1832's full-sized avatar

Adrian Walker woter1832

  • United Kingdom
View GitHub Profile
@woter1832
woter1832 / vega-lite-dual-y-axis.json
Last active December 12, 2024 15:59
Vega-lite dual Y-axis bar graph
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": "container",
"height": 550,
"data": {
"values": [
{"category": "A", "score": 50, "cost": 45},
{"category": "B", "score": 75, "cost": 60},
{"category": "C", "score": 115, "cost": 100}
]
@woter1832
woter1832 / vega-lite-dual-y-axis-v2.json
Last active December 12, 2024 16:12
Vega-lite dual Y-axis bar graph V.2
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": "container",
"height": 550,
"data": {
"values": [
{"model": "Audi", "score": 150, "cost": 4500},
{"model": "Mercedes", "score": 75, "cost": 6000},
{"model": "BMW", "score": 115, "cost": 5000}
]
@woter1832
woter1832 / test1.json
Created December 12, 2024 16:53
Inc. legend. Nearly there.
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": "container",
"height": 550,
"data": {
"values": [
{"model": "Audi", "score": 150, "cost": 4500},
{"model": "Mercedes", "score": 75, "cost": 6000},
{"model": "BMW", "score": 115, "cost": 5000}
]
@woter1832
woter1832 / legend-1.json
Created December 12, 2024 17:49
Trying a legend
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": "container",
"height": 550,
"data": {
"values": [
{"model": "Audi", "score": 150, "cost": 4500},
{"model": "Mercedes", "score": 75, "cost": 6000},
{"model": "BMW", "score": 115, "cost": 5000}
]
@woter1832
woter1832 / vega-lite-dual-y-axis-v3.json
Created December 31, 2024 02:31
Dual Y-axis with legend.
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "Laptop comparison chart",
"width": "container",
"height": 550,
"data": {
"url": "https://witty-desert-01a45b703-35.westeurope.4.azurestaticapps.net/public/computing/assets/laptop-selection-basic.csv"
},
"encoding": {
"x": {
@woter1832
woter1832 / laptop-selection-basic.csv
Created December 31, 2024 09:44
Vega Data v1.0.0
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 4 columns, instead of 2 in line 8.
Model,url,Cost,Score
Lenovo Thinkpad P16s,https://www.lenovo.com/gb/en/p/laptops/thinkpad/thinkpadp/lenovo-thinkpad-p16s-gen-3-16-inch-intel-mobile-workstation/21kscto1wwgb3,2459.99,155
Lenovo Thinkpad P14s,https://www.lenovo.com/gb/en/p/laptops/thinkpad/thinkpadp/thinkpad-p14s-gen-5-14-inch-intel-mobile-workstation/21g2cto1wwgb3,2278.00,187
Lenovo Thinkpad P16v,https://www.lenovo.com/gb/en/configurator/cto/index.html?bundleId=21FECTO1WWGB3,2579.99,224
Lenovo Thinkpad P16v,https://www.lenovo.com/gb/en/p/laptops/thinkpad/thinkpadp/lenovo-thinkpad-p16v-gen-2-16-inch-intel-mobile-workstation/21kxcto1wwgb3,3405.65,230
HP ZBook Power G11,https://www.hp.com/gb-en/shop/product.aspx?id=86B35EA&opt=ABU&sel=NTB,2339.99,244
HP ZBook Fury G11,https://www.hp.com/gb-en/shop/product.aspx?id=62X63EA&opt=ABU&sel=NTB,3443.99,281
Dell Precision 7680,https://www.dell.com/en-uk/shop/cty/pdp/spd/precision-16-7680-laptop,3347.26,283
Lenovo Thinkpad P1,https://www.lenovo.com/gb/en/p/laptops/thinkpad/thinkpadp/thinkpad-p1-gen-7-16-in