Created
May 18, 2022 02:47
-
-
Save philz/6bc760991d9fa2085f963ea3aa47c79f to your computer and use it in GitHub Desktop.
Vegalite Timeline Example
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/v5.json", | |
"description": "Timeline", | |
"title": "Hey there", | |
"width": 600, | |
"height": 200, | |
"data": { | |
"values": [ | |
{"idx": 0, "start": 0, "name": "Took a minute", "end": 60000}, | |
{"idx": 1, "start": 60000, "name": "Took half a minute", "end": 90000}, | |
{ | |
"idx": 2, | |
"start": 60000, | |
"name": "Overlapped with previous", | |
"end": 70000 | |
}, | |
{"idx": 3, "start": 60500, "name": "Same lane", "end": 70000}, | |
{"idx": 4, "start": 80500, "name": "Same lane", "end": 90500} | |
] | |
}, | |
"mark": "bar", | |
"encoding": { | |
"y": {"field": "name", "type": "ordinal", "sort": null, "title": "hi"}, | |
"x": {"field": "start", "timeUnit": "minutesseconds"}, | |
"x2": {"field": "end", "timeUnit": "minutesseconds"}, | |
"color": {"field": "idx", "legend": null}, | |
"tooltip": {"field": "name"} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment