please i need help with code port for graph from Vega-lite to Vega - I created graph in Vega-lite, code and img see below, in Vega editor it works fine for me, but Minsphere (I think) supports only Vega. I'm trying it with "export" => JSON => compiled Vega. But it not work for me. Can anyone help me. Thank you ;-)
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "Machine",
"width":"container",
"height":30,
"config": {
"legend": {"orient": "bottom", "layout": {"bottom": {"anchor": "middle"}},"title": null}
},
"data": {
"values": [
{"time": "2022-01-27T05:00:43.674Z", "y":1 , "stav":"produkce"},
{"time": "2022-01-27T07:32:13.671Z", "y": 0, "stav":"produkce"},
{"time": "2022-01-27T07:32:13.671Z", "y": 1, "stav":"error"},
{"time": "2022-01-27T09:32:13.671Z", "y": 0, "stav":"error"},
{"time": "2022-01-27T09:52:13.671Z", "y": 1, "stav":"error"},
{"time": "2022-01-27T10:41:13.671Z", "y": 0, "stav":"error"},
{"time": "2022-01-27T08:32:13.671Z", "kusy": 1},
{"time": "2022-01-27T08:32:14.671Z", "kusy": 0},
{"time": "2022-01-27T08:42:13.671Z", "program": 1},
{"time": "2022-01-27T08:42:14.671Z", "program": 0},
{"time": "2022-01-27T06:42:13.671Z", "program": 1},
{"time": "2022-01-27T06:42:14.671Z", "program": 0},
{"time": "2022-01-27T09:42:13.671Z", "program": 1},
{"time": "2022-01-27T09:42:14.671Z", "program": 0},
{"time": "2022-01-27T09:32:13.671Z", "y": 1, "stav":"nastaveni"},
{"time": "2022-01-27T09:52:13.671Z", "y": 0, "stav":"nastaveni"},
{"time": "2022-01-27T05:05:43.674Z", "prestavka": 1.2, "od":1},
{"time": "2022-01-27T06:05:43.674Z", "prestavka": 0, "od":0}
]
},
"encoding": {
"x": {"title":false,
"timeUnit":"hoursminutes",
"field": "time",
"type":"temporal",
"axis": {"format": "%H:%M","tickCount": 4}
}
},
"layer": [
{
"mark": {"type": "area","interpolate": "step-after", "tooltip":true},
"encoding": {
"y": {
"field": "y",
"type": "quantitative", "stack":false,
"axis": {"title":null, "labels":false, "ticks": false}},
"color": {
"field":"stav",
"type":"nominal",
"scale":{
"domain":["produkce","error","nastaveni","kusy","prestavka","program"],
"range":["green","red","yellow","black", "grey","blue"]
}
},
"tooltip": [
{"field":"stav"},
{"field": "time", "type": "temporal","format": "%d.%m.%y - %H:%M"}
]
}
},
{
"mark": {"type": "area", "color": "grey", "interpolate": "step-after","tooltip":true},
"encoding": {
"y": {
"field": "prestavka",
"type": "quantitative",
"stack":false,
"axis": {"title":null, "labels":false, "ticks": false}
},
"y2":{
"field":"od",
"type": "quantitative"
},
"tooltip": [
{"field":"prestavka"},
{"field": "time", "type": "temporal","format": "%d.%m.%y - %H:%M"}
]
}
},
{
"mark": {"type": "line","point": {"filled":true, "fill":"black"},"line":false, "tooltip":true},
"encoding": {
"y": {
"field": "kusy",
"type": "quantitative", "stack":false,
"axis": {"title":null, "labels":false, "ticks": false}
},
"tooltip": [
{"field":"kusy"},
{"field": "time", "type": "temporal","format": "%d.%m.%y - %H:%M"}
]
}
},
{
"mark": {"type": "line","point": {"filled":true, "fill":"blue"},"line":false, "tooltip":true},
"encoding": {
"y": {
"field": "program",
"type": "quantitative", "stack":false,
"axis": {"title":null, "labels":false, "ticks": false}
},
"tooltip": [
{"field":"program"},
{"field": "time", "type": "temporal","format": "%d.%m.%y - %H:%M"}
]
}
}
]
}```
You can copy the Vega-Lite spec to the Vega online editor and it will show the compiled Vega spec
Compiled Vega spec: