Last active
November 17, 2020 09:42
-
-
Save matthijskooijman/d94ff15e3b6e90a6edd044fb416ff312 to your computer and use it in GitHub Desktop.
MJS2020 node 2000 graphs
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=2000,2007&begin=2020-11-07,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