Created
December 8, 2020 14:52
-
-
Save matthijskooijman/6785f8bdc06218a9f678b91604636959 to your computer and use it in GitHub Desktop.
MJS2020 solar testje @ DeWAR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v4.json", | |
"description": "MJS2020 data", | |
"data": { | |
"url": "https://meetjestad.net/data/?type=sensors&ids=2001,2003,2004,2005,2006&begin=2020-12-05,00:00&format=json" | |
}, | |
"transform": [{"calculate": "datum.extra[9]/1000", "as": "solar"}], | |
"config": {"mark": {"tooltip": {"content": "data"}}, "point": {"size": 1}}, | |
"facet": {"field": "id"}, | |
"spec": { | |
"vconcat": [ | |
{ | |
"title": "Drag to zoom, click to reset", | |
"width": 500, | |
"height": 50, | |
"mark": { | |
"type": "point", | |
"color": "red", | |
"tooltip": {"content": "data"} | |
}, | |
"encoding": { | |
"x": {"field": "timestamp", "type": "temporal"}, | |
"y": { | |
"field": "temperature", | |
"type": "quantitative", | |
"axis": {"titleColor": "red"}, | |
"scale": {"zero": false} | |
} | |
}, | |
"selection": {"daterange": {"type": "interval", "encodings": ["x"]}} | |
}, | |
{ | |
"title": "Temperature & Humidity", | |
"width": 500, | |
"height": 200, | |
"encoding": { | |
"x": { | |
"field": "timestamp", | |
"type": "temporal", | |
"scale": {"domain": {"selection": "daterange"}} | |
} | |
}, | |
"layer": [ | |
{ | |
"mark": {"type": "point", "color": "red"}, | |
"encoding": { | |
"y": { | |
"field": "temperature", | |
"type": "quantitative", | |
"axis": {"titleColor": "red"} | |
} | |
}, | |
"selection": {"dummy_to_fix_tooltip": {"type": "interval"}} | |
}, | |
{ | |
"mark": {"type": "point", "color": "blue"}, | |
"encoding": { | |
"y": { | |
"field": "humidity", | |
"type": "quantitative", | |
"axis": {"titleColor": "blue"} | |
} | |
}, | |
"selection": {"dummy_to_fix_tooltip2": {"type": "interval"}} | |
} | |
], | |
"resolve": {"scale": {"y": "independent"}} | |
}, | |
{ | |
"title": "Voltages", | |
"width": 500, | |
"height": 200, | |
"transform": [ | |
{"fold": ["supply", "battery", "solar"], "as": ["field", "voltage"]} | |
], | |
"mark": {"type": "point", "color": "red"}, | |
"encoding": { | |
"x": { | |
"field": "timestamp", | |
"type": "temporal", | |
"scale": {"domain": {"selection": "daterange"}} | |
}, | |
"y": {"field": "voltage", "type": "quantitative"}, | |
"color": {"field": "field", "legend": {"title": "Voltages"}} | |
}, | |
"selection": {"dummy_to_fix_tooltip": {"type": "interval"}} | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment